/* ==========================================================================
   拍即得 · 设计系统
   ========================================================================== */

:root {
  --bg: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --surface-3: #f1f3f7;
  --border: #e6e9ef;
  --border-strong: #d5dae4;

  --text: #131824;
  --text-2: #5a6472;
  --text-3: #8c96a6;

  --brand: #f5253f;
  --brand-2: #ff6a3d;
  --brand-soft: #fff0ee;
  --brand-grad: linear-gradient(135deg, #ff6a3d 0%, #f5253f 100%);

  --accent: #6c5ce7;
  --accent-soft: #f1eefe;

  --ok: #0f9d6f;
  --ok-soft: #e8f7f1;
  --warn: #d9861a;
  --warn-soft: #fdf3e3;
  --danger: #dc3b2c;
  --danger-soft: #fdecea;

  --stage: #090b10;

  --r-lg: 16px;
  --r: 12px;
  --r-sm: 9px;

  --sh-1: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.05);
  --sh-2: 0 6px 20px rgba(16, 24, 40, 0.09);
  --sh-3: 0 18px 44px rgba(16, 24, 40, 0.16);

  --ease: cubic-bezier(0.22, 0.68, 0.31, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }

.ic { display: block; flex: none; }
.mono { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row-b { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wrap { width: 100%; max-width: 1260px; margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------------------- 顶栏 */

.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .inner { display: flex; align-items: center; gap: 20px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.logo img { width: 30px; height: 30px; border-radius: 9px; }
.logo small {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  border-left: 1px solid var(--border-strong); padding-left: 9px; letter-spacing: 0;
}
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 550;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.on { background: var(--text); color: #fff; }

/* ------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font-weight: 560; cursor: pointer; white-space: nowrap;
  transition: all 0.16s var(--ease);
}
.btn:hover { border-color: #b9c1ce; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(245, 37, 63, 0.24); }
.btn-primary:hover { filter: brightness(1.05); border-color: transparent; }
.btn-dark { background: var(--text); border-color: var(--text); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { color: var(--danger); border-color: #f3cdc8; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); border-color: #eab4ad; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 34px; padding: 0; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------- 表单 */

.field { display: block; margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; padding: 9px 11px; min-height: 72px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(245, 37, 63, 0.12);
}
.input.err { border-color: var(--danger); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 40px; height: 23px; border-radius: 12px; background: var(--border-strong);
  position: relative; transition: background 0.2s var(--ease); flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s var(--ease);
}
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(17px); }

/* ------------------------------------------------------------- 卡片 / 徽标 */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-pad { padding: 18px; }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-hd h3 { font-size: 14.5px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2);
}
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-brand { background: var(--brand-soft); color: var(--brand); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }

.empty { padding: 52px 20px; text-align: center; color: var(--text-3); }
.empty svg { margin: 0 auto 12px; opacity: 0.4; }

/* ------------------------------------------------------------- 首页 */

.hero { padding: 44px 0 30px; }
.hero .kicker {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px;
  padding: 5px 12px 5px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-size: 12.5px; font-weight: 620;
}
.hero h1 { font-size: 38px; line-height: 1.2; letter-spacing: -0.03em; }
.hero h1 em { font-style: normal; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 12px 0 0; max-width: 640px; color: var(--text-2); font-size: 15px; }
.hero-stats { display: flex; gap: 32px; margin-top: 24px; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 24px; letter-spacing: -0.02em; }
.hero-stats span { font-size: 12.5px; color: var(--text-3); }

.section-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 8px 0 16px; }
.section-hd h2 { font-size: 19px; }

.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; padding-bottom: 56px; }
.vcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-1);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s;
}
.vcard:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--border-strong); }
.vcard .thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; }
.vcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s var(--ease); }
.vcard:hover .thumb img { transform: scale(1.04); }
.vcard .play-fab {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s; background: rgba(6, 8, 12, 0.28);
}
.vcard:hover .play-fab { opacity: 1; }
.vcard .play-fab span {
  width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, 0.95); color: var(--brand);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-2);
}
.badge-dur {
  position: absolute; right: 9px; bottom: 9px;
  padding: 2px 7px; border-radius: 6px; background: rgba(6, 8, 12, 0.74);
  color: #fff; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.badge-goods {
  position: absolute; left: 9px; top: 9px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.94); color: var(--brand);
  font-size: 11.5px; font-weight: 650; box-shadow: var(--sh-1);
}
.badge-draft {
  position: absolute; left: 9px; top: 9px; padding: 3px 9px; border-radius: 999px;
  background: rgba(19, 24, 36, 0.82); color: #fff; font-size: 11.5px; font-weight: 600;
}
.vcard .body { padding: 13px 14px 15px; }
.vcard .body h3 { font-size: 14.5px; line-height: 1.45; min-height: 42px; }
.vcard .body .meta { display: flex; align-items: center; gap: 10px; margin-top: 9px; font-size: 12px; color: var(--text-3); }

