/* 研写 PaperYan — 设计系统
   令牌严格取自《网站开发规格书》第 4 章，不在此文件外硬编码色值 */

:root {
  --brand-700: #1F3A5F;
  --brand-600: #2B4C77;
  --brand-50: #F2F5F9;
  --text-900: #1A1A1A;
  --text-600: #4B5563;
  --text-400: #9CA3AF;
  --bg: #FFFFFF;
  --bg-sub: #FAFAFA;
  --line: #E5E7EB;
  --warn: #B45309;
  --error: #B91C1C;
  --success: #15803D;

  /* 选中文字：深一些的品牌蓝底，配深色字保证对比度 */
  --selection-bg: #A9C6E8;
  --selection-fg: #10243D;
  --selection-bg-dark: #0B2039;
  --selection-fg-dark: #FFFFFF;

  --ff-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --ff-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;

  --fs-12: 12px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-28: 28px;

  --lh-tight: 1.35;
  --lh-normal: 1.6;
  --lh-loose: 1.75;

  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-48: 48px;
  --sp-64: 64px;
  --sp-96: 96px;

  --radius: 4px;
  --container: 1120px;
  --reading: 720px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-fade: 120ms;
  --t-expand: 200ms;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-900);
  font-family: var(--ff-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: var(--lh-tight); }
p { margin: 0; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-600); }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand-700); outline-offset: 2px; }

/* ---------- 文字选中：全站可见的高亮 ----------
   旧值 #F2F5F9 与白底几乎同色，选中后看不出范围也影响辨认 */
::selection { background: var(--selection-bg); color: var(--selection-fg); }
::-moz-selection { background: var(--selection-bg); color: var(--selection-fg); }
/* 深色底（主按钮等）上反白，避免深字压在深底上看不清 */
.btn-primary::selection,
.btn-primary ::selection { background: var(--selection-bg-dark); color: var(--selection-fg-dark); }
.btn-primary::-moz-selection,
.btn-primary ::-moz-selection { background: var(--selection-bg-dark); color: var(--selection-fg-dark); }
/* 输入框 / 编辑器区域同样生效（部分浏览器需显式声明） */
input::selection, textarea::selection,
.editor::selection, .editor ::selection,
[contenteditable]::selection, [contenteditable] ::selection { background: var(--selection-bg); color: var(--selection-fg); }

.num { font-variant-numeric: tabular-nums; }

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.section-sub { background: var(--bg-sub); }
.reading { max-width: var(--reading); margin: 0 auto; }

.row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

.stack-4 > * + * { margin-top: var(--sp-4); }
.stack-8 > * + * { margin-top: var(--sp-8); }
.stack-12 > * + * { margin-top: var(--sp-12); }
.stack-16 > * + * { margin-top: var(--sp-16); }
.stack-24 > * + * { margin-top: var(--sp-24); }
.stack-32 > * + * { margin-top: var(--sp-32); }

.muted { color: var(--text-600); }
.hint { color: var(--text-400); }
.fs-12 { font-size: var(--fs-12); }
.fs-14 { font-size: var(--fs-14); }
.fs-20 { font-size: var(--fs-20); }
.fs-28 { font-size: var(--fs-28); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-12); }

.h1 { font-size: var(--fs-28); letter-spacing: -0.01em; }
.h2 { font-size: var(--fs-20); }
.h3 { font-size: var(--fs-16); }
.lead { font-size: var(--fs-16); color: var(--text-600); line-height: var(--lh-normal); }
.eyebrow { font-size: var(--fs-12); color: var(--text-400); letter-spacing: 0.08em; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-32);
  height: 64px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: var(--sp-8);
  font-size: var(--fs-16);
  font-weight: 600;
  color: var(--text-900);
  flex: none;
}
.brand:hover { color: var(--text-900); }
.brand span { font-size: var(--fs-12); font-weight: 400; color: var(--text-400); }
.nav { display: flex; align-items: center; gap: var(--sp-24); flex: 1; }
.nav a {
  font-size: var(--fs-14);
  color: var(--text-600);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color var(--t-fade) var(--ease);
}
.nav a:hover { color: var(--text-900); }
.nav a[aria-current="page"] { color: var(--text-900); font-weight: 600; border-bottom-color: var(--brand-700); }
.header-actions { display: flex; align-items: center; gap: var(--sp-12); flex: none; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 1px;
  background: var(--text-900);
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1px;
  background: var(--text-900);
}
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(17, 24, 39, 0.4);
  display: none;
}
.drawer[data-open="true"] { display: block; }
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 86vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--line);
  padding: var(--sp-24);
  overflow-y: auto;
}
.drawer-panel a {
  display: block;
  padding: var(--sp-12) 0;
  font-size: var(--fs-16);
  color: var(--text-900);
  border-bottom: 1px solid var(--line);
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-16); }
.drawer-close {
  width: 44px; height: 44px;
  background: none; border: 0; cursor: pointer;
  font-size: var(--fs-20); line-height: 1; color: var(--text-600);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  height: 40px;
  padding: 0 16px;
  font-size: var(--fs-14);
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--t-fade) var(--ease), border-color var(--t-fade) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-700); color: #fff; }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-secondary { background: var(--bg); border-color: var(--line); color: var(--text-900); }
.btn-secondary:hover { border-color: var(--text-400); color: var(--text-900); }
.btn-text { background: none; color: var(--brand-700); padding: 0 8px; }
.btn-text:hover { color: var(--brand-600); }
.btn[disabled],
.btn[aria-disabled="true"] {
  background: var(--bg-sub);
  color: var(--text-400);
  border-color: var(--line);
  cursor: not-allowed;
  transform: none;
}
.btn-lg { height: 44px; padding: 0 24px; font-size: var(--fs-16); }
.btn-block { width: 100%; }
.btn-sm { height: 32px; font-size: var(--fs-12); padding: 0 12px; }

