:root {
  --red: #ff2442;
  --red-dark: #e01b36;
  --red-soft: #fff1f3;
  --ink: #1f1f27;
  --ink-2: #4b4b58;
  --muted: #8b8b99;
  --line: #ececf1;
  --bg: #f7f7fa;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(24, 24, 35, .04), 0 2px 8px rgba(24, 24, 35, .04);
  --shadow-md: 0 4px 14px rgba(24, 24, 35, .07), 0 12px 32px rgba(24, 24, 35, .06);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* ---------- 顶部 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 247, 250, .86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(236, 236, 241, .9);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, #ff4d63, #e01b36);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(224, 27, 54, .28);
  flex: none;
}

.brand-name {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: .2px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.topbar-spacer { flex: 1; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.pill.live { color: #0f9d58; }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(15, 157, 88, .14);
}

.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .16s ease;
}
.icon-btn:hover { color: var(--red); border-color: #ffd0d7; background: var(--red-soft); }

/* 榜单类型切换 */
.segmented {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 3px;
  margin-right: 4px;
}

.seg-btn {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .16s ease;
}
.seg-btn:hover { color: var(--red); }
.seg-btn.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 36, 66, .24);
}

/* ---------- 首屏 ---------- */
.hero {
  padding: 40px 0 26px;
}

.hero h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -.4px;
  font-weight: 700;
}

.hero h1 em {
  font-style: normal;
  color: var(--red);
}

.hero p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  max-width: 720px;
}

