/* ═══════════════════════════════════════════
   多通道计时器 - 自定义样式
   ═══════════════════════════════════════════ */

:root {
  --bg: #FAFAF9; --bg-alt: #F5F5F4; --surface: #FFFFFF;
  --border: #E7E5E4; --border-strong: #D6D3D1;
  --text: #1E293B; --text-secondary: #52525B; --text-muted: #71717A;
  --primary: #4F46E5; --primary-hover: #4338CA;
  --primary-light: rgba(79, 70, 229, 0.08);
  --secondary: #F97316; --accent: #EC4899; --success: #059669;
  --radius: 10px; --radius-lg: 14px; --radius-xl: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.6; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.toast {
  position: fixed; top: 24px; right: 24px;
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 100px;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  z-index: 1000;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.toast.show { transform: translateX(0); }
.toast-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; }

.page { max-width: 960px; margin: 0 auto; padding: 0 32px; }

#header.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.timer-section { padding: 24px 0 32px; }

.add-timer-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 20px; margin-bottom: 16px;
}

.add-timer-row {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
}

.add-input {
  padding: 10px 14px; background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 14px; color: var(--text);
  outline: none; transition: all 0.2s ease;
}
.add-input:focus {
  border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.add-input.name-input { width: 160px; }
.add-input.time-input { width: 100px; }

.add-btn {
  padding: 10px 20px; background: var(--primary);
  border: none; border-radius: var(--radius);
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: white; cursor: pointer;
  transition: background 0.15s ease;
}
.add-btn:hover { background: var(--primary-hover); }

.batch-btn {
  padding: 10px 20px; background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.15s ease;
}
.batch-btn:hover { border-color: var(--primary); color: var(--primary); }

.timer-list { display: flex; flex-direction: column; gap: 12px; }

.timer-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 20px 24px; transition: all 0.3s ease;
}
.timer-card.alarm {
  border-color: var(--red, #DC2626);
  background: rgba(220,38,38,0.04);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(220,38,38,0.1); }
  50% { box-shadow: 0 4px 24px rgba(220,38,38,0.25); }
}

.timer-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.timer-name {
  font-size: 16px; font-weight: 600; color: var(--text);
}

.timer-display {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 40px; font-weight: 700; text-align: center;
  color: var(--text); margin: 16px 0;
  letter-spacing: 0.02em;
}
.timer-display.expired { color: #DC2626; }

.timer-actions {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}

.timer-btn {
  padding: 8px 18px; background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: 100px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.15s ease;
}
.timer-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.timer-btn.start { background: var(--success); border-color: var(--success); color: white; }
.timer-btn.start:hover { background: #047857; }
.timer-btn.pause { background: var(--secondary); border-color: var(--secondary); color: white; }
.timer-btn.pause:hover { background: #EA580C; }
.timer-btn.delete { color: #DC2626; }
.timer-btn.delete:hover { background: rgba(220,38,38,0.08); border-color: rgba(220,38,38,0.3); }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}

.guide-section {
  margin-top: 16px; margin-bottom: 64px;
  background: #ffffff; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.guide-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 14px 20px;
  background: none; border: none; cursor: pointer;
  transition: background 0.15s ease;
}
.guide-toggle:hover { background: var(--bg-alt); }
.guide-toggle-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #1E293B; }
.guide-toggle.open .toggle-arrow { transform: rotate(180deg); }
.toggle-arrow { transition: transform 0.2s ease; color: var(--text-muted); }
.guide-list { padding: 0 20px 20px; }
.guide-list.hidden { display: none; }
.guide-item { padding: 16px 0; border-top: 1px solid var(--border); }
.guide-item:first-child { border-top: 1px solid var(--border); }
.guide-item-title { font-size: 14px; font-weight: 600; color: #1E293B; margin-bottom: 6px; }
.guide-item-body { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.guide-item-body kbd { padding: 1px 6px; background: var(--bg-alt); border: 1px solid var(--border-strong); border-radius: 4px; font-family: 'SF Mono', 'Cascadia Code', monospace; font-size: 12px; color: var(--text-secondary); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #A5B4FC; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
::selection { background: rgba(79, 70, 229, 0.2); color: #1E293B; }

@media (max-width: 768px) {
  .page { padding: 0 16px; }
  .add-timer-row { flex-direction: column; }
  .add-input.name-input, .add-input.time-input { width: 100%; }
  .timer-display { font-size: 28px; }
}
