/* ============================================================
   轻重急缓 · 基础设计系统
   一张纸（东方亮）、一砚墨（墨青）、一片未读的蓝（窃蓝）。
   蓝只负责"还没筛过的信息"，纸只负责"留下来的决定"。
   ============================================================ */
:root {
  /* —— 纸 —— */
  --dawn: #F7FBFE;
  --paper: #F7FBFE;
  --paper-hi: #FDFEFF;
  --paper-lo: #EFF6FB;

  /* —— 墨 —— */
  --ink: #16273A;
  --ink-soft: #3A4E63;
  --ink-mute: #5C7185;

  /* —— 蓝（未筛过的信息场） —— */
  --qielan: #88ABDA;
  --qielan-deep: #6E93C6;
  --white-blue: #98B6C2;
  --accent: #2F5F8F;
  --accent-ink: #21405E;

  /* —— 蛤粉（暖白，只做纸的另一种温度） —— */
  --clamshell: #ECEEE1;

  --error: #9F3434;

  /* —— 表面 —— */
  --surface: rgba(250, 253, 255, .86);
  --surface-strong: #FBFDFF;
  --surface-soft: rgba(236, 238, 225, .46);
  --surface-blue: rgba(136, 171, 218, .16);
  --surface-hover: #FFFFFF;
  --accent-soft: rgba(47, 95, 143, .10);

  /* —— 线 —— */
  --line: rgba(22, 39, 58, .13);
  --line-strong: rgba(22, 39, 58, .26);
  --line-ink: rgba(247, 251, 254, .22);

  /* —— 影 —— */
  --shadow: rgba(31, 62, 94, .13);
  --shadow-soft: rgba(31, 62, 94, .06);
  --shadow-paper: 0 1px 1px rgba(31, 62, 94, .05), 0 12px 28px -14px rgba(31, 62, 94, .22), 0 32px 64px -44px rgba(31, 62, 94, .28);

  /* —— 字 —— */
  --display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --sans: "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "Noto Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-hero: clamp(2.5rem, 5.4vw, 4.6rem);
  --t-h2: clamp(1.875rem, 3.3vw, 2.9rem);
  --t-h3: clamp(1.25rem, 1.7vw, 1.6rem);
  --t-lead: clamp(1.0625rem, 1.2vw, 1.1875rem);
  --t-body: 1rem;
  --t-small: .8125rem;
  --t-micro: .75rem;

  /* —— 节奏 —— */
  --shell: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --sec: clamp(72px, 9vw, 132px);

  /* —— 动 —— */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.22, 1.28, 0.36, 1);
  --d-press: 180ms;
  --d-hover: 280ms;
  --d-enter: 520ms;
  --d-editorial: 760ms;

  --container: 1240px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: clip; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-wrap: pretty;
  font-synthesis-weight: none;
}

