/* ===== 番茄钟 - 全局样式 & 皮肤系统 ===== */

/* ---------- CSS 自定义属性 (默认橙色主题) ---------- */
:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-tertiary: #0f3460;
  --accent-primary: #ff6b35;
  --accent-secondary: #ff8c5a;
  --accent-gradient-1: #ff6b35;
  --accent-gradient-2: #ff4500;
  --text-primary: #ffffff;
  --text-secondary: #c0c0d0;
  --text-muted: #8888a0;
  --card-bg: rgba(255, 107, 53, 0.06);
  --card-border: rgba(255, 107, 53, 0.15);
  --ring-track: rgba(255, 107, 53, 0.12);
  --ring-progress: #ff6b35;
  --btn-primary-bg: #ff6b35;
  --btn-primary-text: #ffffff;
  --btn-hover-bg: #ff8c5a;
  --btn-secondary-bg: rgba(255, 107, 53, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 20px 60px rgba(255, 107, 53, 0.15);
  --shadow-btn: 0 4px 15px rgba(255, 107, 53, 0.35);
  --timer-glow: #ff6b35;
  --panel-bg: rgba(22, 33, 62, 0.98);
  --overlay-bg: rgba(0, 0, 0, 0.6);
  --switch-bg: #3a3a5a;
  --switch-active: #ff6b35;
  --mode-btn-bg: rgba(255, 107, 53, 0.08);
  --mode-btn-active: rgba(255, 107, 53, 0.2);
  --task-done-bg: rgba(255, 107, 53, 0.08);
  --dot-inactive: rgba(255, 107, 53, 0.2);
  --dot-active: #ff6b35;
  --bg-decoration-opacity: 0.04;
}

/* ---------- 全局重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.5s, color 0.5s;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 背景装饰 ---------- */
.bg-decoration { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
  opacity: var(--bg-decoration-opacity);
  filter: blur(80px);
}
.bg-circle-1 { width: 600px; height: 600px; top: -200px; right: -150px; }
.bg-circle-2 { width: 400px; height: 400px; bottom: -100px; left: -100px; }
.bg-circle-3 { width: 300px; height: 300px; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* ---------- 应用容器 ---------- */
.app-container {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ---------- 顶部导航 ---------- */
.app-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0 20px;
}
.header-left { display: flex; align-items: baseline; gap: 8px; }
.app-logo { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.3px; }
.app-version { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }
.header-right { display: flex; gap: 4px; }

/* 图标按钮 */
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.icon-btn:hover { color: var(--text-primary); background: var(--btn-secondary-bg); border-color: var(--card-border); }

/* 安装按钮高亮 */
.install-btn {
  color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  animation: installPulse 2s ease-in-out infinite;
}
@keyframes installPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,53,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(255,107,53,0); }
}

/* ---------- 计时器区域 ---------- */
.timer-section {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 20px 0;
}
.timer-container {
  display: flex; flex-direction: column; align-items: center;
  gap: 28px; width: 100%;
}

/* SVG 圆环 */
.timer-ring-wrapper {
  position: relative;
  width: min(300px, 75vw); height: min(300px, 75vw);
}
.timer-ring {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.ring-track {
  stroke: var(--ring-track);
  stroke-dasharray: 816.8; stroke-dashoffset: 0;
  transition: stroke 0.5s;
}
.ring-progress {
  stroke-dasharray: 816.8;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear, stroke 0.5s;
}

/* 计时器文字 */
.timer-display {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  user-select: none;
}
.timer-text {
  font-size: 3.8rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  line-height: 1;
  transition: color 0.5s;
  text-shadow: 0 0 30px var(--timer-glow);
}
.timer-label {
  font-size: 0.85rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 3px; color: var(--text-secondary);
  margin-top: 8px; transition: color 0.5s;
}

/* 进度圆点 */
.session-dots { display: flex; gap: 10px; }
.session-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--dot-inactive);
  transition: all 0.4s;
}
.session-dot.active { background: var(--dot-active); box-shadow: 0 0 10px var(--dot-active); }
.session-dot.completed { background: var(--accent-primary); opacity: 0.5; }