/* ---------- 表单 ---------- */
.field { display: block; }
.label {
  display: block;
  font-size: var(--fs-14);
  color: var(--text-900);
  margin-bottom: var(--sp-8);
}
.input,
.select,
.textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-family: var(--ff-sans);
  font-size: var(--fs-14);
  color: var(--text-900);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--t-fade) var(--ease);
  appearance: none;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: var(--lh-normal); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-400); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-700);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-50);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--error); }
.select {
  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 1l5 5 5-5' fill='none' stroke='%234B5563' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.error-text { font-size: var(--fs-12); color: var(--text-600); margin-top: var(--sp-8); }
.error-text[data-tone="error"] { color: var(--error); }
.field-row { display: flex; gap: var(--sp-16); }
.field-row > * { flex: 1; min-width: 0; }
.checkbox { display: inline-flex; align-items: flex-start; gap: var(--sp-8); cursor: pointer; font-size: var(--fs-14); }
.checkbox input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--brand-700); flex: none; }

/* ---------- 卡片与列表 ---------- */
.card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--line);
}
.card-plain { background: var(--bg-sub); border-color: transparent; }
.card-hover { transition: border-color var(--t-fade) var(--ease); }
.card-hover:hover { border-color: var(--text-400); }
.card-title { font-size: var(--fs-16); font-weight: 600; margin-bottom: var(--sp-8); }
.card-desc { font-size: var(--fs-14); color: var(--text-600); line-height: var(--lh-normal); }

.entry {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-16);
  padding: var(--sp-24) 0;
  border-top: 1px solid var(--line);
}
.entry:first-child { border-top: 0; }
.entry-icon { width: 24px; height: 24px; flex: none; color: var(--brand-700); }
.entry-body { flex: 1; min-width: 0; }
.entry-more { flex: none; align-self: center; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  font-size: var(--fs-12);
  color: var(--text-600);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  white-space: nowrap;
}
.tag-brand { color: var(--brand-700); border-color: var(--brand-700); }
.tag-warn { color: var(--warn); border-color: var(--warn); }
.tag-error { color: var(--error); border-color: var(--error); }
.tag-success { color: var(--success); border-color: var(--success); }
.tag-row { display: flex; flex-wrap: wrap; gap: var(--sp-8); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.table th,
.table td { padding: 12px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 600; font-size: var(--fs-12); color: var(--text-600); background: var(--bg-sub); }
.table td.num, .table th.num { text-align: right; }
.table tr:last-child td { border-bottom: 0; }

/* ---------- 进度 ---------- */
.progress { height: 4px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--brand-700); transition: width var(--t-expand) var(--ease); }

/* ---------- 空状态 ---------- */
.empty { padding: var(--sp-48) var(--sp-24); text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty p { font-size: var(--fs-14); color: var(--text-600); margin-bottom: var(--sp-16); }

/* ---------- 上传区 ---------- */
.uploader {
  display: block;
  width: 100%;
  padding: var(--sp-48) var(--sp-24);
  text-align: center;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--t-fade) var(--ease), background-color var(--t-fade) var(--ease);
}
.uploader:hover { border-color: var(--text-400); }
.uploader[data-drag="true"] { border-color: var(--brand-700); background: var(--brand-50); }
.uploader-title { font-size: var(--fs-16); margin-bottom: var(--sp-8); }
.uploader-sub { font-size: var(--fs-12); color: var(--text-400); }
.file-row {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-12) var(--sp-16);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-14);
  margin-top: var(--sp-16);
}

/* ---------- 步骤条 ---------- */
.steps { display: flex; flex-wrap: wrap; gap: var(--sp-8) var(--sp-24); font-size: var(--fs-14); color: var(--text-400); }
.steps li { display: flex; align-items: center; gap: var(--sp-8); }
.steps li[data-state="current"] { color: var(--brand-700); font-weight: 600; }
.steps li[data-state="done"] { color: var(--text-900); }
.steps .step-idx { font-variant-numeric: tabular-nums; }

