/* 赤兔马原型 · 共用设计规范 */
:root {
  /* 暖色中性 */
  --bg: #f7f4ee;
  --surface: #fdfbf7;
  --raised: #efe9df;
  --line: rgba(31, 27, 22, 0.09);
  --line-strong: rgba(31, 27, 22, 0.16);
  --text: #1f1b16;
  --text-2: #5e554a;
  --text-3: #7b7266;

  /* 深色区（暖墨） */
  --ink-0: #12110f;
  --ink-1: #161513;
  --ink-2: #1c1a18;
  --ink-3: #262421;
  --ink-line: rgba(239, 233, 222, 0.09);
  --on-ink: #efe9de;
  --on-ink-2: #aaa398;
  --on-ink-3: #8a847a;

  /* 后台用石墨灰 */
  --app-bg: #fafafa;
  --app-card: #ffffff;
  --app-raised: #f4f4f5;
  --app-line: rgba(23, 23, 23, 0.08);
  --app-text: #171717;
  --app-text-2: #525252;
  --app-text-3: #737373;

  /* 赤兔红 */
  --accent: #c93a24;
  --accent-hover: #b0311e;
  --accent-soft: rgba(201, 58, 36, 0.08);

  --ok: #15803d;
  --ok-soft: rgba(21, 128, 61, 0.1);
  --warn: #a16207;
  --warn-soft: rgba(161, 98, 7, 0.1);
  --info: #3f5f8a;
  --info-soft: rgba(63, 95, 138, 0.1);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Geist", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Geist Mono", "SF Mono", ui-monospace, Menlo, monospace;

  --r-tag: 6px;
  --r-ctl: 8px;
  --r-card: 14px;
  --r-panel: 18px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(1200px, calc(100% - 64px)); margin: 0 auto; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-16 { width: 16px; height: 16px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: var(--r-ctl);
  font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: background-color .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-secondary:hover { background: var(--raised); }
.btn-ink { background: var(--app-text); color: #fff; }
.btn-ink:hover { background: #2b2b2b; }
.btn-on-ink { background: var(--ink-3); color: var(--on-ink); box-shadow: inset 0 0 0 1px var(--ink-line); }
.btn-on-ink:hover { background: #2f2c28; }
.btn .icon { width: 16px; height: 16px; }

/* 品牌标识 */
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: 0.02em; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 600; letter-spacing: 0;
}

/* 状态标签 + 翻牌 */
.status {
  --dot: var(--text-3);
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px;
  border-radius: var(--r-tag); font-size: 13px; line-height: 1; white-space: nowrap;
  background: var(--app-raised); color: var(--app-text-2);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot); flex: none; }
.status[data-s="filling"] { --dot: var(--warn); }
.status[data-s="pending"] { --dot: var(--info); background: var(--info-soft); color: var(--info); }
.status[data-s="done"] { --dot: var(--ok); background: var(--ok-soft); color: var(--ok); }
.status[data-s="new"] { --dot: var(--app-text-3); }

.flap { display: inline-grid; perspective: 240px; }
.flap > * { grid-area: 1 / 1; backface-visibility: hidden; }
.flap .flap-out { animation: flapOut .2s var(--ease) forwards; }
.flap .flap-in { animation: flapIn .26s .14s var(--ease) both; }
@keyframes flapOut { to { transform: rotateX(-90deg); opacity: 0; } }
@keyframes flapIn { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; visibility: hidden; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(18, 17, 15, 0.42); opacity: 0; transition: opacity .2s var(--ease); }
.modal-card {
  position: relative; width: min(400px, 100%); background: var(--surface); border-radius: var(--r-panel);
  padding: 32px; box-shadow: 0 24px 64px rgba(18, 17, 15, 0.18);
  opacity: 0; transform: translateY(8px); transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.modal.open { visibility: visible; }
.modal.open .modal-backdrop { opacity: 1; }
.modal.open .modal-card { opacity: 1; transform: none; }
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: var(--r-ctl);
  display: grid; place-items: center; color: var(--text-3); transition: background-color .16s var(--ease), color .16s var(--ease);
}
.modal-close:hover { background: var(--raised); color: var(--text); }
.modal h3 { font-size: 20px; font-weight: 500; }
.modal .lead { margin-top: 4px; color: var(--text-2); font-size: 14px; }
.contact-qr { margin: 24px auto 0; width: 168px; padding: 12px; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.contact-qr svg { width: 100%; height: auto; }
.contact-meta { margin-top: 24px; display: grid; gap: 12px; }
.contact-meta div { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.contact-meta strong { color: var(--text); font-weight: 500; }

/* 轻提示 */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 60; transform: translate(-50%, 8px);
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px;
  background: var(--ink-2); color: var(--on-ink); font-size: 14px;
  box-shadow: 0 12px 32px rgba(18, 17, 15, 0.2); opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .icon { width: 16px; height: 16px; color: #7fd1a0; }

/* 进场：只用一次 */
.rise { opacity: 0; transform: translateY(10px); animation: rise .6s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 60ms + 80ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease), transform .5s var(--ease); transition-delay: calc(var(--i, 0) * 50ms); }
.reveal.in { opacity: 1; transform: none; }

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