/* ===== 玲玲的工作台 - 全局样式 ===== */
/* 主题：樱粉雾蓝 / 蜜桃海蓝 / 紫粉梦幻 / 藕粉靛蓝 — 粉色配蓝色 多色协调 */

/* ---------- 樱粉雾蓝（默认）---------- */
/* 樱花粉 + 雾霾蓝 + 奶油色 — 温柔的粉蓝主调 */
:root,
[data-theme="mist"] {
  --primary: #F4A6C0;          /* 樱花粉 - 主色 */
  --primary-light: #F8C4D6;
  --primary-dark: #D981A0;
  --accent: #7AA8C4;           /* 雾霾蓝 - 强调色 */
  --accent-dark: #5B89A8;
  --secondary: #FFE5EC;        /* 奶油粉 - 辅助 */
  --info: #A5C5DD;

  --bg-main: #FDF5F8;          /* 浅粉白 */
  --bg-card: #FFFFFF;
  --bg-soft: #FFF0F5;
  --bg-header: linear-gradient(135deg, #F4A6C0 0%, #D981A0 50%, #7AA8C4 100%);

  --text-primary: #4A3340;
  --text-secondary: #8A6678;
  --text-muted: #B5A0A8;

  --border: #F2D9E2;
  --gold: #E8B8C8;
  --gold-soft: #FBEEF2;

  --shadow-sm: 0 1px 4px rgba(244, 166, 192, 0.10);
  --shadow-md: 0 4px 16px rgba(244, 166, 192, 0.14);
  --shadow-lg: 0 8px 32px rgba(244, 166, 192, 0.18);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --theme-name: "樱粉雾蓝";
}

/* ---------- 蜜桃海蓝 ---------- */
/* 蜜桃粉 + 海洋蓝 + 日光黄 — 活泼的粉蓝搭配 */
[data-theme="sunset"] {
  --primary: #FF9AAB;          /* 蜜桃粉 */
  --primary-light: #FFB8C5;
  --primary-dark: #E07A8E;
  --accent: #5B8BB5;           /* 海洋蓝 */
  --accent-dark: #3F6E96;
  --secondary: #F5C66B;        /* 日光黄 */
  --info: #7AA3C5;

  --bg-main: #FFF5F2;          /* 暖粉白 */
  --bg-card: #FFFFFF;
  --bg-soft: #FFEAE5;
  --bg-header: linear-gradient(135deg, #FF9AAB 0%, #E07A8E 50%, #5B8BB5 100%);

  --text-primary: #4A2F35;
  --text-secondary: #8A666E;
  --text-muted: #B59FA3;

  --border: #F5D9D5;
  --gold: #F5C66B;
  --gold-soft: #FFF1D6;

  --shadow-sm: 0 1px 4px rgba(255, 154, 171, 0.10);
  --shadow-md: 0 4px 16px rgba(255, 154, 171, 0.14);
  --shadow-lg: 0 8px 32px rgba(255, 154, 171, 0.18);
}

/* ---------- 紫粉梦幻 ---------- */
/* 玫瑰粉 + 丁香蓝 + 薰衣草 — 梦幻粉紫蓝调 */
[data-theme="ink"] {
  --primary: #D89BC2;          /* 玫瑰粉 */
  --primary-light: #E6B7D4;
  --primary-dark: #B97BA6;
  --accent: #8AA8D4;           /* 丁香蓝 */
  --accent-dark: #6B89B8;
  --secondary: #C9B5DB;        /* 薰衣草 */
  --info: #A5B8D5;

  --bg-main: #F7EFF5;          /* 浅紫粉 */
  --bg-card: #FFFFFF;
  --bg-soft: #EFE3F0;
  --bg-header: linear-gradient(135deg, #D89BC2 0%, #B97BA6 50%, #8AA8D4 100%);

  --text-primary: #4A3344;
  --text-secondary: #8A6680;
  --text-muted: #B5A0B0;

  --border: #E5D4E5;
  --gold: #D4A8C8;
  --gold-soft: #F5E8F0;

  --shadow-sm: 0 1px 4px rgba(216, 155, 194, 0.10);
  --shadow-md: 0 4px 16px rgba(216, 155, 194, 0.14);
  --shadow-lg: 0 8px 32px rgba(216, 155, 194, 0.18);
}

/* ---------- 藕粉靛蓝 ---------- */
/* 藕粉色 + 靛蓝 + 桂花黄 — 沉稳的粉蓝搭配 */
[data-theme="berry"] {
  --primary: #E8B5C2;          /* 藕粉色 */
  --primary-light: #F0CDD6;
  --primary-dark: #C8909E;
  --accent: #5C7B9E;           /* 靛蓝 */
  --accent-dark: #435E80;
  --secondary: #D4A574;        /* 桂花黄 */
  --info: #7A99B8;

  --bg-main: #F8F3F0;          /* 宣粉白 */
  --bg-card: #FFFFFF;
  --bg-soft: #EFE0DC;
  --bg-header: linear-gradient(135deg, #E8B5C2 0%, #C8909E 40%, #5C7B9E 100%);

  --text-primary: #3F2E32;
  --text-secondary: #766065;
  --text-muted: #A9999C;

  --border: #E0D0CC;
  --gold: #D4A574;
  --gold-soft: #F5E5D0;

  --shadow-sm: 0 1px 4px rgba(140, 100, 110, 0.08);
  --shadow-md: 0 4px 16px rgba(140, 100, 110, 0.12);
  --shadow-lg: 0 8px 32px rgba(140, 100, 110, 0.15);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 布局容器 ===== */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 80px;
}

/* ===== 顶部头部 ===== */
.app-header {
  background: var(--bg-header);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  color: #fff;
  margin-bottom: 20px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -8%;
  width: 280px;
  height: 280px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 50%;
}

.app-header::after {
  content: "";
  position: absolute;
  bottom: -30%;
  right: 15%;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.header-content {
  position: relative;
  z-index: 1;
}

.header-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-subtitle {
  font-size: 14px;
  opacity: 0.92;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 13px;
}

/* 倒计时卡片 */
.countdown-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.countdown-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  min-width: 72px;
  transition: var(--transition);
}

.countdown-badge:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.countdown-badge .cd-days {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.countdown-badge .cd-days .cd-unit {
  font-size: 12px;
  font-weight: 600;
  margin-left: 1px;
}

.countdown-badge .cd-label {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
  white-space: nowrap;
}

.countdown-badge.urgent {
  background: rgba(255, 100, 100, 0.25);
  animation: pulse-urgent 2s ease-in-out infinite;
}

@keyframes pulse-urgent {
  0%, 100% { background: rgba(255, 100, 100, 0.25); }
  50% { background: rgba(255, 100, 100, 0.4); }
}

.header-progress-ring {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 76px;
  height: 76px;
  z-index: 1;
}

/* ===== 顶栏工具区 ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.theme-switcher {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.theme-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-btn.active {
  background: var(--primary);
  color: #fff;
}

.theme-btn:not(.active):hover {
  background: var(--bg-soft);
  color: var(--text-primary);
}

.sync-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.sync-status {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.sync-status.synced { color: var(--secondary); }
.sync-status.syncing { color: var(--info); }
.sync-status.error { color: var(--primary); }

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.sync-status.synced .sync-dot { background: var(--secondary); }
.sync-status.syncing .sync-dot { background: var(--info); animation: pulse 1s infinite; }
.sync-status.error .sync-dot { background: var(--primary); }

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

.btn-sync {
  padding: 8px 16px;
  background: var(--bg-card);
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-sync:hover {
  background: var(--primary);
  color: #fff;
}

.btn-sync:active {
  transform: scale(0.96);
}

/* 同步状态 offline */
.sync-status.offline { color: var(--text-muted); }
.sync-status.offline .sync-dot { background: var(--text-muted); }

/* ===== 同步设置弹窗 ===== */
.sync-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sync-modal-box {
  background: var(--bg-card);
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.sync-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.sync-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}
.sync-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}
.sync-modal-close:hover { background: var(--bg-hover); }

.sync-modal-body {
  padding: 20px;
}

.sync-connected-tip {
  font-size: 15px;
  color: var(--secondary);
  margin-bottom: 16px;
  font-weight: 600;
}

.sync-code-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.sync-code-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
}
.sync-code-box code {
  flex: 1;
  font-size: 13px;
  word-break: break-all;
  color: var(--text);
  font-family: monospace;
}

.btn-copy-code {
  white-space: nowrap;
  padding: 6px 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-copy-code:hover { opacity: 0.85; }

.sync-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-sync-now {
  flex: 1;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-sync-now:hover { opacity: 0.85; }

.btn-disconnect-sync {
  padding: 10px 16px;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-disconnect-sync:hover { background: rgba(255,107,157,0.1); }

.sync-section-tip {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
}

.btn-generate-code {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  margin-bottom: 20px;
}
.btn-generate-code:hover { opacity: 0.9; }
.btn-generate-code:active { transform: scale(0.97); }
.btn-generate-code:disabled { opacity: 0.5; cursor: wait; }

.sync-code-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--bg-main);
  color: var(--text);
  margin-bottom: 10px;
  box-sizing: border-box;
}
.sync-code-input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-enter-code {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-enter-code:hover { opacity: 0.85; }
.btn-enter-code:disabled { opacity: 0.5; cursor: wait; }

.sync-help-tip {
  margin-top: 20px;
  padding: 12px;
  background: var(--bg-main);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.btn-clear-cache {
  padding: 8px 12px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-clear-cache:hover {
  background: var(--bg-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-clear-cache:active {
  transform: scale(0.96);
}

/* ===== 主网格布局 ===== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.main-grid .full-width {
  grid-column: 1 / -1;
}

/* ===== 卡片通用样式 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  font-size: 20px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ===== 备考计划横幅 ===== */
#plan-banner {
  border-left: 4px solid var(--accent);
  margin-bottom: 20px;
}

/* ===== 任务管理 ===== */
.task-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.task-input {
  flex: 1;
  min-width: 160px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
  background: var(--bg-soft);
  color: var(--text-primary);
}

.task-input:focus {
  border-color: var(--primary-light);
  background: var(--bg-card);
}

.task-select {
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  background: var(--bg-soft);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.task-select:focus {
  border-color: var(--primary-light);
}

.btn-add {
  padding: 10px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn-add:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-add:active {
  transform: translateY(0);
}

.btn-clear-done {
  padding: 10px 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-clear-done:hover {
  background: var(--bg-soft);
  color: var(--primary);
  border-color: var(--primary-light);
}

.btn-clear-done:active {
  transform: scale(0.97);
}

/* 任务统计条 */
.task-stats-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.stat-pill.total {
  background: var(--gold-soft);
  color: var(--accent-dark);
}

.stat-pill.done {
  background: #E8F5E9;
  color: var(--secondary);
}

.stat-pill.pending {
  background: #FFF3E0;
  color: #E65100;
}

/* 进度条 */
.progress-container {
  margin-bottom: 14px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--primary-light));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 5px;
  text-align: right;
}

/* 任务列表 */
.task-list {
  list-style: none;
  /* 移除 max-height 限制，按分组布局自适应高度 */
}

.task-list::-webkit-scrollbar {
  width: 5px;
}

.task-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--bg-soft);
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.task-item:hover {
  background: var(--gold-soft);
}

.task-item.high {
  border-left-color: var(--primary);
}

.task-item.medium {
  border-left-color: var(--accent);
}

.task-item.low {
  border-left-color: var(--info);
}

.task-item.completed {
  opacity: 0.55;
}

.task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.task-checkbox.checked {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}

.task-checkbox.checked::after {
  content: "\2713";
  font-size: 14px;
  font-weight: bold;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-text {
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-word;
}

.task-meta {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.task-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.task-tag.综合素质 {
  background: #FCE4EC;
  color: #C2185B;
}

.task-tag.wps {
  background: #E3F2FD;
  color: #1565C0;
}

.task-tag.教育知识 {
  background: #E8F5E9;
  color: #2E7D32;
}

.task-tag.语文 {
  background: #FFF3E0;
  color: #E65100;
}

.task-tag.daily {
  background: var(--gold-soft);
  color: var(--accent-dark);
}

.task-tag.other {
  background: #ECEFF1;
  color: #455A64;
}

.task-tag.kaogong {
  background: #E0F2F1;
  color: #00695C;
}

.task-tag.kaoyan {
  background: #F3E5F5;
  color: #7B1FA2;
}

.task-priority {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.task-priority.high {
  background: #FFEBEE;
  color: var(--primary);
}

.task-priority.medium {
  background: #FFF8E1;
  color: #F57F17;
}

.task-priority.low {
  background: #E3F2FD;
  color: var(--info);
}

.task-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.task-delete:hover {
  color: var(--primary);
  background: rgba(91, 123, 154, 0.08);
}

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

.empty-state .empty-icon {
  font-size: 44px;
  margin-bottom: 10px;
  opacity: 0.35;
}

/* ===== 任务分组（按倒计时/考试分组）===== */
.task-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-group {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: var(--transition);
}

.task-group:hover {
  box-shadow: var(--shadow-sm);
}

.task-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg-soft);
  transition: var(--transition);
}

.task-group-header:hover {
  background: var(--gold-soft);
}

.task-group-header .tg-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.task-group-header .tg-info {
  flex: 1;
  min-width: 0;
}

.task-group-header .tg-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.task-group-header .tg-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.task-group-header .tg-count {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  white-space: nowrap;
}

.task-group-header .tg-count.done-all {
  background: var(--secondary);
  color: #fff;
  border-color: transparent;
}

.task-group-header .tg-days {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  flex-shrink: 0;
  white-space: nowrap;
}

.task-group-header .tg-days.urgent {
  background: #FF5252;
  color: #fff;
  animation: pulse-urgent 1.5s ease-in-out infinite;
}

.task-group-header .tg-days.normal {
  background: var(--primary);
  color: #fff;
}

.task-group-header .tg-days.far {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.task-group-header .tg-arrow {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.task-group.collapsed .tg-arrow {
  transform: rotate(-90deg);
}

.task-group-body {
  padding: 6px 10px 10px;
}

.task-group.collapsed .task-group-body {
  display: none;
}

.task-group .task-item {
  margin-bottom: 6px;
}

.task-group-empty {
  text-align: center;
  padding: 16px 12px;
  color: var(--text-muted);
  font-size: 13px;
}

@keyframes pulse-urgent {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* 分组色条 */
.task-group[data-group="jiaozi"] { border-top: 3px solid #F4A6C0; }
.task-group[data-group="wps"]    { border-top: 3px solid #7AA8C4; }
.task-group[data-group="guokao"] { border-top: 3px solid #8AA8D4; }
.task-group[data-group="kaoyan"] { border-top: 3px solid #D89BC2; }
.task-group[data-group="daily"]  { border-top: 3px solid var(--text-muted); }

/* ===== 知识卡片 ===== */
.knowledge-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.knowledge-tabs::-webkit-scrollbar {
  height: 3px;
}

.knowledge-tabs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.tab-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-soft);
  color: var(--text-secondary);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tab-btn:not(.active):hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.knowledge-card-container {
  perspective: 1000px;
  margin-bottom: 14px;
}

.knowledge-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.knowledge-card.综合素质 {
  border-top: 4px solid #C2185B;
}

.knowledge-card.wps {
  border-top: 4px solid #1565C0;
}

.knowledge-card.教育知识 {
  border-top: 4px solid var(--secondary);
}

.knowledge-card.语文 {
  border-top: 4px solid #E65100;
}

.knowledge-card.kaogong {
  border-top: 4px solid #00695C;
}

.knowledge-card.kaoyan {
  border-top: 4px solid #7B1FA2;
}

.knowledge-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-difficulty {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.card-difficulty.基础 {
  background: #E8F5E9;
  color: #2E7D32;
}

.card-difficulty.中频 {
  background: #E3F2FD;
  color: #1565C0;
}

.card-difficulty.高频,
.card-difficulty.重点 {
  background: #FCE4EC;
  color: #C2185B;
}

.knowledge-category {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.knowledge-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-right: 60px;
}

.knowledge-points {
  list-style: none;
  margin-bottom: 14px;
}

.knowledge-points li {
  padding: 7px 0 7px 22px;
  font-size: 14px;
  color: var(--text-secondary);
  position: relative;
  border-bottom: 1px solid var(--bg-soft);
}

.knowledge-points li:last-child {
  border-bottom: none;
}

.knowledge-points li::before {
  content: "\25C6";
  position: absolute;
  left: 0;
  top: 7px;
  color: var(--accent);
  font-size: 11px;
}

.knowledge-tip {
  background: var(--gold-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
  border-left: 3px solid var(--gold);
}

.knowledge-tip .tip-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.knowledge-code {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 13px;
  overflow-x: auto;
  margin-bottom: 12px;
  line-height: 1.5;
  white-space: pre;
}

.card-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.card-nav-btn {
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-soft);
  color: var(--text-secondary);
  -webkit-tap-highlight-color: transparent;
}

.card-nav-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.card-counter {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-mastered {
  padding: 8px 14px;
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.btn-mastered.mastered {
  background: var(--border);
  color: var(--text-muted);
}

/* ===== 每日复盘 ===== */
.review-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.review-stat-box {
  text-align: center;
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.review-stat-box .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.review-stat-box .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.review-textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: var(--transition);
  background: var(--bg-soft);
  color: var(--text-primary);
}

.review-textarea:focus {
  border-color: var(--primary-light);
  background: var(--bg-card);
}

.review-save-btn {
  margin-top: 10px;
  padding: 8px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.review-save-btn:hover {
  background: var(--primary-dark);
}

/* ===== 效率分析 ===== */
.chart-container {
  position: relative;
  height: 180px;
  margin-top: 10px;
}

.chart-legend {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.weekly-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.day-cell {
  text-align: center;
  padding: 8px 2px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  transition: var(--transition);
}

.day-cell.today {
  background: var(--primary);
  color: #fff;
}

.day-cell .day-name {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.day-cell.today .day-name {
  color: rgba(255, 255, 255, 0.85);
}

.day-cell .day-num {
  font-size: 16px;
  font-weight: 700;
}

.day-cell .day-completion {
  font-size: 10px;
  margin-top: 3px;
  color: var(--secondary);
  font-weight: 600;
}

.day-cell.today .day-completion {
  color: rgba(255, 255, 255, 0.9);
}

.day-cell.no-data .day-completion {
  color: var(--text-muted);
}

/* ===== 效率建议 ===== */
.suggestion-list {
  list-style: none;
}

.suggestion-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  margin-bottom: 8px;
  transition: var(--transition);
}

.suggestion-item:hover {
  background: var(--gold-soft);
}

.suggestion-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.suggestion-icon.time { background: #E3F2FD; }
.suggestion-icon.focus { background: #FCE4EC; }
.suggestion-icon.method { background: #E8F5E9; }
.suggestion-icon.review { background: #FFF3E0; }

.suggestion-content { flex: 1; }

.suggestion-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.suggestion-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== 移动端底部导航 ===== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  z-index: 100;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
}

.nav-tab.active {
  color: var(--primary);
}

.nav-tab-icon {
  font-size: 22px;
  line-height: 1;
}

.nav-tab-label {
  font-size: 10px;
  font-weight: 600;
}

.nav-tab.active .nav-tab-icon {
  transform: scale(1.1);
}

/* PWA 安装提示 */
.pwa-install-banner {
  display: none;
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 99;
  font-size: 13px;
  color: var(--text-primary);
  align-items: center;
  gap: 10px;
  max-width: 90%;
}

.pwa-install-banner.show {
  display: flex;
}

.pwa-install-banner .install-btn {
  padding: 6px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pwa-install-banner .close-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 4px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  opacity: 1;
}

/* ===== 动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.4s ease; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in { animation: slideIn 0.3s ease; }

/* ===== 响应式：平板 ===== */
@media (max-width: 1024px) {
  .app-container {
    padding: 16px;
  }

  .main-grid {
    gap: 16px;
  }

  .app-header {
    padding: 24px 26px;
  }

  .header-title {
    font-size: 24px;
  }
}

/* ===== 响应式：手机 ===== */
@media (max-width: 768px) {
  .app-container {
    padding: 12px;
    padding-bottom: 80px;
  }

  /* 显示底部导航 */
  .mobile-nav {
    display: block;
  }

  /* 单列布局 */
  .main-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* 移动端只显示当前 tab 对应的 section */
  .main-grid .card-section {
    display: none;
  }

  .main-grid .card-section.active {
    display: block;
  }

  #plan-banner.active {
    display: block;
  }

  #plan-banner:not(.active) {
    display: none;
  }

  .full-width.active {
    display: block;
  }

  .full-width:not(.active) {
    display: none;
  }

  .app-header {
    padding: 20px 18px;
    border-radius: var(--radius-lg);
  }

  .header-title {
    font-size: 20px;
  }

  .header-subtitle {
    font-size: 12px;
    gap: 8px;
  }

  .countdown-badges {
    gap: 6px;
  }

  .countdown-badge {
    padding: 5px 10px;
    min-width: 60px;
  }

  .countdown-badge .cd-days {
    font-size: 18px;
  }

  .countdown-badge .cd-label {
    font-size: 10px;
  }

  .header-progress-ring {
    width: 60px;
    height: 60px;
    top: 14px;
    right: 14px;
  }

  .toolbar {
    gap: 8px;
    margin-bottom: 14px;
  }

  .theme-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .theme-switcher {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sync-status {
    font-size: 11px;
    padding: 5px 10px;
  }

  .btn-sync {
    padding: 6px 12px;
    font-size: 12px;
  }

  .card {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .card-title {
    font-size: 16px;
  }

  .task-input-row {
    flex-direction: column;
  }

  .task-input {
    min-width: 100%;
  }

  .task-select {
    width: 100%;
  }

  .btn-add {
    width: 100%;
  }

  .review-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .review-stat-box {
    padding: 12px 8px;
  }

  .review-stat-box .stat-value {
    font-size: 22px;
  }

  .weekly-calendar {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }

  .day-cell {
    padding: 6px 1px;
  }

  .day-cell .day-num {
    font-size: 14px;
  }

  .day-cell .day-name {
    font-size: 9px;
  }

  .chart-container {
    height: 160px;
  }

  .knowledge-card {
    padding: 18px;
  }

  .knowledge-title {
    font-size: 17px;
    padding-right: 0;
  }

  .card-difficulty {
    position: static;
    display: inline-block;
    margin-bottom: 8px;
  }

  .card-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .toast {
    bottom: 90px;
    font-size: 12px;
  }
}

/* ===== 响应式：小屏手机 ===== */
@media (max-width: 380px) {
  .header-title {
    font-size: 18px;
  }

  .header-subtitle {
    font-size: 11px;
  }

  .header-progress-ring {
    width: 52px;
    height: 52px;
  }

  .theme-btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  .nav-tab-label {
    font-size: 9px;
  }

  .nav-tab-icon {
    font-size: 20px;
  }
}

/* ===== 横屏适配 ===== */
@media (max-width: 768px) and (orientation: landscape) {
  .app-container {
    padding-bottom: 70px;
  }

  .mobile-nav {
    padding: 2px 0;
  }

  .nav-tab {
    padding: 4px;
  }

  .nav-tab-icon {
    font-size: 18px;
  }
}

/* 深色模式适配（跟随系统） */
@media (prefers-color-scheme: dark) {
  /* 保持亮色主题，不做强制深色适配 */
}