/* 控制按钮 */
.timer-controls { display: flex; align-items: center; gap: 24px; }
.control-btn {
  border-radius: 50%; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.25s;
  color: var(--text-primary);
}
.control-btn--play {
  width: 64px; height: 64px;
  background: var(--btn-primary-bg); color: var(--btn-primary-text);
  box-shadow: var(--shadow-btn);
}
.control-btn--play:hover { background: var(--btn-hover-bg); transform: scale(1.08); }
.control-btn--play:active { transform: scale(0.95); }
.control-btn--reset, .control-btn--skip {
  width: 44px; height: 44px;
  background: var(--btn-secondary-bg); color: var(--text-secondary);
}
.control-btn--reset:hover, .control-btn--skip:hover {
  background: var(--card-border); color: var(--text-primary);
}

/* 模式切换按钮 */
.mode-switches { display: flex; gap: 8px; background: var(--card-bg); border-radius: 12px; padding: 4px; }
.mode-btn {
  padding: 8px 18px; border-radius: 10px;
  border: none; background: transparent;
  color: var(--text-secondary); font-size: 0.82rem;
  font-weight: 600; cursor: pointer;
  transition: all 0.25s;
}
.mode-btn:hover { color: var(--text-primary); }
.mode-btn.active {
  background: var(--mode-btn-active); color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ---------- 任务区域 ---------- */
.task-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px; padding: 18px;
  backdrop-filter: blur(10px);
}
.task-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.task-title { font-size: 0.95rem; font-weight: 700; }
.task-count { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }

.task-input-row { display: flex; gap: 8px; margin-bottom: 12px; }
.task-input {
  flex: 1; padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.task-input:focus { border-color: var(--accent-primary); }
.task-input::placeholder { color: var(--text-muted); }
.task-add-btn {
  width: 40px; height: 40px;
  border-radius: 10px; border: none;
  background: var(--btn-primary-bg); color: var(--btn-primary-text);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.task-add-btn:hover { background: var(--btn-hover-bg); }

.task-list { list-style: none; max-height: 200px; overflow-y: auto; }
.task-list::-webkit-scrollbar { width: 4px; }
.task-list::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 2px; }

.task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  transition: background 0.2s;
  animation: slideIn 0.25s ease;
}
.task-item:hover { background: var(--card-bg); }
.task-item.done .task-item-text { text-decoration: line-through; color: var(--text-muted); }
.task-item.done { background: var(--task-done-bg); }

.task-checkbox {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  cursor: pointer; flex-shrink: 0;
  transition: all 0.25s;
  position: relative;
}
.task-checkbox:checked {
  background: var(--accent-primary); border-color: var(--accent-primary);
}
.task-checkbox:checked::after {
  content: '✓'; position: absolute;
  inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; font-weight: 700;
}
.task-item-text { flex: 1; font-size: 0.85rem; transition: all 0.2s; }
.task-delete-btn {
  width: 26px; height: 26px;
  border-radius: 50%; border: none;
  background: transparent; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all 0.2s; font-size: 0.9rem;
}
.task-item:hover .task-delete-btn { opacity: 1; }
.task-delete-btn:hover { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* ---------- 面板 (侧边滑出) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--overlay-bg);
  display: flex; justify-content: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.panel {
  width: min(380px, 90vw); height: 100vh;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--card-border);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.overlay.open .panel { transform: translateX(0); }

.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.panel-title { font-size: 1.05rem; font-weight: 700; }
.panel-close {
  width: 32px; height: 32px;
  border-radius: 50%; border: none;
  background: var(--btn-secondary-bg); color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.panel-close:hover { color: var(--text-primary); background: var(--card-border); }

.panel-body {
  flex: 1; overflow-y: auto; padding: 20px;
}
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 2px; }