/* ---------- Toast / Modal ---------- */
.toast-wrap {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  max-width: 360px;
  padding: 12px 16px;
  font-size: var(--fs-14);
  background: var(--text-900);
  color: #fff;
  border-radius: var(--radius);
  pointer-events: auto;
  animation: fade-in var(--t-fade) var(--ease);
}
.toast[data-tone="error"] { background: var(--error); }
.toast button { background: none; border: 0; color: inherit; cursor: pointer; opacity: 0.7; padding: 0 4px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  padding: 24px;
  background: rgba(17, 24, 39, 0.4);
  overflow-y: auto;
}
.modal[data-open="true"] { display: flex; align-items: flex-start; justify-content: center; }
.modal-panel {
  width: 100%;
  max-width: 480px;
  margin: auto;
  padding: 24px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  animation: fade-in var(--t-fade) var(--ease);
}
.modal-wide { max-width: 640px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-16); margin-bottom: var(--sp-16); }
.modal-close { background: none; border: 0; font-size: var(--fs-20); line-height: 1; cursor: pointer; color: var(--text-600); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--sp-12); margin-top: var(--sp-24); }

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

/* ---------- 首页 ---------- */
.hero { padding: 80px 0 88px; }
.hero-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: var(--sp-48); align-items: center; }
.hero h1 { font-size: clamp(28px, 3.1vw, 40px); line-height: 1.22; max-width: 620px; }
.hero .lead { margin-top: var(--sp-16); max-width: 560px; }
.hero-actions { display: flex; gap: var(--sp-12); margin-top: var(--sp-32); flex-wrap: wrap; }
.hero-trust { margin-top: var(--sp-24); font-size: var(--fs-12); color: var(--text-400); }

/* 首屏产品示意（纯 CSS 界面预览，不使用图片） */
.hero-visual { position: relative; }
.mock-window {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 48px -20px rgba(31, 58, 95, .28), 0 2px 6px rgba(31, 58, 95, .06);
  overflow: hidden;
}
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-sub); }
.mock-bar i { width: 8px; height: 8px; border-radius: 50%; background: #D8DCE3; }
.mock-bar em { font-style: normal; font-size: var(--fs-12); color: var(--text-400); margin-left: var(--sp-12); }
.mock-body { display: grid; grid-template-columns: 118px 1fr; min-height: 244px; }
.mock-side { border-right: 1px solid var(--line); padding: 12px 10px; background: #FCFCFD; }
.mock-side i { display: block; font-style: normal; font-size: 11px; color: var(--text-400); padding: 5px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-side i.on { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.mock-side i.sub { padding-left: 14px; }
.mock-main { padding: 18px 20px; }
.mock-h { font-size: 13px; font-weight: 700; color: var(--text-900); margin-bottom: 10px; }
.mock-line { height: 7px; border-radius: 4px; background: #EDEFF3; margin-bottom: 8px; }
.mock-line.w95 { width: 95%; } .mock-line.w88 { width: 88%; } .mock-line.w72 { width: 72%; } .mock-line.w60 { width: 60%; }
.mock-formula {
  margin: 14px 0; padding: 10px 12px; border-radius: 6px; background: var(--brand-50);
  font-family: var(--ff-serif); font-size: 12px; color: var(--brand-700); text-align: center;
}
.mock-chips { display: flex; gap: 6px; margin-top: 12px; }
.mock-chips span { font-size: 10px; color: var(--text-600); border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px; background: var(--bg); }
.mock-chips span.on { color: var(--brand-700); border-color: var(--brand-600); background: var(--brand-50); }

.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-16); }
.flow-item {
  padding: var(--sp-24);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color var(--t-fade) var(--ease), box-shadow var(--t-fade) var(--ease);
}
.flow-item:hover { border-color: #C9D3E0; box-shadow: 0 8px 20px -14px rgba(31, 58, 95, .35); }
.flow-idx {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-700); color: #fff;
  font-size: var(--fs-12); font-weight: 600; font-variant-numeric: tabular-nums;
  margin-bottom: var(--sp-16);
}
.flow-item h3 { font-size: var(--fs-16); margin-bottom: var(--sp-8); }
.flow-item p { font-size: var(--fs-14); color: var(--text-600); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.feature {
  display: block;
  padding: var(--sp-24);
  background: var(--bg);
  transition: background-color var(--t-fade) var(--ease), transform var(--t-fade) var(--ease);
}
.feature:hover { background: var(--brand-50); }
.feature:hover .feature-ic { background: var(--brand-700); color: #fff; }
.feature-ic {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand-700);
  margin-bottom: var(--sp-16);
  transition: background-color var(--t-fade) var(--ease), color var(--t-fade) var(--ease);
}
.feature h3 { font-size: var(--fs-16); margin-bottom: var(--sp-4); color: var(--text-900); }
.feature p { font-size: var(--fs-14); color: var(--text-600); }

.school-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-12) var(--sp-24); margin-top: var(--sp-24); }
.school-list a { font-size: var(--fs-14); color: var(--text-600); padding: 6px 0; border-bottom: 1px solid transparent; }
.school-list a:hover { color: var(--brand-700); border-bottom-color: var(--line); }

/* ---------- 报告解读 ---------- */
.overview { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); }
.overview-cell { padding: var(--sp-24); border-left: 1px solid var(--line); }
.overview-cell:first-child { border-left: 0; }
.overview-num { font-size: var(--fs-28); font-weight: 600; line-height: var(--lh-tight); font-variant-numeric: tabular-nums; }
.overview-label { font-size: var(--fs-12); color: var(--text-600); margin-top: var(--sp-4); }

.toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-12); align-items: center; }
.toolbar .select { width: auto; min-width: 140px; }

