/* ============================================
   考试实施进度提示系统 — 科技感深色主题
   字体改为各页面 <head> 非阻塞加载（原 @import 会因
   fonts.googleapis.com 不可达而阻塞整页渲染）
   ============================================ */

/* === CSS Custom Properties === */

/* Orbitron 数字字体已本地化（public/vendor/fonts/，可变字重 woff2 仅约 12KB，覆盖 400~900），
   内网环境零外部请求 */
@font-face {
  font-family: 'Orbitron';
  src: url('/vendor/fonts/orbitron-var.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111631;
  --bg-card: rgba(17, 22, 49, 0.85);
  --bg-card-hover: rgba(25, 33, 70, 0.9);
  --bg-overlay: rgba(5, 8, 18, 0.92);

  --accent-cyan: #00d4ff;
  --accent-blue: #0080ff;
  --accent-green: #00ff88;
  --accent-orange: #ff9500;
  --accent-red: #ff3366;
  --accent-purple: #a855f7;

  --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.4), 0 0 60px rgba(0, 212, 255, 0.1);
  --glow-green: 0 0 20px rgba(0, 255, 136, 0.4), 0 0 60px rgba(0, 255, 136, 0.1);
  --glow-blue: 0 0 20px rgba(0, 128, 255, 0.4), 0 0 60px rgba(0, 128, 255, 0.1);

  --text-primary: #f0f4ff;
  --text-secondary: #7b8caa;
  --text-muted: #4a5578;

  --border-subtle: rgba(0, 212, 255, 0.1);
  --border-active: rgba(0, 212, 255, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-display: 'Orbitron', 'Segoe UI', monospace;
  --font-body: 'Microsoft YaHei', '微软雅黑', 'PingFang SC', -apple-system, 'Segoe UI', sans-serif;
  --font-title: 'SimSun', '宋体', 'Source Han Serif SC', 'Noto Serif SC', serif;

  --transition-fast: 0.2s ease;
  --transition-normal: 0.35s ease;
  --transition-slow: 0.6s ease;
}

/* ============================================
   白屏模式（浅色主题）— html[data-theme="light"]
   由 theme.js 切换，localStorage['examTheme'] 持久化
   ============================================ */
[data-theme="light"] {
  --bg-primary: #e8eef6;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-overlay: rgba(232, 238, 246, 0.95);

  --accent-cyan: #0086b3;
  --accent-blue: #0062cc;
  --accent-green: #00a854;
  --accent-orange: #d97706;
  --accent-red: #e0294f;
  --accent-purple: #8b31d6;

  --glow-cyan: 0 0 12px rgba(0, 134, 179, 0.16), 0 0 30px rgba(0, 134, 179, 0.05);
  --glow-green: 0 0 12px rgba(0, 168, 84, 0.16), 0 0 30px rgba(0, 168, 84, 0.05);
  --glow-blue: 0 0 12px rgba(0, 98, 204, 0.16), 0 0 30px rgba(0, 98, 204, 0.05);

  --text-primary: #16233a;
  --text-secondary: #4c5d7a;
  --text-muted: #8595ae;

  --border-subtle: rgba(30, 90, 140, 0.18);
  --border-active: rgba(0, 134, 179, 0.5);
}

/* 浅色主题下覆盖深色硬编码背景与效果 */
[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 120, 200, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(0, 134, 179, 0.05) 0%, transparent 60%);
}

[data-theme="light"] body::after {
  background-image:
    linear-gradient(rgba(0, 90, 150, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 90, 150, 0.045) 1px, transparent 1px);
}

[data-theme="light"] .scan-line {
  opacity: 0.06;
}

[data-theme="light"] .header,
[data-theme="light"] .schedule-header {
  background: rgba(255, 255, 255, 0.78);
}

