:root {
  color-scheme: dark;
  --bg: #0d0d0c;
  --panel: #151411;
  --panel-2: #1c1a16;
  --line: rgba(255,255,255,.09);
  --text: #f4f0e8;
  --muted: #8f8a80;
  --accent: #e45132;
  --accent-2: #ffad4d;
}
* { box-sizing: border-box; }
html { touch-action: manipulation; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Noto Sans TC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 26%, rgba(228,81,50,.12), transparent 28rem),
    linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px), var(--bg);
  background-size: auto, 42px 42px, 42px 42px, auto;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.app-shell { width: min(920px, calc(100% - 32px)); min-height: 100vh; margin: auto; display: flex; flex-direction: column; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { color: var(--text); text-decoration: none; font-size: 13px; font-weight: 800; letter-spacing: .18em; }
.brand-mark { color: var(--accent); margin-right: 10px; }
.timer-panel { flex: 1; display: flex; align-items: center; flex-direction: column; padding: 54px 0 42px; }
h1 { font-family: Georgia, "Noto Serif TC", serif; font-size: clamp(24px, 4vw, 36px); font-weight: 500; margin: 0 0 30px; letter-spacing: .03em; }
.timer-wheel { position: relative; width: 310px; height: 310px; display: grid; place-items: center; outline: none; cursor: ns-resize; }
.timer-wheel:focus-visible { border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,173,77,.22); }
.progress { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 0 18px rgba(228,81,50,.13)); }
.track, .progress-ring { fill: none; stroke-width: 3; }
.track { stroke: #2b2822; }
.progress-ring { stroke: url(#none); stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 791.68; stroke-dashoffset: 0; transition: stroke-dashoffset .25s linear, stroke .2s; }
.timer-content { position: absolute; inset: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #201d18, #131210 70%); border: 1px solid rgba(255,255,255,.06); box-shadow: inset 0 0 40px rgba(0,0,0,.28); }
.time { font-variant-numeric: tabular-nums; font-size: clamp(64px, 12vw, 86px); font-weight: 250; line-height: .95; letter-spacing: -.07em; }
.timer-status { margin-top: 17px; color: var(--muted); font-size: 12px; letter-spacing: .14em; }
.scroll-hint { position: absolute; bottom: -22px; color: #69655d; background: var(--bg); padding: 5px 14px; font-size: 10px; letter-spacing: .08em; transition: color .18s ease; pointer-events: none; }
.timer-wheel:hover .scroll-hint, .timer-wheel:focus-visible .scroll-hint { color: #fff; }
.adjust-row { width: min(420px, 100%); margin-top: 48px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; gap: 8px; }
.adjust-btn, .icon-btn { min-height: 45px; border: 1px solid var(--line); color: #b9b3a8; background: var(--panel); border-radius: 10px; cursor: pointer; transition: .18s ease; }
.adjust-btn:hover, .icon-btn:hover { color: var(--text); border-color: rgba(255,173,77,.35); transform: translateY(-1px); }
.early-alert { width: min(420px, 100%); margin-top: 12px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(21,20,17,.72); }
.alert-copy { display: flex; align-items: center; gap: 11px; }
.alert-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--accent-2); background: rgba(255,173,77,.09); }
.cast-setting { margin-top: 8px; }
.cast-icon { color: #e7775d; background: rgba(228,81,50,.1); }
.cast-stepper output { min-width: 72px; }
.alert-copy div { display: flex; flex-direction: column; gap: 2px; }
.alert-copy strong { font-size: 12px; font-weight: 650; }
.alert-copy div span { color: var(--muted); font-size: 9px; }
.alert-controls { display: flex; align-items: center; gap: 8px; }
.sound-select select { height: 34px; max-width: 104px; padding: 0 24px 0 9px; border: 1px solid var(--line); border-radius: 9px; color: #c9c3b8; background: #1a1815; font: inherit; font-size: 10px; cursor: pointer; }
.sound-select select:focus-visible { outline: 2px solid rgba(255,173,77,.45); outline-offset: 2px; }
.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; }
.stepper { display: grid; grid-template-columns: 30px 72px 30px; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.stepper button { height: 32px; border: 0; color: #bbb5aa; background: rgba(255,255,255,.025); cursor: pointer; }
.stepper button:hover { color: var(--accent-2); background: rgba(255,173,77,.07); }
.stepper output { text-align: center; color: var(--text); font-size: 11px; font-variant-numeric: tabular-nums; }
.primary-actions { display: flex; width: min(420px, 100%); gap: 10px; margin-top: 14px; }
.primary-btn { flex: 1; min-height: 54px; border: 0; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #d6472b, #a92920); font-weight: 750; cursor: pointer; box-shadow: 0 12px 30px rgba(182,51,34,.2); transition: .18s ease; }
.primary-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.primary-btn span:first-child { margin-right: 10px; font-size: 11px; }
.icon-btn { width: 54px; font-size: 22px; }
.info-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 14px; background: rgba(21,20,17,.78); }
.info-strip > div { padding: 18px 24px; display: flex; flex-direction: column; gap: 5px; }
.info-strip > div + div { border-left: 1px solid var(--line); }
.info-strip span { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.info-strip strong { font-size: 14px; font-variant-numeric: tabular-nums; }
footer { min-height: 74px; display: flex; justify-content: flex-end; align-items: center; color: #5f5c56; font-size: 10px; letter-spacing: .05em; }
.toast { position: fixed; left: 50%; top: 22px; transform: translate(-50%, -130px); opacity: 0; display: flex; align-items: center; gap: 14px; min-width: 300px; padding: 15px 18px; border: 1px solid rgba(255,173,77,.25); border-radius: 12px; background: rgba(29,26,21,.96); box-shadow: 0 18px 50px rgba(0,0,0,.35); transition: .35s cubic-bezier(.22,1,.36,1); z-index: 5; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-icon { color: var(--accent-2); }
.toast div { display: flex; flex-direction: column; gap: 2px; }
.toast strong { font-size: 13px; }
.toast div span { color: var(--muted); font-size: 11px; }
@media (max-width: 600px) {
  .app-shell { width: min(100% - 24px, 460px); }
  .topbar { height: 68px; }
  .timer-panel { padding-top: 35px; }
  .timer-wheel { width: 280px; height: 280px; }
  .scroll-hint { display: none; }
  .adjust-row { margin-top: 28px; }
  .info-strip > div { padding: 14px 12px; }
  .early-alert { padding: 10px; }
  .alert-copy div span { display: none; }
  .early-alert { align-items: flex-start; }
  .alert-controls { flex-direction: column-reverse; align-items: stretch; }
  .sound-select select { width: 100%; max-width: none; }
  .shortcut { display: none; }
}
@media (hover: none), (pointer: coarse) {
  .scroll-hint { display: none !important; }
  .adjust-row { margin-top: 28px; }
  .timer-wheel { cursor: default; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; } }