/* ------------------------------------------------------------- 播放器 */

.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 22px; padding: 22px 0 60px; align-items: start; }
@media (max-width: 1080px) { .watch-layout { grid-template-columns: 1fr; } }

.stage-wrap { position: relative; }
.stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: var(--stage); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--sh-3); user-select: none;
}
.stage.fs { border-radius: 0; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }

.layer { position: absolute; inset: 0; pointer-events: none; }
.layer-hotspot { z-index: 20; }
.layer-gaze { z-index: 22; }

/* 中央播放/暂停提示 */
.big-play {
  position: absolute; inset: 0; z-index: 25;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.2), rgba(6, 8, 12, 0.42));
  cursor: pointer; transition: opacity 0.25s var(--ease);
}
.big-play span {
  width: 74px; height: 74px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.94); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4); transition: transform 0.2s var(--ease);
}
.big-play:hover span { transform: scale(1.07); }
.big-play.off { opacity: 0; pointer-events: none; }

.center-toast {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 30; padding: 9px 15px; border-radius: 999px;
  background: rgba(8, 10, 14, 0.76); color: #fff; font-size: 13px; font-weight: 560;
  backdrop-filter: blur(8px); opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.center-toast.on { opacity: 1; }

/* 控制条 */
.controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 26px 14px 11px;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0) 0%, rgba(6, 8, 12, 0.58) 45%, rgba(6, 8, 12, 0.86) 100%);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.stage.idle .controls { opacity: 0; transform: translateY(8px); pointer-events: none; }
.stage.idle { cursor: none; }

.pbar { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; }
.pbar .track { position: relative; width: 100%; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.26); transition: height 0.15s var(--ease); }
.pbar:hover .track { height: 7px; }
.pbar .buffered { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: rgba(255, 255, 255, 0.24); }
.pbar .played { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--brand-grad); }
.pbar .knob {
  position: absolute; top: 50%; width: 13px; height: 13px; margin-left: -6.5px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
  transform: translateY(-50%) scale(0); transition: transform 0.15s var(--ease);
}
.pbar:hover .knob { transform: translateY(-50%) scale(1); }

