/* =========================================================
   派影 PAIYING — 共享设计令牌与基础组件（清新自然 · 浅色锁定）
   ========================================================= */
:root {
  /* 纸感中性底 + 苔绿单强调色 */
  --bg: #f3f6f1;
  --surface: #ffffff;
  --surface-2: #fafbf8;
  --surface-3: #eef3ec;
  --ink: #1f2a24;
  --ink-2: #4d5b52;
  --ink-3: #7f8c82;
  --line: #dfe6da;
  --line-2: #c9d5c8;
  --brand: #2c8a5b;
  --brand-deep: #1e6a45;
  --brand-ink: #16523a;
  --brand-soft: #e3f1e9;
  --brand-tint: #edf5f0;
  --pine: #22362c;          /* 深色块（页脚/特性卡），同色系不跑题 */
  --warn: #a86b1c;
  --warn-soft: #f7eedd;
  --err: #bf4a3e;
  --err-soft: #f8e9e6;
  --ok: #2c8a5b;

  --r-card: 16px;
  --r-btn: 10px;
  --r-chip: 999px;

  --shadow-1: 0 1px 2px rgba(31, 42, 36, .05);
  --shadow-2: 0 10px 28px -14px rgba(31, 42, 36, .22);

  --font: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
          "Noto Sans CJK SC", "Microsoft YaHei", system-ui, -apple-system,
          "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--brand-soft); }

/* ---- 图标 ---- */
.ic { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -0.15em; }

/* ---- 排版 ---- */
.h1 { font-size: clamp(38px, 5vw, 72px); line-height: 1.08; font-weight: 700; letter-spacing: -0.025em; }
.h2 { font-size: clamp(26px, 3.1vw, 42px); line-height: 1.22; font-weight: 700; letter-spacing: -0.02em; }
.h3 { font-size: 18px; font-weight: 700; }
.lead { color: var(--ink-2); font-size: clamp(15px, 1.15vw, 17.5px); line-height: 1.75; max-width: 66ch; }
.muted { color: var(--ink-3); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  border-radius: var(--r-btn); padding: 10px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-1); }
.btn.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.btn.ghost { background: transparent; }
.btn.invert { background: #fff; border-color: #fff; color: var(--brand-ink); }
.btn.invert:hover { background: var(--brand-soft); color: var(--brand-ink); border-color: #fff; }
.btn.tiny { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn.lg { padding: 13px 26px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

/* ---- 徽标 / 筹码 ---- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r-chip); padding: 4px 12px; font-size: 12.5px; color: var(--ink-2);
}
.chip.free { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); font-weight: 600; }
.chip.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.chip.soon { background: var(--surface-3); border-color: transparent; color: var(--ink-3); }

/* ---- 表单 ---- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
textarea, input[type="text"] {
  width: 100%; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 10px; color: var(--ink); padding: 11px 13px; font: inherit; resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea:focus, input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea::placeholder, input::placeholder { color: var(--ink-3); }

/* ---- 卡片 ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-1);
}

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(90px);
  background: var(--pine); color: #eef3ec; padding: 11px 22px; border-radius: 12px;
  opacity: 0; transition: opacity .28s ease, transform .28s ease; z-index: 90;
  pointer-events: none; box-shadow: var(--shadow-2); display: flex; align-items: center; gap: 8px;
  max-width: min(520px, 92vw);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--err); color: #fff; }

/* ---- 遮罩 + 模态 + 抽屉 ---- */
.mask { position: fixed; inset: 0; background: rgba(31, 42, 36, .42); z-index: 60; opacity: 0; transition: opacity .2s ease; }
.mask.show { opacity: 1; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -48%); z-index: 61;
  width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto;
  background: var(--surface); border-radius: 18px; border: 1px solid var(--line);
  box-shadow: var(--shadow-2); opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 22px; }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2);
  transition: background .15s ease;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }

/* ---- 入场动效（load stagger） ---- */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .65s cubic-bezier(.16, 1, .3, 1) both; }
  .rise.d1 { animation-delay: .06s; } .rise.d2 { animation-delay: .12s; }
  .rise.d3 { animation-delay: .18s; } .rise.d4 { animation-delay: .24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
}
