/* ==========================================================================
   管理后台样式 —— 深色侧栏 + 明亮工作区，信息密度高但不拥挤
   ========================================================================== */
:root {
  --bg: #f4f0e6; --surface: #fffdf8; --surface-2: #faf7f0; --line: #e6e0d2; --line-2: #d6cebd;
  --text: #1f1d1a; --text-2: #3d3a34; --muted: #77705f; --faint: #a59d8a;
  --brand: #d97757; --brand-2: #e5b85c; --brand-soft: #f6e1d6;
  --ok: #12b76a; --ok-soft: #e7f8ef; --warn: #f79009; --warn-soft: #fff4e5; --bad: #f04438; --bad-soft: #feeceb; --info: #0ba5ec; --info-soft: #e6f6fd;
  --side: #1f1d1a; --side-2: #2c2a26; --side-text: #b5ad9c;
  --r: 12px; --r-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 12px 32px -8px rgba(16, 24, 40, .14), 0 2px 6px rgba(16,24,40,.05);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.i { width: 1em; height: 1em; flex: none; vertical-align: -0.125em; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------------- 登录 ---------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { position: relative; overflow: hidden; background: var(--side); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art::before { content: ""; position: absolute; width: 700px; height: 700px; left: -200px; bottom: -300px; border-radius: 50%; background: radial-gradient(circle, rgba(217,119,87,.5), transparent 65%); }
.login-art::after { content: ""; position: absolute; width: 500px; height: 500px; right: -160px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(229,184,92,.3), transparent 65%); }
.login-art > * { position: relative; z-index: 1; }
.login-art h1 { font-family: "Noto Serif CJK SC", "Songti SC", serif; font-size: 42px; line-height: 1.15; margin: 0 0 14px; letter-spacing: -1px; }
.login-art p { color: var(--side-text); max-width: 420px; margin: 0; }
.sec-list { display: grid; gap: 12px; margin-top: 34px; }
.sec-list div { display: flex; align-items: center; gap: 12px; color: #d7d8ea; font-size: 14px; }
.sec-list .i { width: 30px; height: 30px; padding: 7px; border-radius: 9px; background: rgba(255,255,255,.08); color: #e8a184; }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(380px, 100%); }
.login-card h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.5px; }
.login-card > p { margin: 0 0 28px; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: #d97757; position: relative; flex: none; box-shadow: 0 6px 18px -4px rgba(184,92,61,.5); }
.logo::after { content: ""; position: absolute; inset: 7px; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.otp-inputs { display: flex; gap: 8px; justify-content: space-between; }
.otp-inputs input { width: 100%; height: 54px; text-align: center; font: 700 22px var(--mono); border: 1px solid var(--line-2); border-radius: 12px; outline: none; background: #fff; }
.otp-inputs input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

/* ---------------- 布局 ---------------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); color: var(--side-text); padding: 18px 12px; display: flex; flex-direction: column; }
.side .brand { color: #fff; padding: 4px 10px 20px; }
.side .brand small { display: block; font-size: 11px; font-weight: 500; color: var(--side-text); letter-spacing: .5px; }
.nav-group { margin-top: 14px; }
.nav-group > span { display: block; padding: 0 12px 6px; font-size: 11px; letter-spacing: 1px; color: #6f685a; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 2px 0; border-radius: 9px; color: var(--side-text); font-size: 14px; transition: .15s; position: relative; }
.nav-item .i { font-size: 17px; opacity: .85; }
.nav-item:hover { background: var(--side-2); color: #fff; }
.nav-item.on { background: linear-gradient(90deg, rgba(217,119,87,.3), rgba(217,119,87,.06)); color: #fff; }
.nav-item.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-item em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--bad); color: #fff; }
.side-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid rgba(255,255,255,.06); }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; color: #fff; background: #d97757; flex: none; text-transform: uppercase; }
.me b { display: block; color: #fff; font-size: 13.5px; }
.me small { font-size: 11.5px; }
.me button { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--side-text); font-size: 16px; }
.me button:hover { background: var(--side-2); color: #fff; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: rgba(244,240,230,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 700; font-family: "Noto Serif CJK SC", "Songti SC", Georgia, serif; letter-spacing: -.2px; }
.topbar .crumb { color: var(--muted); font-size: 13px; }
.topbar .sp { flex: 1; }
.mode-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.mode-badge.demo { background: var(--warn-soft); color: #b54708; }
.mode-badge.live { background: var(--ok-soft); color: #067647; }
.menu-btn { display: none; }
.content { padding: 24px 28px 60px; max-width: 1400px; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------------- 通用组件 ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-h .sp { flex: 1; }
.card-b { padding: 18px 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: grid; gap: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 13.5px; border: 1px solid var(--line-2); background: #fff; color: var(--text-2); transition: .15s; white-space: nowrap; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--surface-2); border-color: #c8cbd9; color: var(--text); }
.btn .i { font-size: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px -4px rgba(184,92,61,.5); }
.btn.primary:hover { background: #c4643f; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #fbc5c1; }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: rgba(255,255,255,.4) rgba(255,255,255,.4) #fff; animation: spin .7s linear infinite; }
.btn:not(.primary).loading::after { border-color: var(--line-2) var(--line-2) var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--muted); font-size: 16px; transition: .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }

.field { display: grid; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; justify-content: space-between; }
.field > label small { font-weight: 400; color: var(--faint); }
.field .help { font-size: 12px; color: var(--muted); }
.inp, select.inp, textarea.inp { width: 100%; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; outline: none; transition: .15s; }
textarea.inp { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.inp-group { position: relative; }
.inp-group > .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 16px; pointer-events: none; }
.inp-group .inp { padding-left: 34px; }
.inp-group .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
select.inp { appearance: none; padding-right: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371768a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center/16px no-repeat; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #d0d3df; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s var(--ease); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-ok { background: var(--ok-soft); color: #067647; } .b-warn { background: var(--warn-soft); color: #b54708; }
.b-bad { background: var(--bad-soft); color: #b42318; } .b-info { background: var(--info-soft); color: #026aa2; }
.b-gray { background: #f0f1f5; color: var(--muted); } .b-brand { background: var(--brand-soft); color: #a24e30; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafbfd; }
tr.click { cursor: pointer; }
th.r, td.r { text-align: right; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
.empty-row td { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-row .i { display: block; margin: 0 auto 8px; font-size: 32px; opacity: .4; }
.pi { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pi b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.pi small { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.picon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 18px; flex: none; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 4px 10px -4px var(--c1); }
.t-violet { --c1: #8b5cf6; --c2: #6366f1; } .t-cyan { --c1: #22d3ee; --c2: #0284c7; } .t-amber { --c1: #f59e0b; --c2: #ea580c; }
.t-rose { --c1: #fb7185; --c2: #db2777; } .t-emerald { --c1: #10b981; --c2: #0d9488; } .t-blue { --c1: #3b82f6; --c2: #4f46e5; }
.t-orange { --c1: #fb923c; --c2: #e11d48; } .t-slate { --c1: #64748b; --c2: #334155; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar .sp { flex: 1; }
.toolbar .inp { width: auto; min-width: 160px; height: 34px; }
.toolbar .inp-group .inp { min-width: 240px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #eef0f5; gap: 2px; flex-wrap: wrap; }
.seg button { height: 28px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); transition: .15s; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(16,24,40,.1); }
.seg button em { font-style: normal; margin-left: 4px; color: var(--faint); font-weight: 500; }
.pager { display: flex; align-items: center; gap: 6px; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pager .btns { display: flex; gap: 4px; }
.pager button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--brand-soft); color: #a24e30; font-size: 13px; font-weight: 600; border-bottom: 1px solid #efcdbd; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { position: relative; padding: 18px 20px; overflow: hidden; }
.kpi .lab { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .lab .i { width: 28px; height: 28px; padding: 6px; border-radius: 8px; color: var(--kc); background: color-mix(in srgb, var(--kc) 12%, white); }
.kpi .val { margin-top: 12px; font-size: 28px; font-weight: 750; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 16px; font-weight: 600; margin-right: 2px; color: var(--text-2); }
.kpi .sub { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.delta { font-weight: 700; } .delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--kc) 14%, transparent), transparent 70%); }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.chart { position: relative; height: 280px; padding: 8px 20px 16px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: #15161c; color: #fff; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .15s; box-shadow: var(--shadow); }
.chart .tip b { display: block; font-size: 14px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.rank { display: grid; gap: 14px; }
.rank-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.rank-item .no { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: #f0f1f5; color: var(--muted); }
.rank-item:nth-child(1) .no { background: #fff1d6; color: #b54708; }
.rank-item:nth-child(2) .no { background: #eef0f5; color: #475467; }
.rank-item:nth-child(3) .no { background: #fbe9e1; color: #b93815; }
.rank-item .bar { height: 6px; border-radius: 6px; background: #f0f1f5; margin-top: 6px; overflow: hidden; }
.rank-item .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.stock-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.stock-item:last-child { border-bottom: 0; }
.stock-item .pi { flex: 1; }

/* 弹层 */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 16, 26, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: ofade .2s; }
@keyframes ofade { from { opacity: 0; } }
.dialog { width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: #fff; border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(15,16,26,.4); animation: pop .3s var(--ease); }
.dialog.wide { width: min(860px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.dialog-h { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dialog-h h3 { margin: 0; font-size: 16px; flex: 1; }
.dialog-b { padding: 20px 22px; overflow-y: auto; }
.dialog-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.drawer-ov { place-items: stretch end; padding: 0; }
.drawer { width: min(560px, 100%); height: 100vh; background: #fff; display: flex; flex-direction: column; animation: slide .35s var(--ease); box-shadow: -20px 0 60px rgba(15,16,26,.2); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.confirm-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; background: var(--warn-soft); color: var(--warn); }
.confirm-ic.bad { background: var(--bad-soft); color: var(--bad); }

/* 商品编辑：图标/主题选择 + 预览 */
.picker { display: flex; flex-wrap: wrap; gap: 6px; }
.picker button { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; border: 1px solid var(--line); background: #fff; color: var(--text-2); transition: .12s; }
.picker button:hover { border-color: var(--brand); }
.picker button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.swatch { width: 28px !important; height: 28px !important; border-radius: 50% !important; background: linear-gradient(135deg, var(--c1), var(--c2)) !important; border: 2px solid #fff !important; box-shadow: 0 0 0 1px var(--line-2); }
.swatch.on { box-shadow: 0 0 0 2px var(--text) !important; }
.prod-edit { display: grid; grid-template-columns: 1fr 260px; gap: 22px; }
.preview { position: sticky; top: 0; }
.preview .lab { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.pv { --c: #b7a4d6; border-radius: 20px; background: #faf8f2; color: #1f1d1a; border: 1px solid #e6e0d2; box-shadow: 0 20px 40px -20px rgba(31,29,26,.35); overflow: hidden; }
.pv.t-violet { --c: #b7a4d6; } .pv.t-cyan { --c: #8fbcd4; } .pv.t-amber { --c: #e9bf6b; } .pv.t-rose { --c: #e3a1a1; }
.pv.t-emerald { --c: #9dbf92; } .pv.t-blue { --c: #93a9d8; } .pv.t-orange { --c: #e28c67; } .pv.t-slate { --c: #b3b1a8; }
.pv .art { position: relative; height: 130px; margin: 8px 8px 0; border-radius: 14px; background: var(--c); color: rgba(31,29,26,.82); overflow: hidden; }
.pv .art::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255,255,255,.14) 0 2px, transparent 2px 10px); }
.pv .no { position: absolute; right: 10px; top: 9px; font: 700 10.5px var(--mono); opacity: .6; }
.pv .dl { position: absolute; left: 10px; top: 10px; font-size: 10.5px; font-weight: 600; background: rgba(250,248,242,.92); border-radius: 99px; padding: 2px 8px; color: #1f1d1a; }
.pv .big { position: absolute; right: -8px; bottom: -16px; font-size: 104px; line-height: 0; } .pv .big .i { stroke-width: 1.2; }
.pv .tg { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 4px; }
.pv .tg span { padding: 2px 8px; background: #1f1d1a; color: #f4f0e6; font-size: 10px; font-weight: 600; border-radius: 99px; }

.pv .bd { padding: 12px 14px 4px; }
.pv h4 { margin: 0 0 2px; font: 700 16px "Noto Serif CJK SC", "Songti SC", Georgia, serif; }
.pv p { margin: 0; font-size: 12px; color: #77705f; min-height: 18px; }
.pv .ft { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 14px; margin-top: 6px; }
.pv .pr { font: 700 24px "Noto Serif CJK SC", "Songti SC", Georgia, serif; letter-spacing: -1px; }
.pv .pr small { font-size: 12px; } .pv .pr del { font-size: 10px; color: #a59d8a; font-weight: 400; margin-left: 4px; letter-spacing: 0; }
.pv .bt { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #1f1d1a; color: #f4f0e6; font-size: 15px; }

/* 导入 */
.import-stats { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.import-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
textarea.codearea { font: 13px/1.7 var(--mono); min-height: 260px; white-space: pre; }
.result-box { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.result-box div { padding: 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.result-box b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.result-box span { font-size: 12px; color: var(--muted); }

/* 详情 */
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.sect { margin-top: 22px; }
.sect h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.secret-line { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 6px; font: 13px var(--mono); }
.secret-line span { flex: 1; word-break: break-all; }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 13px; background: var(--info-soft); color: #065986; }
.callout.warn { background: var(--warn-soft); color: #93370d; }
.callout.bad { background: var(--bad-soft); color: #912018; }
.callout .i { font-size: 17px; margin-top: 1px; }
.code-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: #15161c; color: #e5e7f0; font: 14px var(--mono); letter-spacing: 1px; word-break: break-all; }
.code-box span { flex: 1; }
.code-box .icon-btn { color: #a1a5b5; } .code-box .icon-btn:hover { background: #2a2c38; color: #fff; }

/* Toast */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 420px; padding: 12px 16px; border-radius: 12px; background: #15161c; color: #fff; font-size: 13.5px; box-shadow: var(--shadow); animation: tin .35s var(--ease); }
.toast .i { font-size: 18px; color: #4ade80; } .toast.err .i { color: #f97066; }
.toast.out { animation: tout .25s forwards; }
@keyframes tin { from { opacity: 0; transform: translateX(20px); } }
@keyframes tout { to { opacity: 0; transform: translateX(20px); } }
.skel { border-radius: var(--r); background: linear-gradient(90deg, #eceef3 25%, #f5f6f9 50%, #eceef3 75%); background-size: 200% 100%; animation: sk 1.3s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .grid2, .grid3 { grid-template-columns: 1fr; }
  .prod-edit { grid-template-columns: 1fr; } .preview { position: static; }
}
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; width: 240px; left: 0; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .side.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.3); }
  .menu-btn { display: inline-grid; }
  .content { padding: 16px; } .topbar { padding: 0 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .result-box { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 二开：报表 / 内容管理 / 日期筛选 ---------- */
.date-range { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.toolbar .date-range .inp { min-width: 0; width: 138px; }
.inp-group .prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font: 13px var(--mono); pointer-events: none; }
.inp-group .prefix + .inp { padding-left: 62px; }
textarea.mono-ta { font: 13px/1.7 var(--mono); }
.rep-kpis .val { font-size: 26px; }
.rep-bar { position: relative; display: flex; align-items: center; height: 26px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.rep-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--brand-soft), #f3d3c3); border-radius: inherit; }
.rep-bar b { position: relative; padding-left: 10px; font-weight: 600; font-size: 13px; }
.rep-2 { grid-template-columns: 1fr 1fr; }
.rep-2 .rank-item .no .i { width: 13px; height: 13px; }
.page-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.md-preview { max-height: 560px; overflow: auto; padding: 22px 24px; border-radius: 14px; border: 1px solid var(--line); background: #faf8f2; color: var(--text-2); font-size: 14px; line-height: 1.8; }
.md-preview h1 { margin: 0 0 14px; font: 700 24px var(--font); color: var(--text); }
.md-preview h2, .md-preview h3, .md-preview h4 { color: var(--text); margin: 18px 0 8px; line-height: 1.35; }
.md-preview h2 { font-size: 19px; } .md-preview h3 { font-size: 16.5px; } .md-preview h4 { font-size: 15px; }
.md-preview p { margin: 0 0 10px; }
.md-preview ul, .md-preview ol { margin: 0 0 12px; padding-left: 1.3em; }
.md-preview li::marker { color: var(--brand); }
.md-preview a { color: var(--brand); }
@media (max-width: 1100px) { .rep-2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .page-edit { grid-template-columns: 1fr; } }
.page-edit .form-grid { grid-template-columns: 1fr 1fr; }
.page-edit .preview { position: sticky; top: 0; }