[data-theme="light"] .debug-bar {
  background: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .schedule-nav {
  background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .schedule-table th {
  background: rgba(0, 100, 160, 0.08);
  color: #14506e;
}

[data-theme="light"] .schedule-table td {
  border-bottom: 1px solid rgba(30, 90, 140, 0.1);
}

[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 30px rgba(30, 60, 110, 0.2);
}

[data-theme="light"] .seat-shift-clock-card.right {
  background: rgba(255, 255, 255, 0.65);
}

[data-theme="light"] .seat-shift-clock-card.left .seat-shift-body {
  color: #16233a;
}

[data-theme="light"] .seat-shift-clock-card.left .divider-line {
  color: rgba(22, 35, 58, 0.35);
}

/* 浅色下启动按钮文字改白色（原为 var(--bg-primary) 会变成浅字浅底） */
[data-theme="light"] .start-overlay__btn {
  color: #ffffff;
}

/* 浅色下关闭大字号的深色主题辉光，避免白底上发虚 */
[data-theme="light"] .header__title,
[data-theme="light"] .start-overlay__title,
[data-theme="light"] .clock-time,
[data-theme="light"] .progress-value {
  text-shadow: none;
}

/* 青色半透明底在白底上过淡，加深一档 */
[data-theme="light"] .nav-btn,
[data-theme="light"] .schedule-nav__btn {
  background: rgba(0, 134, 179, 0.08);
}

[data-theme="light"] .nav-btn:hover,
[data-theme="light"] .schedule-nav__btn:hover {
  background: rgba(0, 134, 179, 0.16);
}

[data-theme="light"] .backend-msg-close {
  border-color: rgba(30, 90, 140, 0.3);
}

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Background Effects === */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 128, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(0, 212, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(10, 14, 26, 0) 0%, var(--bg-primary) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle grid overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* === Scan Line Animation === */
@keyframes scanLine {
  0% { transform: translateY(-100vh); }
  100% { transform: translateY(100vh); }
}

.scan-line {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-cyan) 50%, transparent 100%);
  opacity: 0.15;
  z-index: 1;
  animation: scanLine 8s linear infinite;
  pointer-events: none;
}

/* ============================================
   START OVERLAY
   ============================================ */
.start-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.start-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-overlay__icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.start-overlay__title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--text-primary);
  text-shadow: var(--glow-cyan);
  margin-bottom: 0.5rem;
}

.start-overlay__subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.start-overlay__btn {
  position: relative;
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--bg-primary);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  padding: 1rem 3rem;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 30px rgba(0, 212, 255, 0.3);
}

.start-overlay__btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 40px rgba(0, 212, 255, 0.5);
}

.start-overlay__btn::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  z-index: -1;
  opacity: 0.4;
  filter: blur(12px);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

.start-overlay__clock-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2.5rem;
}

.start-overlay__clock {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--accent-cyan);
  letter-spacing: 0.1em;
  opacity: 0.8;
  text-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.start-overlay__sync {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
}

.start-overlay__sync:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.15);
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.app-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 0;
  overflow: hidden;
}

/* === Header === */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 2rem;
  background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header__left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.header__icon {
  font-size: 1.5rem;
}

.header__title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* === Connection Status Badge (Online / Offline / Reconnecting) === */
.connection-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  user-select: none;
}

.connection-status-badge.online {
  background: rgba(48, 209, 88, 0.15);
  border: 1px solid rgba(48, 209, 88, 0.6);
  color: #30d158;
  box-shadow: 0 0 10px rgba(48, 209, 88, 0.2);
}

.connection-status-badge.offline {
  background: rgba(255, 69, 58, 0.18);
  border: 1px solid rgba(255, 69, 58, 0.7);
  color: #ff453a;
  box-shadow: 0 0 10px rgba(255, 69, 58, 0.3);
}

.connection-status-badge.reconnecting {
  background: rgba(255, 159, 10, 0.18);
  border: 1px solid rgba(255, 159, 10, 0.7);
  color: #ff9f0a;
  box-shadow: 0 0 10px rgba(255, 159, 10, 0.3);
}