/* 进度条上的商品标记（PRD 3.1.2「进度条上应有视觉标记」） */
.pmark {
  position: absolute; top: 50%; width: 9px; height: 9px; margin-left: -4.5px;
  transform: translateY(-50%); border-radius: 50%;
  background: #ffd166; border: 1.5px solid rgba(10, 12, 16, 0.55);
  cursor: pointer; pointer-events: auto; z-index: 3;
  transition: transform 0.15s var(--ease), box-shadow 0.15s;
}
.pmark:hover { transform: translateY(-50%) scale(1.45); box-shadow: 0 0 0 5px rgba(255, 209, 102, 0.3); }
.pmark.ai { background: #b7a6ff; }
.pmark.glow { animation: pmarkGlow 1.8s ease-in-out infinite; }
@keyframes pmarkGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(183, 166, 255, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(183, 166, 255, 0); }
}
.pmark-tip {
  position: absolute; bottom: 26px; transform: translateX(-50%);
  padding: 7px 10px; border-radius: 8px; background: rgba(8, 10, 14, 0.9); color: #fff;
  font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0;
  transition: opacity 0.15s; z-index: 6; backdrop-filter: blur(6px);
}
.pmark-tip.on { opacity: 1; }
.pmark-tip b { color: #ffd166; font-weight: 600; }

.ctrl-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.cbtn {
  width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent;
  color: rgba(255, 255, 255, 0.92); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s;
}
.cbtn:hover { background: rgba(255, 255, 255, 0.16); }
.ctime { color: rgba(255, 255, 255, 0.9); font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 0 4px; }
.vol { display: flex; align-items: center; gap: 6px; }
.vol input[type='range'] {
  width: 0; opacity: 0; transition: width 0.2s var(--ease), opacity 0.2s;
  accent-color: #fff; cursor: pointer;
}
.vol:hover input[type='range'] { width: 72px; opacity: 1; }
.rate {
  height: 28px; padding: 0 7px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 12px; cursor: pointer;
}
.rate option { color: #111; }

/* 商品热点：锚点 + 卡片 */
.hs { position: absolute; pointer-events: none; }
.hs-pin {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); pointer-events: auto; cursor: pointer;
  animation: pinIn 0.4s var(--ease) both;
}
.hs-pin::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(255, 106, 61, 0.6); animation: pinRipple 2s ease-out infinite;
}
@keyframes pinIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.4); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes pinRipple { 0% { transform: scale(0.8); opacity: 0.85; } 100% { transform: scale(1.9); opacity: 0; } }

.hs-card {
  position: absolute; top: 50%; width: 244px;
  transform: translateY(-50%);
  background: rgba(14, 17, 23, 0.74); backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 13px;
  padding: 10px; color: #fff; pointer-events: auto; cursor: pointer;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  animation: cardIn 0.42s var(--ease) both;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.hs.side-left .hs-card { right: 26px; }
.hs.side-right .hs-card { left: 26px; }
.hs-card:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(14, 17, 23, 0.86); }
.hs.side-left .hs-card:hover { transform: translateY(-50%) translateX(-3px); }
.hs.side-right .hs-card:hover { transform: translateY(-50%) translateX(3px); }
@keyframes cardIn { from { opacity: 0; transform: translateY(-50%) scale(0.94); } to { opacity: 1; transform: translateY(-50%) scale(1); } }
.hs.leaving .hs-card, .hs.leaving .hs-pin { animation: fadeOut 0.3s var(--ease) both; }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-50%) scale(0.95); } }

.hs-card .top { display: flex; gap: 10px; }
.hs-card img { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; flex: none; background: #222; }
.hs-card .t { font-size: 13px; font-weight: 620; line-height: 1.4; margin-bottom: 3px; }
.hs-card .p { color: #ff9d7a; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.hs-card .more {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.28s var(--ease), opacity 0.2s, margin-top 0.28s var(--ease);
  font-size: 12px; color: rgba(255, 255, 255, 0.74); line-height: 1.55;
}
.hs-card:hover .more { max-height: 96px; opacity: 1; margin-top: 8px; }
.hs-card .cta {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 9px; height: 32px; border-radius: 8px;
  background: var(--brand-grad); font-size: 12.5px; font-weight: 650;
}
.hs-close {
  position: absolute; right: -7px; top: -7px; width: 21px; height: 21px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24); background: rgba(14, 17, 23, 0.94); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}

/* V3.0 注意力气泡 */
.gaze-box {
  position: absolute; border: 1.5px dashed rgba(140, 122, 255, 0.5); border-radius: 10px;
  background: rgba(140, 122, 255, 0.08); transform: translate(-50%, -50%);
}
.gaze-bubble {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px 7px 9px; border-radius: 999px;
  background: rgba(108, 92, 231, 0.94); color: #fff; font-size: 12.5px; font-weight: 620;
  box-shadow: 0 8px 24px rgba(46, 30, 120, 0.45); pointer-events: auto; cursor: pointer;
  animation: bubbleIn 0.32s var(--ease) both; white-space: nowrap;
}
@keyframes bubbleIn { from { opacity: 0; transform: translate(-50%, -85%) scale(0.85); } to { opacity: 1; transform: translate(-50%, -100%) scale(1); } }
.gaze-dwell {
  position: absolute; width: 46px; height: 46px; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none;
}
.gaze-dwell svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.gaze-dwell circle { fill: none; stroke-width: 3; }