/* 设置表单 */
.setting-group { margin-bottom: 28px; }
.setting-group-title {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--accent-primary); margin-bottom: 14px;
}
.setting-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.setting-label { font-size: 0.85rem; color: var(--text-secondary); }
.setting-input-group { display: flex; align-items: center; gap: 6px; }
.setting-stepper {
  width: 30px; height: 30px;
  border-radius: 8px; border: 1px solid var(--card-border);
  background: var(--card-bg); color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 600;
  transition: all 0.15s;
}
.setting-stepper:hover { background: var(--btn-secondary-bg); color: var(--text-primary); }
.setting-input {
  width: 56px; height: 30px; text-align: center;
  border-radius: 8px; border: 1px solid var(--card-border);
  background: var(--bg-primary); color: var(--text-primary);
  font-size: 0.85rem; font-weight: 600; outline: none;
}
.setting-input:focus { border-color: var(--accent-primary); }
.setting-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.setting-select {
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--bg-primary); color: var(--text-primary);
  font-size: 0.82rem; outline: none; cursor: pointer;
}

.setting-range {
  -webkit-appearance: none; appearance: none;
  width: 120px; height: 6px; border-radius: 3px;
  background: var(--card-border); outline: none;
}
.setting-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--accent-primary); cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* 开关 */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { display: none; }
.switch-slider {
  position: absolute; inset: 0; border-radius: 24px;
  background: var(--switch-bg); cursor: pointer;
  transition: background 0.3s;
}
.switch-slider::after {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px;
  transition: transform 0.3s;
}
.switch input:checked + .switch-slider { background: var(--switch-active); }
.switch input:checked + .switch-slider::after { transform: translateX(20px); }

/* ---------- 皮肤面板 ---------- */
.skin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.skin-card {
  aspect-ratio: 1;
  border-radius: 14px; border: 2px solid transparent;
  cursor: pointer; overflow: hidden;
  transition: all 0.25s;
  position: relative;
  display: flex; align-items: flex-end; padding: 10px;
}
.skin-card:hover { transform: translateY(-2px); }
.skin-card.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent-primary); }
.skin-card-name {
  font-size: 0.72rem; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.skin-card-check {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  opacity: 0; transition: opacity 0.2s;
}
.skin-card.active .skin-card-check { opacity: 1; }

.skin-divider {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; color: var(--text-muted); font-size: 0.75rem;
}
.skin-divider::before, .skin-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-subtle);
}

.skin-hint { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; }
.skin-json-input {
  width: 100%; padding: 10px; border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--bg-primary); color: var(--text-primary);
  font-size: 0.75rem; resize: vertical;
  font-family: 'SF Mono', 'Fira Code', monospace;
  outline: none;
}
.skin-json-input:focus { border-color: var(--accent-primary); }

.skin-custom-actions { display: flex; gap: 8px; margin-top: 10px; }

.btn {
  padding: 8px 16px; border-radius: 10px;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.2s;
}
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn-primary:hover { background: var(--btn-hover-bg); }
.btn-secondary { background: var(--btn-secondary-bg); color: var(--text-secondary); }
.btn-secondary:hover { background: var(--card-border); color: var(--text-primary); }

/* ---------- 统计面板 ---------- */
.stats-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 24px; }
.stat-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--accent-primary); }
.stat-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

.stats-chart-container { margin-top: 8px; }
.stats-chart-title { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 14px; }
.stats-chart { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding: 0 4px; }
.stats-chart-bar {
  flex: 1; border-radius: 6px 6px 0 0;
  background: var(--accent-primary); opacity: 0.7;
  transition: height 0.5s, opacity 0.3s;
  min-height: 4px; position: relative;
}
.stats-chart-bar:hover { opacity: 1; }
.stats-chart-bar-value {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 0.65rem; font-weight: 700; color: var(--text-secondary);
  opacity: 0; transition: opacity 0.2s;
}
.stats-chart-bar:hover .stats-chart-bar-value { opacity: 1; }
.stats-chart-labels { display: flex; gap: 10px; margin-top: 8px; padding: 0 4px; }
.stats-chart-label { flex: 1; text-align: center; font-size: 0.65rem; color: var(--text-muted); }