/* 纸面：一层极淡的、有方向的冷光，而不是整屏渐变 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 78% at 78% -12%, #E4EFF9 0%, rgba(228, 239, 249, 0) 58%),
    radial-gradient(90% 60% at 4% 108%, #E8F1F8 0%, rgba(232, 241, 248, 0) 62%),
    linear-gradient(178deg, var(--paper-hi) 0%, var(--paper) 46%, var(--paper-lo) 100%);
}
/* 纸纹：只够感觉得到 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

body.menu-open, body.sheet-open { overflow: hidden; }
button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-underline-offset: .3em; text-decoration-thickness: 1px; }
em { font-style: normal; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.18; }
p { text-wrap: pretty; }
img { display: block; max-width: 100%; }

/* —— 浏览器自己的表面，也要属于这套设计 —— */
::selection { color: var(--ink); background: rgba(136, 171, 218, .42); }
:root { caret-color: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: rgba(22, 39, 58, .24) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(22, 39, 58, .22);
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(22, 39, 58, .36); background-clip: content-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--paper);
  background: var(--ink);
  font-size: var(--t-small);
  text-decoration: none;
  transform: translateY(-80px);
  transition: transform var(--d-press) var(--ease);
}
.skip-link:focus { transform: translateY(0); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.shell-width {
  width: min(calc(100% - var(--gutter) * 2), var(--shell));
  margin-inline: auto;
}

/* ---------- 品牌 ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
}
.brand-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 7px;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(247, 251, 254, .16);
}

/* ---------- 通用文字 ---------- */
/* 小标签：不描边、不发光，只是一行安静的字 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-mute);
  font-size: var(--t-micro);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.serif { font-family: var(--display); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-soft); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: var(--t-body);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--d-hover) var(--ease), background-color var(--d-hover) var(--ease), border-color var(--d-hover) var(--ease), box-shadow var(--d-hover) var(--ease), transform var(--d-press) var(--ease);
}
.btn-primary {
  color: var(--paper);
  background: var(--ink);
  box-shadow: inset 0 1px 0 rgba(247, 251, 254, .14), 0 10px 24px -14px rgba(22, 39, 58, .7);
}
.btn-secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}
.btn-quiet {
  color: var(--ink-soft);
  background: transparent;
  border-color: transparent;
}
.btn-sm { min-height: 34px; padding: 6px 12px; border-radius: 8px; font-size: var(--t-small); }
.btn-block { width: 100%; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }

/* 方向箭头：绘制出来的，不是字体里的一个字符 */
.btn-arrow {
  display: inline-block;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  font-size: 0;
  color: transparent;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 12L12 4M12 4H5.6M12 4v6.4' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='square'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 12L12 4M12 4H5.6M12 4v6.4' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='square'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--d-hover) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent-ink); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(247, 251, 254, .16), 0 16px 30px -16px rgba(22, 39, 58, .8); }
  .btn-primary:hover .btn-arrow { transform: translate(2px, -2px); }
  .btn-secondary:hover { background: var(--surface-hover); border-color: var(--ink-soft); transform: translateY(-1px); }
  .btn-secondary:hover .btn-arrow { transform: translate(2px, -2px); }
  .btn-quiet:hover { color: var(--ink); background: var(--accent-soft); }
}

/* ---------- 表单 ---------- */
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 500;
  line-height: 1.5;
}
input[type="text"],
input[type="url"],
input[type="search"],
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, .55);
  font-size: var(--t-body);
  line-height: 1.7;
  transition: border-color var(--d-hover) var(--ease), box-shadow var(--d-hover) var(--ease), background-color var(--d-hover) var(--ease);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-mute); opacity: 1; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-soft);
  background: transparent;
  font-size: var(--t-micro);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color var(--d-hover) var(--ease), border-color var(--d-hover) var(--ease), background-color var(--d-hover) var(--ease);
}
.chip:active { transform: translateY(1px); }
@media (hover: hover) and (pointer: fine) {
  .chip:hover { color: var(--ink); background: #fff; border-color: var(--line-strong); }
}
.sr-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 浮层与反馈 ---------- */
.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 1200;
  max-width: min(88vw, 560px);
  padding: 13px 18px;
  border: 1px solid rgba(247, 251, 254, .16);
  border-radius: 10px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 0 18px 44px -18px rgba(22, 39, 58, .8);
  font-size: var(--t-small);
  line-height: 1.6;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity var(--d-hover) var(--ease), transform var(--d-enter) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

dialog {
  width: min(calc(100% - 32px), 480px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--paper-hi);
  box-shadow: 0 40px 100px -40px rgba(22, 39, 58, .6);
}
dialog::backdrop { background: rgba(22, 39, 58, .34); backdrop-filter: blur(8px); }
.dialog-body { padding: 28px; }
.dialog-body h2 { margin-bottom: 10px; font-family: var(--display); font-size: 1.5rem; font-weight: 600; line-height: 1.35; }
.dialog-body p { color: var(--ink-soft); font-size: var(--t-small); line-height: 1.7; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 26px; }
.dialog-danger { color: var(--paper); background: var(--error); border-color: var(--error); }

/* ---------- 滚动显现 ---------- */
.reveal { opacity: 0; }
.reveal.is-visible { animation: revealUp var(--d-editorial) var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes revealUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@media (scripting: none) {
  .reveal { opacity: 1 !important; }
}

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}
