/* style.css — 周迹全局样式，莫兰迪暖色治愈风 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f8f6f3; color: #2d2a26; font-size: 15px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; outline: none; }
img { max-width: 100%; display: block; }

/* ===== 布局 ===== */
.page { max-width: 640px; margin: 0 auto; padding: 16px; padding-bottom: 80px; }
.dash-page { padding-top: 12px; }

/* ===== 导航栏 ===== */
.nav-bar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 56px;
  display: flex; align-items: center; justify-content: space-around;
  background: #ffffff; border-top: 1px solid #e5e0db; z-index: 100;
  transition: top 0.2s, bottom 0.2s;
}
.nav-item { flex: 1; text-align: center; font-size: 12px; color: #8a8580; padding: 6px 0; transition: opacity 0.2s; }
.nav-item.active { color: #c97b5d; font-weight: 600; }

@media (min-width: 768px) {
  .nav-bar { top: 0; bottom: auto; border-top: none; border-bottom: 1px solid #e5e0db; }
  .page { padding-top: 72px; padding-bottom: 24px; max-width: 720px; }
}

/* ===== 登录页 ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; background: #f8f6f3; }
.login-box { text-align: center; max-width: 320px; width: 100%; }
.login-brand { font-size: 32px; font-weight: 300; color: #c97b5d; margin-bottom: 8px; letter-spacing: 2px; }
.login-desc { font-size: 13px; color: #8a8580; margin-bottom: 32px; }
.login-input { width: 100%; padding: 12px 16px; border: 1px solid #e5e0db; border-radius: 6px; background: #ffffff; font-size: 16px; text-align: center; margin-bottom: 16px; transition: border-color 0.2s; }
.login-input:focus { border-color: #c97b5d; }
.login-btn { width: 100%; padding: 12px; border-radius: 6px; background: #c97b5d; color: #ffffff; font-size: 16px; font-weight: 500; transition: opacity 0.2s; }
.login-btn:hover { opacity: 0.9; }
.login-btn:disabled { opacity: 0.5; }
.login-hint { font-size: 12px; color: #b8b2ab; margin-top: 16px; }

/* ===== 看板 ===== */
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 17px; font-weight: 500; }
.section-title { font-size: 17px; font-weight: 500; margin-bottom: 8px; color: #2d2a26; }
.task-card {
  display: flex; align-items: center; justify-content: space-between;
  background: #ffffff; border-radius: 8px; padding: 12px 16px; margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(45,42,38,0.06); transition: opacity 0.2s;
  cursor: pointer;
}
.task-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.task-circle { width: 18px; height: 18px; border: 2px solid #c97b5d; border-radius: 50%; flex-shrink: 0; cursor: pointer; transition: background 0.2s; }
.task-circle:hover { background: #c97b5d20; }
.task-title { font-size: 15px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { font-size: 12px; color: #8a8580; margin-top: 2px; }
.task-start { width: 32px; height: 32px; border-radius: 50%; background: #f5f1ec; font-size: 14px; flex-shrink: 0; transition: background 0.2s; }
.task-start:hover { background: #c97b5d; color: #fff; }

.done-item { font-size: 14px; color: #8a8580; text-decoration: line-through; padding: 4px 0; border-bottom: 1px solid #e5e0db; }

/* ===== 进度条 ===== */
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar { flex: 1; height: 6px; background: #e5e0db; border-radius: 3px; overflow: hidden; }
.progress-bar.sm { height: 4px; }
.progress-fill { height: 100%; background: #c97b5d; border-radius: 3px; transition: width 0.3s ease; }
.progress-text { font-size: 13px; color: #8a8580; white-space: nowrap; }

/* ===== 快捷操作 ===== */
.dash-actions { display: flex; gap: 8px; margin: 16px 0; }
.action-btn { flex: 1; padding: 10px; border-radius: 6px; background: #ffffff; border: 1px solid #e5e0db; font-size: 13px; text-align: center; transition: all 0.2s; }
.action-btn:hover { background: #f5f1ec; }
.action-btn:active { transform: scale(0.98); }

/* ===== 折叠洞察 ===== */
.dash-insights { margin-top: 8px; }
.dash-insights summary { font-size: 13px; color: #8a8580; cursor: pointer; padding: 8px 0; user-select: none; }
.dash-insights summary::-webkit-details-marker { display: none; }
.insight-item { font-size: 14px; color: #8a8580; padding: 6px 0; border-bottom: 1px solid #e5e0db; }

/* ===== 周视图 ===== */
.weekly-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.weekly-top button { width: 32px; height: 32px; border-radius: 50%; background: #f5f1ec; font-size: 16px; transition: background 0.2s; }
.weekly-top button:hover { background: #e8e2d9; }
.weekly-range { flex: 1; font-size: 15px; font-weight: 500; }
.weekly-rate { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #8a8580; }
.weekly-grid { display: flex; gap: 0; border: 1px solid #e5e0db; overflow-x: auto; }
.weekly-col { flex: 1; min-width: 100px; border-right: 1px solid #e5e0db; display: flex; flex-direction: column; }
.weekly-col:last-child { border-right: none; }
.weekly-col.today { background: #f5f1ec; }
.weekly-col-header { text-align: center; font-size: 12px; font-weight: 500; padding: 8px 4px; border-bottom: 1px solid #e5e0db; line-height: 1.4; }
.weekly-date { font-weight: 400; color: #8a8580; }
.weekly-items { flex: 1; min-height: 80px; padding: 4px; }
.weekly-item { font-size: 12px; padding: 4px 6px; margin: 2px 0; border-radius: 4px; background: #ffffff; cursor: grab; transition: opacity 0.2s, transform 0.2s; }
.weekly-item:hover { opacity: 0.8; }
.weekly-item.done { color: #8a8580; text-decoration: line-through; background: #f5f1ec; }
.weekly-col-footer { text-align: center; font-size: 11px; color: #8a8580; padding: 6px; border-top: 1px solid #e5e0db; }
.weekly-actions { margin-top: 12px; text-align: center; }

/* ===== 日记页 ===== */
.diary-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.diary-nav button { width: 36px; height: 36px; border-radius: 50%; background: #f5f1ec; font-size: 16px; transition: background 0.2s; }
.diary-nav button:hover { background: #e8e2d9; }
.diary-date { font-size: 17px; font-weight: 500; }
.diary-tasks { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; font-size: 13px; color: #7a9a7a; }
.diary-task-tag { background: #f0f5f0; padding: 2px 8px; border-radius: 4px; cursor: pointer; font-size: 12px; transition: background 0.2s; }
.diary-task-tag:hover { background: #7a9a7a30; }
.mood-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.mood-btn { width: 44px; height: 44px; border-radius: 50%; font-size: 22px; background: #f5f1ec; transition: all 0.2s; border: 2px solid transparent; }
.mood-btn:hover { transform: scale(1.05); }
.mood-btn.selected { background: #c97b5d20; border-color: #c97b5d; }
.diary-input { width: 100%; min-height: 200px; padding: 12px; border: 1px solid #e5e0db; border-radius: 8px; background: #faf8f5; font-size: 15px; line-height: 1.8; resize: vertical; transition: border-color 0.2s; }
.diary-input:focus { border-color: #c97b5d; }
.diary-status { display: flex; justify-content: space-between; font-size: 12px; color: #b8b2ab; margin: 4px 0 12px; }
.diary-list { margin-top: 24px; }
.diary-list-item { padding: 12px 0; border-bottom: 1px solid #e5e0db; cursor: pointer; transition: background 0.15s; }
.diary-list-item:hover { background: #f5f1ec; margin: 0 -16px; padding: 12px 16px; }
.diary-list-header { font-size: 13px; color: #8a8580; margin-bottom: 4px; }
.diary-list-preview { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 看板 ===== */
.kanban-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kanban-tabs { display: flex; gap: 4px; }
.kanban-board { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.kanban-col { min-width: 140px; flex: 1; }
.kanban-col-title { font-size: 13px; font-weight: 600; color: #2d2a26; padding: 8px 4px; }
.kanban-items { min-height: 60px; }
.kanban-card { background: #ffffff; border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; box-shadow: 0 1px 3px rgba(45,42,38,0.06); cursor: grab; transition: opacity 0.2s, transform 0.2s; }
.kanban-card:hover { opacity: 0.9; }
.kanban-card-title { font-size: 14px; font-weight: 400; }
.kanban-card-meta { font-size: 11px; color: #8a8580; margin-top: 2px; }

/* ===== 统计页 ===== */
.stats-streak { display: flex; gap: 16px; margin-bottom: 20px; }
.streak-box { flex: 1; text-align: center; background: #ffffff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(45,42,38,0.06); }
.streak-icon { font-size: 24px; margin-bottom: 4px; }
.streak-num { font-size: 28px; font-weight: 300; color: #c97b5d; }
.tab-switch { font-size: 13px; color: #8a8580; }
.tab { cursor: pointer; padding: 2px 8px; border-radius: 4px; transition: all 0.2s; }
.tab.active { color: #c97b5d; font-weight: 500; border-bottom: 2px solid #c97b5d; }
.chart-wrap { background: #ffffff; border-radius: 8px; padding: 12px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(45,42,38,0.06); }
.chart-wrap canvas { width: 100%; height: auto; }
.mood-chart { display: flex; gap: 8px; justify-content: center; align-items: flex-end; height: 100px; background: #ffffff; border-radius: 8px; padding: 12px; box-shadow: 0 1px 3px rgba(45,42,38,0.06); }
.mood-bar-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mood-bar-label { font-size: 10px; color: #8a8580; }
.mood-bar-fill { width: 16px; border-radius: 3px; transition: height 0.3s; }

/* ===== 专注页 ===== */
.focus-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; gap: 16px; }
.focus-timer { font-size: 56px; font-weight: 300; color: #2d2a26; letter-spacing: 4px; }
.focus-sounds { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sound-btn { padding: 8px 16px; border-radius: 6px; background: #ffffff; border: 1px solid #e5e0db; font-size: 13px; transition: all 0.2s; }
.sound-btn:hover { background: #f5f1ec; }
.sound-btn.active { background: #c97b5d; color: #ffffff; border-color: #c97b5d; }
.focus-volume { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #8a8580; }
.focus-volume input { width: 120px; }

/* ===== 设置页 ===== */
.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #e5e0db; font-size: 15px; }
.setting-status { font-size: 13px; color: #8a8580; margin-top: 8px; }
.backup-item { font-size: 13px; color: #8a8580; padding: 6px 0; border-bottom: 1px solid #e5e0db; }

/* ===== 按钮 ===== */
.btn-primary { width: 100%; padding: 12px; border-radius: 6px; background: #c97b5d; color: #ffffff; font-size: 15px; font-weight: 500; transition: opacity 0.2s; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { width: 100%; padding: 10px; border-radius: 6px; background: #ffffff; border: 1px solid #e5e0db; font-size: 14px; transition: background 0.2s; }
.btn-secondary:hover { background: #f5f1ec; }
.btn-danger { width: 100%; padding: 10px; border-radius: 6px; background: #ffffff; border: 1px solid #c97070; color: #c97070; font-size: 14px; transition: all 0.2s; }
.btn-danger:hover { background: #c9707010; }
.btn-sm { padding: 4px 12px; border-radius: 4px; background: #f5f1ec; font-size: 12px; transition: background 0.2s; }
.btn-sm:hover { background: #e8e2d9; }

/* ===== 浮动按钮（灵感） ===== */
.fab-inspiration {
  position: fixed; bottom: 68px; right: 16px; width: 44px; height: 44px; border-radius: 50%;
  background: #c97b5d; color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(45,42,38,0.15); z-index: 90; cursor: pointer; transition: transform 0.2s, opacity 0.2s;
}
.fab-inspiration:hover { transform: scale(1.1); }
.fab-inspiration:active { transform: scale(0.95); }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(45,42,38,0.3); z-index: 500; display: none; align-items: flex-end; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal-box { width: 100%; max-width: 480px; background: #ffffff; border-radius: 10px 10px 0 0; padding: 20px; max-height: 80vh; overflow-y: auto; animation: fadeInUp 0.15s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; font-size: 17px; font-weight: 500; margin-bottom: 16px; }
.modal-close { width: 28px; height: 28px; border-radius: 50%; background: #f5f1ec; font-size: 14px; transition: background 0.2s; }
.modal-close:hover { background: #e8e2d9; }
.form-input { width: 100%; padding: 10px 12px; border: 1px solid #e5e0db; border-radius: 6px; margin-bottom: 8px; font-size: 15px; background: #fff; transition: border-color 0.2s; }
.form-input:focus { border-color: #c97b5d; }
.form-select { width: 100%; padding: 10px 12px; border: 1px solid #e5e0db; border-radius: 6px; margin-bottom: 8px; font-size: 15px; background: #fff; }
.task-pool-list { max-height: 300px; overflow-y: auto; }
.task-pool-item { padding: 10px 0; border-bottom: 1px solid #e5e0db; cursor: pointer; font-size: 14px; transition: color 0.2s; }
.task-pool-item:hover { color: #c97b5d; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); padding: 8px 16px; border-radius: 6px; font-size: 13px; background: #2d2a26; color: #f8f6f3; z-index: 9999; opacity: 0; transition: opacity 0.2s ease; max-width: 80vw; text-align: center; pointer-events: none; }

/* ===== 通用 ===== */
.loading { text-align: center; color: #b8b2ab; padding: 40px 0; font-size: 14px; }
.empty-state { text-align: center; color: #b8b2ab; padding: 32px 0; font-size: 14px; }
.text-secondary { color: #8a8580; }
hr { border: none; border-top: 1px solid #e5e0db; margin: 12px 0; }

/* ===== 性能优化：减少重绘 ===== */
.task-card, .kanban-card, .weekly-item, .diary-list-item { will-change: transform; }
.progress-fill, .mood-bar-fill { will-change: width, height; }
