:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #1f2933;
  --blue: #246bfd;
  --border: #d9e2ec;
  --muted: #52606d;
  --danger: #b42318;
  --warning: #9a6700;
  --success: #16794b;
}
* { box-sizing: border-box; }
body { margin: 0; }
body > main:not(.admin-main) { width: min(92vw, 440px); margin: 12vh auto; }
.skip-link { position: fixed; z-index: 30; top: 8px; left: 8px; padding: 10px 14px; border-radius: 8px; background: #102a43; color: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 14px max(3vw, 20px); border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .96); }
.brand { white-space: nowrap; }
.top-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px; }
.admin-shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 32px; width: min(94vw, 1440px); margin: 0 auto; }
/* ⚠️ sticky 元素**自己不会滚动**。侧栏 16 项 + 3 个组标题约 830px 高，
   在 800~900px 高的笔记本屏上底部几项（功能手册、预览发布）够不着，
   而且页面主体滚动时侧栏钉在原地，怎么滑都出不来。
   所以 sticky 必须配 max-height + overflow-y，缺一个就是这个症状。
   padding-bottom 收到 24px：80px 在滚动容器里就是底部一段空白。 */
.sidebar {
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 76px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 0 24px;
}
.sidebar-nav { display: grid; gap: 22px; }
.nav-group { display: grid; gap: 4px; }
.nav-group h2 { margin: 0 10px 6px; color: #7b8794; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.nav-group a { min-height: 40px; padding: 10px 12px; border-radius: 8px; color: #334e68; text-decoration: none; }
.nav-group a:hover { background: #edf4ff; }
.nav-group a[aria-current="page"] { background: #e8f0ff; color: #174ea6; font-weight: 650; }
.mobile-nav { display: none; }
.admin-main { min-width: 0; width: 100%; max-width: 1180px; margin: 32px 0 80px; }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 3px; }
.draft-state { padding: 5px 8px; border-radius: 999px; background: #fff5d6; color: #765600; font-weight: 700; text-decoration: none; }
.draft-state:hover { background: #ffebad; }
.revision-details > summary { cursor: pointer; }
.revision-values { display: grid; gap: 3px; margin-top: 6px; }
.panel { margin: 18px 0; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .05); }
.page-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 20px; }
h1 { margin: 0 0 8px; font-size: 26px; }
h2 { margin: 0 0 14px; font-size: 19px; }
h3 { font-size: 16px; }
p { line-height: 1.65; color: var(--muted); }
small, .muted { display: block; margin-top: 5px; color: #7b8794; }
.notice { margin: 14px 0; padding: 12px 14px; border: 1px solid transparent; border-radius: 9px; line-height: 1.5; }
.notice.error, .error { border-color: #f3c1bd; background: #fff1f0; color: var(--danger); }
.notice.warning { border-color: #efd28a; background: #fff8df; color: var(--warning); }
.notice.success { border-color: #a6dfc6; background: #ecfdf3; color: var(--success); }
.notice.info { border-color: #bfd4ff; background: #edf4ff; color: #174ea6; }
.compliance { border-left: 5px solid var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: end; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #334e68; font-weight: 600; }
input, textarea, select { width: 100%; padding: 10px 12px; border: 1px solid #bcccdc; border-radius: 8px; background: #fff; color: #1f2933; font: inherit; font-weight: 400; }
textarea { min-height: 96px; resize: vertical; }
button { padding: 10px 15px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button.danger { background: var(--danger); }
button.secondary { background: #52606d; }
.link-button { padding: 5px; background: transparent; color: #334e68; }
.actions, .actions form { display: flex; align-items: center; gap: 6px; }
.actions button { padding: 7px 9px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid #e6ebf0; text-align: left; vertical-align: top; }
th { color: #52606d; font-size: 13px; }
pre { max-width: 420px; margin: 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.request-value-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.request-value-list li { padding: 8px 10px; border-radius: 8px; background: #f7faff; line-height: 1.45; }
.request-value-list small { margin-top: 2px; }
.empty { padding: 28px 12px; color: #7b8794; text-align: center; }
.record-list { margin: 0; padding: 0; list-style: none; }
.record-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e6ebf0; }
.content-columns { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr); gap: 20px; align-items: start; }
/* ⚠️ 曾经是两栏 grid（列表在左、正文在右）。改成整宽单栏之后这条没删干净，
   结果标题占左格、筛选被挤到右上角，列表还留着一条 border-right 的竖线。
   产品方反馈「筛选为什么不在正上方」就是这个。 */
.news-list { max-height: 60vh; overflow: auto; }
.news-list a { display: block; padding: 10px; border-radius: 8px; color: #334e68; text-decoration: none; }
.news-list a[aria-current="page"] { background: #edf4ff; }
.article-body { min-width: 0; }
.article-body article > h2 { font-size: 22px; }
.article-list { padding-left: calc(18px + var(--indent, 0px)); }
.indent-1 { margin-left: 18px; }
.indent-2 { margin-left: 36px; }
.indent-3 { margin-left: 54px; }
.indent-4 { margin-left: 72px; }
blockquote { margin: 16px 0; padding: 8px 14px; border-left: 4px solid #9fb3c8; background: #f7f9fb; color: #486581; }
.article-image { display: block; max-width: 100%; height: auto; margin: 16px auto; border-radius: 8px; }
.activity-editor { position: sticky; top: 84px; }
.activity-editor form + h2 { margin-top: 28px; }
.generic-field { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.changed { color: var(--warning); font-weight: 700; }
.publish-actions { display: grid; gap: 18px; }
.publish-actions form { display: grid; gap: 14px; }
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.status-grid > div { padding: 14px; border: 1px solid #dce6f0; border-radius: 10px; background: #f7faff; }
.status-grid strong, .status-grid span { display: block; }
.status-grid strong { margin-bottom: 4px; color: #174ea6; font-size: 22px; }
.status-grid span { color: #52606d; font-size: 13px; }
.status-grid small { margin-top: 4px; }
.price-complete { margin-bottom: 10px; padding: 12px 14px; border-radius: 9px; background: #ecfdf3; color: var(--success); }
.price-guidance { margin-top: 10px; }
.price-guidance > :not(summary) { margin-left: 12px; margin-right: 12px; }
.recorded-filters { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px) auto; gap: 12px; align-items: end; margin-bottom: 14px; }
.list-more { margin: 16px 0 0; text-align: center; }
.resolution-badge { margin-top: 6px; font-weight: 700; }
tr[data-resolution="direct"] .resolution-badge { color: var(--success); }
tr[data-resolution="rebuild"] .resolution-badge { color: var(--warning); }
.finding-messages { margin: 0; padding-left: 18px; }
.finding-messages li + li { margin-top: 8px; }
.rebuild-data-help { margin-top: 16px; padding: 0 12px; border: 1px solid #efd28a; border-radius: 9px; background: #fffaf0; }
.task-config { margin-top: 16px; padding: 0 14px 14px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.task-config > summary { min-height: 44px; }
.task-config form { margin-top: 16px; }
.task-switch-state { padding-top: 6px; color: #334e68; }
.publish-empty { padding: 18px; border: 1px solid #a6dfc6; border-radius: 10px; background: #ecfdf3; color: var(--success); }
.publish-empty p { margin: 4px 0 0; color: #346b54; }
.publish-help { margin-top: 16px; }
.publish-help ul { color: var(--muted); line-height: 1.7; }
.handbook-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.handbook-toc a { min-height: 40px; padding: 9px 11px; border-radius: 8px; color: #174ea6; text-decoration: none; }
.handbook-toc a:hover { background: #edf4ff; }
.handbook-price-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.handbook-price-stats > div { padding: 12px; border-radius: 9px; background: #f7faff; }
.handbook-price-stats span, .handbook-price-stats strong { display: block; }
.handbook-price-stats span { color: var(--muted); font-size: 13px; }
.handbook-price-stats strong { margin-top: 4px; color: #174ea6; font-size: 20px; }

/* ── 卷轴资料：桌面端列表 + 核对工作台 ── */
.scroll-summary { margin-bottom: 14px; }
.scroll-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.scroll-toolbar > form:last-child { flex: none; }
.scroll-filters {
  flex: 1; display: grid;
  grid-template-columns: minmax(190px, 1.4fr) repeat(3, minmax(130px, .75fr)) auto auto;
  gap: 10px; align-items: end;
}
.scroll-filters .button-link { min-height: 42px; padding: 10px 6px; text-align: center; }
.scroll-workspace {
  display: grid; grid-template-columns: minmax(400px, .92fr) minmax(500px, 1.08fr);
  gap: 18px; align-items: start;
}
.scroll-workspace > .panel { margin-top: 0; }
.scroll-list-panel { padding: 0; overflow: hidden; }
.scroll-list-heading { display: flex; align-items: baseline; justify-content: space-between; padding: 20px 22px 12px; }
.scroll-list-heading h2 { margin: 0; }
.scroll-list-heading span { color: var(--muted); font-size: 13px; }
.scroll-record-list { max-height: calc(100vh - 330px); min-height: 360px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.scroll-record-list li { border-top: 1px solid #e6ebf0; }
.scroll-record-list li > a {
  display: flex; justify-content: space-between; gap: 18px; padding: 14px 22px;
  color: #243b53; text-decoration: none;
}
.scroll-record-list li > a:hover { background: #f7faff; }
.scroll-record-list li.selected > a { background: #edf4ff; box-shadow: inset 3px 0 #246bfd; }
.scroll-record-list strong, .scroll-record-list small { overflow-wrap: anywhere; }
.scroll-row-meta { flex: none; min-width: 104px; text-align: right; }
.scroll-status { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 750; }
.scroll-status-manual { background: #ecfdf3; color: var(--success); }
.scroll-status-pending { background: #fff8df; color: #8a6116; }
.scroll-status-missing-id { background: #fff1f0; color: var(--danger); }
.scroll-status-source-missing { background: #eef1f5; color: #52606d; }
.scroll-editor-panel { position: sticky; top: 84px; max-height: calc(100vh - 108px); overflow: auto; }
.scroll-editor-head h2 { margin: 10px 0 2px; }
.scroll-editor-head p { margin: 0; font-size: 13px; }
.scroll-evidence { margin: 16px 0 20px; padding: 14px 16px; border: 1px solid #dce6f0; border-radius: 10px; background: #f7faff; }
.scroll-evidence h3, .scroll-evidence p { margin: 0; }
.scroll-evidence p + p { margin-top: 5px; }
.scroll-evidence p { font-size: 13px; }
.scroll-edit-form { align-items: start; }
.scroll-edit-form small { font-weight: 400; }
.scroll-primary-action { display: flex; align-items: center; gap: 12px; }
.scroll-primary-action small { margin: 0; }
.scroll-remove { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.scroll-remove > summary { cursor: pointer; color: var(--danger); font-size: 13px; font-weight: 700; }
.scroll-remove form { display: grid; gap: 12px; margin-top: 14px; }
.scroll-remove button { justify-self: start; }
.scroll-history { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.scroll-history ol { margin: 0; padding-left: 20px; }
.scroll-history li { padding: 7px 0; color: #334e68; }
.scroll-history li strong, .scroll-history li span { display: block; }
.scroll-history li span { margin-top: 3px; color: var(--muted); font-size: 13px; }

/* 卷轴资料库第二版：列表直接展示效果和全部来源，详情默认只读。 */
.scroll-heading-actions { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.scroll-heading-actions > .button-link { margin-left: auto; }
.scroll-summary { display: flex; align-items: baseline; gap: 22px; margin: 0; color: var(--muted); font-size: 13px; }
.scroll-summary span { white-space: nowrap; }
.scroll-summary strong { margin-right: 5px; color: #243b53; font-size: 22px; }
.scroll-workspace { grid-template-columns: minmax(700px, 1.42fr) minmax(340px, .58fr); gap: 14px; }
.scroll-list-heading { padding: 16px 18px 10px; }
.scroll-table-wrap { overflow: auto; }
.scroll-library-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.scroll-library-table th { padding: 9px 12px; background: #f5f7fa; color: #627386; font-size: 12px; text-align: left; }
.scroll-library-table th:nth-child(1) { width: 28%; }
.scroll-library-table th:nth-child(2) { width: 21%; }
.scroll-library-table th:nth-child(3) { width: 41%; }
.scroll-library-table th:nth-child(4) { width: 10%; }
.scroll-library-table td { padding: 11px 12px; border-top: 1px solid #e6ebf0; vertical-align: middle; font-size: 13px; overflow-wrap: anywhere; }
.scroll-library-table tr.selected td { background: #fff8ee; }
.scroll-library-table tr.selected td:first-child { box-shadow: inset 3px 0 #c67c30; }
.scroll-name-cell { display: flex; align-items: center; gap: 10px; color: #243b53; text-decoration: none; }
.scroll-name-cell > span:last-child { min-width: 0; }
.scroll-name-cell strong, .scroll-name-cell small { display: block; overflow-wrap: anywhere; }
.scroll-name-cell small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.scroll-icon-placeholder { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border: 1px dashed #b8c2cc; border-radius: 7px; background: #f2f4f6; color: #7b8794; font-size: 9px; line-height: 1.1; text-align: center; }
.scroll-icon-large { width: 48px; height: 48px; flex-basis: 48px; font-size: 10px; }
.scroll-effects span, .scroll-sources span { display: block; line-height: 1.55; }
.scroll-effects strong { color: #9a5723; }
.scroll-sources strong { color: #334e68; }
.scroll-effects .scroll-fact { display: inline-block; margin-top: 4px; padding: 2px 6px; border-radius: 999px; font-size: 10px; }
.scroll-fact-reference { color: #7a4b12; background: #fff4d6; }
.scroll-fact-verified { color: #176247; background: #dcf5e9; }
.scroll-fact-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.scroll-sources small { margin-left: 4px; color: var(--muted); font-size: 10px; }
.scroll-missing { color: #8a6116; font-weight: 600; }
.scroll-rate { font-weight: 750; white-space: nowrap; }
.scroll-detail-panel { position: sticky; top: 84px; max-height: calc(100vh - 108px); overflow: auto; }
.scroll-detail-head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.scroll-detail-head > div { min-width: 0; }
.scroll-detail-head h2 { margin: 7px 0 3px; font-size: 20px; }
.scroll-detail-head p { margin: 0; color: var(--muted); font-size: 12px; }
.scroll-detail-head > .button-link { margin-left: auto; white-space: nowrap; }
.scroll-detail-section { padding: 16px 0; border-bottom: 1px solid var(--border); }
.scroll-detail-section h3 { margin: 0 0 11px; font-size: 14px; }
.scroll-detail-section dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.scroll-detail-section dl div { min-width: 0; }
.scroll-detail-section dt { color: var(--muted); font-size: 11px; }
.scroll-detail-section dd { margin: 4px 0 0; color: #243b53; font-size: 13px; font-weight: 650; }
.scroll-source-detail { margin: 0; padding: 0; list-style: none; }
.scroll-source-detail li { padding: 7px 0; }
.scroll-source-detail strong, .scroll-source-detail span, .scroll-source-detail small { display: block; }
.scroll-source-detail span, .scroll-source-detail small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.scroll-request-form-panel { max-width: 900px; }
.scroll-request-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.request-workspace { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(520px, 1.3fr); gap: 14px; align-items: start; }
.request-workspace > .panel { margin-top: 0; }
.request-list { padding: 0; overflow: hidden; }
.request-list h2 { margin: 0; padding: 16px 18px 10px; }
.request-list ul { margin: 0; padding: 0; list-style: none; }
.request-list li { border-top: 1px solid var(--border); }
.request-list a { display: block; padding: 12px 18px; color: #243b53; text-decoration: none; }
.request-list li.selected a { background: #fff8ee; box-shadow: inset 3px 0 #c67c30; }
.request-list strong, .request-list span { display: block; }
.request-list span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.request-detail { position: sticky; top: 84px; }
.request-review-head h2 { margin: 8px 0 3px; }
.request-review-head p { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.request-diff { width: 100%; table-layout: fixed; }
.request-diff th:first-child { width: 18%; }
.request-diff td { vertical-align: top; }
.request-diff pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }
.request-diff .request-after { background: #f0faf2; color: #28613e; }
.request-reason { margin-top: 15px; padding: 12px 14px; border-radius: 8px; background: #f6f7f8; }
.request-reason h3, .request-reason p { margin: 0; }
.request-reason p { margin-top: 6px; font-size: 13px; }
.request-review-actions { display: flex; align-items: end; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.request-review-actions form { display: flex; align-items: end; gap: 8px; }
.request-review-actions label { margin: 0; }
.member-table strong, .member-table small { display: block; }
.member-table small { margin-top: 3px; color: var(--muted); }
.member-table form { display: flex; gap: 8px; align-items: center; }
.member-table select { min-width: 120px; }

@media (max-width: 1180px) {
  .scroll-workspace { grid-template-columns: 1fr; }
  .scroll-detail-panel { position: static; max-height: none; }
  .request-workspace { grid-template-columns: 1fr; }
  .request-detail { position: static; }
}

@media (max-width: 800px) {
  .topbar, .top-meta { align-items: flex-start; }
  .topbar { position: static; flex-direction: column; gap: 12px; }
  /* ⚠️ 窄屏下 topbar 不再 sticky，侧栏也换成 .mobile-nav，
     所以那个 calc(100vh - 76px) 的前提没了，得撤掉。 */
  .sidebar { max-height: none; overflow-y: visible; }
  .top-meta { gap: 6px 12px; }
  .top-meta button { min-height: 44px; }
  .admin-shell { display: block; width: min(94vw, 680px); }
  .sidebar { display: none; }
  .mobile-nav { display: block; width: 100%; border: 0; }
  .mobile-nav > summary { min-height: 44px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
  .mobile-nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-top: 14px; }
  .mobile-nav-links .nav-group { align-content: start; }
  .mobile-nav-links .nav-group a { min-height: 44px; }
  .admin-main { margin-top: 20px; }
  .content-columns, .form-grid { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recorded-filters { grid-template-columns: 1fr; }
  .handbook-price-stats { grid-template-columns: 1fr; }
  .scroll-toolbar { align-items: stretch; flex-direction: column; }
  .scroll-filters, .scroll-workspace { grid-template-columns: 1fr; }
  .scroll-editor-panel { position: static; max-height: none; }
  .scroll-record-list { max-height: 420px; min-height: 0; }
  .news-list { max-height: 320px; }
  .activity-editor { position: static; }
  .record-list li, .actions { align-items: flex-start; flex-direction: column; }
  .panel { padding: 18px; }
}

/* 道具定价：规则矩阵是 10 属性 × 3 成功率，格子要紧凑才装得下一屏。 */
.panel .hint { margin: 0 0 12px; color: #5a6b7a; font-size: 13px; line-height: 1.6; }
.panel table select { width: 100%; min-width: 84px; padding: 4px 6px; }
.panel table th[scope="row"] { text-align: left; white-space: nowrap; padding-right: 12px; }
/* 逐条定价那一行：档位下拉和按钮并排，别各占一行 */
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form select { min-width: 84px; }

/* 已设过的档位格子要一眼看得出来 —— 30 个下拉框长得一样时，
   「哪些设过」只能一格格看，那是这页最累的地方。 */
select.tier-unset { color: #98a6b3; }
select.tier-prime { background: #e8f5e9; border-color: #66bb6a; font-weight: 600; }
select.tier-good  { background: #e3f2fd; border-color: #64b5f6; }
select.tier-junk  { background: #f5f5f5; color: #78909c; }
/* 顶部摘要：进页面第一眼就知道现在到哪一步了 */
.panel .summary { margin: 0 0 8px; font-size: 14px; color: #22303a; }
.panel .summary strong { color: #1565c0; }

/* 分组浏览：维度切换 + 可折叠分组。原生 <details>，不需要 JS。 */
.group-switch { margin: 0 0 12px; font-size: 14px; color: #5a6b7a; }
.group-switch a { margin-left: 12px; color: #1565c0; text-decoration: none; }
.group-switch a[aria-current="page"] { font-weight: 700; text-decoration: underline; }
details { border-bottom: 1px solid #e6ebf0; }
details summary { cursor: pointer; padding: 10px 0; font-weight: 600; color: #22303a; }
details summary:hover { color: #1565c0; }
details .search-results { margin: 0 0 12px; padding-left: 18px; }
/* 分组后的下拉框会很长，给它足够高度 */
select optgroup { font-weight: 700; color: #5a6b7a; }

/* 选中记录后的编辑区：排在最前面，并且要显眼 —— 它是这一页的主角。 */
.panel.highlight { border-left: 4px solid #1565c0; background: #f7fbff; }
.panel.highlight h2 small { font-weight: 400; color: #78909c; font-size: 13px; }
.panel.highlight table input { width: 100%; min-width: 120px; }

/* 字段说明：中文名在上，缩写与提示在下，一眼知道这是什么 */
.panel.highlight table td strong { display: block; }
.panel.highlight table td small { color: #78909c; font-size: 12px; }
.panel.highlight table td small code { background: #eceff1; padding: 1px 4px; border-radius: 3px; }
/* 不可改的字段折叠起来，但要能展开看到原因 */
details.locked { margin-top: 12px; border: 0; }
details.locked summary { color: #78909c; font-weight: 400; font-size: 13px; }
details.locked ul { margin: 8px 0 0; padding-left: 20px; color: #5a6b7a; font-size: 13px; line-height: 1.8; }
.group-switch .sep { margin: 0 4px 0 12px; color: #cfd8dc; }

/* 功能手册里的功能条目：紧凑，一行一条 */
.feat-list { margin: 0; padding-left: 1.1rem; }
.feat-list li { margin: .2rem 0; font-size: .9rem; }
.feat-list li small { display: block; color: var(--muted, #6b7280); font-size: .8rem; }

/* ── 公告与活动：操作指引与状态 ── */
.steps { margin: 0 0 18px; padding: 14px 18px 14px 34px; background: #f7f9fc; border: 1px solid #e6ebf0; border-radius: 9px; line-height: 1.7; color: #486581; }
.steps li { margin: 4px 0; }
.steps strong { color: #243b53; margin-right: 6px; }
.panel h2 .count { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px; background: #e6ebf0; color: #486581; font-size: 12px; font-weight: 700; vertical-align: middle; }
.button-link { display: inline-block; white-space: nowrap; padding: 7px 12px; border: 1px solid #cbd6e2; border-radius: 7px; background: #fff; color: #334e68; font-weight: 700; font-size: 13px; text-decoration: none; }
.button-link:hover { background: #f4f7fa; }
.event-form a.wide { text-align: center; text-decoration: underline; }
.news-item .tag { display: inline-block; padding: 0 7px; border-radius: 999px; font-weight: 700; }
.news-item.pending .tag { background: #fff8df; color: #8a6116; }
/* 两种「已处理」含义不同，颜色要分开：录到了活动 vs 读过了但没有活动。 */
.news-item.done-event .tag { background: #ecfdf3; color: #1b7a4f; }
.news-item.done-none .tag { background: #eef1f5; color: #7b8794; }
.news-item.done-event strong, .news-item.done-none strong { color: #7b8794; font-weight: 600; }

/* ⚠️ 「每周」和「日期区间」的字段互斥，混填会被校验拒绝。按选择显示，
   让不该填的框根本看不见——以前一次全显示、没有提示，这是填不对的主因。
   ⚠️ 整块必须包在 @supports 里：不支持 :has() 的浏览器会卡在「默认隐藏」那条上，
   把字段永久藏死，比现在更糟。包住之后降级成「全部显示」，也就是改动前的样子。 */
@supports selector(:has(*)) {
  .event-form .when-ranges,
  .event-form .when-always { display: none; }
  .event-form:has(select[name="kind"] option[value="ranges"]:checked) .when-weekly { display: none; }
  .event-form:has(select[name="kind"] option[value="ranges"]:checked) .when-ranges { display: grid; }
  .event-form:has(select[name="scope"] option[value="always"]:checked) .when-scheduled,
  .event-form:has(select[name="scope"] option[value="always"]:checked) .when-weekly,
  .event-form:has(select[name="scope"] option[value="always"]:checked) .when-ranges { display: none; }
  .event-form:has(select[name="scope"] option[value="always"]:checked) .when-always { display: block; }
}

/* AI 抽取候选 */
.suggest-list li { align-items: flex-start; }
.suggest-list small { margin-top: 3px; }
/* ⚠️ 缺日期要显眼。模型填 null 是对的（公告确实没写），
   但产品方必须一眼看到这里需要他补，不能悄悄留空。 */
.suggest-list small.warn { color: #8a6116; background: #fff8df; display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 700; }
/* AI 候选标记：和「未处理/已录活动」并列，但用不同的色，一眼能分开 */
.news-item .tag-ai { margin-left: 6px; background: #edf4ff; color: #174ea6; }

/* ── 活动列表 ── */
.pv-group { margin-top: 16px; }
.pv-group:first-of-type { margin-top: 6px; }
.pv-group h3 {
  margin: 0; padding: 7px 0; font-size: 13px; color: #486581;
  display: flex; align-items: baseline; gap: 8px;
  border-bottom: 1px solid #eef1f5;
}
.pv-hint { font-weight: 400; font-size: 12px; color: #9aa5b1; }
.pv-group h3 .count { margin-left: auto; }
.pv-group .record-list li { padding: 12px 0; gap: 16px; }
.pv-group .record-list strong { font-size: 14px; }
.pv-group .when { color: #1b7a4f; font-weight: 700; }
/* ⚠️ 「玩家看不到」要显眼——录进去了却不显示，是最容易被忽略的失败 */
.pv-hidden h3 { color: #8a6116; border-bottom-color: #efd28a; }
.pv-hidden .warn { color: #8a6116; font-weight: 700; }
.record-list small.ok { color: #1b7a4f; font-weight: 700; }
.record-list small.warn { color: #8a6116; font-weight: 700; }

/* 发布状态：一眼看出这条玩家看没看得到 */
.actions .tag { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag-live { background: #ecfdf3; color: #1b7a4f; }
.tag-draft { background: #fff8df; color: #8a6116; }

/* 编辑区置顶时要显眼，否则和下面的列表糊在一起 */
.editor-open { border: 2px solid #bfd4ff; background: #fbfdff; }
.editor-open > h2 { color: #174ea6; }
.add-event { margin-top: 16px; }

/* 折叠的低频区块 */
.extras > summary {
  cursor: pointer; font-weight: 800; color: #486581; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.extras > summary::-webkit-details-marker { display: none; }
.extras > summary::before { content: "\25B8"; color: #9aa5b1; font-size: 12px; }
.extras[open] > summary::before { content: "\25BE"; }
.extras h3 { margin: 18px 0 8px; font-size: 14px; color: #243b53; }

/* ── 官方公告：分类筛选 + 单栏列表 ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid #cbd6e2; border-radius: 999px;
  background: #fff; color: #486581; font-size: 13px; font-weight: 700; text-decoration: none;
}
.chip span { color: #9aa5b1; font-weight: 800; }
.chip:hover { background: #f4f7fa; }
.chip.on { background: #243b53; border-color: #243b53; color: #fff; }
.chip.on span { color: #bfd4ff; }
/* 天然不用处理的分类：视觉上压下去，但不藏掉 */
.chip.muted-chip { color: #9aa5b1; border-style: dashed; }

.news-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #eef1f5; }
.news-row:last-child { border-bottom: 0; }
.news-row.current { background: #f4f8ff; }
.news-row > .news-item { flex: 1; min-width: 0; border: 0; }
.news-row.skip > .news-item strong { color: #9aa5b1; font-weight: 600; }
.news-row.skip .tag { background: #eef1f5; color: #9aa5b1; }
.row-skip { flex: none; }
.row-skip button { padding: 5px 10px; font-size: 12px; }

/* 正文整宽——分两栏时长文挤在窄列里根本看不全 */
.article-open .article-body { max-width: 78ch; }

/* 上传活动汇总图 */
.upload-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }
.upload-form input[type=file] {
  flex: 1; min-width: 240px; padding: 9px 12px;
  border: 1px dashed #cbd6e2; border-radius: 9px; background: #fbfdff; font-size: 13px;
}
.upload-form button { flex: none; }

/* 正文可收起。⚠️ 产品方：「内容太长要翻很久」——点公告主要是为了看 AI 候选，
   正文只在需要核对原文时才展开。所以候选排在正文**上面**，正文默认折起。 */
.article-fold { margin-top: 8px; border-top: 1px solid #eef1f5; }
.article-fold > summary {
  cursor: pointer; padding: 12px 2px; font-weight: 800; color: #486581;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.article-fold > summary::-webkit-details-marker { display: none; }
.article-fold > summary::before { content: "\25B8"; color: #9aa5b1; font-size: 12px; }
.article-fold[open] > summary::before { content: "\25BE"; }
/* ⚠️ 内部滚动才是「不想翻很久」的解法：正文再长也只占 60vh，
   下面的「上传活动汇总图」始终够得着。 */
.article-fold .article-body {
  max-width: 78ch; max-height: 60vh; overflow: auto;
  padding: 4px 12px 4px 0; border-left: 3px solid #eef1f5; padding-left: 14px;
}
.fold-hint { margin-left: 8px; font-weight: 400; font-size: 12px; color: #9aa5b1; }

/* ── 发布差异：说人话 ── */
.diff-item { padding: 16px 0; border-top: 1px solid #eef1f5; }
.diff-item:first-of-type { border-top: 0; }
.diff-item h3 { margin: 0 0 6px; font-size: 15px; color: #243b53; display: flex; align-items: baseline; gap: 10px; }
.diff-item h3 code { font-size: 12px; font-weight: 400; color: #9aa5b1; background: #f4f7fa; padding: 2px 7px; border-radius: 6px; }
.diff-headline { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: #8a6116; }
.diff-list { margin: 8px 0 0; padding: 0; list-style: none; }
.diff-list li { padding: 5px 0; font-size: 13px; display: flex; align-items: baseline; gap: 9px; }
.diff-list .mark { flex: none; width: 18px; text-align: center; border-radius: 5px; font-weight: 800; }
.mark-add .mark { background: #ecfdf3; color: #1b7a4f; }
.mark-del .mark { background: #fff1f0; color: #b42318; }
.mark-chg .mark { background: #fff8df; color: #8a6116; }
.mark-del { color: #7b8794; text-decoration: line-through; }
.diff-raw { margin-top: 12px; }
.diff-raw > summary { cursor: pointer; font-size: 12px; color: #9aa5b1; list-style: none; }
.diff-raw > summary::-webkit-details-marker { display: none; }
.diff-raw > summary::before { content: "\25B8 "; }
.diff-raw[open] > summary::before { content: "\25BE "; }
.diff-raw pre { max-height: 40vh; overflow: auto; }

/* ── 枫币行情 ── */
.meso-now { margin: 0 0 12px; font-size: 15px; color: #486581; }
.meso-now strong { font-size: 30px; color: #243b53; margin-right: 6px; }
.meso-now small { display: block; margin-top: 4px; color: #7b8794; }
.meso-chart { width: 100%; height: auto; display: block; margin: 8px 0 4px; }
.meso-chart circle { fill: #26715a; }
.meso-chart .ax { font-size: 11px; fill: #9aa5b1; }
.meso-list li { padding: 11px 0; }
.meso-list strong { font-variant-numeric: tabular-nums; }

/* ── 同名重复的对照表 ────────────────────────────────────
   产品方要的是「摆出差异让我选保留哪条」，所以这张表的工作是
   让差异一眼可见：字段名一列，每条记录一列，只列不一样的。 */
.dup-compare { margin-top: 10px; }
.dup-compare > summary { font-size: 13px; color: #3d6285; cursor: pointer; }
.dup-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.dup-table th, .dup-table td {
  border: 1px solid #e2e8e4; padding: 5px 8px; text-align: left; vertical-align: top;
}
.dup-table thead th { background: #f4f7f5; font-weight: 700; }
.dup-table td:first-child { color: #5f6d65; white-space: nowrap; }
.dup-table td small { display: block; color: #9ca6a0; font-size: 11px; }
/* 出没地图那一行加重：同一张图多半是重复，不同图多半只是重名，
   这一行常常一眼定生死 */
.dup-key-row td { background: #fbfdfb; font-weight: 600; }
.dup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dup-actions form { margin: 0; }
.dup-actions button.ghost { background: #fff; color: #5f6d65; border: 1px solid #d7ded8; }

/* 说明文字过期：排期是对的，但那句话在骗人。用琥珀而不是红——
   它不是坏掉，是需要人看一眼。 */
.pv-stale h3 { color: #9a6127; }
.pv-stale .count { background: #fdf0e6; color: #9a6127; }
.pv-stale .record-list li { border-left: 3px solid #e5b478; }

/* 提审文案。只读文本框：要的是「全选复制」，不是在这里编辑 ——
   改文案去 manual/handbook.json，那才是它的源头。 */
.release-note { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e2e8e4; }
.release-note h3 { margin: 0 0 6px; font-size: 15px; font-weight: 800; }
.release-note h3 small { color: #7b877e; font-weight: 500; }
.release-note textarea { width: 100%; font-family: inherit; font-size: 13px; line-height: 1.6; }
.release-wording { margin: 10px 0 0; padding-left: 18px; }
.release-wording li { font-size: 13px; color: #5f6d65; margin-bottom: 5px; }

/* 资料库面板里的三个动作（改数据 / 热门 / 下架）。
   ⚠️ 用 <details> 折叠是有意的：三个动作摊开会把选中的记录挤出屏幕，
   而「点一条记录之后看不到它」正是数据纠错页当年被投诉的那个问题。
   「改数据」默认展开——它是最常用的那个。 */
.library-action { border-top: 1px solid #e6ebf0; padding: 12px 0; }
.library-action > summary { cursor: pointer; font-weight: 700; color: #2f6f9f; }
.library-action > summary:hover { text-decoration: underline; }
.library-action[open] > summary { margin-bottom: 12px; }

/* 资料库的展示区：先看清这条记录是什么，再谈改。
   ⚠️ 产品方要求「一定要先做好展示，然后修改的话是最简单的入口修改」。 */
.record-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px 18px; margin: 0 0 18px; }
.record-field dt { color: #7a8791; font-size: 12px; margin: 0 0 2px; }
.record-field dd { margin: 0; font-size: 15px; font-weight: 600; color: #1f2933;
  overflow-wrap: anywhere; }
/* 被人工覆盖过的字段要看得出来 —— 否则数字和来源站对不上时，
   人会以为是抓取错了，而实际是自己改过。 */
.record-field.overridden dd { color: #8a5a1e; }
.record-field.overridden dd small { display: block; font-weight: 400; font-size: 11px;
  color: #9aa5ad; }
.action-lead { margin: 0 0 6px; }

/* 每一行自己的修改入口。
   ⚠️ 详情面板排在 199 行表格之后，选中一条要滚过 143KB 才够得着 ——
   产品方原话「我没看到修改数据的地方」。改成行内展开：点「改」就在原地改。 */
.scroll-edit-cell { white-space: nowrap; text-align: right; }
.scroll-edit-row > td { background: #f7fafc; padding: 16px 14px; }
.scroll-edit-row .form-grid { margin: 0; }

/* 资料库列表：每行内联展开修改（与卷轴资料库同一套交互）。
   ⚠️ 原来是「搜索 → 选中 → 上方面板」，人得先想清楚要找谁；
   现在摊开一张表，看到哪条不对就在那一行点「改」。 */
.row-edit-cell { white-space: nowrap; text-align: right; }
.row-edit > td { background: #f7fafc; padding: 16px 14px; }
tr.selected > td { background: #eef6fb; }
.tag-off, .tag-hot, .tag-patched { display: inline-block; padding: 2px 8px; margin-right: 6px;
  border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tag-off { background: #fdecea; color: #a1332b; }
.tag-hot { background: #ecfdf3; color: #1b7a4f; }
.tag-patched { background: #fff4df; color: #8a5a1e; }

/* 资料库筛选条。⚠️ 零客户端 JS —— 走 GET 参数，提交才生效。 */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px;
  padding: 14px 16px; margin: 0 0 16px; background: #fff; border: 1px solid #e6ebf0;
  border-radius: 12px; }
.filter-bar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #52606d; }
.filter-bar input, .filter-bar select { height: 34px; padding: 0 8px; font-size: 14px;
  border: 1px solid #d7dee5; border-radius: 8px; background: #fff; }
.filter-bar input[type="number"] { width: 84px; }
.filter-bar button, .filter-bar .button-link { height: 34px; line-height: 32px; }

/* 道具机率存档页。⚠️ 只加这几条 —— 表格本身用全局样式。 */
.prob-disclaimer { color: #8a5a1e; background: #fff7e8; border-radius: 6px;
  padding: 10px 12px; font-size: 13px; margin: 12px 0; }
.prob-meta { color: #52606d; font-size: 13px; margin: 10px 0 16px; }
.prob-rate { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prob-box { border: 1px solid #e6ebf0; border-radius: 8px; margin-bottom: 10px; }
.prob-box > summary { padding: 12px 14px; cursor: pointer; font-weight: 600;
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.prob-count { color: #7b8794; font-size: 13px; font-weight: 400; flex: none; }
.prob-note { color: #52606d; font-size: 13px; margin: 0 14px 10px; }
.prob-pool-label { margin: 4px 14px; font-size: 13px; color: #52606d; }
.prob-pool-label small { color: #7b8794; margin-left: 8px; }
.prob-source { color: #7b8794; font-size: 12px; margin-top: 20px; }

/* 分页条。⚠️ 后台是零客户端 JS，翻页全靠 <a href="?page=N">，
   所以这里样式的是链接，不是按钮 —— 不要为了好看换成 <button>，
   那样没有 JS 就点不动了。 */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 14px 16px; border-top: 1px solid var(--border); }
.pager-link { min-width: 38px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: #334e68; font-size: 13px; text-decoration: none; }
.pager-link:hover { background: #edf4ff; }
.pager-link.is-current { border-color: #174ea6; background: #e8f0ff; color: #174ea6; font-weight: 700; }
/* ⚠️ 用 span 而不是 disabled 的链接：<a> 没有 disabled 属性，
   加了也点得动。第一页的「上一页」必须是不可点的 span。 */
.pager-link.is-disabled { color: #9aa5b1; background: #f5f7fa; cursor: default; }
.pager-gap { padding: 0 2px; color: var(--muted); }
.pager-meta { margin-left: auto; color: var(--muted); font-size: 13px; }

@media (max-width: 800px) {
  .pager { gap: 8px; }
  .pager-meta { width: 100%; margin-left: 0; }
}

/* 参考网站表里的「玩家可见 / 仅后台」角标。
   ⚠️ 这不是装饰：玩家可见的来源必须同时写进小程序免责声明，
   仅后台的绝不能出现在玩家页面上（DD373 是真钱交易平台）。 */
.ref-scope { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.ref-scope.is-player { background: #e6f4ea; color: var(--success); }
.ref-scope.is-admin { background: #fdf0e3; color: var(--warning); }
.panel-lead { margin: -4px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* 装备资料的第三态：参考值（引自第三方，非我们核验）。
   ⚠️ 颜色要和「已核验」明显不同 —— 两者在同一列里，看错一眼就等于
   把别人标注存疑的数值当成我们确认过的事实。 */
.tag-ref { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #eef2f7; color: #4a6285; font-size: 12px; font-weight: 700; }
.ref-spec { color: #4a6285; }
