/* ============================================================
   樱花食堂 · 共享设计令牌与基础样式（冻结）
   顾客端 /t 与店员端 /staff 共用；页面专属样式写各自 css。
   ============================================================ */
:root {
  --bg: #f6efe3;
  --bg-deep: #efe4d2;
  --surface: #fffdf7;
  --surface-2: #fbf5ea;
  --ink: #2b221c;
  --ink-soft: #4a3b31;
  --muted: #7c6b5e;
  --brand: #b23a2b;
  --brand-dark: #8a2a1e;
  --brand-soft: #f3ddd5;
  --gold: #c49a4a;
  --gold-soft: #f0e2c4;
  --line: #e5d7c5;
  --success: #3e7554;
  --success-soft: #e3efe6;
  --warning: #b7791f;
  --warning-soft: #f7ead0;
  --danger: #a8322a;
  --danger-soft: #f6dfdb;
  --radius: 18px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(74, 48, 30, 0.09);
  --shadow-sm: 0 3px 10px rgba(74, 48, 30, 0.07);
  --font-display: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans", "Noto Sans CJK JP", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --maxw: 1080px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::selection {
  background: var(--brand-soft);
}

h1, h2, h3, h4, p, figure {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--brand-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

img, svg, canvas {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.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;
}

.container {
  width: min(100% - 32px, var(--maxw));
  margin-inline: auto;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn:focus-visible,
.icon-btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(178, 58, 43, 0.35);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff8f2;
  box-shadow: 0 6px 16px rgba(138, 42, 30, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #bd4434 0%, #952f22 100%);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--gold);
}

.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.btn-sm {
  min-height: 36px;
  padding: 7px 13px;
  font-size: 13.5px;
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- 表单 ---------- */
.field {
  display: grid;
  gap: 6px;
}

.field > label,
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--gold);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(178, 58, 43, 0.12);
  outline: none;
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

/* ---------- 通用零件 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.badge-brand {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.chip:hover {
  border-color: var(--gold);
}

.chip[aria-pressed="true"],
.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff8f2;
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.text-muted {
  color: var(--muted);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(178, 58, 43, 0.18);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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