/* ==========================================================================
   Aurora · 墨黑与香槟金（共享设计令牌）
   全站颜色、字体、缓动、圆角只在这里定义一次；页面内只写组件样式。
   换肤 = 覆写一个 [data-theme] 块，任何页面都不用改。
   ========================================================================== */
:root {
  /* ---- 00 · 底色与层 ---- */
  --bg: #070510;
  --bg-2: #0b0817;
  --surface: #100c1b;
  --surface-2: #16111f;
  --surface-3: #1d1728;
  --ink: #050308;

  /* ---- 01 · 描边（香槟金发丝线，比纯白描边更贵气） ---- */
  --line: rgba(216, 196, 143, 0.15);
  --line-strong: rgba(216, 196, 143, 0.32);
  --hair: rgba(216, 196, 143, 0.09);

  /* ---- 02 · 强调色 ---- */
  --primary: #d8c48f;
  --primary-2: #ecdcb4;
  --primary-dim: #8a7340;
  --gold: #f2e3ba;
  --gold-deep: #a88b4c;
  --gilt: linear-gradient(104deg, #f6e7be 0%, #d8c48f 46%, #a88b4c 100%);

  /* ---- 03 · 文字 ---- */
  --text: #ede9e1;
  --text-2: #b2ada3;
  --text-3: #847e73;

  /* ---- 04 · 语义色（低饱和，和金色同处一个明度带） ---- */
  --red: #e0918d;
  --green: #7fc09b;
  --warn: #d8b06a;

  /* ---- 05 · 形状与投影 ---- */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8);
  --glow: 0 0 0 1px rgba(216, 196, 143, 0.16), 0 18px 44px -26px rgba(216, 196, 143, 0.4);

  /* ---- 06 · 字体：标题衬线，正文无衬线 ---- */
  --f-disp: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font: "PingFang SC", "Microsoft YaHei", "微软雅黑", "Hiragino Sans GB", system-ui, sans-serif;
  --f-lat: "Jost", "Helvetica Neue", Arial, sans-serif;

  /* ---- 07 · 缓动（与参考设计一致） ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 墨黑底 + 极淡的金色光晕，像展厅里的顶灯，不抢内容 */
body {
  background-image:
    radial-gradient(1000px 560px at 50% -12%, rgba(216, 196, 143, 0.07), transparent 66%),
    radial-gradient(760px 460px at 100% 0%, rgba(140, 120, 220, 0.05), transparent 62%),
    linear-gradient(180deg, #08060f 0%, #070510 42%, #050308 100%);
  background-attachment: fixed;
  min-height: 100vh;
  transition: background-color 0.6s var(--ease), color 0.6s var(--ease);
}

/* 纸纹颗粒：让大面积纯黑不出现色带，也压掉屏幕的数码感 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.032;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--primary-2); text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
::selection { background: rgba(216, 196, 143, 0.32); color: #fff; }

:focus-visible { outline: 1px solid var(--primary); outline-offset: 3px; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(216, 196, 143, 0.2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(216, 196, 143, 0.34); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 文字 ---------- */
.h1 {
  font-family: var(--f-disp); font-size: 23px; font-weight: 400;
  letter-spacing: 0.14em; margin: 0; line-height: 1.35;
}
.h2 {
  font-family: var(--f-disp); font-size: 17px; font-weight: 400;
  letter-spacing: 0.1em; margin: 0;
}
/* 拉丁小标：全站统一的「章节感」来源 */
.eyebrow {
  font-family: var(--f-lat); font-size: 10px; font-weight: 400;
  letter-spacing: 0.36em; text-transform: uppercase;
  color: var(--primary); margin: 0;
}
/* 鎏金渐变大字：只给首屏与关键数字用，多了就廉价 */
.gilt {
  background: var(--gilt);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.disp { font-family: var(--f-disp); font-weight: 400; letter-spacing: 0.1em; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.mono { font-variant-numeric: tabular-nums; }
.gold { color: var(--gold); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* 发丝分隔线：色值统一由令牌控制，改色不用翻页面 */
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: linear-gradient(172deg, rgba(22, 18, 32, 0.94), rgba(9, 7, 15, 0.97));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  background: rgba(216, 196, 143, 0.08);
  border: 1px solid var(--line-strong);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s, opacity 0.2s;
  white-space: nowrap;
}
.btn:hover { background: rgba(216, 196, 143, 0.16); border-color: rgba(216, 196, 143, 0.46); }
.btn:active { transform: scale(0.985); }
.btn[disabled], .btn.is-disabled {
  opacity: 0.36; cursor: not-allowed; transform: none;
}
/* 主按钮：鎏金实底 + 墨黑字，是全站唯一的「实心」动作 */
.btn-primary {
  background: var(--gilt);
  border: 1px solid transparent;
  color: #14100a;
  font-weight: 700;
  box-shadow: 0 12px 30px -16px rgba(216, 196, 143, 0.85);
}
.btn-primary:hover { filter: brightness(1.06); background: var(--gilt); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); }
.btn-danger { background: rgba(224, 145, 141, 0.1); border-color: rgba(224, 145, 141, 0.3); color: #f0b4b0; }
.btn-danger:hover { background: rgba(224, 145, 141, 0.18); border-color: rgba(224, 145, 141, 0.45); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 999px; }
.btn-block { width: 100%; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(216, 196, 143, 0.1);
  color: var(--primary-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.gold { background: rgba(242, 227, 186, 0.1); color: var(--gold); border-color: rgba(242, 227, 186, 0.26); }
.tag.green { background: rgba(127, 192, 155, 0.1); color: var(--green); border-color: rgba(127, 192, 155, 0.26); }
.tag.warn { background: rgba(216, 176, 106, 0.1); color: var(--warn); border-color: rgba(216, 176, 106, 0.26); }
.tag.red { background: rgba(224, 145, 141, 0.1); color: var(--red); border-color: rgba(224, 145, 141, 0.26); }
.tag.gray { background: rgba(255, 255, 255, 0.04); color: var(--text-3); border-color: rgba(255, 255, 255, 0.07); }
.tag.dot::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.08em;
}
.input, select.input, textarea.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  background: rgba(6, 4, 10, 0.72);
  border: 1px solid var(--line);
  color: var(--text);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
textarea.input { height: auto; padding: 11px 13px; resize: vertical; min-height: 74px; line-height: 1.6; }
.input:hover { border-color: rgba(216, 196, 143, 0.24); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(216, 196, 143, 0.12); background: rgba(6, 4, 10, 0.9); }
.input::placeholder { color: #5c574f; }
select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8b8478 50%), linear-gradient(135deg, #8b8478 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.input-row { display: flex; gap: 10px; }
.input-row > * { flex: 1; min-width: 0; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.err { font-size: 12.5px; color: var(--red); margin-top: 8px; min-height: 18px; }

/* ---------- 头像 ---------- */
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(140deg, #241d33, #14101f);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-disp);
  font-weight: 400; color: var(--primary-2); font-size: 16px;
  overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* ---------- 空状态 / 加载 ---------- */
.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.empty .ico { font-size: 26px; opacity: 0.4; margin-bottom: 8px; }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(3, 2, 6, 0.74);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0; pointer-events: none;
  transition: 0.26s var(--ease);
}
.mask.on { opacity: 1; pointer-events: auto; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 12px);
  z-index: 200; max-width: 82vw;
  padding: 11px 18px; border-radius: 12px;
  background: rgba(18, 14, 26, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.9);
  font-size: 13.5px; color: var(--text);
  opacity: 0; pointer-events: none;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
  text-align: center;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { border-color: rgba(224, 145, 141, 0.42); color: #f2bcb8; }
#toast.good { border-color: rgba(127, 192, 155, 0.38); color: #b6e3cb; }

/* ---------- 表格（后台） ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  font-family: var(--f-lat);
  color: var(--text-3);
  padding: 11px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.tbl tbody tr { transition: background 0.22s var(--ease); }
.tbl tbody tr:hover { background: rgba(216, 196, 143, 0.045); cursor: pointer; }
.tbl tbody tr:focus-visible { outline: 1px solid rgba(216, 196, 143, 0.55); outline-offset: -1px; background: rgba(216, 196, 143, 0.06); }
.tbl .num { font-variant-numeric: tabular-nums; }

/* ---------- 动效与降级 ---------- */
@keyframes aurora-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.rise { animation: aurora-rise 0.7s var(--ease) both; }

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