/* ============================================================
   Qraft 设计系统
   浅色主题 · 靛蓝主色 · 卡片化布局
   ============================================================ */
:root {
  --bg: #f6f7fb;
  --bg-soft: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e5e8f0;
  --line-strong: #d3d8e6;
  --text: #0e1526;
  --text-2: #475069;
  --muted: #7b849b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --accent: #0891b2;
  --accent-soft: #e0f7fb;
  --success: #059669;
  --success-soft: #e7f7f0;
  --warn: #b45309;
  --warn-soft: #fef4e6;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(14, 21, 38, 0.05);
  --shadow: 0 4px 16px -4px rgba(14, 21, 38, 0.08), 0 1px 3px rgba(14, 21, 38, 0.04);
  --shadow-lg: 0 24px 48px -16px rgba(14, 21, 38, 0.18);
  --nav-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
::selection { background: #c7d2fe; color: #1e1b4b; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 860px; }

/* ---------------- 顶部导航 ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  height: var(--nav-h); display: flex; align-items: center; gap: 28px;
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(140deg, #4f46e5, #06b6d4);
  display: grid; place-items: center; color: #fff; flex: none;
  box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.45);
}
.brand small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); letter-spacing: 0.08em; }
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 12px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.nav-link .chev { width: 10px; height: 10px; opacity: 0.5; }
.nav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 8px; opacity: 0; visibility: hidden;
  transform: translateY(-4px); transition: 0.16s ease;
}
.nav-item:hover .nav-menu, .nav-item:focus-within .nav-menu { opacity: 1; visibility: visible; transform: none; }
.nav-menu a { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 9px; }
.nav-menu a:hover { background: var(--surface-2); }
.nav-menu .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.nav-menu b { display: block; font-size: 13px; font-weight: 600; }
.nav-menu span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600;
  transition: 0.16s ease; white-space: nowrap; box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -6px rgba(79, 70, 229, 0.7); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border-color: var(--line-strong); box-shadow: none; color: var(--text-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 9px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.label { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.label .opt { font-weight: 400; color: var(--muted); font-size: 11px; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s; font-size: 13.5px;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }
.input::placeholder, .textarea::placeholder { color: #a8afc2; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); }

/* 分段控件 */
.segmented { display: flex; gap: 4px; padding: 4px; background: var(--bg-soft); border-radius: 11px; }
.segmented button {
  flex: 1; height: 32px; border: 0; background: transparent; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: 0.15s;
}
.segmented button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* 色板 */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); cursor: pointer; transition: 0.15s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: var(--primary); box-shadow: 0 0 0 2px #fff inset; }

/* 开关 */
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d8dde9; border-radius: 999px; transition: 0.18s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: 0.18s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }

/* 滑杆 */
input[type="range"] { -webkit-appearance: none; width: 100%; height: 4px; border-radius: 99px; background: var(--line-strong); outline: none; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); cursor: pointer;
}

