/* ============================================================
   海右内审投票 — 设计系统
   基调：纸白 + 墨黑 + 朱砂，编辑感排版，克制的动效
   ============================================================ */

:root {
  /* 色彩 */
  --paper: #f0eee8;
  --paper-deep: #e8e5dd;
  --card: #ffffff;
  --ink: #16150f;
  --ink-soft: #4b463c;
  --muted: #8b8478;
  --line: rgba(22, 21, 15, 0.09);
  --line-strong: rgba(22, 21, 15, 0.16);
  --accent: #c4432a;
  --accent-deep: #9b3119;
  --accent-soft: #fbeee8;
  --accent-tint: rgba(196, 67, 42, 0.08);
  --wecom: #2f7de1;
  --ok: #3f6b4f;

  /* 形状 */
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 11px;

  /* 阴影 */
  --sh-1: 0 1px 2px rgba(22, 21, 15, 0.05);
  --sh-2: 0 1px 2px rgba(22, 21, 15, 0.04), 0 14px 34px -18px rgba(22, 21, 15, 0.22);
  --sh-3: 0 2px 4px rgba(22, 21, 15, 0.05), 0 26px 60px -26px rgba(22, 21, 15, 0.3);

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.9, 0.24, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 60%),
    radial-gradient(90% 50% at 100% 0%, rgba(196, 67, 42, 0.05) 0%, rgba(196, 67, 42, 0) 55%);
  background-repeat: no-repeat;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 22px 20px calc(56px + env(safe-area-inset-bottom));
}

/* ---------- 排版 ---------- */

h1, h2, h3, p, dl, dd, dt { margin: 0; }

.kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.kicker::before {
  content: "";
  width: 14px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.page-title {
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin-top: 10px;
  text-wrap: balance;
}

.page-sub {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin-top: 9px;
  line-height: 1.62;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 28px 0 12px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.section-title:first-child { margin-top: 0; }

.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.94em;
  letter-spacing: -0.01em;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.center { text-align: center; }

.mt-6 { margin-top: 6px; }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

hr.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 680;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  color: var(--ink);
  flex: none;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 48%;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  font: inherit;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
  backdrop-filter: blur(8px);
}

.user-chip:active { background: #fff; }
.user-chip b { font-weight: 620; color: var(--ink); }

.user-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}

.user-chip.is-out::before { background: var(--muted); }

/* ---------- 卡片 ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-2);
}

.card + .card { margin-top: 14px; }

.card-flat {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.55);
}

.card-ink {
  background: linear-gradient(155deg, #23211a 0%, #131210 100%);
  border-color: rgba(255, 255, 255, 0.06);
  color: #f7f5ef;
  box-shadow: var(--sh-3);
}

/* ---------- 首页入口 ---------- */

.entry {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
}

.entry-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 24px 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--sh-2);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.entry-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 67, 42, 0.07) 0%, rgba(196, 67, 42, 0) 70%);
  pointer-events: none;
}

.entry-card:active {
  transform: scale(0.984);
  box-shadow: var(--sh-1);
}