.seg {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: var(--sp-16);
  padding: var(--sp-16);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color var(--t-fade) var(--ease);
}
.seg:hover { background: var(--bg-sub); }
.seg[aria-expanded="true"] { background: var(--brand-50); }
.seg-rate { font-size: var(--fs-16); font-weight: 600; font-variant-numeric: tabular-nums; }
.seg-rate[data-level="warn"] { color: var(--warn); }
.seg-rate[data-level="error"] { color: var(--error); }
.seg-main { min-width: 0; }
.seg-text {
  font-family: var(--ff-serif);
  font-size: var(--fs-14);
  line-height: var(--lh-loose);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.seg-meta { font-size: var(--fs-12); color: var(--text-400); margin-top: var(--sp-8); }
.seg-side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-8); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.compare > div { padding: var(--sp-16) 0 0; }
.compare > div + div { border-left: 1px solid var(--line); padding-left: var(--sp-16); }
.compare-label { font-size: var(--fs-12); color: var(--text-400); margin-bottom: var(--sp-8); }
.compare-body { font-family: var(--ff-serif); font-size: var(--fs-14); line-height: var(--lh-loose); }
.compare-body mark { background: var(--brand-50); color: inherit; }
.seg-detail { padding: 0 var(--sp-16) var(--sp-16); background: var(--brand-50); border-bottom: 1px solid var(--line); }
.seg-actions { display: flex; flex-wrap: wrap; gap: var(--sp-8); margin-top: var(--sp-16); }

.seg.locked { filter: blur(4px); pointer-events: none; user-select: none; }
.paywall {
  margin-top: var(--sp-16);
  padding: var(--sp-32) var(--sp-24);
  text-align: center;
  border: 1px solid var(--brand-700);
  border-radius: var(--radius);
  background: var(--bg);
}

/* ---------- 工作台 ---------- */
.workbench {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  border-top: 1px solid var(--line);
  height: calc(100vh - 64px);
  min-height: 560px;
}
.wb-pane { min-width: 0; }
.wb-left { border-right: 1px solid var(--line); padding: var(--sp-16); overflow-y: auto; }
.wb-right { border-left: 1px solid var(--line); padding: var(--sp-16); overflow-y: auto; }
.wb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  padding-bottom: var(--sp-12);
  margin-bottom: var(--sp-12);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-12);
  color: var(--text-400);
}
.tree { font-size: var(--fs-14); }
.tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  width: 100%;
  padding: 8px;
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-600);
  line-height: var(--lh-tight);
}
.tree-item:hover { background: var(--bg-sub); color: var(--text-900); }
.tree-item[aria-current="true"] { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.tree-item[data-level="1"] { padding-left: 8px; }
.tree-item[data-level="2"] { padding-left: 24px; }
.tree-item[data-level="3"] { padding-left: 40px; font-size: var(--fs-12); }
.tree-count { font-size: var(--fs-12); color: var(--text-400); font-variant-numeric: tabular-nums; flex: none; }

.wb-center { display: flex; flex-direction: column; overflow: hidden; }
.wb-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-12) var(--sp-24);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.wb-toolbar .sep { width: 1px; height: 20px; background: var(--line); }
.wb-toolbar .spacer { flex: 1; }
.wb-status { font-size: var(--fs-12); color: var(--text-400); }
.editor-wrap { flex: 1; overflow-y: auto; padding: var(--sp-48) 0; }
.editor {
  max-width: var(--reading);
  margin: 0 auto;
  padding: 0 24px;
  font-family: var(--ff-serif);
  font-size: var(--fs-16);
  line-height: var(--lh-loose);
  color: var(--text-900);
  outline: none;
  min-height: 320px;
}
.editor h1 { font-family: var(--ff-sans); font-size: var(--fs-28); margin-bottom: var(--sp-24); }
.editor h2 { font-family: var(--ff-sans); font-size: var(--fs-20); margin: var(--sp-32) 0 var(--sp-16); }
.editor h3 { font-family: var(--ff-sans); font-size: var(--fs-16); margin: var(--sp-24) 0 var(--sp-12); }
.editor p { margin: 0 0 var(--sp-16); }
.editor blockquote {
  margin: 0 0 var(--sp-16);
  padding: 8px 0 8px 16px;
  border-left: 2px solid var(--brand-700);
  color: var(--text-600);
  font-size: var(--fs-14);
}
.editor p:empty::before { content: ""; display: inline-block; }
.caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--brand-700);
  vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.lit-item { padding: var(--sp-12) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-14); }
