/* T&H Event Decor：前台与后台共用的设计变量与基础样式 */
:root {
  color-scheme: light;
  --paper: #FFFFFF;
  --paper-2: #F6F3F6;
  --mat: #F2EFF2;
  --ink: #2B1E2F;
  --ink-2: #55485A;
  --muted: #736777;
  --line: #E6E0E7;
  --line-2: #D3CAD5;
  --accent: #A3245E;
  --accent-hover: #891C4E;
  --accent-ink: #FFFFFF;
  --accent-soft: #F8E9F0;
  --brass: #8A6A2F;
  --ok: #2F6F4E;
  --ok-soft: #E6F1EA;
  --warn: #8F5E10;
  --warn-soft: #FBF0DD;
  --crit: #B3261E;
  --crit-soft: #FBE9E7;

  --font-display: "Bodoni Moda", "Didot", "Bodoni 72", "Noto Serif SC", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --font-ui: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;

  --r-sm: 3px;
  --r: 6px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  --shadow: 0 1px 2px rgba(43, 30, 47, .06), 0 12px 32px -18px rgba(43, 30, 47, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--accent-soft); color: var(--ink); }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: var(--r);
}
.skip:focus { top: 12px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border: 1px solid var(--ink); border-radius: var(--r);
  background: var(--paper); color: var(--ink);
  font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--paper-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.quiet { border-color: transparent; background: transparent; padding-inline: 10px; }
.btn.quiet:hover { background: var(--paper-2); }
.btn.danger { border-color: transparent; background: transparent; color: var(--crit); }
.btn.danger:hover { background: var(--crit-soft); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field .opt { font-weight: 400; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--paper); color: var(--ink); font-size: 16px;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--crit); }
.hint { font-size: 13px; color: var(--muted); }
.err { font-size: 13px; color: var(--crit); }
.err:empty { display: none; }

/* 数量增减 */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; height: 44px; }
.stepper button { width: 44px; border: 0; background: var(--paper); font-size: 20px; line-height: 1; color: var(--ink); }
.stepper button:hover:not(:disabled) { background: var(--paper-2); }
.stepper button:disabled { color: var(--line-2); cursor: not-allowed; }
.stepper input { width: 56px; border: 0; border-inline: 1px solid var(--line-2); text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: var(--accent-soft); }

.num { font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90;
  max-width: min(520px, calc(100vw - 32px));
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: var(--r);
  font-size: 15px; box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