.connection-status-badge .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.connection-status-badge.online .status-dot {
  background-color: #30d158;
  box-shadow: 0 0 6px #30d158;
  animation: pulseGreen 2s infinite ease-in-out;
}

.connection-status-badge.offline .status-dot {
  background-color: #ff453a;
  box-shadow: 0 0 6px #ff453a;
  animation: pulseRed 1s infinite ease-in-out;
}

.connection-status-badge.reconnecting .status-dot {
  background-color: #ff9f0a;
  box-shadow: 0 0 6px #ff9f0a;
  animation: pulseOrange 0.8s infinite ease-in-out;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); opacity: 0.7; box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.7); }
  70% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 0 5px rgba(48, 209, 88, 0); }
  100% { transform: scale(0.95); opacity: 0.7; box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

@keyframes pulseRed {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

@keyframes pulseOrange {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.header__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.nav-btn:hover {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--border-active);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.1);
}

/* === Toggle Switch === */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  transition: all 0.3s;
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(0, 212, 255, 0.2);
  border-color: var(--accent-cyan);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(16px);
  background: var(--accent-cyan);
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.4);
}

.toggle-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  transition: color 0.3s;
}

.toggle-switch input:checked ~ .toggle-label {
  color: var(--accent-cyan);
}

/* === Voice Controls === */
.voice-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.7rem;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.voice-controls__icon {
  font-size: 0.85rem;
}

.voice-select {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  max-width: 150px;
}

.voice-select:focus {
  border-color: var(--accent-cyan);
}

.voice-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* === Sync Button === */
.sync-btn {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.sync-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.12);
}

.sync-btn.synced {
  color: var(--accent-green);
  border-color: rgba(0, 255, 136, 0.3);
}

/* === Status Bar (Waiting / No exam) === */
.status-waiting {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 1.5rem;
  padding: 2rem;
}

.status-waiting.active {
  display: flex;
}

.status-waiting__icon {
  font-size: 4rem;
  opacity: 0.6;
  animation: float 4s ease-in-out infinite;
}

.status-waiting__text {
  font-size: 1.5rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.status-waiting__hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* === Main Content === */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.6rem 2rem;
  gap: 0.6rem;
  min-height: 0;
  overflow: hidden;
}

.main-content.hidden {
  display: none;
}

/* === Info Bar === */
.info-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.info-item {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  transition: all var(--transition-normal);
}

.info-item:hover {
  border-color: var(--border-active);
}

.info-item__icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.info-item__body {
  display: flex;
  flex-direction: column;
}

.info-item__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
}

.info-item__value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

/* === Clock Section === */
.clock-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.6rem 1.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  min-height: 120px;
}

.clock-center-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
}

.seat-shift-clock-card {
  flex: 1;
  max-width: 420px;
  min-width: 250px;
  z-index: 3;
  animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.seat-shift-clock-card.left {
  margin-right: auto;
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.16), rgba(255, 59, 48, 0.16));
  border: 1px solid rgba(255, 149, 0, 0.5);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  box-shadow: 0 0 16px rgba(255, 149, 0, 0.18);
}

.seat-shift-clock-card.left .seat-shift-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #ff9500;
  font-weight: bold;
  margin-bottom: 0.35rem;
  letter-spacing: 0.03em;
}

.seat-shift-clock-card.left .seat-shift-icon {
  font-size: 1.2rem;
}

.seat-shift-clock-card.left .seat-shift-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.95rem;
  color: #fff;
}

.seat-shift-clock-card.left .subject-text {
  color: var(--accent-cyan);
  font-weight: bold;
}

.seat-shift-clock-card.left .divider-line {
  color: rgba(255, 255, 255, 0.3);
}

.seat-shift-clock-card.left .code-badge {
  color: #ff9500;
  background: rgba(255, 149, 0, 0.25);
  padding: 2px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 149, 0, 0.6);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
}

