/* 星耀·手卡 · 样式 v4（2026-10 改版）
   ------------------------------------------------------------------
   1. 暖白底 + 墨色文字，白天在办公室看得清；只有价格用橙红色，扫一眼就找到价。
   2. 产品库首屏留给手卡本身：统计数字、上传框都收起来，只在需要处理时出一条细提示。
   3. 详情页先给价格表，常用的 3 个操作在外面，其余收进「更多」。
   4. 火焰首页单独一套深色，见文件末尾。 */

@font-face {
  font-family: "XYTitle";
  /* 标题只子集了「星耀·手卡」几个字；小薇体文件缺失时自动退回庆科黄油体 */
  src: url("/static/fonts/title_xiaowei.woff2") format("woff2"),
       url("/static/fonts/star_qingke.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #F6F5F2;
  --surface: #FFFFFF;
  --sunken: #F1EFEA;
  --line: #E7E4DE;
  --line-soft: #F0EDE8;
  --line-strong: #D9D5CD;
  --ink: #1C1B18;
  --ink-2: #3F3C36;
  --ink-3: #5C5850;
  --price: #B93D0B;
  --ok: #1E5B32;
  --ok-bg: #E9F3EC;
  --warn: #7A3E00;
  --warn-bg: #FDF1DE;
  --warn-line: #F2D3A6;
  --err: #B42318;
  --err-bg: #FDECEA;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(28, 27, 24, .08);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC",
          "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
a { color: var(--ink); }
a:hover { color: var(--price); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ------------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 14px; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--bg); color: var(--ink); border-color: #CFCAC1; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary, .btn-script { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 500; }
.btn-primary:hover, .btn-script:hover { background: #33312C; border-color: #33312C; color: #fff; }
.btn-danger { color: var(--err); border-color: #F1C6C1; }
.btn-danger:hover { background: var(--err-bg); color: var(--err); border-color: #E9A8A1; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 40px; padding: 0; color: var(--ink-3); }
.btn-icon.btn-sm { width: 32px; }
.btn-ghost { border-color: transparent; background: transparent; }
.linkbtn {
  border: 0; background: none; padding: 4px 2px; color: inherit; font-size: 14px; font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* ------------------------------------------------------------------ 顶栏 */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 1360px; margin: 0 auto; padding: 12px 32px;
  display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.brand-text { font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.searchbox {
  flex: 1 1 380px; max-width: 680px; display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 8px 0 14px; background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink-3);
}
.searchbox:focus-within { border-color: var(--ink); background: var(--surface); }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); }
.searchbox input::-webkit-search-cancel-button { display: none; }
.q-clear { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.q-clear:hover { background: var(--sunken); }
.q-key { font-family: var(--font); font-size: 12px; color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 7px; background: var(--surface); }
.searchbox:focus-within .q-key { display: none; }
.topnav { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.userbox {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 5px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface); cursor: text;
}
.avatar {
  width: 30px; height: 30px; border-radius: 15px; flex: none; background: #EFE7DF; color: #8A3A0C;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.userbox input { width: 76px; border: 0; outline: 0; background: transparent; font-size: 14px; }

/* ------------------------------------------------------------------ 通用容器 */
.container { max-width: 1360px; margin: 0 auto; padding: 22px 32px 64px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 12px; }
.card-head h2 { font-size: 16px; font-weight: 700; }
.hint { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.pad { padding: 0 22px 18px; }
.badge {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; line-height: 1.5;
  padding: 1px 8px; border-radius: 6px; background: var(--sunken); color: var(--ink-2); white-space: nowrap;
}
.badge-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.badge-err { background: var(--err-bg); color: var(--err); }

.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; margin: 0 0 16px;
  border-radius: 12px; font-size: 14px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line);
}
.notice svg { flex: none; margin-top: 2px; }
.notice.err { background: var(--err-bg); color: var(--err); border-color: #F1C6C1; }
.notice details { margin-top: 6px; }
.notice summary { cursor: pointer; font-weight: 500; }

/* ------------------------------------------------------------------ 产品库 */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 14px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.chip .n { color: var(--ink-3); }
.chip:hover { border-color: #CFCAC1; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on .n { color: rgba(255, 255, 255, .75); }
.chip.ghost { border-style: dashed; border-color: var(--line-strong); background: transparent; color: var(--ink-3); cursor: default; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.field-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; color: var(--ink-3);
}
.field-pill[hidden] { display: none; }
.field-pill select { border: 0; outline: 0; background: transparent; color: var(--ink); font-weight: 500; font-size: 14px; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 8px; height: 36px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }

.strips { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.strips > div:empty { display: none; }
.strips > div { display: flex; flex-direction: column; gap: 10px; }
.strip {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px;
}
.strip > svg { flex: none; }
.strip > span { flex: 1; min-width: 0; }
.strip-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.strip-err { background: var(--err-bg); border-color: #F1C6C1; color: var(--err); }
.strip-job > svg { color: var(--ink-3); animation: spin 1.6s linear infinite; }
.job-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.job-line { display: flex; justify-content: space-between; gap: 12px; }
.job-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-stage { color: var(--ink-3); white-space: nowrap; }
.bar { display: block; height: 4px; border-radius: 2px; background: #EFECE6; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); transition: width .4s; }

/* 本次上传的文件（上传中 → 解析中 → 完成） */
.jobs { display: flex; flex-direction: column; gap: 8px; }
.job {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px;
}
.jicon { color: var(--ink-3); display: inline-flex; }
.jname { flex: 0 1 auto; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.jmsg { flex: 1; min-width: 0; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jbar { width: 120px; height: 4px; border-radius: 2px; background: #EFECE6; overflow: hidden; flex: none; }
.jbar > i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .4s; }
.job.uploading .jbar > i { width: 35%; animation: indet 1.2s ease-in-out infinite; }
.job.done .jicon { color: var(--ok); }
.job.done .jbar > i { background: var(--ok); width: 100%; }
.job.fail { border-color: #F1C6C1; }
.job.fail .jmsg { color: var(--err); }
.jcancel { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--ink-3); font-size: 18px; }
.jcancel:hover { background: var(--sunken); }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

.list-head { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 14px; }
.list-head h1 { font-size: 20px; font-weight: 700; }
.count { font-size: 14px; color: var(--ink-3); }
.list-tip { font-size: 13px; color: var(--ink-3); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.pcard {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink);
  transition: box-shadow .15s, border-color .15s;
}
.pcard:hover { color: var(--ink); border-color: #CFCAC1; box-shadow: var(--shadow); }
.pcard-media {
  position: relative; height: 188px; background: var(--sunken); padding: 18px;
  display: flex; align-items: center; justify-content: center;
}
.pcard-media img { position: relative; z-index: 1; max-width: 100%; max-height: 100%; object-fit: contain; }
.pcard-media img.is-page { max-height: 100%; border-radius: 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.pcard-media-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink-3); font-size: 13px; }
.pcard-cat {
  position: absolute; top: 12px; left: 12px; font-size: 12px; padding: 2px 8px; border-radius: 6px;
  background: rgba(255, 255, 255, .92); color: var(--ink-2);
}
.pcard-flags { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pcard-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.pcard-name {
  font-size: 15px; font-weight: 500; line-height: 1.4; min-height: 42px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard-brand { font-size: 13px; color: var(--ink-3); margin-top: -6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; }
.pcard-price .lbl { font-size: 12px; color: var(--ink-3); }
.pcard-price .num { font-size: 26px; font-weight: 700; color: var(--price); line-height: 1.1; }
.pcard-price .unit { font-size: 13px; color: var(--price); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-price .tiers { font-size: 12px; color: var(--ink-2); background: var(--sunken); border-radius: 6px; padding: 1px 7px; }
.pcard-ref { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -4px; }
.pcard-hist { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); }
.pcard-hist .go { text-decoration: underline; cursor: pointer; margin-left: 4px; }
.pcard-meta { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-3); }
.pcard.is-hist { opacity: .9; }
.pcard.is-skel { pointer-events: none; }

.skel { border-radius: 8px; background: linear-gradient(90deg, #EFECE6 0%, #F7F5F1 50%, #EFECE6 100%); background-size: 200% 100%; animation: skel 1.3s infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.empty { text-align: center; padding: 64px 16px; color: var(--ink-3); }
.empty-art { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; background: var(--sunken); display: grid; place-items: center; color: var(--ink-3); }
.empty h3 { font-size: 17px; color: var(--ink); margin-bottom: 6px; }
.empty p { margin: 0 0 16px; font-size: 14px; }

/* ------------------------------------------------------------------ 详情 */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: 14px; color: var(--ink-3); }
.crumbs a { color: var(--ink-3); text-decoration: none; display: inline-flex; align-items: center; gap: 2px; min-height: 32px; }
.crumbs a:hover { color: var(--ink); }
.crumbs .cur { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

.dhead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 26px; margin-bottom: 16px; }
.dhead-main { flex: 1 1 520px; min-width: 0; display: flex; gap: 20px; align-items: center; }
.dhead-img {
  width: 96px; height: 96px; flex: none; border-radius: 12px; background: var(--sunken);
  display: flex; align-items: center; justify-content: center; padding: 10px; color: var(--ink-3); overflow: hidden;
}
.dhead-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dhead-img img.is-page { padding: 0; }
.dhead-text { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.dhead-text h1 { font-size: 24px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.chips-s { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.chip-s { padding: 2px 9px; border-radius: 6px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.chip-s.ok { background: var(--ok-bg); color: var(--ok); }
.chip-s.warn { background: var(--warn-bg); color: var(--warn); }
.chip-s.err { background: var(--err-bg); color: var(--err); }
.chip-s.dashed { background: transparent; border: 1px dashed #CFCAC1; color: var(--ink-3); }
.chips-s .meta { color: var(--ink-3); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.checks span { display: inline-flex; align-items: center; gap: 4px; }
.checks .ok { color: var(--ok); }
.checks .warn { color: var(--warn); font-weight: 500; }
.checks .none { color: var(--ink-3); }
.dhead-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(28, 27, 24, .14); display: flex; flex-direction: column;
}
.menu[hidden] { display: none; }
.menu button {
  text-align: left; height: 38px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; font-size: 14px; cursor: pointer;
}
.menu button:hover, .menu button:focus-visible { background: var(--bg); outline: none; }
.menu button.danger { color: var(--err); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 6px 4px; }

.dlayout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.dmain { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.dside { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid2:empty { display: none; }

.table-wrap { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: 15px; }
.ptable th {
  text-align: left; font-size: 13px; font-weight: 500; color: var(--ink-3); background: #FAF9F7;
  padding: 9px 16px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}
.ptable th:first-child, .ptable td:first-child { padding-left: 22px; }
.ptable td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: baseline; }
.ptable td.spec { min-width: 110px; }
.ptable td.price { white-space: nowrap; }
.ptable .num, .prow-big .num { font-size: 24px; font-weight: 700; color: var(--price); }
.ptable .unit, .prow-big .unit { font-size: 14px; color: var(--price); margin-left: 2px; }
.plist { padding: 0 22px 8px; display: flex; flex-direction: column; gap: 6px; }
.prow-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.prow-big .lbl { font-size: 13px; color: var(--ink-3); min-width: 44px; }
.pcard-section .kv { padding-top: 14px; }

.kv { margin: 0; display: grid; grid-template-columns: 76px 1fr; gap: 10px 14px; font-size: 14px; line-height: 1.6; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.oneliner { margin: 0 0 12px; font-size: 17px; font-weight: 500; line-height: 1.6; }
.olist { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 7px; font-size: 15px; line-height: 1.65; color: #2E2C28; }
.missing { margin: 0; padding: 0 4px; font-size: 13px; color: var(--ink-3); }

.viewer { overflow: hidden; }
.viewer-stage { background: var(--sunken); display: flex; justify-content: center; }
.viewer-stage img { display: block; max-width: 100%; max-height: 520px; cursor: zoom-in; }
.viewer-bar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 14px; font-size: 14px; color: var(--ink-2); }
.viewer-bar span { flex: 1; text-align: center; }
.viewer-thumbs { display: flex; gap: 8px; padding: 0 14px 12px; overflow-x: auto; }
.viewer-thumbs button { flex: none; width: 76px; height: 46px; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); cursor: pointer; }
.viewer-thumbs button.on { border: 2px solid var(--ink); }
.viewer-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer-actions { display: flex; gap: 10px; padding: 0 14px 14px; }
.viewer-actions .btn { flex: 1; }

.vlist { padding: 0 18px 14px; display: flex; flex-direction: column; gap: 8px; }
.vrow { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.vrow .vname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrow.here .vname { font-weight: 500; }

.fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; font-size: 15px; font-weight: 700;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary > svg { margin-left: auto; color: var(--ink-3); transition: transform .15s; }
.fold[open] > summary > svg { transform: rotate(180deg); }
.fold { overflow: hidden; }
.fold-body { padding: 0 20px 18px; font-size: 14px; overflow-wrap: anywhere; }
.raw { margin: 0; white-space: pre-wrap; max-height: 420px; overflow: auto; font-family: var(--font); color: var(--ink-2); line-height: 1.7; }
.brandinfo p { margin: 8px 0; line-height: 1.65; }
.brandinfo h4 { font-size: 14px; margin: 12px 0 4px; }
.brandinfo ul { margin: 0; padding-left: 20px; }
.brand-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.warn-text { color: var(--warn); }
.sources a { display: block; font-size: 13px; margin: 4px 0; }

/* ------------------------------------------------------------------ 弹层 */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(28, 27, 24, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.overlay[hidden] { display: none; }
.overlay-inner { max-width: 100%; max-height: 100%; display: flex; }
.overlay-inner > img { max-width: 96vw; max-height: 92vh; border-radius: 8px; background: #fff; cursor: zoom-out; }
.modal {
  width: min(640px, 94vw); max-height: 88vh; overflow: auto; background: var(--surface);
  border-radius: 16px; padding: 24px 26px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.modal h3 { font-size: 19px; margin-bottom: 8px; }
.modal .lead { margin: 0 0 16px; color: var(--ink-3); font-size: 14px; line-height: 1.65; }
.modal label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 14px 0 6px; }
.modal input[type=text], .modal input[type=password], .modal input[type=number], .modal input:not([type]),
.modal select, .modal textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); font-size: 14px; outline: none;
}
.modal textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--ink); }
.modal input[type=file] { font-size: 14px; }
.modal .hint { margin: 6px 0 0; font-size: 12.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-actions .left { margin-right: auto; }
.modal-scroll { max-height: 40vh; overflow: auto; padding-right: 4px; }
.modal .statbar { display: flex; flex-wrap: wrap; gap: 8px; }
.modal .stat { padding: 6px 10px; border-radius: 8px; background: var(--bg); font-size: 13px; }

.prow { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
.prow-head { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.prow-del { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer; }
.prow-del:hover { background: var(--err-bg); color: var(--err); }
.tier-editor { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.tier-edit-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 8px; align-items: end; padding: 10px; background: var(--bg); border-radius: 10px; }
.modal .tier-edit-row label { margin: 0; font-size: 12px; }
.modal .tier-edit-row input { height: 34px; margin-top: 4px; }

.cat-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.modal .cat-opt { margin: 0; cursor: pointer; }
.cat-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cat-opt span {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 19px;
  border: 1px solid var(--line-strong); font-size: 14px; font-weight: 400; color: var(--ink);
}
.cat-opt input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.script-bar { display: flex; align-items: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.script-meta { font-size: 13px; color: var(--ink-3); }
.script-body { white-space: pre-wrap; line-height: 1.85; font-size: 15px; padding: 16px 18px; border-radius: 12px; background: var(--bg); max-height: 48vh; overflow: auto; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunken); }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 14px; }
.seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); font-weight: 500; }
.fortune-list { display: flex; flex-direction: column; gap: 8px; }
.fortune-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left;
}
.fortune-item:hover { border-color: var(--ink); }
.fortune-item .txt { flex: 1; font-size: 16px; font-weight: 500; }
.fortune-item .cnt { font-size: 12px; color: var(--ink-3); }
.fortune-loading { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 120px; color: var(--ink-3); font-size: 14px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.candgrid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.candgrid button { aspect-ratio: 1; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--sunken); cursor: pointer; }
.candgrid button.on, .candgrid button:hover { border: 2px solid var(--ink); }
.candgrid img { width: 100%; height: 100%; object-fit: contain; }

.toasts { position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px; max-width: min(520px, 92vw); padding: 10px 16px;
  border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
.toast.ok svg { color: #8FD3A5; }
.toast.err svg, .toast.warn svg { color: #FFB86B; }
.drop-hint { position: fixed; inset: 0; z-index: 70; background: rgba(28, 27, 24, .55); display: grid; place-items: center; pointer-events: none; }
.drop-hint[hidden] { display: none; }
.drop-hint > div { display: flex; align-items: center; gap: 10px; padding: 18px 28px; border-radius: 16px; background: var(--surface); font-size: 17px; font-weight: 500; border: 2px dashed var(--ink); }

/* ------------------------------------------------------------------ 手机 */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .topbar-inner { padding: 10px 16px; gap: 10px; }
  .brand-text { font-size: 16px; }
  .searchbox { order: 3; flex: 1 1 100%; max-width: none; height: 46px; }
  .searchbox input { font-size: 16px; }
  .q-key, .hide-sm { display: none; }
  #btn-upload { width: 44px; height: 44px; padding: 0; }
  .btn-icon { width: 44px; height: 44px; }
  .userbox { height: 44px; padding-right: 8px; }
  .userbox input { width: 56px; }
  .container { padding: 14px 16px 48px; }
  .filterbar { gap: 10px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; width: calc(100% + 32px); }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .filters { margin-left: 0; width: 100%; }
  .list-head { margin: 12px 0 10px; }
  .list-head h1 { font-size: 18px; }

  /* 手机上产品库改成横条：左图右价，一屏能看 6~7 个品 */
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .pcard { flex-direction: row; gap: 12px; padding: 12px; border-radius: 14px; }
  .pcard-media { width: 88px; height: 88px; flex: none; padding: 8px; border-radius: 10px; }
  .pcard-cat, .pcard-meta { display: none; }
  .pcard-flags { top: 4px; right: 4px; }
  .pcard-flags .badge { font-size: 10px; padding: 0 5px; }
  .pcard-body { padding: 0; gap: 4px; min-width: 0; }
  .pcard-name { min-height: 0; font-size: 15px; }
  .pcard-brand { margin-top: 0; }
  .pcard-price .num { font-size: 21px; }
  .pcard-ref { margin-top: 0; font-size: 12px; }
  
  .crumbs { margin-bottom: 10px; }
  .dhead { padding: 16px; gap: 14px; }
  .dhead-main { gap: 14px; align-items: flex-start; flex-basis: 100%; }
  .dhead-img { width: 72px; height: 72px; }
  .dhead-text h1 { font-size: 19px; }
  /* 常用操作固定在屏幕底部，大拇指够得着 */
  .dhead-actions {
    position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; flex-wrap: nowrap; gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
  }
  .dhead-actions > .btn { height: 46px; flex: 1; padding: 0 8px; font-size: 14px; }
  .dhead-actions > #a-copy { flex: 1.6; }
  .dhead-actions > .btn, .dhead-actions .menu-wrap { min-width: 0; }
  .dhead-actions .menu-wrap .btn { height: 46px; width: 46px; padding: 0; }
  .menu { top: auto; bottom: calc(100% + 8px); }
  .detail { padding-bottom: 96px; }
  .card-head { padding: 14px 16px 10px; }
  .pad { padding: 0 16px 14px; }
  /* 手机上三列表格定宽，参考价不再被挤出屏幕 */
  .ptable { table-layout: fixed; font-size: 13px; }
  .ptable th { padding: 8px 6px; font-size: 12px; white-space: normal; }
  .ptable td { padding: 10px 6px; vertical-align: top; overflow-wrap: anywhere; }
  .ptable th:first-child, .ptable td:first-child { width: 30%; padding-left: 12px; }
  .ptable td.spec { min-width: 0; }
  .ptable td.price { white-space: normal; }
  .ptable .num { font-size: 19px; }
  .ptable .unit { display: block; margin-left: 0; font-size: 12px; }
  .kv { grid-template-columns: 64px 1fr; }
  .viewer-stage img { max-height: 300px; }
  .modal { padding: 20px 18px; }
  .prow { grid-template-columns: 1fr 1fr; }
  .prow-head { display: none; }
  .tier-edit-row { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------------ 火焰首页（深色） */
body.welcome-mode { background: #050101; overflow: hidden; }
body.welcome-mode .topbar { display: none; }
.welcome {
  position: relative; height: 100vh; height: 100dvh; min-height: 560px; overflow: hidden;
  background: #050101; color: #FFF3E3; touch-action: manipulation;
}
.fire-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fire-canvas.spark { pointer-events: none; }
.welcome-inner {
  position: relative; z-index: 2; height: 100%; padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  pointer-events: none;
}
.welcome-inner form, .welcome-inner a { pointer-events: auto; }
.flame-glow { width: 99px; height: 168px; animation: flicker 2.6s ease-in-out infinite; }
.flame-logo {
  width: 100%; height: 100%;
  -webkit-mask: url("/static/flame-logo.png") center / contain no-repeat;
  mask: url("/static/flame-logo.png") center / contain no-repeat;
  background: linear-gradient(180deg, #FFF8EC 0%, #FFE0A8 38%, #FFB35C 70%, #F07A2A 100%);
}
@keyframes flicker {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255, 150, 60, .55)) drop-shadow(0 0 42px rgba(255, 90, 20, .35)); }
  45% { filter: drop-shadow(0 0 18px rgba(255, 170, 80, .7)) drop-shadow(0 0 60px rgba(255, 100, 30, .45)); }
  70% { filter: drop-shadow(0 0 12px rgba(255, 140, 50, .5)) drop-shadow(0 0 36px rgba(255, 80, 20, .3)); }
}
.welcome-title {
  margin: 4px 0 6px; font-family: "XYTitle", "STKaiti", "KaiTi", serif; font-size: 44px; font-weight: 400;
  letter-spacing: .22em; text-indent: .22em; line-height: 1.1; color: #FFF1DC;
  text-shadow: 0 0 18px rgba(255, 140, 50, .55), 0 2px 0 rgba(60, 10, 0, .6);
}
.welcome-title .dot { opacity: .7; padding: 0 .06em; }
.welcome-search {
  width: min(560px, 100%); display: flex; align-items: center; gap: 10px; height: 58px;
  padding: 0 6px 0 20px; border-radius: 29px; border: 1px solid rgba(255, 190, 130, .45);
  background: rgba(20, 6, 2, .48); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #FFD9B0;
}
.welcome-search:focus-within { border-color: rgba(255, 200, 140, .85); background: rgba(20, 6, 2, .62); }
.welcome-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: #FFF7EE; }
.welcome-search input::placeholder { color: rgba(255, 226, 200, .55); }
.welcome-search input::-webkit-search-cancel-button { display: none; }
.welcome-search button {
  flex: none; height: 46px; padding: 0 24px; border: 0; border-radius: 23px; cursor: pointer;
  background: linear-gradient(180deg, #FFD08A, #F2913E); color: #3A1302; font-size: 15px; font-weight: 700;
}
.welcome-search button:hover { filter: brightness(1.08); }
.welcome-all {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px;
  font-size: 15px; letter-spacing: .08em; color: #FFE7C7; text-decoration: none;
  border-bottom: 1px solid rgba(255, 210, 160, .4);
}
.welcome-all:hover { color: #fff; border-color: #FFBE7A; }
.welcome-hint {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 18px; margin: 0; text-align: center;
  font-size: 12px; letter-spacing: .1em; color: rgba(255, 235, 215, .8); pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}
@media (max-width: 720px) {
  .flame-glow { width: 82px; height: 140px; }
  .welcome-title { font-size: 36px; }
  .welcome-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .flame-glow, .strip-job > svg, .skel { animation: none; }
}

/* ------------------------------------------------------------------ 登录页 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 92vw); text-align: center; padding: 32px 28px; }
.login-card h1 { font-size: 22px; margin: 14px 0 6px; }
.login-card p { margin: 0 0 20px; color: var(--ink-3); font-size: 14px; }
.login-card input {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px;
  font-size: 16px; text-align: center; outline: none;
}
.login-card input:focus { border-color: var(--ink); }
.login-card .err { color: var(--err); font-size: 13px; min-height: 20px; margin: 10px 0 0; }
.login-card .btn { width: 100%; height: 46px; margin-top: 4px; font-size: 15px; }

/* ------------------------------------------------------------------ 主播售卖记录（2026-10） */
.anchor-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.anchor-bar::-webkit-scrollbar { display: none; }
.anchor-bar .lbl { flex: none; font-size: 13px; color: var(--ink-3); margin-right: 2px; }
.anchor {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 5px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface); font-size: 14px; cursor: pointer;
}
.anchor:hover { border-color: #CFCAC1; }
.anchor .n { color: var(--ink-3); font-size: 13px; }
.anchor.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.anchor.on .n { color: rgba(255, 255, 255, .75); }
.anchor.all { padding: 0 16px; }
.av {
  width: 30px; height: 30px; border-radius: 15px; flex: none; display: inline-flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700; background: #EFE7DF; color: #8A3A0C;
}
.av.c1 { background: #F3E6DA; color: #8A3A0C; } .av.c2 { background: #E4ECF7; color: #24477A; }
.av.c3 { background: #E6F1E8; color: #23573A; } .av.c4 { background: #F3E4EC; color: #7A2752; }
.av.c5 { background: #EEE9F7; color: #4B3A7A; } .av.c6 { background: #F6EED7; color: #6B5310; }

.pcard-sold { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); min-width: 0; }
.pcard-sold .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-sold.none { color: #8C877E; }
.avs { display: inline-flex; flex: none; }
.avs .av { width: 22px; height: 22px; font-size: 11px; border: 2px solid #fff; margin-left: -6px; }
.avs .av:first-child { margin-left: 0; }

.sold-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 12px; }
.sold-head h2 { font-size: 16px; font-weight: 700; }
.sold-sum { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 22px 14px; }
.sold-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 12px; background: var(--bg); border: 1px solid #ECE9E3; }
.sold-chip .av { width: 32px; height: 32px; border-radius: 16px; font-size: 14px; }
.sold-chip b { font-size: 14px; font-weight: 600; display: block; line-height: 1.3; }
.sold-chip small { font-size: 12px; color: var(--ink-3); display: block; line-height: 1.3; }
.sold-log { border-top: 1px solid var(--line-soft); padding: 6px 22px 14px; }
.sold-log .row { display: grid; grid-template-columns: 92px 64px 1fr auto 28px; gap: 10px; align-items: center; padding: 8px 0; font-size: 14px; border-bottom: 1px dashed var(--line-soft); }
.sold-log .row:last-of-type { border-bottom: 0; }
.sold-log .d { color: var(--ink-2); }
.sold-log .who { font-weight: 500; }
.sold-log .note { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sold-log .by { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.sold-log .del { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: #A39E95; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sold-log .del:hover { background: var(--err-bg); color: var(--err); }
.sold-empty { margin: 0; padding: 0 22px 18px; font-size: 14px; color: var(--ink-3); }

/* 折叠：长内容先两行，卖点先 3 条 */
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp.clamp-open, .olist.open .clamp { display: block; -webkit-line-clamp: unset; overflow: visible; }
.olist.short:not(.open) li:nth-child(n+4) { display: none; }
.more { border: 0; background: none; padding: 4px 0; font-size: 13px; color: var(--ink-2); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 3px; }
.more:hover { color: var(--ink); text-decoration: underline; }
.more.up svg { transform: rotate(180deg); }
.kv dd .more { margin-left: 4px; }
.sub-h { font-size: 13px; color: var(--ink-3); font-weight: 500; margin: 4px 0 8px; }
.sub-h + .kv { margin-bottom: 16px; }

/* 记一次售卖 / 上传时选主播 */
.pick-anchors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.modal .pick { margin: 0; cursor: pointer; position: relative; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick > span {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px 0 6px;
  border: 1px solid var(--line-strong); border-radius: 12px; font-size: 14px; font-weight: 400; color: var(--ink);
}
.pick input:checked + span { border: 2px solid var(--ink); background: var(--bg); padding-left: 5px; }
.pick input:checked + span::after { content: "✓"; margin-left: auto; font-weight: 700; }
.pick input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal input[type=date] {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-size: 14px;
}
.quick { display: flex; gap: 8px; margin-top: 8px; }
.quick button { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line-strong); background: #fff; font-size: 13px; cursor: pointer; }
.quick button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.callout { font-size: 13px; color: var(--ink-3); background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 14px 0 0; line-height: 1.6; }

@media (max-width: 720px) {
  .anchor-bar { margin: 0 -16px 12px; padding: 0 16px 2px; }
  .sold-head, .sold-sum, .sold-log, .sold-empty { padding-left: 16px; padding-right: 16px; }
  .sold-log .row { grid-template-columns: 74px 1fr 28px; row-gap: 2px; }
  .sold-log .note { grid-column: 2; grid-row: 2; }
  .sold-log .by { display: none; }
  .sold-log .del { grid-column: 3; grid-row: 1 / span 2; }
  .pick-anchors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row2 { grid-template-columns: 1fr; }
  .pcard-sold { font-size: 11.5px; }
}

/* 品牌深挖：结论徽标、红旗信号、上游核查链 */
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.fold > summary .badge { font-weight: 500; }
.flags { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--err-bg); color: #7A1E14; }
.flags b { display: inline-flex; align-items: center; gap: 5px; }
.flags ul { margin: 6px 0 0; padding-left: 20px; }
.chain { margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--line); }
.chain li { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 4px 0 4px 14px; }
.chain li::before { content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 4px; background: var(--ink-3); }
.chain .k { color: var(--ink-3); }
.fold > summary { flex-wrap: wrap; row-gap: 4px; }
.fold > summary .hint { white-space: nowrap; }
