/* 淺色紙感風格：色票沿用理查筆記 */
:root {
  --paper: #f2ede0;
  --card: #fffdf9;
  --card-line: #e6ddc6;
  --ink: #2c291f;
  --ink-dim: #756c58;
  --teal: #3f8570;
  --teal-soft: #e2efe8;
  --terracotta: #c4633c;
  --terracotta-soft: #f8e6da;
  --red: #b23b3b;
  --shadow: 0 6px 20px rgba(70, 58, 30, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.sheet {
  max-width: 440px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}

.brand {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.view {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  text-align: center;
}

h1 { font-size: 20px; margin: 0 0 8px; }
.hint { color: var(--ink-dim); margin: 0 0 20px; }

form { text-align: left; display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; font-size: 15px; margin-top: 8px; }

input[type="text"], input:not([type]), input[type="date"], input[type="time"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--card-line);
  border-radius: 10px;
}
input:focus-visible, .btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.segmented { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; }
.segmented legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; padding: 0; }
.segmented label { flex: 1; margin: 0; }
.segmented input { position: absolute; opacity: 0; }
.segmented span {
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; border: 1px solid var(--card-line); border-radius: 10px;
  background: #fff; font-weight: 600; cursor: pointer;
}
.segmented input:checked + span { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.segmented input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }

.btn {
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  border: 0;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms ease-out, opacity 120ms ease-out;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--card-line); }
.btn-big { min-height: 64px; font-size: 20px; }

.kind { font-size: 18px; font-weight: 700; color: var(--teal); margin: 0; }
.kind.out { color: var(--terracotta); }
.clock { font-size: 56px; font-weight: 700; margin: 4px 0; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.place { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink-dim); margin: 0 0 8px; }
.place svg, .warn svg { flex: none; }

.warn {
  display: flex; align-items: flex-start; gap: 8px; text-align: left;
  background: var(--terracotta-soft); color: #8a3f20;
  border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; font-size: 15px;
}
.field-error { color: var(--red); font-size: 15px; min-height: 1.2em; margin: 4px 0 0; }

.icon-wrap { display: flex; justify-content: center; margin-bottom: 8px; }
.icon-wrap.ok { color: var(--teal); }
.icon-wrap.bad { color: var(--terracotta); }

.spinner {
  width: 36px; height: 36px; margin: 8px auto 16px;
  border: 3px solid var(--card-line); border-top-color: var(--teal);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
  .btn { transition: none; }
}
