:root {
  color-scheme: dark;
  --bg: #0d1222;
  --panel: rgba(13, 23, 44, 0.88);
  --panel-strong: rgba(21, 34, 67, 0.95);
  --line: rgba(160, 180, 255, 0.18);
  --text: #f6f8ff;
  --muted: #b8c3e5;
  --accent: #8db4ff;
  --accent-strong: #ab8dff;
  --good: #7ce0b0;
  --warn: #ffcf7d;
  --shadow: 0 28px 64px rgba(0, 6, 18, 0.35);
  font-family: "Noto Sans TC", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(131, 147, 255, 0.18), transparent 32%),
    linear-gradient(180deg, #182445 0%, var(--bg) 100%);
  color: var(--text);
}

button {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero-card,
.panel,
.timer-card,
.stat-card,
.today-session-card,
.week-card,
.score-card,
.day-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card,
.panel {
  padding: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.hero-copy,
.panel-heading p,
.note-list,
.day-summary,
.score-copy,
.phase-item p,
.phase-cue,
.label,
.day-date,
.day-duration,
.day-top {
  color: var(--muted);
}

.hero-stats,
.top-grid,
.score-grid,
.schedule-grid,
.button-row {
  display: grid;
  gap: 18px;
}

.hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.stat-card {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.04);
}

.stat-label {
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.stat-value {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.top-grid {
  grid-template-columns: 1.1fr 1.1fr 0.9fr;
  margin: 24px 0;
}

.panel-heading {
  margin-bottom: 18px;
}

.today-session-card,
.timer-card {
  padding: 24px;
  background: var(--panel-strong);
}

.narration-card {
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(126, 176, 255, 0.1);
}

.narration-status {
  margin: 8px 0 10px;
  color: var(--text);
  font-weight: 700;
}

.narration-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.guidance-live {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(160, 180, 255, 0.16);
  color: var(--good);
  font-weight: 600;
  min-height: 1.5em;
}

.session-title {
  margin-bottom: 8px;
  font-size: 1.4rem;
  font-weight: 700;
}

.session-duration {
  margin-bottom: 14px;
  color: var(--accent);
  font-weight: 600;
}

.note-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.note-list.compact {
  gap: 8px;
}

.timer-panel {
  display: grid;
  gap: 16px;
}

.timer-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.phase-label,
.phase-progress {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.time-display {
  margin: 12px 0;
  font-size: clamp(3rem, 8vw, 5.4rem);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.phase-cue {
  margin-bottom: 0;
}

.button-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

button {
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, background 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.primary {
  color: #08111f;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  font-weight: 700;
}

.plan-panel,
.score-panel,
.arousal-panel,
.schedule-panel {
  margin-top: 24px;
}

.phase-plan {
  display: grid;
  gap: 12px;
  padding-left: 0;
  margin: 0;
  list-style: none;
}

.phase-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.phase-item.complete {
  opacity: 0.58;
}

.phase-item.active {
  border-color: rgba(124, 224, 176, 0.65);
  background: rgba(124, 224, 176, 0.12);
}

.phase-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.score-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.score-card,
.arousal-card {
  padding: 18px;
}

.score-number {
  margin-bottom: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--warn);
}

.arousal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.arousal-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.arousal-title {
  margin-bottom: 10px;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--warn);
}

.arousal-hints {
  margin-top: 12px;
}

.arousal-callout {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(141, 180, 255, 0.2);
  border-radius: 20px;
  background: rgba(141, 180, 255, 0.08);
}

.schedule-week-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.week-tab {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.week-tab.active {
  border-color: rgba(171, 141, 255, 0.88);
  background: rgba(171, 141, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(171, 141, 255, 0.22);
}

.week-tab-label {
  font-weight: 700;
  color: var(--text);
}

.week-tab-focus {
  color: var(--muted);
  font-size: 0.92rem;
}

.schedule-grid {
  grid-template-columns: 1fr;
}

.week-card {
  padding: 18px;
}

.week-heading {
  margin-bottom: 14px;
}

.week-heading h3 {
  margin-bottom: 6px;
}

.week-heading p {
  margin-bottom: 0;
  color: var(--accent);
}

.week-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.day-card {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
}

.day-card-button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
}

.day-card-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.day-card-button:focus-visible {
  outline: 2px solid rgba(141, 180, 255, 0.9);
  outline-offset: 2px;
}

.day-card.selected {
  border-color: rgba(171, 141, 255, 0.88);
  background: rgba(171, 141, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(171, 141, 255, 0.22);
}

.day-card.current {
  border-color: rgba(124, 224, 176, 0.7);
  background: rgba(124, 224, 176, 0.12);
}

.day-card.past {
  opacity: 0.7;
}

.day-top {
  margin-bottom: 6px;
  font-size: 0.92rem;
}

.day-card h4 {
  margin-bottom: 6px;
}

.day-date,
.day-summary,
.day-duration {
  margin-bottom: 6px;
}

.day-duration {
  margin-bottom: 0;
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 1024px) {
  .top-grid,
  .score-grid,
  .arousal-grid,
  .week-list,
  .schedule-week-tabs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding: 20px 0 36px;
  }

  .hero-stats,
  .button-row {
    grid-template-columns: 1fr;
  }

  .timer-meta {
    flex-direction: column;
  }

  .hero-card,
  .panel {
    padding: 20px;
    border-radius: 20px;
  }
}