.seat-shift-clock-card.right {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(255, 149, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.seat-shift-clock-card.right .seat-shift-tip-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.clock-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.clock-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.clock-time {
  font-family: var(--font-display);
  font-size: 5.5rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.3), 0 0 80px rgba(0, 212, 255, 0.1);
  line-height: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.clock-time > span {
  display: inline-block;
  text-align: center;
}

/* Fixed-width digit pairs to prevent width jumping */
#clockHH, #clockMM, #clockSS {
  width: 2.15em;
}

.clock-time .colon {
  width: 0.5em;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.clock-date {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
  letter-spacing: 0.1em;
}

/* === Progress Section === */
.progress-section {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.6rem 1.5rem;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.06), rgba(0, 212, 255, 0.06));
  border: 1px solid rgba(0, 255, 136, 0.15);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.progress-section::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent-green), var(--accent-cyan));
  border-radius: 0 4px 4px 0;
}

.progress-section.active {
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 255, 136, 0); }
  50% { box-shadow: 0 0 25px rgba(0, 255, 136, 0.08); }
}

.progress-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.progress-body {
  flex: 1;
}

.progress-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.15rem;
}

.progress-value-container {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.progress-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-green);
  text-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
  letter-spacing: 0.05em;
}

.progress-time {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-cyan);
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

/* === Timeline Section === */
.timeline-section {
  padding: 0.5rem 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) var(--bg-secondary);
  flex-shrink: 0;
}

.timeline-track {
  display: flex;
  align-items: center;
  position: relative;
  min-width: max-content;
  padding: 2.2rem 1rem 0.8rem;
}

.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 100px;
  cursor: default;
}

.timeline-node__label {
  position: absolute;
  top: -2rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.05em;
  transition: color var(--transition-fast);
}

.timeline-node__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg-primary);
  position: relative;
  z-index: 2;
  transition: all var(--transition-normal);
}

.timeline-node__time {
  margin-top: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  transition: color var(--transition-fast);
}

.timeline-connector {
  flex: 1;
  height: 2px;
  background: var(--text-muted);
  opacity: 0.3;
  min-width: 30px;
  transition: all var(--transition-normal);
}

/* Timeline States */
.timeline-node.past .timeline-node__dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.timeline-node.past .timeline-node__label,
.timeline-node.past .timeline-node__time {
  color: var(--accent-cyan);
}

.timeline-connector.past {
  background: var(--accent-cyan);
  opacity: 0.6;
}

.timeline-node.current .timeline-node__dot {
  background: var(--accent-green);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
  width: 20px;
  height: 20px;
  animation: pulseNode 2s ease-in-out infinite;
}

.timeline-node.current .timeline-node__label {
  color: var(--accent-green);
  font-weight: 700;
  font-size: 0.75rem;
}

.timeline-node.current .timeline-node__time {
  color: var(--accent-green);
  font-weight: 700;
}

@keyframes pulseNode {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.4); }
  50% { box-shadow: 0 0 25px rgba(0, 255, 136, 0.7); }
}

.timeline-node.future .timeline-node__dot {
  background: transparent;
  border: 2px solid var(--text-muted);
}

/* === Focus & Instruction Sections === */
.focus-section {
  flex: 1;
  display: flex;
  flex-direction: row;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 0;
}

.instruction-section {
  flex: 1;
  display: flex;
  flex-direction: row;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 0;
}

.focus-header, .instruction-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 0.4rem;
  border-right: 1px solid var(--border-subtle);
  width: 52px;
  min-width: 52px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.focus-header {
  background: rgba(255, 149, 0, 0.08);
}

.instruction-header {
  background: rgba(0, 128, 255, 0.08);
}

.focus-header__icon, .instruction-header__icon {
  font-size: 1.3rem;
}

.focus-header__title, .instruction-header__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  user-select: none;
}

.focus-header__title {
  color: var(--accent-orange);
}

.instruction-header__title {
  color: var(--accent-cyan);
}

.focus-content {
  padding: 0.7rem 1.5rem;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) var(--bg-secondary);
}