.entry-card.primary {
  background:
    radial-gradient(120% 130% at 92% -20%, rgba(196, 67, 42, 0.45) 0%, rgba(196, 67, 42, 0) 55%),
    linear-gradient(150deg, #1e1410 0%, #120b08 100%);
  border-color: rgba(255, 255, 255, 0.07);
  color: #fbf9f4;
  box-shadow: 0 2px 4px rgba(22, 21, 15, 0.12), 0 26px 54px -24px rgba(38, 13, 7, 0.6);
}

.entry-card.primary::after {
  background: radial-gradient(circle, rgba(232, 110, 74, 0.26) 0%, rgba(232, 110, 74, 0) 68%);
}

.entry-index {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  opacity: 0.45;
}

.entry-title {
  font-size: 20px;
  font-weight: 670;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.entry-desc {
  margin-top: 7px;
  font-size: 12.5px;
  opacity: 0.62;
  line-height: 1.55;
  max-width: 88%;
}

.entry-arrow {
  position: absolute;
  right: 22px;
  bottom: 24px;
  font-size: 15px;
  opacity: 0.45;
  transition: transform 0.24s var(--ease);
}

.entry-card:active .entry-arrow { transform: translateX(3px); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 620;
  font-size: 15px;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s var(--ease), background 0.18s var(--ease),
    box-shadow 0.18s var(--ease), opacity 0.18s var(--ease), border-color 0.18s var(--ease);
}

.btn:active { transform: scale(0.975); }

.btn-block { display: flex; width: 100%; }

.btn-primary {
  background: linear-gradient(175deg, #cf4c31 0%, #b93a22 100%);
  border-color: #a83519;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 22px -12px rgba(185, 58, 34, 0.85);
}

.btn-primary:active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 10px -8px rgba(185, 58, 34, 0.8);
}

.btn-ink {
  background: linear-gradient(175deg, #241712 0%, #120b08 52%, #260d07 100%);
  border-color: #0c0705;
  color: #fbf9f4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 24px -14px rgba(38, 13, 7, 0.9);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: saturate(0.6);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
  padding: 0 12px;
  font-weight: 560;
  min-height: 40px;
}

.btn-sm {
  min-height: 38px;
  padding: 0 13px;
  font-size: 13px;
  border-radius: 11px;
  font-weight: 600;
}

.btn-danger {
  color: var(--accent-deep);
  border-color: rgba(196, 67, 42, 0.24);
  background: var(--accent-tint);
}

.btn-row {
  display: flex;
  gap: 9px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-row > .btn { flex: 1 1 0; min-width: 0; }

/* ---------- 分段控件（投票类型） ---------- */

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-md);
  background: rgba(22, 21, 15, 0.055);
  border: 1px solid var(--line);
}

.seg-item {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 12px;
  min-height: 42px;
  padding: 6px 4px;
  font: inherit;
  font-size: 13px;
  font-weight: 620;
  letter-spacing: -0.01em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.24s var(--ease),
    box-shadow 0.24s var(--ease), transform 0.2s var(--ease);
}

.seg-item:active { transform: scale(0.97); }

.seg-item.selected {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(22, 21, 15, 0.08), 0 4px 12px -6px rgba(22, 21, 15, 0.22);
}

/* ---------- 胶囊选择（类别） ---------- */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  appearance: none;
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  align-items: flex-start;
  padding: 10px 15px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.22s var(--ease);
}

.chip strong {
  font-size: 13.5px;
  font-weight: 640;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.chip span {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

.chip:active { transform: scale(0.97); }

.chip.selected {
  background: linear-gradient(160deg, #2c1a12 0%, #170c08 55%, #33120a 100%);
  border-color: #1c0d07;
  color: #fbf9f4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 18px -10px rgba(48, 14, 6, 0.75);
}

.chip.selected span { color: rgba(251, 249, 244, 0.6); }

/* ---------- 选择列表 ---------- */

.choice-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 16px 17px;
  min-height: 62px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    transform 0.16s var(--ease), box-shadow 0.22s var(--ease);
  box-shadow: var(--sh-1);
}

.choice:active { transform: scale(0.99); }

.choice.selected {
  border-color: rgba(196, 67, 42, 0.42);
  background: linear-gradient(180deg, #fffaf7 0%, #fdf3ee 100%);
  box-shadow: 0 1px 2px rgba(196, 67, 42, 0.06), 0 12px 26px -18px rgba(196, 67, 42, 0.5);
}

.choice-main { flex: 1; min-width: 0; }

.choice-label {
  font-weight: 640;
  font-size: 15.5px;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.35;
}

.choice-note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.45;
}

.choice.selected .choice-note { color: rgba(155, 49, 25, 0.72); }

.choice-badge {
  flex: none;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  font-weight: 660;
  color: var(--ink-soft);
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(22, 21, 15, 0.05);
  letter-spacing: -0.01em;
}

.choice.selected .choice-badge {
  color: var(--accent-deep);
  background: rgba(196, 67, 42, 0.12);
}

.choice-radio {
  flex: none;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1.5px solid rgba(22, 21, 15, 0.22);
  display: grid;
  place-items: center;
  transition: border-color 0.2s var(--ease);
}

.choice.selected .choice-radio { border-color: var(--accent); }

.choice.selected .choice-radio::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  animation: pop 0.28s var(--ease-spring);
}

@keyframes pop {
  from { transform: scale(0.2); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.tag {
  display: inline-block;
  padding: 1.5px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0;
  background: rgba(22, 21, 15, 0.07);
  color: var(--muted);
  vertical-align: middle;
  white-space: nowrap;
}

.grade-letter {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.04em;
  width: 24px;
  display: inline-block;
  text-align: center;
  color: var(--accent);
  line-height: 1.1;
}

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

.field { margin-top: 16px; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 15px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font: inherit;
  color: inherit;
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  appearance: none;
}

.input:focus {
  border-color: rgba(196, 67, 42, 0.55);
  box-shadow: 0 0 0 4px rgba(196, 67, 42, 0.09);
}

.input::placeholder { color: #b8b1a4; }

textarea.input { resize: none; }

select.input {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238b8478' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 38px;
}

/* ---------- 编辑器行（身份 / 选项） ---------- */

.role-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.role-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.role-row .input {
  min-height: 42px;
  padding: 9px 11px;
  font-size: 13.5px;
  border-radius: 10px;
}

.role-name { flex: 1; min-width: 0; }

.opt-label {
  flex: none;
  width: 92px;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

.opt-label + .input { flex: 1; min-width: 0; }

.role-weight {
  width: 62px;
  flex: none;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 620;
}

.role-del {
  flex: none;
  width: 34px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.role-del:active { background: var(--accent-tint); color: var(--accent); }

.editor-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 9px;
}

.hint strong { color: var(--ink-soft); font-weight: 620; }

/* ---------- 折叠块 ---------- */

.fold {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.6);
  overflow: hidden;
}

.fold > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 620;
  color: var(--ink-soft);
  transition: background 0.2s var(--ease);
}

.fold > summary::-webkit-details-marker { display: none; }

.fold > summary:hover { background: rgba(255, 255, 255, 0.6); }

.fold > summary .fold-meta {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

.fold > summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.24s var(--ease);
}

.fold[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }

.fold-body { padding: 0 16px 16px; }

/* ---------- 链接与话术 ---------- */

.link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 13px;
  background: rgba(22, 21, 15, 0.035);
  border: 1px dashed var(--line-strong);
  font-size: 12px;
  color: var(--ink-soft);
  word-break: break-all;
  line-height: 1.55;
}

.copy-note {
  margin-top: 12px;
  padding: 15px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf7 0%, #fdf4ef 100%);
  border: 1px solid rgba(196, 67, 42, 0.14);
  color: #7d3120;
  font-size: 12.5px;
  line-height: 1.68;
  white-space: pre-wrap;
}

/* ---------- 结果条形图 ---------- */

.bar-list { display: flex; flex-direction: column; gap: 18px; margin-top: 6px; }

.bar-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.bar-label {
  font-weight: 620;
  font-size: 14px;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bar-label .grade-letter { font-size: 17px; width: 20px; }

.bar-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.bar-value .unit {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.bar-value span.sub {
  font-size: 11.5px;
  font-weight: 520;
  color: var(--muted);
  margin-left: 6px;
  letter-spacing: 0;
}

.bar-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(22, 21, 15, 0.06);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d9532f 0%, #b93a22 100%);
  width: 0;
  transition: width 0.85s var(--ease);
}

.bar-fill.lv-0 { background: linear-gradient(90deg, #d9532f 0%, #b93a22 100%); }
.bar-fill.lv-1 { background: linear-gradient(90deg, #d4643f 0%, #c2512d 100%); }
.bar-fill.lv-2 { background: linear-gradient(90deg, #c9764f 0%, #b36244 100%); }
.bar-fill.lv-3 { background: linear-gradient(90deg, #b58a6f 0%, #9d7660 100%); }
.bar-fill.lv-4 { background: linear-gradient(90deg, #a9a094 0%, #8f877b 100%); }
.bar-fill.lv-5 { background: linear-gradient(90deg, #bdb5a8 0%, #a49c90 100%); }

/* ---------- 状态条 ---------- */

.status-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 620;
  letter-spacing: -0.005em;
  background: rgba(22, 21, 15, 0.055);
  color: var(--ink-soft);
  text-decoration: none;
}

.pill.live { background: rgba(63, 107, 79, 0.1); color: #33573f; }

.pill.live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3f6b4f;
  animation: breathe 2.4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.82); }
}

.pill.dead { background: rgba(22, 21, 15, 0.06); color: var(--muted); }

.pill.link { background: #fff; border: 1px solid var(--line-strong); color: var(--ink-soft); }

/* ---------- 明细表 ---------- */

.table-wrap {
  margin: 0 -20px;
  padding: 0 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.detail {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 100%;
}

table.detail th {
  text-align: left;
  font-weight: 650;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.detail td {
  padding: 11px 6px;
  border-bottom: 1px solid rgba(22, 21, 15, 0.05);
  vertical-align: middle;
}

table.detail tbody tr:last-child td { border-bottom: 0; }

table.detail tr.excluded td { color: #b6afa2; text-decoration: line-through; }
table.detail tr.excluded .btn { text-decoration: none; }

table.detail td.num { font-variant-numeric: tabular-nums; font-weight: 620; }

/* ---------- 空态 ---------- */

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.empty .big {
  font-size: 26px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.35;
}

/* ---------- 弹层 ---------- */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(18, 17, 13, 0.42);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
  padding: 0;
  animation: fade 0.2s var(--ease);
}

@media (min-width: 560px) {
  .modal-mask { align-items: center; padding: 20px; }
}

.modal {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 26px 26px 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  animation: sheetUp 0.34s var(--ease);
  box-shadow: 0 -20px 60px -20px rgba(22, 21, 15, 0.35);
}

@media (min-width: 560px) {
  .modal { border-radius: 24px; }
}

.modal::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(22, 21, 15, 0.14);
  margin: 0 auto 16px;
}

.modal h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.modal-body { margin-top: 14px; }

.summary {
  display: flex;
  flex-direction: column;
  border-radius: 15px;
  background: rgba(22, 21, 15, 0.032);
  padding: 4px 15px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  font-size: 13.5px;
  border-bottom: 1px solid rgba(22, 21, 15, 0.06);
}

.summary-row:last-child { border-bottom: 0; }

.summary-row dt { color: var(--muted); flex: none; }
.summary-row dd { margin: 0; font-weight: 620; text-align: right; letter-spacing: -0.01em; }

.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* ---------- Toast ---------- */

.toast-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(30px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 80;
  pointer-events: none;
}

.toast {
  max-width: 84vw;
  padding: 11px 18px;
  border-radius: 13px;
  background: rgba(22, 21, 15, 0.92);
  backdrop-filter: blur(10px);
  color: #fbf9f4;
  font-size: 13px;
  font-weight: 520;
  line-height: 1.5;
  box-shadow: 0 10px 30px -12px rgba(22, 21, 15, 0.6);
  animation: toastIn 0.3s var(--ease-spring);
}

/* ---------- 登录页 ---------- */

/* 登录态：黑红渐变通铺整个页面背景（红色占比加大） */
body:has(.login) {
  background:
    radial-gradient(125% 95% at 85% -12%, rgba(212, 78, 42, 0.66) 0%, rgba(196, 67, 42, 0) 60%),
    radial-gradient(105% 88% at -10% 112%, rgba(196, 67, 42, 0.52) 0%, rgba(196, 67, 42, 0) 62%),
    radial-gradient(65% 55% at 112% 52%, rgba(196, 67, 42, 0.3) 0%, rgba(196, 67, 42, 0) 70%),
    linear-gradient(165deg, #24110b 0%, #0e0908 46%, #1f0c06 100%);
  background-color: #0e0908;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.login {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0 72px;
  color: #f6f2ea;
}

.login-logo {
  margin-bottom: 28px;
  color: #f6f2ea;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.4));
}

.login .kicker { color: rgba(246, 242, 234, 0.52); }

.login-title {
  font-size: 34px;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.14;
  text-wrap: balance;
}

.login-title .dim { color: rgba(246, 242, 234, 0.48); }

.login-sub {
  margin-top: 14px;
  color: rgba(246, 242, 234, 0.7);
  font-size: 14px;
  line-height: 1.65;
  max-width: 30em;
}

.login-panel {
  margin-top: 38px;
  padding: 22px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login-panel .field-label { color: rgba(246, 242, 234, 0.6); }

.login-panel .input {
  background: rgba(0, 0, 0, 0.32);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f6f2ea;
}

.login-panel .input::placeholder { color: rgba(246, 242, 234, 0.35); }

.login-panel .input:focus {
  border-color: rgba(214, 84, 48, 0.7);
  box-shadow: 0 0 0 4px rgba(196, 67, 42, 0.2);
}

.login-panel .btn-ink {
  background: linear-gradient(175deg, #d8552f 0%, #b23a20 100%);
  border-color: #8f2e18;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 28px -14px rgba(196, 67, 42, 0.85);
}

.login-panel .sim-hint {
  background: rgba(196, 67, 42, 0.18);
  color: #eba289;
}

.wecom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  border-radius: 15px;
  border: 0;
  background: linear-gradient(175deg, #3a88e8 0%, #2a6fd0 100%);
  color: #fff;
  font: inherit;
  font-size: 15.5px;
  font-weight: 640;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 12px 26px -14px rgba(42, 111, 208, 0.9);
  transition: transform 0.16s var(--ease), box-shadow 0.2s var(--ease);
}

.wecom-btn:active {
  transform: scale(0.978);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 6px 14px -10px rgba(42, 111, 208, 0.9);
}

.wecom-btn svg { flex: none; }

.login-note {
  margin-top: 14px;
  font-size: 11.5px;
  color: rgba(246, 242, 234, 0.5);
  line-height: 1.65;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.login-note .dot {
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(246, 242, 234, 0.5);
  margin-top: 7px;
  opacity: 0.6;
}

.login-foot {
  margin-top: 30px;
  font-size: 11px;
  color: rgba(246, 242, 234, 0.4);
  letter-spacing: 0.02em;
}

/* 手机端：页边距加大、内容整体缩小 */
@media (max-width: 520px) {
  .login {
    padding: 44px 30px 64px;
  }

  .login-logo { margin-bottom: 22px; }

  .login-logo svg {
    height: 33px;
    width: auto;
  }

  .login .kicker { font-size: 10px; }

  .login-title { font-size: 25px; }

  .login-sub {
    margin-top: 11px;
    font-size: 13px;
  }

  .login-panel {
    margin-top: 30px;
    padding: 18px;
  }

  .wecom-btn { min-height: 50px; font-size: 14.5px; }

  .login-foot { margin-top: 24px; font-size: 10.5px; }
}

.sim-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0.02em;
  background: rgba(47, 125, 225, 0.1);
  color: #255fa8;
}

/* ---------- 底部固定操作栏 ---------- */

.sticky-bar {
  position: sticky;
  bottom: 0;
  margin: 24px -20px 0;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(240, 238, 232, 0) 0%, var(--paper) 32%);
  backdrop-filter: blur(2px);
}

/* ---------- 统计块 ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
}

.stat {
  background: #fff;
  padding: 14px 12px;
}

.stat dt {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 620;
}

.stat dd {
  margin: 5px 0 0;
  font-size: 24px;
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat dd small {
  font-size: 11px;
  font-weight: 560;
  color: var(--muted);
  margin-left: 2px;
  letter-spacing: 0;
}

/* ---------- 动画 ---------- */

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes sheetUp {
  from { transform: translateY(38px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes toastIn {
  from { transform: translateY(10px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes riseIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fade-in { animation: riseIn 0.38s var(--ease) both; }

/* 子元素依次入场 */
.stagger > * {
  animation: riseIn 0.44s var(--ease) both;
}

.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.07s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.17s; }
.stagger > *:nth-child(5) { animation-delay: 0.22s; }
.stagger > *:nth-child(6) { animation-delay: 0.27s; }
.stagger > *:nth-child(7) { animation-delay: 0.32s; }
.stagger > *:nth-child(8) { animation-delay: 0.37s; }
.stagger > *:nth-child(n + 9) { animation-delay: 0.42s; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
