/**
 * Web of Science 风格主题 token（2026-10 全站改版；配色按 WoS 官网口径重校 —— 白底 + 浅紫卡 + 单一中紫点缀）。
 *
 * 两处消费方式：
 *  - HTML 入口（popup / options / account / viewer / legal）：`@import '../src/ui/theme.css';`
 *    （Vite 会在构建期内联）；
 *  - Shadow DOM（常驻面板 / 划词气泡 / 译文块 / 期刊徽标）：`import themeCss from '...?inline'`
 *    后拼在各 *_CSS 之前 —— Shadow DOM 不继承宿主页面变量，必须重新声明，不要依赖页面。
 *
 * 设计口径（对齐 webofscience.com）：**大面积白/极浅紫**，紫色只做点缀——
 * 按钮、选中态、左侧强调条、图标；不使用大块深紫渐变填充。
 */
:root,
:host {
  color-scheme: light;

  /* 中性色（WoS 正文近黑、层级靠灰阶拉开） */
  --wos-ink: #1c1c28;
  --wos-ink-soft: #4a4a5a;
  --wos-muted: #6b6b7b;
  --wos-faint: #9a9aab;
  --wos-border: #e4e1ef;
  --wos-border-soft: #f0eef8;
  --wos-bg: #f6f5fb;
  --wos-card: #ffffff;
  --wos-surface-tint: #f4f1fb;

  /* 点缀紫（从 WoS 官网取样：注册按钮/图标/选中标签的中紫） */
  --wos-accent: #6b4fa8;
  --wos-accent-strong: #5a3f92;
  --wos-accent-ink: #3f2a5c;
  --wos-accent-mid: #8f78c9;
  --wos-accent-soft: #c3b6e2;
  --wos-tint: #ece9f8;
  --wos-tint-soft: #f7f5fd;

  /* 语义色 */
  --wos-ok: #16a34a;
  --wos-err: #b3261e;
  --wos-err-bg: #fdf3f2;
  --wos-err-border: #f2c9c5;
  --wos-warn: #8a5a00;
  --wos-warn-bg: #fdf6e6;
  --wos-warn-border: #efdcb0;
  --wos-off: #9a5b0a;
  --wos-off-bg: #fdf3e3;

  /* 渐变只保留两处极轻的使用（会员卡底纹、徽标） */
  --wos-grad: linear-gradient(135deg, #6b4fa8 0%, #8f78c9 100%);
  --wos-grad-soft: linear-gradient(180deg, #f7f5fd 0%, #ffffff 70%);

  /* 形状与阴影（WoS 卡片是「细边框 + 几乎无阴影」的观感） */
  --wos-radius: 12px;
  --wos-radius-sm: 8px;
  --wos-radius-lg: 14px;
  --wos-shadow-1: 0 1px 2px rgba(28, 28, 40, 0.04);
  --wos-shadow-2: 0 8px 24px rgba(28, 28, 40, 0.14);
  --wos-ring: 0 0 0 3px rgba(107, 79, 168, 0.16);

  /* 动效（约定：hover/press ≤160ms；位移动效在 reduced-motion 下全关） */
  --wos-t-fast: 120ms ease;
  --wos-t: 160ms ease;
}

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

/* 瞬时提示（账号页刷新节流 / 设置页兑换码）：固定底部居中，脱离文档流，零布局抖动。
   默认琥珀色（警告）；.ok / .err 用于成功/失败。 */
.notice-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2147483000;
  margin: 0;
  max-width: min(480px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 10px 16px;
  border: 1px solid var(--wos-warn-border);
  border-radius: 999px;
  background: var(--wos-warn-bg);
  color: var(--wos-warn);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--wos-shadow-2);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--wos-t-fast), visibility var(--wos-t-fast);
}
.notice-toast.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}
.notice-toast.err {
  border-color: var(--wos-err-border);
  background: var(--wos-err-bg);
  color: var(--wos-err);
}
.notice-toast.show {
  opacity: 1;
  visibility: visible;
}
@media (prefers-reduced-motion: reduce) {
  .notice-toast {
    transition: none;
  }
}