.instruction-content {
  padding: 0.6rem 1.5rem;
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-primary);
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) var(--bg-secondary);
}

.focus-content::-webkit-scrollbar, .instruction-content::-webkit-scrollbar {
  width: 6px;
}

.focus-content::-webkit-scrollbar-track, .instruction-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.focus-content::-webkit-scrollbar-thumb, .instruction-content::-webkit-scrollbar-thumb {
  background: var(--accent-cyan);
  border-radius: 3px;
}

.focus-content .focus-empty, .instruction-content .instruction-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 1rem;
  letter-spacing: 0.1em;
}

/* Highlight animation when instruction changes */
.focus-content.highlight {
  animation: focusFlash 1.5s ease;
}

.instruction-content.highlight {
  animation: instructionFlash 1.5s ease;
}

@keyframes focusFlash {
  0% { background: rgba(255, 149, 0, 0.1); }
  100% { background: transparent; }
}

@keyframes instructionFlash {
  0% { background: rgba(0, 212, 255, 0.1); }
  100% { background: transparent; }
}

/* ============================================
   DEBUG BAR
   ============================================ */
.debug-bar {
  padding: 0.5rem 1.5rem;
  background: rgba(10, 14, 26, 0.9);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
}

.debug-bar-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.debug-toggle-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 149, 0, 0.08);
  border: 1px solid rgba(255, 149, 0, 0.2);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.debug-toggle-btn:hover {
  color: var(--accent-orange);
  background: rgba(255, 149, 0, 0.15);
  border-color: rgba(255, 149, 0, 0.4);
}

.debug-toggle-btn.active {
  color: var(--bg-primary);
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  font-weight: bold;
}

.debug-controls {
  display: none;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.debug-controls.show {
  display: flex;
}

.debug-controls label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.debug-controls input[type="datetime-local"] {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  outline: none;
}

.debug-controls input:focus {
  border-color: var(--accent-orange);
}

.debug-btn {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.debug-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--border-active);
}

.debug-btn.active {
  color: var(--accent-orange);
  border-color: var(--accent-orange);
}

.debug-speed-group {
  display: flex;
  gap: 0.3rem;
}

.debug-status {
  font-size: 0.7rem;
  color: var(--accent-orange);
  margin-left: auto;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}

/* ============================================
   SCHEDULE PAGE
   ============================================ */
.schedule-page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2rem;
  background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.schedule-header__title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--accent-cyan);
}

.schedule-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.8rem 2rem;
  background: rgba(17, 22, 49, 0.5);
  border-bottom: 1px solid var(--border-subtle);
}

.schedule-nav__btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.schedule-nav__btn:hover,
.schedule-nav__btn.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.08);
}

.schedule-container {
  flex: 1;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Subject Card */
.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-normal);
}

.subject-card:hover {
  border-color: var(--border-active);
}

.subject-card__header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(0, 128, 255, 0.08), rgba(0, 212, 255, 0.04));
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.subject-card__name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.08em;
}

.subject-card__meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.subject-card__meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.subject-card__meta-item span {
  font-weight: 600;
  color: var(--text-primary);
}

/* Schedule Table */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
}

.schedule-table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.8rem 1.2rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
}

.schedule-table td {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: top;
  font-size: 0.9rem;
  line-height: 1.8;
}

.schedule-table tr:last-child td {
  border-bottom: none;
}

.schedule-table tr:hover td {
  background: rgba(0, 212, 255, 0.03);
}

.schedule-table .col-time {
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
  width: 80px;
}

.schedule-table .col-progress {
  white-space: nowrap;
  font-weight: 600;
  color: var(--accent-green);
  width: 150px;
}

.schedule-table .col-focus {
  color: var(--accent-orange);
  font-weight: 500;
  width: 250px;
}

.schedule-table .col-instruction {
  color: var(--text-secondary);
  line-height: 1.9;
}