.consent {
  position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 8, 12, 0.72); backdrop-filter: blur(6px); padding: 20px;
}
.consent .box {
  max-width: 420px; background: var(--surface); border-radius: var(--r-lg); padding: 22px;
  box-shadow: var(--sh-3);
}
.consent h4 { font-size: 15.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.consent p { color: var(--text-2); font-size: 13px; margin: 0 0 8px; }
.consent ul { margin: 0 0 16px; padding-left: 18px; color: var(--text-2); font-size: 12.5px; }
.consent ul li { margin-bottom: 4px; }

/* 观看页信息区 */
.vinfo { margin-top: 16px; }
.vinfo h1 { font-size: 21px; line-height: 1.4; }
.vinfo .meta { display: flex; align-items: center; gap: 14px; margin-top: 9px; color: var(--text-3); font-size: 12.5px; flex-wrap: wrap; }
.vinfo .desc { margin-top: 12px; color: var(--text-2); font-size: 13.5px; }

.side-card + .side-card { margin-top: 16px; }
.glist { max-height: 470px; overflow: auto; }
.gitem {
  display: flex; gap: 11px; padding: 11px 16px; cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.gitem:last-child { border-bottom: 0; }
.gitem:hover { background: var(--surface-2); }
.gitem.active { background: var(--brand-soft); }
.gitem img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-3); }
.gitem .t { font-size: 13px; font-weight: 600; line-height: 1.4; }
.gitem .m { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.gitem .price { color: var(--brand); font-weight: 700; font-size: 13.5px; }
.time-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 5px;
  background: var(--surface-3); color: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums;
}

.feature-box { padding: 15px 16px; }
.feature-box .ttl { display: flex; align-items: center; gap: 8px; font-weight: 640; font-size: 13.5px; }
.feature-box p { margin: 8px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.6; }

/* ------------------------------------------------------------- 管理后台 */

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(1000px 500px at 50% -10%, #ffe9e2 0%, var(--bg) 55%); }
.login-card { width: 100%; max-width: 372px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 28px; box-shadow: var(--sh-2); }
.login-card .lg { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login-card .lg img { width: 38px; height: 38px; border-radius: 11px; }
.login-card h2 { font-size: 17px; }
.login-card .tip { margin-top: 14px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-3);
  font-size: 12px; color: var(--text-2); }

.admin-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: calc(100vh - 62px); }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } }
.aside { border-right: 1px solid var(--border); background: var(--surface); padding: 18px 12px; }
.aside .grp { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: 0.06em; padding: 10px 10px 6px; }
.aside a {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 560; cursor: pointer; transition: all 0.15s var(--ease);
}
.aside a:hover { background: var(--surface-3); color: var(--text); }
.aside a.on { background: var(--brand-soft); color: var(--brand); }
.amain { padding: 22px 26px 60px; min-width: 0; }
.page-hd { margin-bottom: 18px; }
.page-hd h1 { font-size: 21px; }
.page-hd p { margin: 5px 0 0; color: var(--text-2); font-size: 13px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search-box { position: relative; }
.search-box .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search-box .input { padding-left: 32px; width: 244px; }

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 650; color: var(--text-3);
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  letter-spacing: 0.03em; white-space: nowrap;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--surface-2); }
.tbl-thumb { width: 84px; height: 48px; border-radius: 7px; object-fit: cover; background: var(--surface-3); flex: none; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 15px 16px; box-shadow: var(--sh-1); }
.kpi .lbl { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); font-weight: 560; }
.kpi .val { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.heat { display: flex; align-items: flex-end; gap: 2px; height: 108px; padding: 0 2px; }
.heat i { flex: 1; background: linear-gradient(180deg, var(--accent), #a99bf5); border-radius: 3px 3px 0 0; min-height: 2px; opacity: 0.9; }
.heat-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 7px; }

/* 时间戳配置：时间轴编辑器 */
.cfg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 18px; align-items: start; }
@media (max-width: 1180px) { .cfg-layout { grid-template-columns: 1fr; } }

.editor-stage { position: relative; background: var(--stage); border-radius: var(--r); overflow: hidden; aspect-ratio: 16/9; }
.editor-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.editor-stage.picking { cursor: crosshair; }
.pick-hint {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 12;
  padding: 6px 12px; border-radius: 999px; background: rgba(108, 92, 231, 0.94); color: #fff;
  font-size: 12px; font-weight: 600; pointer-events: none;
}
.anchor {
  position: absolute; transform: translate(-50%, -50%); pointer-events: none;
  border: 2px solid #ffd166; border-radius: 8px; background: rgba(255, 209, 102, 0.12);
}
.anchor::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; background: #ffd166; box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.28);
}
.anchor.ghost { border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.06); }
.anchor.ghost::after { background: rgba(255, 255, 255, 0.65); box-shadow: none; }
.anchor .lb {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 6px;
  padding: 2px 7px; border-radius: 5px; background: rgba(8, 10, 14, 0.85); color: #fff;
  font-size: 11px; white-space: nowrap;
}

