/* ==========================================================================
   theme.css — Auto PPT 全站设计令牌与共享原语
   引入顺序：本文件必须在各页面自身 CSS 之前。
   兼容别名（--green/--red/--amber/--blue）永久保留，供存量 CSS 消费。
   ========================================================================== */

:root {
  color-scheme: light;

  /* 灰阶 */
  --ink: #17181c;
  --ink-strong: #0b0c0f;
  --muted: #6b7078;
  --line: #e2e3e6;
  --line-strong: #c9ccd1;
  --soft: #f1f2f4;
  --bg: #f5f5f6;
  --paper: #fff;

  /* 主色（黑白基因） */
  --accent: #17181c;
  --accent-hover: #000;
  --accent-soft: #ededf0;

  /* 语义状态 */
  --pos: #1a7f4b;
  --pos-soft: #e7f3ec;
  --warn: #9a5b00;
  --warn-soft: #f8efe2;
  --err: #b42318;
  --err-soft: #fbeae8;
  --info: #2f6cb0;
  --info-soft: #e9f0f8;

  /* 兼容别名（勿删）：旧类名按语境映射 */
  --green: var(--accent);
  --green-2: var(--accent-hover);
  --green-soft: var(--accent-soft);
  --red: var(--err);
  --amber: var(--warn);
  --blue: var(--info);

  /* 圆角 */
  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-full: 999px;

  /* 间距（4px 基） */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;

  /* 阴影与焦点 */
  --e1: 0 1px 2px rgba(11, 12, 15, .05), 0 1px 3px rgba(11, 12, 15, .04);
  --e2: 0 8px 24px rgba(11, 12, 15, .12);
  --e3: 0 16px 48px rgba(11, 12, 15, .2);
  --ring: 0 0 0 3px rgba(23, 24, 28, .14);
  --shadow: var(--e1);

  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---- 基础 reset（各页共用，替代三份重复 reset） ---- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button { cursor: pointer; }

::selection { background: var(--accent-soft); }

/* ---- 共享原语 ---- */
/* 数字/金额统一等宽数字 */
.tnum,
.metric-value,
td.tabular,
th.tabular { font-variant-numeric: tabular-nums; }

/* 屏幕阅读器专用 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 统一焦点可见性（键盘操作）：链接/按钮等无自定义 focus 的元素给全局焦点环 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 输入类控件已有 border+ring 自定义 focus，避免双重指示 */
input:focus-visible,
textarea:focus-visible,
select:focus-visible { outline: none; }

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