/* ---------- Toast ---------- */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px; border-radius: 12px;
  background: var(--card-bg); border: 1px solid var(--card-border);
  color: var(--text-primary); font-size: 0.85rem; font-weight: 500;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s ease, toastOut 0.35s ease 2.5s forwards;
  pointer-events: auto; max-width: 300px;
}
.toast.success { border-color: #22c55e; }
.toast.error { border-color: #ef4444; }

/* ---------- 动画 ---------- */
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

.timer-running .timer-text { animation: pulse 2s ease-in-out infinite; }

/* ---------- PWA 安装横幅 ---------- */
.install-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
  background: var(--panel-bg); border-top: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  padding: 12px 16px;
  animation: slideUp 0.4s ease;
}
.install-banner-content {
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.install-banner-icon { font-size: 1.8rem; flex-shrink: 0; }
.install-banner-text { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.install-banner-text strong { font-size: 0.88rem; color: var(--text-primary); }
.install-banner-text span { font-size: 0.75rem; color: var(--text-muted); }
.install-banner-btn { flex-shrink: 0; white-space: nowrap; }
.install-banner-close {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: transparent; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
}
.install-banner-close:hover { background: var(--btn-secondary-bg); color: var(--text-primary); }

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---------- 响应式 ---------- */
@media (max-width: 400px) {
  .timer-text { font-size: 3rem; }
  .control-btn--play { width: 56px; height: 56px; }
  .mode-btn { padding: 6px 12px; font-size: 0.75rem; }
}

/* ===== 轮播面板 (无限循环：计时 ↔ 指针时钟 ↔ 数字时钟) ===== */
.carousel-viewport {
  overflow: hidden;
  width: 100%;
}

.carousel-track {
  display: flex;
  width: 300%; /* JS 动态覆盖为 500% */
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-panel {
  flex: 0 0 33.333%;
  width: 33.333%; /* JS 动态覆盖为 20% */
  display: flex; align-items: center; justify-content: center;
}

/* 时钟容器 */
.clock-container {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; width: 100%;
}

.clock-ring-wrapper {
  position: relative;
  width: min(300px, 75vw);
  height: min(300px, 75vw);
}

.clock-ring {
  width: 100%; height: 100%;
}

.clock-ring .ring-track {
  stroke: var(--ring-track);
}

.clock-display {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  user-select: none;
}

.clock-time {
  font-size: 3.2rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px; line-height: 1;
}

.clock-seconds {
  font-size: 1rem; font-weight: 600;
  color: var(--accent-primary); margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.clock-date {
  font-size: 0.8rem; color: var(--text-secondary);
  font-weight: 500; margin-top: 6px;
}

/* 数字时钟 */
.digital-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  user-select: none;
}

.digital-time-wrap {
  display: flex; align-items: baseline; gap: 6px;
}

.digital-time {
  font-size: 3.8rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 3px; line-height: 1;
  text-shadow: 0 0 30px var(--timer-glow);
}

.digital-seconds {
  font-size: 1.4rem; font-weight: 600;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
}

.digital-date {
  font-size: 0.85rem; color: var(--text-secondary);
  font-weight: 500; letter-spacing: 1px;
}

/* 刻度线 */
.clock-tick { stroke: var(--text-muted); transition: stroke 0.5s; }
.clock-tick.major { stroke: var(--text-secondary); stroke-width: 2.5; }
.clock-tick.minor { stroke: var(--ring-track); stroke-width: 1; }

/* 时区选择器 */
.tz-picker {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 5px; margin-top: 4px;
}
.tz-btn {
  padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 0.7rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
}
.tz-btn:hover { background: var(--btn-secondary-bg); color: var(--text-primary); }
.tz-btn.active { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); }

.digital-tz-label {
  font-size: 0.75rem; font-weight: 600;
  color: var(--accent-primary); letter-spacing: 1px;
  margin-top: 2px;
}

/* 面板导航点 */
.carousel-nav {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 12px;
}
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dot-inactive);
  cursor: pointer; transition: all 0.3s;
}
.carousel-dot.active { background: var(--accent-primary); box-shadow: 0 0 8px var(--accent-primary); }
.carousel-dot:hover { background: var(--accent-secondary); }

/* 导航点：紧凑模式下隐藏 */
body.compact .carousel-nav { display: none; }

/* ===== 紧凑模式 ===== */
body.compact { overflow: hidden; }

body.compact .app-header,
body.compact .task-section,
body.compact .mode-switches,
body.compact .session-dots,
body.compact .bg-decoration,
body.compact .tz-picker,
body.compact .digital-tz-label { display: none !important; }

body.compact .app-container {
  padding: 0;
  min-height: 100vh; min-height: 100dvh;
  max-width: 100%;
  justify-content: center;
  align-items: center;
}

body.compact .timer-section {
  padding: 0; flex: none;
  width: 100%;
  height: 100vh; height: 100dvh;
}

body.compact .carousel-viewport {
  width: 100%;
  height: 100vh; height: 100dvh;
}
body.compact .carousel-track { height: 100%; }
body.compact .carousel-panel {
  height: 100%;
  display: flex; align-items: center; justify-content: center;
}

body.compact .timer-container,
body.compact .clock-container,
body.compact .digital-container {
  width: 100%; max-width: 100%; padding: 8px; gap: 6px;
}

/* 环形自适应：用 vmin 确保在横屏/竖屏都合适 */
body.compact .timer-ring-wrapper,
body.compact .clock-ring-wrapper {
  width: min(65vmin, 80vw, 80vh);
  height: min(65vmin, 80vw, 80vh);
}

body.compact .timer-text      { font-size: clamp(1.6rem, 13vmin, 4rem); letter-spacing: 1px; }
body.compact .timer-label     { font-size: clamp(0.5rem, 3vmin, 1rem); letter-spacing: 2px; margin-top: 2px; }
body.compact .clock-time      { font-size: clamp(1.6rem, 13vmin, 4rem); letter-spacing: 1px; }
body.compact .clock-seconds   { font-size: clamp(0.55rem, 4vmin, 1.2rem); }
body.compact .clock-date      { font-size: clamp(0.45rem, 3vmin, 0.9rem); }
body.compact .digital-time    { font-size: clamp(2rem, 15vmin, 5rem); letter-spacing: 2px; }
body.compact .digital-seconds { font-size: clamp(0.7rem, 5vmin, 1.6rem); }
body.compact .digital-date    { font-size: clamp(0.5rem, 3vmin, 1rem); }

body.compact .timer-controls { gap: clamp(4px, 4vw, 20px); }
body.compact .control-btn--play { width: clamp(38px, 15vmin, 64px); height: clamp(38px, 15vmin, 64px); }
body.compact .control-btn--reset,
body.compact .control-btn--skip { width: clamp(26px, 9vmin, 44px); height: clamp(26px, 9vmin, 44px); }

body.compact .compact-toggle { position: fixed; top: 6px; right: 6px; opacity: 0.35; }

/* Electron 紧凑：窗口可拖拽 */
body.compact.electron-compact .app-container { -webkit-app-region: drag; user-select: none; }
body.compact.electron-compact .timer-controls,
body.compact.electron-compact .control-btn,
body.compact.electron-compact .compact-toggle,
body.compact.electron-compact .carousel-panel { -webkit-app-region: no-drag; }

/* 紧凑切换按钮基础样式 */
.compact-toggle {
  position: fixed; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border-subtle); background: var(--card-bg);
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; transition: all 0.2s; z-index: 10; opacity: 0;
}
body:hover .compact-toggle { opacity: 1; }
.compact-toggle:hover { background: var(--btn-secondary-bg); color: var(--text-primary); }
body.compact .compact-toggle { opacity: 0.5; }