.tl-wrap { margin-top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px 14px; }
.tl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tl {
  position: relative; height: 62px; background: var(--surface-3); border-radius: 8px;
  overflow: hidden; cursor: pointer;
}
.tl-ticks { position: absolute; inset: 0; }
.tl-ticks i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(0, 0, 0, 0.06); }
.tl-ticks span { position: absolute; bottom: 3px; font-size: 10px; color: var(--text-3); transform: translateX(-50%); }
.tl-bar {
  position: absolute; top: 8px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, #ffb26b, #ff6a3d); color: #fff;
  font-size: 11px; font-weight: 600; display: flex; align-items: center; padding: 0 6px;
  overflow: hidden; white-space: nowrap; cursor: grab; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.tl-bar.row1 { top: 33px; }
.tl-bar.ai { background: linear-gradient(135deg, #a99bf5, #6c5ce7); }
.tl-bar.sel { outline: 2px solid var(--text); outline-offset: 1px; z-index: 4; }
.tl-bar .h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.tl-bar .h.l { left: 0; } .tl-bar .h.r { right: 0; }
.tl-cursor { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brand); z-index: 6; pointer-events: none; }
.tl-cursor::before {
  content: ''; position: absolute; top: -1px; left: -4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand);
}

.ts-list { max-height: 320px; overflow: auto; }
.ts-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: center; }
.ts-item:hover { background: var(--surface-2); }
.ts-item.sel { background: var(--brand-soft); }
.ts-item img { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; flex: none; background: var(--surface-3); }
.ts-item .t { font-size: 13px; font-weight: 600; }
.ts-item .m { font-size: 11.5px; color: var(--text-3); margin-top: 2px; display: flex; gap: 8px; align-items: center; }

.ai-panel { border: 1px dashed var(--accent); background: var(--accent-soft); border-radius: var(--r); padding: 13px 14px; }
.ai-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed rgba(108, 92, 231, 0.28); }
.ai-item:last-child { border-bottom: 0; }
.ai-item img { width: 34px; height: 34px; border-radius: 7px; flex: none; }
.conf-bar { width: 54px; height: 5px; border-radius: 3px; background: rgba(108, 92, 231, 0.2); overflow: hidden; }
.conf-bar i { display: block; height: 100%; background: var(--accent); }

