/* ===================================================
   即时码 · 前台样式
   =================================================== */
:root {
  --primary: #1a6dff;
  --primary-dark: #0b52d4;
  --primary-light: #eaf1ff;
  --ink: #0e2440;
  --ink-2: #2c3e57;
  --muted: #6b7a90;
  --line: #e6ecf5;
  --bg: #f6f8fc;
  --white: #fff;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(14, 36, 64, .06);
  --shadow-lg: 0 16px 48px rgba(14, 36, 64, .1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, li { list-style: none; margin: 0; padding: 0; }
button, input, textarea, select { font-family: inherit; font-size: 14px; outline: none; }

.wrap { width: 1200px; max-width: calc(100% - 48px); margin: 0 auto; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}
.logo-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a6dff, #4d9bff);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
.mainnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}
.mainnav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: .18s;
}
.mainnav a:hover, .mainnav a.active {
  color: var(--primary);
  background: var(--primary-light);
}
.topnav-right { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: .18s;
  white-space: nowrap;
  background: transparent;
  color: var(--ink-2);
}
.btn:hover { color: var(--primary); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(26, 109, 255, .28);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { border-color: var(--line); background: #fff; }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { height: 46px; padding: 0 26px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 56px 0 64px;
  background:
    radial-gradient(900px 420px at 15% -10%, #e8f1ff 0%, transparent 60%),
    radial-gradient(700px 380px at 95% 0%, #eaf6ff 0%, transparent 55%),
    linear-gradient(180deg, #fbfdff, #f6f9ff);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.hero-title {
  margin: 0 0 12px;
  font-size: 38px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  font-weight: 800;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(90deg, #1a6dff, #35a8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.generator {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 28px;
  align-items: stretch;
}
.gen-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(230, 236, 245, .9);
  overflow: hidden;
}
.gen-tabs {
  display: flex;
  gap: 2px;
  padding: 14px 14px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.gen-tabs button {
  position: relative;
  border: 0;
  background: transparent;
  padding: 10px 14px 14px;
  font-size: 14.5px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.gen-tabs button.active { color: var(--primary); font-weight: 600; }
.gen-tabs button.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
}
.gen-body { padding: 24px 22px; min-height: 230px; display: flex; flex-direction: column; justify-content: center; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.input, .textarea, .select {
  width: 100%;
  border: 1px solid #dfe7f2;
  background: #fbfcfe;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  color: var(--ink);
  transition: .16s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 109, 255, .1);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.hint { font-size: 12px; color: #93a1b5; margin-top: 6px; line-height: 1.5; }

.uploader {
  border: 1.5px dashed #cfdcee;
  border-radius: 12px;
  padding: 26px;
  text-align: center;
  color: var(--muted);
  background: #fafcff;
  cursor: pointer;
  transition: .18s;
}
.uploader:hover { border-color: var(--primary); color: var(--primary); background: #f4f9ff; }
.uploader b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; font-weight: 600; }

.preview-panel {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.qr-box {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 14px;
  background: #f7f9fd;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #eef3fa;
}
.qr-box svg, .qr-box img { width: 100%; height: 100%; }
.qr-empty { text-align: center; color: #a9b6c8; font-size: 13.5px; line-height: 1.8; }
.preview-actions { display: flex; gap: 10px; width: 100%; }
.preview-actions .btn { flex: 1; }

/* ---------- 段落 ---------- */
.section { padding: 68px 0; }
.section.alt { background: var(--bg); }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 {
  margin: 0 0 12px;
  font-size: 28px;
  letter-spacing: -.3px;
  font-weight: 750;
}
.section-head p { margin: 0; color: var(--muted); font-size: 15px; }
.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .3px;
}

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.scene-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: .2s;
}
.scene-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #d5e3ff;
}
.scene-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 20px;
  margin-bottom: 14px;
}
.scene-card h3 { margin: 0 0 8px; font-size: 16.5px; font-weight: 650; }
.scene-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.65; }

.tpl-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: .2s;
}
.tpl-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.tpl-cover {
  aspect-ratio: 3 / 4;
  background: linear-gradient(150deg, #e8f0ff 0%, #f4f8ff 55%, #eaf2ff 100%);
  display: grid;
  place-items: center;
  color: #8fa9d0;
  overflow: hidden;
  position: relative;
}
.tpl-cover span {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #93aed4;
  padding: 0 12px;
  text-align: center;
  line-height: 1.4;
}
.tpl-cover::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed #cfdcf0;
  border-radius: 8px;
  pointer-events: none;
}
.tpl-cover img { width: 100%; height: 100%; object-fit: cover; }
.tpl-meta { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.tpl-meta span { font-size: 13.5px; color: var(--ink-2); }

/* ---------- 数据条 ---------- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stats-bar div { padding: 26px; text-align: center; border-right: 1px solid var(--line); }
.stats-bar div:last-child { border-right: 0; }
.stats-bar b { display: block; font-size: 30px; font-weight: 800; color: var(--primary); letter-spacing: -.5px; }
.stats-bar span { color: var(--muted); font-size: 13.5px; }

/* ---------- 页脚 ---------- */
.footer {
  background: #0d1a2e;
  color: #94a6c0;
  padding: 54px 0 26px;
  font-size: 13.5px;
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.footer h4 { color: #fff; font-size: 14.5px; margin: 0 0 16px; font-weight: 600; }
.footer li { margin-bottom: 10px; }
.footer a:hover { color: #fff; }
.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  justify-content: space-between;
  color: #6c7d96;
  font-size: 12.5px;
}

/* ---------- 工具页 ---------- */
.tool-hero {
  padding: 38px 0 12px;
  background: linear-gradient(180deg, #f4f8ff, #fff);
}
.tool-hero h1 { margin: 0 0 8px; font-size: 26px; font-weight: 750; }
.tool-hero p { margin: 0; color: var(--muted); }
.tool-layout { display: grid; grid-template-columns: 1fr 380px; gap: 28px; padding: 26px 0 60px; }

.tag { display: inline-block; padding: 3px 9px; border-radius: 6px; background: var(--primary-light); color: var(--primary); font-size: 12px; }

/* ---------- 扫码页（移动端） ---------- */
.scan-page {
  background: #f2f4f8;
  min-height: 100vh;
}
.scan-hero {
  padding: 26px 20px 30px;
  background: linear-gradient(135deg, #1a6dff, #4d9bff);
  color: #fff;
}
.scan-hero h1 { margin: 0 0 10px; font-size: 21px; line-height: 1.45; font-weight: 700; }
.scan-hero p { margin: 0; opacity: .88; font-size: 14px; line-height: 1.7; }
.scan-body {
  background: #fff;
  border-radius: 16px 16px 0 0;
  margin-top: -14px;
  padding: 22px 18px 60px;
  min-height: 60vh;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-2);
  word-break: break-word;
}
.scan-body img { border-radius: 10px; margin: 10px 0; }
.scan-tip {
  margin-top: 24px;
  text-align: center;
  color: #9aa8bb;
  font-size: 12px;
}

/* ---------- 认证页 ---------- */
.auth-page {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  background:
    radial-gradient(700px 400px at 20% 0%, #eaf2ff, transparent 60%),
    var(--bg);
  padding: 40px 20px;
}
.auth-card {
  width: 400px;
  max-width: 100%;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
}
.auth-card h2 { margin: 0 0 6px; font-size: 22px; }
.auth-card .sub { margin: 0 0 24px; color: var(--muted); font-size: 13.5px; }
.tip-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 14px; }
.tip-row a:hover { color: var(--primary); }

.alert { padding: 10px 14px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: #fff1f0; color: #d4380d; }
.alert-ok { background: #f0fbf4; color: #237804; }

@media (max-width: 1080px) {
  .generator, .tool-layout { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .mainnav { display: none; }
}
@media (max-width: 620px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero-title { font-size: 27px; }
  .stats-bar { grid-template-columns: 1fr; }
}
/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(9, 20, 36, .5);
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal {
  position: relative;
  width: 420px;
  max-width: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .24);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal-sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.modal-qr {
  width: 220px;
  height: 220px;
  margin: 0 auto 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.modal-qr svg { width: 100%; height: 100%; }
.modal-link { display: flex; gap: 8px; margin-bottom: 16px; }
.modal-link input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  background: #fafcff;
  font-size: 13px;
}
.modal-link button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
}
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border: 0;
  border-radius: 8px;
  background: #f4f7fb;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.style-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.style-row label { font-size: 13.5px; color: var(--ink-2); }
.style-row input[type="color"] { width: 44px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 2px; }
.style-row input[type="text"], .style-row select {
  width: 160px; border: 1px solid #dfe7f2; border-radius: 9px; padding: 8px 10px; font-size: 13px; background: #fbfcfe;
}

/* ---------- 扫码页元素 ---------- */
.card-hero {
  padding: 44px 20px 34px;
  text-align: center;
  color: #fff;
  background: linear-gradient(150deg, #123c78, #1a6dff 55%, #4d9bff);
}
.card-avatar {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  border: 2px solid rgba(255, 255, 255, .5);
  display: grid; place-items: center;
  font-size: 28px; font-weight: 700;
}
.card-hero h1 { margin: 0 0 6px; font-size: 22px; }
.card-hero p { margin: 0; opacity: .86; font-size: 14px; }
.card-body { background: #fff; border-radius: 18px 18px 0 0; margin-top: -16px; padding: 22px 20px 60px; min-height: 50vh; }
.card-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid #f0f4f9; font-size: 14.5px; }
.card-row span { color: #8b98ab; }
.card-row a { color: #1a6dff; }
.card-row em { font-style: normal; color: #2c3e57; text-align: right; }

.file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px;
  border: 1px solid #eef2f8;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #fbfcfe;
}
.file-item:active { background: #f2f7ff; }
.file-ext {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 10px;
  background: #eaf1ff;
  color: #1a6dff;
  font-size: 11px;
  font-weight: 700;
  display: grid; place-items: center;
}
.file-name { flex: 1; font-size: 14px; color: #0e2440; word-break: break-all; line-height: 1.4; }
.file-size { color: #9aa8bb; font-size: 12px; white-space: nowrap; }

.rich-text { font-size: 15px; line-height: 1.9; color: #2c3e57; }
.map-placeholder {
  font-size: 56px;
  text-align: center;
  padding: 30px 0;
  background: #f4f8ff;
  border-radius: 14px;
  margin-bottom: 16px;
}

/* ===== 扫码页表单 ===== */
.scan-form { background: #fff; border-radius: 14px; padding: 18px 16px 20px; box-shadow: 0 2px 14px rgba(16,42,76,.07); }
.scan-form .field { margin-bottom: 15px; }
.scan-form label { display: block; font-size: 13.5px; color: #3b4a5e; margin-bottom: 7px; font-weight: 500; }
.scan-form label i { color: #e5484d; font-style: normal; margin-left: 3px; }
.scan-form input,
.scan-form textarea,
.scan-form select {
  width: 100%; box-sizing: border-box; border: 1px solid #dfe5ee; border-radius: 9px;
  padding: 11px 13px; font-size: 14px; color: #0E2440; background: #fbfcfe; font-family: inherit;
  outline: none; transition: border-color .15s, background .15s;
}
.scan-form input:focus,
.scan-form textarea:focus { border-color: #1a6dff; background: #fff; }
.scan-form textarea { resize: vertical; min-height: 88px; }
.scan-form .field-opts { display: flex; flex-wrap: wrap; gap: 8px 10px; padding: 2px 0; }
.scan-form .field-opts .opt {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400;
  font-size: 13.5px; color: #3b4a5e; background: #fbfcfe; border: 1px solid #dfe5ee;
  border-radius: 9px; padding: 9px 13px; cursor: pointer; transition: .15s;
}
.scan-form .field-opts .opt:hover { border-color: #9dc0ff; background: #f5f9ff; }
.scan-form .field-opts .opt input { width: auto; margin: 0; padding: 0; border: 0; background: none; accent-color: #1a6dff; }

/* 扫码页：防横向溢出 */
.scan-page { overflow-x: hidden; }
.scan-body { box-sizing: border-box; }
.scan-form { max-width: 100%; box-sizing: border-box; }
.scan-form input, .scan-form textarea, .scan-form select { max-width: 100%; box-sizing: border-box; }
