/*
 * Unio 设计系统（所有页面共用）：<link rel="stylesheet" href="/unio.css?v=N">，<body class="u-page">
 * 风格：极简 + 动效。中性的近白 / 近黑底，细线，大量留白；只有一个强调色，少量使用；
 * 无衬线大字但不过粗；个性靠动效（文字逐词浮现、滚动时渐显、两个圆环相扣的动画）。
 * 规范见 docs/DESIGN.md。变量和类名沿用旧版，旧页面不用改名也能套上新风格。
 */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@300..700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
  --paper: #fbfbfa;        /* 页面底色：中性近白（不是米色） */
  --surface: #ffffff;      /* 卡片 */
  --text: #111111;         /* 正文 */
  --muted: #6f6f6c;        /* 次要文字 */
  --faint: #a3a3a0;        /* 更弱的文字、占位 */
  --line: #e6e6e3;         /* 细线、描边 */
  --soft-line: #efefec;
  --blush: #f3f3f1;        /* 次要底色（旧名字保留，现在是浅灰） */
  --red: #e5484d;          /* 唯一的强调色：小面积用（圆点、选中、链接悬停、数字） */
  --red-deep: #cf3a3f;
  --ink: #111111;
  --cream: #fbfbfa;
  --ok: #18794e;
  --warn: #d13438;

  --shadow: 0 1px 2px rgba(0,0,0,.04);           /* 几乎看不见：极简里不靠阴影分层 */
  --shadow-lg: 0 24px 48px -24px rgba(0,0,0,.18);
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .1, 1);

  --display: "Geist", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;

  --btn-surface-bg: var(--text); --btn-surface-fg: var(--paper); --btn-surface-shadow: transparent;
  --btn-bg: var(--btn-surface-bg); --btn-fg: var(--btn-surface-fg); --btn-shadow: var(--btn-surface-shadow);
  --bg: var(--paper); --accent: var(--red); --accent-text: #fff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b0b0b; --surface: #141414; --text: #f2f2f0; --muted: #9c9c98; --faint: #66665f;
    --line: #262624; --soft-line: #1c1c1b; --blush: #171716; --red: #ff5a5f; --red-deep: #e5484d;
    --ink: #f2f2f0; --cream: #0b0b0b; --ok: #3dd68c; --warn: #ff6369;
    --shadow: none; --shadow-lg: 0 24px 48px -24px rgba(0,0,0,.6);
    --btn-surface-bg: var(--text); --btn-surface-fg: var(--paper);
    --bg: var(--paper);
  }
}
:root[data-theme="dark"] {
  --paper: #0b0b0b; --surface: #141414; --text: #f2f2f0; --muted: #9c9c98; --faint: #66665f;
  --line: #262624; --soft-line: #1c1c1b; --blush: #171716; --red: #ff5a5f; --red-deep: #e5484d;
  --ink: #f2f2f0; --cream: #0b0b0b; --ok: #3dd68c; --warn: #ff6369;
  --shadow: none; --shadow-lg: 0 24px 48px -24px rgba(0,0,0,.6);
  --btn-surface-bg: var(--text); --btn-surface-fg: var(--paper);
  --bg: var(--paper);
}

.u-page { margin: 0; background: var(--paper); color: var(--text); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.u-page ::selection { background: var(--red); color: #fff; }
.u-display { font-family: var(--display); font-weight: 600; letter-spacing: -.045em; line-height: 1.02; }
:lang(zh-CN) .u-display { letter-spacing: -.02em; line-height: 1.12; font-weight: 600; }

/* 旧页面里的"红色块"现在不铺色：保持中性 */
.on-red { background: transparent; color: inherit; }

/* 按钮：实心（主）/ 描边（次）；悬停时轻微变化，不弹跳 */
.u-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 15px/1 var(--sans); letter-spacing: -.01em;
  text-decoration: none; cursor: pointer; border: 1px solid var(--btn-bg); border-radius: 999px; padding: 13px 22px;
  background: var(--btn-bg); color: var(--btn-fg); transition: opacity .2s, background .2s, transform .2s var(--ease); }
.u-btn:hover { opacity: .86; }
.u-btn:active { transform: scale(.98); }
.u-btn:disabled { opacity: .4; cursor: default; }
.u-btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.u-btn.ghost:hover { opacity: 1; border-color: var(--text); }
.u-btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.u-btn.sm { padding: 9px 16px; font-size: 14px; }
.u-btn .arr { transition: transform .25s var(--ease); }
.u-btn:hover .arr { transform: translateX(3px); }

/* 卡片：细线，不靠阴影 */
.u-card { --btn-bg: var(--btn-surface-bg); --btn-fg: var(--btn-surface-fg); --btn-shadow: var(--btn-surface-shadow);
  background: var(--surface); color: var(--text); border: 1px solid var(--line) !important; border-radius: var(--radius); box-shadow: var(--shadow) !important; }

/* 输入框 */
.u-input { width: 100%; font: 400 16px/1.4 var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line) !important;
  border-radius: 12px; padding: 12px 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
.u-input:focus { border-color: var(--text) !important; box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 8%, transparent) !important; }
.u-input::placeholder { color: var(--faint); }

/* 小标签 */
.u-sticker { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1 var(--sans); padding: 7px 12px; border-radius: 999px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); white-space: nowrap; }

/* 字标：两个细线圆环 + 小写 unio */
.u-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; font-family: var(--display);
  font-weight: 600; font-size: 20px; letter-spacing: -.04em; line-height: 1; }
.u-logo svg { flex: none; }
.u-logo svg circle { stroke-width: 2.2 !important; }
.u-logo svg circle:first-child { stroke: currentColor; }
.u-logo svg circle:last-child { stroke: var(--red); }

/* 顶部栏（旧页面写的 class="app-bar on-red" 也按这个显示）：半透明、细下边线 */
.app-bar, .app-bar.on-red { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 85%, transparent) !important;
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  color: var(--text) !important; border-bottom: 1px solid var(--line) !important;
  --btn-bg: var(--btn-surface-bg); --btn-fg: var(--btn-surface-fg); --btn-shadow: var(--btn-surface-shadow); }

/* 顶栏右侧的链接（账号、收件箱等） */
.app-bar .bar-r { display: flex; align-items: center; gap: 16px; }
.app-bar .bar-link { font-size: 14px; color: var(--muted); text-decoration: none; transition: color .2s; white-space: nowrap; }
.app-bar .bar-link:hover { color: var(--text); }

/* 语言切换（i18n.js 插入的 .unio-lang） */
.unio-lang { border: 1px solid var(--line) !important; background: transparent !important; box-shadow: none !important; }
.unio-lang button { color: var(--muted) !important; font-weight: 500 !important; }
.unio-lang button[aria-pressed="true"] { background: var(--text) !important; color: var(--paper) !important; }

/* 进场动效：加 .u-reveal，滚动到时加 .in（页面自己用 IntersectionObserver） */
.u-reveal { opacity: 0; transform: translateY(18px); filter: blur(6px); transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease); }
.u-reveal.in { opacity: 1; transform: none; filter: none; }

[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .u-btn, .u-btn .arr, .u-reveal { transition: none !important; }
  .u-reveal { opacity: 1; transform: none; filter: none; }
}