.lit-item:last-child { border-bottom: 0; }
.lit-title { color: var(--text-900); line-height: var(--lh-tight); }
.lit-meta { font-size: var(--fs-12); color: var(--text-400); margin-top: var(--sp-4); }

/* ---------- 定价 ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-24); align-items: stretch; }
.price-card {
  display: flex;
  flex-direction: column;
  padding: var(--sp-24);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.price-card[data-featured="true"] { border-color: var(--brand-700); }
.price-name { font-size: var(--fs-14); color: var(--text-600); }
.price-amount { font-size: 40px; font-weight: 600; line-height: 1.1; margin: var(--sp-8) 0 var(--sp-4); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.price-amount span { font-size: var(--fs-14); font-weight: 400; color: var(--text-600); letter-spacing: 0; }
.price-list { margin: var(--sp-24) 0; flex: 1; font-size: var(--fs-14); color: var(--text-600); }
.price-list li { padding: 6px 0 6px 16px; position: relative; }
.price-list li::before { content: "·"; position: absolute; left: 4px; }

/* ---------- 模板库 ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-16); }
.tpl-card { display: block; padding: var(--sp-24); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color var(--t-fade) var(--ease); }
.tpl-card:hover { border-color: var(--brand-700); }
.tpl-name { font-size: var(--fs-16); font-weight: 600; color: var(--text-900); }

/* ---------- 手风琴 ---------- */
.acc-item { border-bottom: 1px solid var(--line); }
.acc-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-16);
  width: 100%;
  min-height: 48px;
  padding: var(--sp-16) 0;
  text-align: left;
  background: none;
  border: 0;
  font-size: var(--fs-14);
  font-weight: 600;
  cursor: pointer;
  color: var(--text-900);
}
.acc-btn::after { content: "+"; font-weight: 400; color: var(--text-400); flex: none; transition: color var(--t-fade) var(--ease); }
.acc-btn[aria-expanded="true"] { color: var(--brand-700); }
.acc-btn[aria-expanded="true"]::after { content: "−"; color: var(--brand-700); }
.acc-body {
  max-height: 0; opacity: 0; overflow: hidden;
  padding: 0; font-size: var(--fs-14); color: var(--text-600); line-height: var(--lh-normal);
  transition: max-height .24s var(--ease), opacity .18s var(--ease), padding .24s var(--ease);
}
.acc-item[data-open="true"] .acc-body { max-height: 720px; opacity: 1; padding: 0 0 var(--sp-16); }

