/* ============================================================
   亮 / 暗主题
   暗色：墨黑纸 + 奶油字；亮色：暖纸 + 墨字
   两套都只用一种强调色（朱砂），避免花
   ============================================================ */

html[data-theme="light"] {
  --bg: #f3efe4;
  --surface: #fbf8f0;
  --surface-2: #efeade;
  --ink: #17181c;
  --text: var(--ink);
  --muted: #5a5850;
  --line: rgba(23, 24, 28, .14);
  --line-strong: rgba(23, 24, 28, .34);
  --accent: #c03a20;
  --accent2: #1f4fd8;
  --ok: #147a52;
  --warn: #96690c;
  --err: #bf2b2b;
  --card: var(--surface);
  --card-hover: var(--surface-2);
}

html[data-theme="light"] .nav {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

/* 亮色下主按钮用朱砂底白字，对比足够 */
html[data-theme="light"] .btn-primary { color: #fff; }

/* 暗色下朱砂底白字对比略低，改用近白字 + 深色描边 */
html[data-theme="dark"] .btn-primary,
html:not([data-theme="light"]) .btn-primary { color: #170a06; background: #ff8a63; border-color: #ff8a63; }
html[data-theme="dark"] .tag,
html:not([data-theme="light"]) .tag { color: #170a06; background: #ff8a63; }

/* 卡片式容器统一走 token，避免深色写死的白透明值在亮色下发灰 */
html[data-theme="light"] .search,
html[data-theme="light"] textarea,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] select {
  background: var(--surface);
}

/* 滚动条：亮色下别太黑 */
html[data-theme="light"] * { scrollbar-color: rgba(23,24,28,.28) transparent; }

/* 选中文字 */
html[data-theme="light"] ::selection { background: rgba(192, 58, 32, .18); }
::selection { background: rgba(255, 107, 69, .28); }