/* 弹窗 / 提示 */
.modal-mask {
  position: fixed; inset: 0; z-index: 200; background: rgba(12, 15, 22, 0.5);
  backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: maskIn 0.18s var(--ease);
}
@keyframes maskIn { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; overflow: auto;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  animation: modalIn 0.24s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-hd h3 { font-size: 15.5px; }
.modal-bd { padding: 20px; }
.modal-ft { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 9px; }
.toast {
  display: flex; align-items: center; gap: 9px; min-width: 220px; max-width: 380px;
  padding: 11px 14px; border-radius: var(--r); background: var(--text); color: #fff;
  font-size: 13px; box-shadow: var(--sh-3); animation: toastIn 0.26s var(--ease);
}
.toast.ok { background: #0f7f5c; }
.toast.err { background: #c22e21; }
.toast.warn { background: #b06f11; }
@keyframes toastIn { from { opacity: 0; transform: translateX(22px); } }
.toast.out { animation: toastOut 0.24s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(22px); } }

.progress-line { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress-line i { display: block; height: 100%; background: var(--brand-grad); width: 0; transition: width 0.2s; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cdd3dd; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #b6bec9; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================ 观看页补充（watch.html） */
.gbtn {
  width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center;
  justify-content: center; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
}
.gbtn:hover { background: var(--brand-soft); color: var(--brand); border-color: #ffd2cc; }
.gaze-log { max-height: 130px; overflow: auto; line-height: 1.7; font-size: 11.5px; }
.gaze-log b { color: var(--text); }
.err-stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-height: 300px; color: var(--text-3); background: var(--stage); border-radius: var(--r-lg); padding: 30px;
}
.err-stage svg { color: #5a6472; }
.pill-err { background: var(--danger-soft); color: var(--danger); }

/* ============================================================ 登录页（后台） */
.login-view {
  min-height: calc(100vh - 62px); display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(900px 480px at 50% -8%, #ffe9e2 0%, var(--bg) 55%);
}
.login-view .login-card { width: 100%; max-width: 360px; }
.login-logo { width: 46px; height: 46px; border-radius: 12px; display: block; margin: 0 auto 8px; }
.login-view h2 { text-align: center; font-size: 18px; }
.login-view .dim { text-align: center; }
.login-view label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 14px 0 6px; }
.login-view input { width: 100%; }
.login-view .btn { width: 100%; margin-top: 18px; height: 42px; }
.login-view .back { display: block; text-align: center; margin-top: 14px; color: var(--text-3); font-size: 12.5px; }
.login-view .back:hover { color: var(--text-2); }

/* ============================================================ 后台布局（admin.html） */
.admin { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; padding-top: 18px; padding-bottom: 46px; }
@media (max-width: 880px) { .admin { grid-template-columns: 1fr; } }
.admin-side {
  position: sticky; top: 82px; align-self: start; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 10px; box-shadow: var(--sh-1);
}
.side-tab {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 560; background: none; border: none; cursor: pointer; text-align: left; font-size: 13.5px;
}
.side-tab:hover { background: var(--surface-3); color: var(--text); }
.side-tab.active { background: var(--brand-soft); color: var(--brand); }
.admin-main { min-width: 0; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 18px; }
.panel-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-hd h2 { font-size: 17px; }
.panel-hd .btn { margin-left: 0; }

.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--r); }
.tcover { width: 84px; height: 48px; border-radius: 7px; object-fit: cover; background: var(--surface-3); }
.t-title { font-weight: 600; }
.ops { display: flex; gap: 5px; }
.op {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.op:hover { background: var(--surface-3); color: var(--text); }
.op.danger { color: var(--danger); }
.op.danger:hover { background: var(--danger-soft); border-color: #eab4ad; }
.op svg { width: 15px; height: 15px; }

.input-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.mini-tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; line-height: 1; padding: 2px 6px;
  border-radius: 5px; background: var(--accent-soft); color: var(--accent); vertical-align: middle;
}
.mini-tag.warn { background: var(--warn-soft); color: var(--warn); }

/* 数据看板 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 4px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 15px 16px; box-shadow: var(--sh-1); }
.stat-card .ico {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.stat-card .v { font-size: 24px; font-weight: 720; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-card .k { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.heat i.hb { flex: 0 0 auto; }
.heat i[data-h="0"] { opacity: 0.18; }

/* 商品点编辑器（弹窗内） */
.ts-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ts-list { display: flex; flex-direction: column; gap: 8px; }
.ts-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.ts-row:hover { border-color: var(--border-strong); }
.ts-main { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.ts-cover { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-3); }
.ts-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ts-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.ts-ops { display: flex; gap: 5px; }
.ts-ops .op { width: 28px; height: 28px; }

.sug-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; max-height: 300px; overflow: auto; }
.sug { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.sug.conflict { border-color: #f0c9a3; background: var(--warn-soft); }
.sug .ts-title { font-size: 13px; }