/* ---------- 侧栏（个人中心） ---------- */
.side-layout { display: grid; grid-template-columns: 200px 1fr; gap: var(--sp-48); }
.side-menu { display: flex; flex-direction: column; gap: 2px; }
.side-menu button {
  text-align: left;
  padding: 10px 12px;
  font-size: var(--fs-14);
  color: var(--text-600);
  background: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.side-menu button:hover { background: var(--bg-sub); }
.side-menu button[aria-current="true"] { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: var(--sp-48) 0 var(--sp-32); background: var(--bg); }
.footer-grid { display: flex; justify-content: space-between; gap: var(--sp-32); flex-wrap: wrap; }
.footer-links { display: flex; gap: var(--sp-24); flex-wrap: wrap; font-size: var(--fs-14); }
.footer-links a { color: var(--text-600); }
.footer-note { font-size: 13px; color: var(--text-600); line-height: 1.7; margin-top: var(--sp-32); padding-top: var(--sp-24); border-top: 1px solid var(--line); }

/* ---------- 移动底部行动条 ---------- */
.action-bar {
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 30;
  padding: 12px 16px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

/* ---------- 工具类 ---------- */
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-8 { gap: var(--sp-8); }
.gap-12 { gap: var(--sp-12); }
.gap-16 { gap: var(--sp-16); }
.gap-24 { gap: var(--sp-24); }
.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: var(--sp-8); }
.mt-16 { margin-top: var(--sp-16); }
.mt-24 { margin-top: var(--sp-24); }
.mt-32 { margin-top: var(--sp-32); }
.mt-48 { margin-top: var(--sp-48); }
.mb-8 { margin-bottom: var(--sp-8); }
.mb-16 { margin-bottom: var(--sp-16); }
.mb-24 { margin-bottom: var(--sp-24); }
.mb-32 { margin-bottom: var(--sp-32); }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); border: 0; margin: var(--sp-24) 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 1023px) {
  .section { padding: 64px 0; }
  .hero { padding: 56px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-visual { display: none; }
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-actions .btn-text { display: none; }
  .row { gap: 16px; }
  .col-3, .col-4, .col-5 { grid-column: span 6; }
  .col-7, .col-8 { grid-column: span 12; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .tpl-grid { grid-template-columns: repeat(2, 1fr); }
  .school-list { grid-template-columns: repeat(3, 1fr); }
  .overview { grid-template-columns: repeat(2, 1fr); }
  .overview-cell:nth-child(3) { border-left: 0; }
  .overview-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
  .workbench { grid-template-columns: 1fr; }
  .wb-left, .wb-right { display: none; }
  .wb-left[data-open="true"], .wb-right[data-open="true"] {
    display: block;
    position: fixed;
    inset: 64px 0 0 0;
    z-index: 50;
    background: var(--bg);
    overflow-y: auto;
    padding: var(--sp-16);
  }
  .side-layout { grid-template-columns: 1fr; gap: var(--sp-24); }
  .side-menu { flex-direction: row; overflow-x: auto; gap: var(--sp-8); padding-bottom: var(--sp-8); }
  .side-menu button { white-space: nowrap; }
  .price-grid { grid-template-columns: 1fr; }
  .action-bar { display: block; }
}

@media (max-width: 639px) {
  .container { padding: 0 16px; }
  .header-actions .btn-secondary { display: none; }
  .section { padding: 48px 0; }
  .hero { padding: 48px 0; }
  .card { padding: 16px; }
  .flow { grid-template-columns: 1fr; gap: var(--sp-12); }
  .flow-item { padding: var(--sp-20); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .tpl-grid { grid-template-columns: 1fr; }
  .school-list { grid-template-columns: repeat(2, 1fr); }
  .overview { grid-template-columns: 1fr; }
  .overview-cell { border-left: 0; border-top: 1px solid var(--line); }
  .overview-cell:first-child { border-top: 0; }
  .seg { grid-template-columns: 48px 1fr; }
  .seg-side { grid-column: span 2; flex-direction: row; align-items: center; justify-content: flex-start; }
  .compare { grid-template-columns: 1fr; }
  .compare > div + div { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: var(--sp-16); margin-top: var(--sp-16); }
  .hero-actions .btn { width: 100%; }
  .btn { height: 44px; }
  .input, .select, .textarea { font-size: 16px; height: 44px; }
  .textarea { height: auto; }
  .price-list { margin: var(--sp-16) 0; }
  .col-3, .col-4, .col-5, .col-6 { grid-column: span 12; }
  .field-row { flex-direction: column; }
  .toast-wrap { left: 16px; right: 16px; bottom: 16px; }
  .table-cards thead { display: none; }
  .table-cards tr { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
  .table-cards td { display: flex; justify-content: space-between; gap: 16px; border: 0; padding: 4px 0; text-align: right; }
  .table-cards td::before { content: attr(data-label); color: var(--text-600); font-size: var(--fs-12); text-align: left; }
  .editor-wrap { padding: var(--sp-24) 0; }
  .editor { padding: 0 16px; }
}

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

/* ---------- 项目工作区 ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-16); }
.proj-card { position: relative; display: flex; flex-direction: column; gap: var(--sp-8); }
.proj-title { margin: 0; }
.proj-title a { color: var(--text-900); }
.proj-title a:hover { color: var(--brand-700); }
.proj-card .tag { position: absolute; top: var(--sp-12); right: var(--sp-12); }
.proj-actions { margin-top: auto; display: flex; align-items: center; gap: var(--sp-8); padding-top: var(--sp-8); }
@media (max-width: 1023px) { .proj-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 639px) { .proj-grid { grid-template-columns: 1fr; } }

.proj-bar { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-sub); }
.proj-bar-inner { display: flex; align-items: center; gap: var(--sp-12); padding-top: var(--sp-8); padding-bottom: var(--sp-8); }
.mod-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.mod-tabs::-webkit-scrollbar { display: none; }
.mod-tabs button {
  flex: none; padding: 8px 12px; border: 0; background: none; cursor: pointer;
  font-size: var(--fs-14); color: var(--text-600); border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 2px solid transparent;
}
.mod-tabs button:hover { color: var(--text-900); }
.mod-tabs button.on { color: var(--brand-700); font-weight: 600; border-bottom-color: var(--brand-700); }

.ol-list { font-size: var(--fs-14); }
.ol-row { padding: 6px 0; color: var(--text-600); }
.ol-l1 { font-weight: 600; color: var(--text-900); padding-left: 0; }
.ol-l2 { padding-left: 24px; }
.ol-l3 { padding-left: 48px; color: var(--text-600); }

/* 工作台 */
.wb-wrap { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 200px); }
.wb-side { border-right: 1px solid var(--line); padding: var(--sp-12); }
.wb-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; }
.ch-tree { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.ch-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 8px; text-align: left; background: none; border: 0;
  border-radius: var(--radius); cursor: pointer; color: var(--text-600);
  font-size: var(--fs-14); line-height: var(--lh-tight);
}
.ch-item:hover { background: var(--bg-sub); color: var(--text-900); }
.ch-item.on { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.ch-item.ch-l1 { font-size: 15px; font-weight: 700; color: var(--text-900); }
.ch-item.ch-l2 { padding-left: 20px; font-size: var(--fs-14); }
.ch-item.ch-l3 { padding-left: 34px; font-size: 12.5px; color: var(--text-600); }
.ch-item.ch-l3.on { color: var(--brand-700); font-weight: 600; }
.ch-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-w { flex: none; }
.wb-main { display: flex; flex-direction: column; min-width: 0; }
.wb-toolbar {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  padding: 6px 12px; border-bottom: 1px solid var(--line);
}
.wb-toolbar button {
  padding: 6px 10px; border: 0; background: none; cursor: pointer;
  font-size: var(--fs-14); color: var(--text-600); border-radius: var(--radius);
}
.wb-toolbar button:hover { background: var(--bg-sub); color: var(--text-900); }
.wb-toolbar .tb-primary { color: var(--brand-700); font-weight: 600; }
.wb-toolbar .tb-action {
  color: var(--brand-700); font-weight: 600;
  background: var(--brand-50); border: 1px solid rgba(31, 58, 95, 0.25);
  margin-left: 4px;
}
.wb-toolbar .tb-action:hover { background: rgba(31, 58, 95, 0.14); color: var(--brand-700); }
.tb-sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.wb-editor {
  flex: 1; overflow-y: auto; outline: none; min-height: 420px;
  max-width: var(--reading); width: 100%; margin: 0 auto; padding: var(--sp-32) 24px;
  font-family: var(--ff-serif); font-size: var(--fs-16); line-height: var(--lh-loose); color: var(--text-900);
}
.wb-editor:focus { outline: none; }
.wb-editor p { margin: 0 0 var(--sp-16); }
.wb-editor h2 { font-family: var(--ff-sans); font-size: var(--fs-20); margin: var(--sp-24) 0 var(--sp-12); }
.wb-editor h3 { font-family: var(--ff-sans); font-size: var(--fs-16); margin: var(--sp-16) 0 var(--sp-8); }
.wb-editor img, .py-img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.wb-editor table, .py-table { border-collapse: collapse; width: 100%; margin: var(--sp-16) 0; font-size: var(--fs-14); }
.wb-editor th, .wb-editor td, .py-table th, .py-table td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.wb-editor th { background: var(--bg-sub); }
.formula { display: inline-block; padding: 0 4px; }
/* 公式编号：右对齐贴在本行右侧 */
.wb-editor p.formula-line { position: relative; padding-right: 64px; text-align: center; }
.formula-no {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-family: "Times New Roman", Times, serif; font-size: 14px;
  color: var(--text-600); user-select: none; pointer-events: none;
}
/* 每节生成设置：字数 + 图/表/公式 */
.wb-secbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg-sub);
}
.sec-chk {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  font-size: var(--fs-12); color: var(--text-600); user-select: none;
}
.sec-chk input { margin: 0; cursor: pointer; accent-color: var(--brand-600, #2F6BFF); }
.wb-secbar .input { background: #fff; }
.wb-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-8) var(--sp-16); border-top: 1px solid var(--line);
}
@media (max-width: 767px) { .wb-wrap { grid-template-columns: 1fr; } .wb-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 200px; overflow-y: auto; } }

/* 基础资料 */
.sub-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.sub-tabs button { padding: 8px 14px; border: 0; background: none; cursor: pointer; font-size: var(--fs-14); color: var(--text-600); border-bottom: 2px solid transparent; }
.sub-tabs button.on { color: var(--brand-700); font-weight: 600; border-bottom-color: var(--brand-700); }
.ref-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-14); }
.ref-item:last-child { border-bottom: 0; }
.ref-no { color: var(--text-400); flex: none; font-variant-numeric: tabular-nums; }
.mat-item { padding: var(--sp-12) 0; border-bottom: 1px solid var(--line); }
.mat-item:last-child { border-bottom: 0; }
.mat-head { display: flex; align-items: center; gap: var(--sp-12); margin-bottom: var(--sp-8); }
.mat-head strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 模块文档区 */
.mod-doc { font-size: var(--fs-14); line-height: var(--lh-loose); color: var(--text-900); }
.mod-doc p { margin: 0 0 var(--sp-12); white-space: pre-wrap; }
.rd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-16); }
@media (max-width: 767px) { .rd-grid { grid-template-columns: 1fr; } }
.rd-box { max-height: 360px; overflow-y: auto; padding: var(--sp-12); background: var(--bg-sub); border-radius: var(--radius); }