/* ---------------- 卡片 ---------------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.panel-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.panel-body { padding: 18px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------------- 徽章 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--bg-soft); color: var(--text-2);
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------- 首页 ---------------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; pointer-events: none;
}
.hero::before { width: 460px; height: 460px; background: #dbe2ff; top: -140px; left: -100px; }
.hero::after { width: 420px; height: 420px; background: #d5f6fb; top: -60px; right: -120px; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  font-size: 12px; color: var(--text-2); font-weight: 500; box-shadow: var(--shadow-sm);
}
.hero h1 {
  font-size: 46px; line-height: 1.15; letter-spacing: -0.035em; margin: 18px 0 16px; font-weight: 800;
}
.hero h1 em { font-style: normal; background: linear-gradient(100deg, #4f46e5, #0891b2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 16px; color: var(--text-2); max-width: 500px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 22px; margin-top: 30px; flex-wrap: wrap; }
.hero-meta div { font-size: 12px; color: var(--muted); }
.hero-meta b { display: block; font-size: 19px; color: var(--text); font-weight: 700; letter-spacing: -0.02em; }

.hero-visual { position: relative; display: grid; place-items: center; min-height: 400px; }
.qr-card {
  width: 320px; background: var(--surface); border-radius: 26px; padding: 22px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); transform: rotate(-3deg);
  transition: transform 0.35s ease;
}
.qr-card:hover { transform: rotate(0deg) translateY(-4px); }
.qr-card .qr-art { border-radius: 16px; overflow: hidden; background: #fff; }
.qr-card .qr-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.qr-card .qr-meta b { font-size: 13px; }
.qr-card .qr-meta span { font-size: 11px; color: var(--muted); }
.float-chip {
  position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 9px 13px; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.float-chip .ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.float-chip.c1 { top: 34px; left: 6px; transform: rotate(-2deg); }
.float-chip.c2 { bottom: 46px; right: 0; transform: rotate(2deg); }
.float-chip small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); }

.section { padding: 56px 0; }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head h2 { font-size: 28px; letter-spacing: -0.03em; margin-bottom: 10px; font-weight: 750; }
.section-head p { color: var(--text-2); font-size: 14px; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; transition: 0.2s ease; display: block; position: relative; overflow: hidden;
}
.tool-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1px solid transparent;
  transition: 0.2s; pointer-events: none;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.tool-card:hover::after { border-color: rgba(79, 70, 229, 0.35); }
.tool-card .ic {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--primary-soft); color: var(--primary);
}
.tool-card h3 { font-size: 15px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.tool-card p { font-size: 12.5px; color: var(--muted); line-height: 1.6; min-height: 40px; }
.tool-card .arrow { position: absolute; right: 18px; top: 22px; color: var(--line-strong); transition: 0.2s; }
.tool-card:hover .arrow { color: var(--primary); transform: translateX(2px); }
.tool-card .flag { font-size: 10px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; }

.feature-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.feature-list { display: grid; gap: 18px; margin-top: 22px; }
.feature-item { display: flex; gap: 12px; }
.feature-item .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--success-soft); color: var(--success); display: grid; place-items: center; flex: none; margin-top: 2px; }
.feature-item b { font-size: 13.5px; display: block; }
.feature-item p { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.code-card { background: #0f172a; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.code-card .bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.code-card .bar i { width: 9px; height: 9px; border-radius: 50%; background: #334155; display: block; }
.code-card .bar span { margin-left: 8px; font-size: 11px; color: #94a3b8; font-family: var(--mono); }
.code-card pre { margin: 0; padding: 18px; overflow-x: auto; font-family: var(--mono); font-size: 12px; line-height: 1.7; color: #cbd5e1; }
.code-card .k { color: #7dd3fc; }
.code-card .s { color: #86efac; }
.code-card .c { color: #64748b; }

/* ---------------- 工具页布局 ---------------- */
.page-head { padding: 28px 0 8px; }
.crumb { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.crumb a:hover { color: var(--primary); }
.page-head h1 { font-size: 26px; letter-spacing: -0.03em; font-weight: 750; display: flex; align-items: center; gap: 10px; }
.page-head p { color: var(--text-2); font-size: 13.5px; margin-top: 6px; max-width: 720px; }

.studio { display: grid; grid-template-columns: 400px 1fr; gap: 20px; padding: 20px 0 56px; align-items: start; }
.studio.wide { grid-template-columns: 1fr 380px; }
.studio-panel { position: sticky; top: calc(var(--nav-h) + 16px); }
.studio-panel .panel-body { max-height: calc(100vh - var(--nav-h) - 140px); overflow-y: auto; }
.studio-panel::-webkit-scrollbar, .studio-panel .panel-body::-webkit-scrollbar { width: 8px; }
.studio-panel .panel-body::-webkit-scrollbar-thumb { background: #d8dde9; border-radius: 99px; }

.preview-stage {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 460px; display: flex; flex-direction: column;
}
.preview-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.preview-top .t { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.preview-canvas {
  flex: 1; display: grid; place-items: center; padding: 32px;
  background-image: radial-gradient(#d9dfec 1px, transparent 1px); background-size: 16px 16px;
}
.qr-out { width: min(380px, 100%); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); background: #fff; }
.qr-out svg { width: 100%; height: auto; }
.preview-actions { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 18px; overflow-x: auto; }
.tabs button {
  border: 0; background: transparent; padding: 12px 12px 11px; font-size: 13px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.style-opt {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 4px;
  font-size: 11px; color: var(--text-2); display: grid; place-items: center; gap: 6px; transition: 0.15s;
}
.style-opt:hover { border-color: var(--line-strong); background: var(--surface-2); }
.style-opt.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.style-opt .mini { width: 26px; height: 26px; }
.material { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.material button {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); font-size: 12px; text-align: left;
}
.material button:hover { border-color: var(--primary); }
.material .sw { width: 20px; height: 20px; border-radius: 6px; flex: none; }

/* 上传区 */
.drop {
  border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 22px; text-align: center;
  background: var(--surface-2); transition: 0.18s; cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop .ic { width: 36px; height: 36px; margin: 0 auto 8px; color: var(--muted); }
.drop b { font-size: 13px; display: block; }
.drop span { font-size: 11.5px; color: var(--muted); }
.upload-preview { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.upload-preview img { width: 100%; max-height: 180px; object-fit: contain; background: #fff; }
.upload-preview .remove {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 8px;
  background: rgba(15, 23, 42, 0.7); color: #fff; border: 0; display: grid; place-items: center;
}

/* 结果 */
.result-box { padding: 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); flex: none; }
.kv b { font-weight: 600; word-break: break-all; text-align: right; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfe; }
td b, td strong { color: var(--text); font-weight: 600; }
.mono { font-family: var(--mono); font-size: 11.5px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; }
.empty .ic { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--line-strong); }

/* ---------------- 弹窗 / 提示 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(3px);
  display: none; place-items: center; z-index: 100; padding: 20px;
}
.modal-mask.show { display: grid; }
.modal {
  background: var(--surface); border-radius: 18px; width: 100%; max-width: 460px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.18s ease;
}
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }
.modal-head { padding: 18px 20px 0; font-size: 15px; font-weight: 700; }
.modal-body { padding: 14px 20px 18px; font-size: 13px; color: var(--text-2); }
.modal-foot { padding: 12px 20px; background: var(--surface-2); display: flex; justify-content: flex-end; gap: 8px; }

#toast-wrap { position: fixed; top: 80px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 11px 14px; min-width: 220px; max-width: 360px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-lg);
  font-size: 13px; animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }
.toast .ic { width: 20px; height: 20px; flex: none; }
.toast.ok .ic { color: var(--success); }
.toast.err .ic { color: var(--danger); }
.toast.info .ic { color: var(--primary); }

/* ---------------- 页脚 ---------------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 40px 0 28px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { font-size: 12px; font-weight: 700; margin-bottom: 12px; }
.footer a { display: block; font-size: 12.5px; color: var(--muted); padding: 4px 0; }
.footer a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); gap: 12px; flex-wrap: wrap; }

/* ---------------- 认证页 ---------------- */
.auth-wrap { min-height: calc(100vh - var(--nav-h)); display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { padding: 56px; background: linear-gradient(150deg, #eef0ff, #e6f9fc); display: flex; flex-direction: column; justify-content: center; }
.auth-side h2 { font-size: 30px; letter-spacing: -0.03em; margin-bottom: 12px; }
.auth-side p { color: var(--text-2); font-size: 14px; max-width: 420px; }
.auth-side ul { margin-top: 26px; display: grid; gap: 12px; }
.auth-side li { display: flex; gap: 10px; font-size: 13px; color: var(--text-2); }
.auth-side li svg { color: var(--success); flex: none; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* ---------------- 后台 ---------------- */
.admin-body { background: #f4f6fb; }
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: #0f172a; color: #cbd5e1; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { color: #fff; margin-bottom: 22px; padding: 0 8px; }
.sidebar .brand small { color: #64748b; }
.side-group { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: #64748b; padding: 14px 10px 6px; text-transform: uppercase; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  font-size: 13px; color: #cbd5e1; transition: 0.15s; font-weight: 500;
}
.side-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-link.active { background: rgba(79, 70, 229, 0.25); color: #fff; box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.35); }
.side-link .ic { width: 17px; height: 17px; opacity: 0.8; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.admin-main { padding: 24px 28px 48px; min-width: 0; }
.admin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.admin-top h1 { font-size: 20px; letter-spacing: -0.02em; }
.admin-top p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat-card span { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-card b { display: block; font-size: 24px; letter-spacing: -0.03em; margin-top: 6px; font-weight: 750; }
.stat-card small { font-size: 11px; color: var(--muted); }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.chart-bars .bar { flex: 1; background: linear-gradient(180deg, #818cf8, #4f46e5); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.chart-bars .bar:hover { filter: brightness(1.1); }
.chart-labels { display: flex; gap: 6px; margin-top: 6px; }
.chart-labels span { flex: 1; font-size: 9px; color: var(--muted); text-align: center; }
.admin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.pager .btns { display: flex; gap: 6px; }

/* 登录墙 */
.gate { max-width: 400px; margin: 80px auto; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .hero h1 { font-size: 38px; }
  .studio, .studio.wide { grid-template-columns: 1fr; }
  .studio-panel { position: static; }
  .studio-panel .panel-body { max-height: none; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar .brand { margin: 0 12px 0 0; }
  .side-group { display: none; }
  .side-foot { margin: 0; border: 0; padding: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
  .feature-split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; }
  .nav-inner { gap: 12px; }
  .hero { padding: 44px 0 32px; }
  .hero h1 { font-size: 32px; }
  .tool-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .preview-canvas { padding: 18px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .container { padding: 0 16px; }
  .nav-inner { padding: 0 16px; }
  .style-grid { grid-template-columns: repeat(4, 1fr); }
}
.mobile-menu {
  display: none; position: fixed; inset: var(--nav-h) 0 auto 0; background: var(--surface);
  border-bottom: 1px solid var(--line); padding: 12px 16px 18px; z-index: 49; box-shadow: var(--shadow-lg);
}
.mobile-menu.show { display: block; }
.mobile-menu a { display: block; padding: 10px 8px; font-size: 14px; border-radius: 8px; }
.mobile-menu a:hover { background: var(--surface-2); }
.mobile-menu .grp { font-size: 10px; color: var(--muted); padding: 10px 8px 4px; letter-spacing: 0.08em; }

/* 打印 */
@media print {
  .nav, .footer, .preview-actions, .studio-panel { display: none !important; }
  body { background: #fff; }
  .preview-stage { border: 0; }
}

/* ---------------- 电子名片 ---------------- */
.biz-card {
  --bc-a: #4f46e5; --bc-b: #06b6d4;
  width: 100%; max-width: 520px; aspect-ratio: 1.72; background: #fff;
  border-radius: 20px; overflow: hidden; position: relative;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.biz-card .bc-bar { height: 8px; background: linear-gradient(90deg, var(--bc-a), var(--bc-b)); flex: none; }
.biz-card .bc-body { display: flex; gap: 18px; padding: 24px 24px 22px; flex: 1; min-height: 0; }
.bc-left { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bc-name { font-size: 27px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.2; }
.bc-title { font-size: 12px; color: var(--muted); margin-top: 5px; }
.bc-company { font-size: 13px; font-weight: 650; margin-top: 12px; color: var(--text); }
.bc-lines { margin-top: auto; display: grid; gap: 5px; font-size: 11px; color: var(--text-2); }
.bc-line { display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-line svg { color: var(--bc-a); flex: none; }
.bc-qr {
  width: 40%; align-self: center; background: #fff; border-radius: 14px;
  padding: 7px; border: 1px solid var(--line); flex: none;
}
.bc-qr svg { width: 100%; height: auto; display: block; }
.bc-placeholder { aspect-ratio: 1; display: grid; place-items: center; color: var(--muted); font-size: 11px; text-align: center; }
.bc-themes { display: flex; gap: 8px; }
.bc-theme { width: 30px; height: 30px; border-radius: 9px; border: 2px solid transparent; cursor: pointer; }
.bc-theme.active { border-color: var(--text); }

/* ---------------- 标签排版预览 ---------------- */
.label-sheet {
  background: #fff; box-shadow: var(--shadow-lg); border-radius: 4px;
  display: grid; width: min(100%, 560px); padding: 16px;
  margin: 0 auto; border: 1px solid var(--line);
}
.label-cell {
  border: 1px dashed #d4d4d8; border-radius: 3px; overflow: hidden;
  display: flex; flex-direction: column; position: relative; background: #fff;
  font-size: 8px; line-height: 1.35; color: #111827;
}
.label-cell .lc-head { background: var(--lc-accent, #111827); color: #fff; padding: 2px 4px; font-weight: 700; font-size: 7px; letter-spacing: .02em; }
.label-cell .lc-body { padding: 4px; display: flex; gap: 4px; flex: 1; min-height: 0; }
.label-cell .lc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.label-cell .lc-title { font-weight: 700; font-size: 9px; line-height: 1.2; overflow: hidden; }
.label-cell .lc-sub { color: #52525b; font-size: 7px; margin-top: 1px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.label-cell .lc-meta { color: #3f3f46; font-size: 6.5px; margin-top: 2px; overflow: hidden; }
.label-cell .lc-price { color: var(--lc-accent, #111827); font-weight: 800; font-size: 13px; margin-top: auto; line-height: 1; }
.label-cell .lc-price small { font-size: 6px; font-weight: 500; color: #71717a; }
.label-cell .lc-qr { flex: none; align-self: flex-end; }
.label-cell .lc-qr svg { width: 100%; height: auto; display: block; }
.label-cell.big-title .lc-title { font-size: 15px; }

/* 二维码空状态 */
.qr-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 44px 16px; }
.qr-empty svg { margin: 0 auto 12px; opacity: .35; }
.bc-qr .qr-empty { padding: 24px 6px; font-size: 10px; line-height: 1.5; }
.bc-qr .qr-empty svg { width: 30px; height: 30px; margin-bottom: 6px; }

/* hidden 属性优先级修正（避免被 display 规则覆盖） */
[hidden] { display: none !important; }

.badge:empty { display: none; }

/* 移动端：工具页优先展示预览 */
@media (max-width: 760px) {
  .studio { display: flex; flex-direction: column; gap: 16px; }
  .studio > .studio-panel { order: 2; }
  .studio > div:not(.studio-panel) { order: 1; }
  .studio-panel .panel-body { max-height: none; overflow: visible; }
}