/* ---------- 控制面板 ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}

.panel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.panel-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .3px;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}

.cat:hover { border-color: #ffc2cb; color: var(--red); }

.cat.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 36, 66, .26);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); }

input[type="date"] {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 11px;
  background: #fff;
  outline: none;
  min-width: 168px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="date"]:focus {
  border-color: #ffb3bf;
  box-shadow: 0 0 0 3px rgba(255, 36, 66, .1);
}

.text-input {
  flex: 1;
  min-width: 220px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.text-input::placeholder { color: #b3b3bf; }
.text-input:focus {
  border-color: #ffb3bf;
  box-shadow: 0 0 0 3px rgba(255, 36, 66, .1);
}

.select-input {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  outline: none;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.select-input:focus {
  border-color: #ffb3bf;
  box-shadow: 0 0 0 3px rgba(255, 36, 66, .1);
}

.btn {
  font-family: inherit;
  border: 0;
  border-radius: 11px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 36, 66, .26);
}
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .6; cursor: progress; transform: none; }

.btn-ghost {
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--red); border-color: #ffd0d7; }

.hint {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- 提示条 ---------- */
.notice {
  display: none;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  background: #fff8e8;
  border: 1px solid #ffe3ac;
  color: #8a5b00;
}
.notice.show { display: flex; }
.notice.error { background: #fff1f3; border-color: #ffd0d7; color: #b3162c; }
.notice.error .notice-action { color: #b3162c; }

.notice-action {
  border: 0;
  background: transparent;
  color: #8a5b00;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}

/* ---------- 概览 ---------- */
.summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 22px 0 16px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.stat .k { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }
.stat .v {
  font-size: 19px;
  font-weight: 680;
  margin-top: 5px;
  letter-spacing: -.3px;
}
.stat .v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }

/* ---------- 榜单表格 ---------- */
.table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.table-title { font-size: 15px; font-weight: 650; }
.table-title span { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 8px; }
.table-head .spacer { flex: 1; }

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

thead th {
  position: sticky;
  top: 0;
  background: #fbfbfd;
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .4px;
  text-align: right;
  padding: 11px 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  z-index: 2;
}

thead th.left { text-align: left; }
thead th:first-child { padding-left: 20px; }
thead th:last-child { padding-right: 20px; }

tbody td {
  padding: 13px 12px;
  border-bottom: 1px solid #f4f4f8;
  text-align: right;
  color: var(--ink-2);
  vertical-align: middle;
  white-space: nowrap;
}

tbody td:first-child { padding-left: 20px; }
tbody td:last-child { padding-right: 20px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #fdf7f8; }

.rank {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--muted);
  width: 46px;
  text-align: center;
}
.rank.top { font-size: 17px; }

.note { text-align: left !important; min-width: 320px; white-space: normal !important; }
.note-inner { display: flex; gap: 11px; align-items: flex-start; }

.cover {
  width: 44px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: linear-gradient(135deg, #f3f3f7, #e9e9f0);
  flex: none;
  border: 1px solid rgba(0, 0, 0, .04);
}

.note-body { min-width: 0; }

.note-title {
  font-size: 13.8px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .14s ease;
}
.note-title:hover { color: var(--red); }

.note-meta {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.author { color: var(--ink-2); font-weight: 500; }
.author:hover { color: var(--red); }

.tag {
  background: var(--red-soft);
  color: var(--red);
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.total-cell { font-weight: 700; color: var(--ink); font-size: 14px; }
.num-muted { color: var(--muted); }

.time { color: var(--muted); font-size: 12.5px; text-align: right; }

/* ---------- 状态 ---------- */
.state {
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}
.state .big { font-size: 34px; margin-bottom: 10px; }
.state strong { color: var(--ink-2); display: block; margin-bottom: 6px; font-size: 14.5px; }

.sk { padding: 8px 20px; }
.sk-row { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f4f4f8; align-items: center; }
.sk-b { background: linear-gradient(90deg, #f2f2f6 25%, #f8f8fb 37%, #f2f2f6 63%); background-size: 400% 100%; animation: sh 1.3s ease infinite; border-radius: 8px; }
@keyframes sh { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.more-wrap { display: flex; justify-content: center; padding: 18px; }

.footer {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
}
.footer a { color: var(--ink-2); border-bottom: 1px dashed #d7d7e0; }

/* ---------- 访问码弹层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 28, .38);
  backdrop-filter: blur(3px);
  display: none;
  place-items: center;
  z-index: 90;
  padding: 20px;
}
.modal.show { display: grid; }

.modal-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 24px 64px rgba(20, 20, 28, .22);
}

.modal-card h3 { margin: 0 0 8px; font-size: 17px; }
.modal-card p { margin: 0 0 18px; font-size: 13px; color: var(--muted); line-height: 1.7; }

.modal-card input[type="password"] {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  letter-spacing: 2px;
}
.modal-card input[type="password"]:focus { border-color: #ffb3bf; box-shadow: 0 0 0 3px rgba(255, 36, 66, .1); }

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

@media (max-width: 860px) {
  .wrap { padding: 0 16px 48px; }
  .topbar-inner { padding: 12px 14px; gap: 8px; }
  .segmented { min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .segmented::-webkit-scrollbar { display: none; }
  .seg-btn { font-size: 12px; padding: 5px 9px; }
  .hero { padding: 26px 0 20px; }
  .hero h1 { font-size: 23px; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 16px; }
  .hide-sm { display: none !important; }
  .note { min-width: 240px; }
  .brand-sub { display: none; }
  .pill.live { display: none; }
  table { font-size: 12.5px; }
}

/* ---------- AI 拆解 ---------- */
.icon-btn.accent {
  color: #fff;
  background: linear-gradient(135deg, #ff4d63, #e01b36);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(255, 36, 66, .22);
}
.icon-btn.accent:hover { color: #fff; background: linear-gradient(135deg, #ff6074, #c9152e); }
.icon-btn.accent:disabled { opacity: .55; cursor: default; box-shadow: none; }

.analysis {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: anIn .32s cubic-bezier(.2, .8, .3, 1);
}
@keyframes anIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.an-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff8f9, #fff);
}
.an-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.an-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #ffd9df;
  border-radius: 999px;
  padding: 2px 9px;
}
.an-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.an-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.an-insights { padding: 20px 24px 4px; }
.an-tip { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 8px; }
.ins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}
.ins-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  background: #fcfcfd;
}
.ins-card .k { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.ins-card .v { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.ins-card .v small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.ins-card .d { font-size: 11px; color: var(--muted); margin-top: 3px; }

.ins-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chip {
  font-size: 11.5px;
  color: var(--ink-2);
  background: #f4f4f7;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}
.chip b { color: var(--red); font-weight: 600; }

.an-body {
  padding: 8px 24px 24px;
  font-size: 14px;
  line-height: 1.78;
  color: var(--ink-2);
  min-height: 40px;
}
.an-status {
  padding: 0 24px 20px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.an-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }

/* Markdown 排版 */
.md h2 {
  font-size: 16.5px;
  color: var(--ink);
  margin: 26px 0 10px;
  padding-left: 11px;
  border-left: 3px solid var(--red);
  line-height: 1.35;
}
.md h2:first-child { margin-top: 12px; }
.md h3 { font-size: 14.5px; color: var(--ink); margin: 18px 0 8px; }
.md h4 { font-size: 13.5px; color: var(--ink-2); margin: 14px 0 6px; }
.md p { margin: 9px 0; }
.md ul, .md ol { margin: 9px 0; padding-left: 22px; }
.md li { margin: 4px 0; }
.md li::marker { color: #c3c3ce; }
.md strong { color: var(--ink); font-weight: 600; }
.md em { font-style: normal; color: var(--red); }
.md code {
  background: #f4f4f7;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #c9152e;
}
.md blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  background: var(--red-soft);
  border-left: 3px solid #ffc2cb;
  border-radius: 0 8px 8px 0;
  color: var(--ink-2);
}
.md hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.md table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 13px;
}
.md table th {
  background: #fafafc;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}
.md table th, .md table td {
  border: 1px solid var(--line);
  padding: 8px 11px;
  vertical-align: top;
}
.md table tr:nth-child(even) td { background: #fcfcfd; }
.md table tbody tr:nth-child(even) td { background: #fcfcfd; }

.md-caret {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--red);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink .9s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 860px) {
  .an-head { flex-direction: column; padding: 16px; }
  .an-actions { justify-content: flex-start; }
  .an-insights { padding: 16px 16px 0; }
  .an-body { padding: 6px 16px 18px; font-size: 13.5px; }
  .an-status { padding: 0 16px 16px; }
}

/* ---------- 独立报告页 ---------- */
.report-wrap { max-width: 980px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 16px;
}

.report-hero {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 34px 0 22px;
}
.report-hero-main { flex: 1; min-width: 0; }
.report-hero h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -.4px;
}
.report-desc {
  margin: 9px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
}
.report-desc b { color: var(--ink-2); font-weight: 600; }
.report-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.report-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

.report-card { padding: 6px 0 0; }
.report-card .an-body { padding: 14px 26px 26px; }
.report-card .an-status { padding: 0 26px 18px; }

.sample-scroll { overflow-x: auto; }
.sample-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sample-table th {
  text-align: right;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.sample-table th.left, .sample-table td.left { text-align: left; }
.sample-table td {
  text-align: right;
  padding: 9px 10px;
  border-bottom: 1px solid #f4f4f7;
  color: var(--ink-2);
  vertical-align: top;
}
.sample-table tr:last-child td { border-bottom: 0; }
.sample-table .note-title {
  display: block;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.45;
  max-width: 420px;
}
.sample-table .note-title:hover { color: var(--red); }

@media (max-width: 860px) {
  .report-hero { flex-direction: column; padding: 24px 0 16px; }
  .report-hero h1 { font-size: 21px; }
  .report-actions { width: 100%; }
  .card { padding: 16px; }
  .report-card { padding: 2px 0 0; }
  .report-card .an-body { padding: 10px 16px 18px; }
  .report-card .an-status { padding: 0 16px 14px; }
  .sample-table .note-title { max-width: 200px; }
}

/* 报告页表格布局优化：按列类型分配宽度，内容不再被挤成窄条 */
.md table {
  display: table;
  table-layout: fixed;
  width: 100%;
  min-width: 460px;
  margin: 14px 0 18px;
  font-size: 12.5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.md table th,
.md table td {
  text-align: left !important;
  padding: 9px 11px;
  line-height: 1.65;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}
.md table th {
  background: #fafafc;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .2px;
  border-bottom: 1px solid var(--line);
}
.md table td { color: var(--ink-2); }
.md table tbody tr + tr td { border-top: 1px solid #f2f2f5; }

/* 短列（序号/占比/难度/评分/周期等）收窄，长列自动吃掉剩余宽度 */
.md table th:nth-child(n+2):not(:last-child) { width: 15%; }
.md table td:nth-child(n+2):not(:last-child) { width: 15%; }
.md table th:last-child,
.md table td:last-child { width: 18%; }

/* 首列（特征/标题/型号名）加重，作为行标签 */
.md table th:first-child,
.md table td:first-child { width: auto; }
.md table td:first-child { color: var(--ink); font-weight: 500; }

/* 单元格内的列表/分段文字收紧，避免竖排成一条 */
.md table td ul,
.md table td ol { margin: 0; padding-left: 16px; }
.md table td li { margin: 2px 0; }
.md table td br { line-height: 1.2; }
.md table code { font-size: 11.5px; white-space: nowrap; }

/* 报告正文容器：表格超出时给横向滚动，但不影响整体排版 */
.an-body { overflow-x: auto; }
.an-body > * { max-width: 100%; }

@media (max-width: 860px) {
  .md table { min-width: 560px; font-size: 12px; }
  .md table th,
  .md table td { padding: 8px 9px; }
}

/* ---------- 爆款规律分析（本地规则统计） ---------- */
.reg-sub {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.reg-empty {
  margin: 8px 0 4px;
  font-size: 13px;
  color: var(--muted);
}
.reg-block + .reg-block { margin-top: 22px; }
.reg-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}
.reg-head h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.reg-head h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--red);
  margin-right: 7px;
  vertical-align: -1px;
}
.table-scroll { overflow-x: auto; }
.reg-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12.5px;
  table-layout: auto;
}
.reg-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: #fafafc;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.reg-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #f4f4f7;
  color: var(--ink-2);
  line-height: 1.6;
  vertical-align: top;
}
.reg-table tr:last-child td { border-bottom: 0; }
.reg-table tbody tr:hover td { background: #fcfcfd; }
.reg-table .reg-type {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.reg-table .reg-pct {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.reg-table code {
  font-size: 11.5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #f4f4f7;
  color: var(--ink-2);
  white-space: nowrap;
}
.reg-refs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reg-ref {
  color: var(--red);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.5;
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reg-ref:hover { text-decoration: underline; }
.reg-ref-plain { font-size: 12px; color: var(--muted); }
.reg-highlights {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.85;
}
.reg-highlights li::marker { color: #c3c3ce; }
.reg-highlights b { color: var(--ink); font-weight: 600; }

@media (max-width: 860px) {
  .reg-table { min-width: 640px; font-size: 12px; }
  .reg-ref { max-width: 110px; }
}

/* ---------- 自定义分类输入 ---------- */
.cat-custom {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.cat-custom .text-input {
  min-width: 0;
  font-size: 13.5px;
  padding: 9px 12px;
  border-radius: 10px;
}
.cat-custom .btn-sm {
  flex-shrink: 0;
  padding: 9px 14px;
  font-size: 13px;
  border-radius: 10px;
  white-space: nowrap;
}
#cat-hint { margin-top: 8px; }
#cat-hint.ok { color: #16794c; }
#cat-hint.warn { color: #b06d00; }

@media (max-width: 860px) {
  .cat-custom { flex-wrap: nowrap; }
  .cat-custom .btn-sm { padding: 9px 11px; font-size: 12.5px; }
}