/* 进度条 */
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--brand-700); transition: width .25s var(--ease); }

/* PPT */
.ppt-list { display: flex; flex-direction: column; gap: var(--sp-12); }
.ppt-slide { padding: var(--sp-16); border: 1px solid var(--line); border-radius: var(--radius); }

/* 公式预览 */
.math-preview { padding: var(--sp-16); background: var(--bg-sub); border-radius: var(--radius); min-height: 48px; overflow-x: auto; }
.math-preview math { font-size: 20px; }
.mod-doc math, .wb-editor math { font-size: 18px; }

/* ---------- 登录/注册 ---------- */
.auth-card { max-width: 420px; margin: 0 auto; padding: var(--sp-32); box-shadow: 0 16px 40px -24px rgba(31, 58, 95, .30); }
.auth-shell { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56vh; }
.auth-foot { margin-top: var(--sp-24); font-size: var(--fs-12); color: var(--text-400); text-align: center; }
.auth-foot a { color: var(--brand-700); }
.auth-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.auth-tabs button { padding: 10px 18px; border: 0; background: none; cursor: pointer; font-size: var(--fs-14); color: var(--text-600); border-bottom: 2px solid transparent; }
.auth-tabs button.on { color: var(--brand-700); font-weight: 600; border-bottom-color: var(--brand-700); }
.header-user { font-size: var(--fs-14); color: var(--text-900); font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-link { display: block; width: 100%; text-align: left; padding: 10px 0; border: 0; background: none; cursor: pointer; font-size: var(--fs-16); color: var(--text-900); }
@media (max-width: 639px) { .header-user { display: none; } }

/* ---------- 自动修改 / 章节删除 ---------- */
.ch-x {
  flex: none; width: 18px; height: 18px; line-height: 16px; text-align: center;
  border-radius: 4px; color: var(--text-400); font-size: 14px; cursor: pointer;
  visibility: hidden;
}
.ch-item:hover .ch-x { visibility: visible; }
.ch-x:hover { background: var(--bg-sub); color: #b42318; }
.revise-bar {
  display: flex; gap: 8px; align-items: flex-end;
  padding: var(--sp-8) var(--sp-12); border-bottom: 1px solid var(--line); background: var(--bg-sub);
}
.revise-bar .textarea { flex: 1; }
.revise-bar .btn { flex: none; }
.revise-bar[hidden] { display: none; }
/* 带 display 属性的组件需显式声明 [hidden] 生效（否则 flex 会覆盖 UA 样式） */
.auth-tabs[hidden] { display: none; }

/* ---------- 充值中心 / 字符余额 ---------- */
.header-chars {
  font-size: var(--fs-14); font-weight: 600; color: var(--brand-700);
  background: var(--brand-50); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 4px 10px; white-space: nowrap;
}
.header-chars:hover { border-color: var(--brand-600); }
.drawer-chars {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: var(--sp-16); padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--brand-50);
  font-size: var(--fs-14); color: var(--text-600);
}
.drawer-chars b { color: var(--brand-700); font-weight: 600; }
@media (max-width: 639px) { .header-chars { display: none; } }

.balance-panel {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-24);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--brand-50); padding: var(--sp-24);
}
.balance-main .chars-big { font-size: 40px; font-weight: 700; color: var(--brand-700); line-height: var(--lh-tight); margin-top: 4px; }
.balance-side { display: flex; gap: var(--sp-32); text-align: right; }
.balance-side strong { font-size: var(--fs-20); }
@media (max-width: 639px) {
  .balance-panel { flex-direction: column; align-items: flex-start; }
  .balance-side { text-align: left; }
}