/* Current row highlight in schedule */
.schedule-table tr.current-row td {
  background: rgba(0, 255, 136, 0.06);
  border-color: rgba(0, 255, 136, 0.1);
}

.schedule-table tr.current-row .col-time {
  color: var(--accent-green);
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */
.toast-container {
  position: fixed;
  top: 5rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1.1rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
  width: 360px;
  max-width: 90vw;
  opacity: 0;
  transform: translateX(110%);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(30px); }
}

.toast__icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast__text {
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-cyan { color: var(--accent-cyan); }
.text-green { color: var(--accent-green); }
.text-orange { color: var(--accent-orange); }
.text-red { color: var(--accent-red); }
.text-muted { color: var(--text-muted); }

.hidden { display: none !important; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .header {
    padding: 0.8rem 1rem;
  }

  .header__title {
    font-size: 0.85rem;
  }

  .main-content {
    padding: 0.8rem 1rem;
    gap: 0.8rem;
  }

  .info-bar {
    flex-direction: column;
  }

  .clock-time {
    font-size: 3rem;
  }

  .progress-value {
    font-size: 1.2rem;
  }

  .focus-section, .instruction-section {
    flex-direction: column;
  }

  .focus-header, .instruction-header {
    flex-direction: row;
    width: auto;
    padding: 0.5rem 1.2rem;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .focus-header__title, .instruction-header__title {
    flex-direction: row;
    gap: 0.15rem;
    margin-top: 0;
  }

  .focus-content, .instruction-content {
    font-size: 1rem;
  }

  .schedule-container {
    padding: 1rem;
  }

  .schedule-table .col-instruction {
    min-width: 200px;
  }
}

/* Large screen optimizations */
@media (min-width: 1600px) {
  .clock-time {
    font-size: 7rem;
  }

  .info-item__value {
    font-size: 1.6rem;
  }

  .progress-value {
    font-size: 2rem;
  }

  .progress-time {
    font-size: 1.5rem;
  }

  .focus-content {
    font-size: 1.35rem;
    line-height: 1.65;
  }
  .instruction-content {
    font-size: 1.22rem;
    line-height: 1.6;
  }
}

@media (min-width: 2500px) {
  .clock-time {
    font-size: 9rem;
  }

  .info-item__value {
    font-size: 2rem;
  }

  .progress-value {
    font-size: 2.5rem;
  }

  .progress-time {
    font-size: 1.8rem;
  }

  .focus-content {
    font-size: 1.6rem;
    line-height: 1.75;
  }
  .instruction-content {
    font-size: 1.45rem;
    line-height: 1.7;
  }

  .header__title {
    font-size: 1.5rem;
  }
}

/* === Backend Message Box === */
.backend-msg-box {
  margin-bottom: 1rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 51, 102, 0.08);
  border: 1px solid rgba(255, 51, 102, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.15);
  animation: msgPulse 2s infinite alternate;
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

@keyframes msgPulse {
  0% { border-color: rgba(255, 51, 102, 0.25); box-shadow: 0 0 10px rgba(255, 51, 102, 0.1); }
  100% { border-color: rgba(255, 51, 102, 0.45); box-shadow: 0 0 20px rgba(255, 51, 102, 0.25); }
}

.backend-msg-header {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.backend-msg-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.backend-msg-body {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  word-break: break-word;
}

.backend-msg-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.backend-msg-ack {
  background: rgba(0, 255, 136, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  padding: 0.25rem 0.75rem;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.backend-msg-ack:hover {
  background: var(--accent-green);
  color: #0b1120;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.5);
}

.backend-msg-ack.acked {
  background: rgba(0, 255, 136, 0.25);
  color: var(--accent-green);
  border-color: var(--accent-green);
  cursor: default;
  box-shadow: none;
}

.backend-msg-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 14px;
  transition: all 0.2s;
  white-space: nowrap;
}

.backend-msg-close:hover {
  color: var(--accent-red);
  border-color: var(--accent-red);
  background: rgba(255, 51, 102, 0.1);
}