.pkg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-16); }
@media (max-width: 899px) { .pkg-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479px) { .pkg-grid { grid-template-columns: 1fr; } }
.pkg-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--sp-24); background: var(--bg);
  display: flex; flex-direction: column; gap: var(--sp-8);
}
.pkg-name { font-weight: 600; color: var(--text-900); }
.pkg-price { font-size: var(--fs-28); font-weight: 700; color: var(--brand-700); }
.pkg-price span { font-size: var(--fs-14); font-weight: 400; color: var(--text-600); }
.pkg-chars { font-size: var(--fs-14); color: var(--text-600); }
.pkg-card .btn { margin-top: auto; }

.redeem-row { display: flex; gap: var(--sp-8); max-width: 560px; }
.redeem-row .input { flex: 1; }
.redeem-row .btn { flex: none; }
@media (max-width: 479px) { .redeem-row { flex-direction: column; } }

.status-pill {
  display: inline-block; font-size: var(--fs-12); font-weight: 600;
  border-radius: var(--radius); padding: 2px 8px;
}
.status-pill[data-st="paid"], .status-pill[data-st="unused"] { background: #ECFDF3; color: var(--success); }
.status-pill[data-st="pending"], .status-pill[data-st="used"] { background: #FFF7ED; color: var(--warn); }

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

/* ---------- 管理后台 ---------- */
.admin-panel { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-24); }
@media (max-width: 899px) { .admin-panel { grid-template-columns: 1fr; } }
.admin-panel-block { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-24); background: var(--bg); }
.admin-panel-title { font-size: var(--fs-16); font-weight: 600; margin-bottom: var(--sp-8); }
.checkbox-row { display: flex; align-items: center; gap: var(--sp-8); font-size: var(--fs-14); color: var(--text-600); }
.checkbox-row input { width: 16px; height: 16px; }

/* 管理后台：区块标题与危险操作 */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-16); margin-bottom: var(--sp-16); }
.admin-head .h2 { margin-bottom: 0; }
.btn-danger { color: var(--error); border-color: transparent; }
.btn-danger:hover { background: #FEF2F2; border-color: var(--error); }

/* 后台设置面板内的分隔线 */
.admin-divider { height: 1px; background: var(--line); margin: var(--sp-24) 0; }
