:root {
  --bg: #f5f6f8;
  --sidebar-bg: #ffffff;
  --sidebar-bg-2: #ffffff;
  --card-bg: #ffffff;
  --text: #1f2533;
  --text-soft: #5b6472;
  --muted: #9aa3b2;
  --primary: #4f7cff;
  --primary-dark: #3b63d8;
  --accent: #ff7a59;
  --border: #e8ebf0;
  --ok: #2bb673;
  --shadow: 0 1px 3px rgba(20, 30, 60, 0.06), 0 8px 24px rgba(20, 30, 60, 0.05);
  --sidebar-w: 248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100vh; }

/* ===== 左侧导航栏（白色简洁）===== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.brand-logo { font-size: 26px; }
.brand-text { display: flex; flex-direction: column; }
.brand-title { font-size: 17px; font-weight: 800; letter-spacing: 0.3px; }
.brand-sub { font-size: 12px; color: var(--muted); }

.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border: none;
  background: transparent;
  color: #4a5160;
  font-size: 14px;
  text-align: center;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  box-shadow: inset 3px 0 0 transparent;
}
.nav-item:hover { background: #f0f2f7; color: var(--text); }
.nav-item.active {
  background: #eaf0ff;
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
}
.nav-icon { font-size: 22px; width: auto; text-align: center; line-height: 1; }
.nav-label { font-weight: 700; font-size: 13px; line-height: 1.2; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, #ffe1ec, #ffc9dd);
}
.streak-chip {
  background: #fff0f5;
  color: #e23c7e;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.reset-btn {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(226, 60, 126, 0.25);
  color: #c22e6c;
  border-radius: 8px;
  padding: 7px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}
.reset-btn:hover { background: #fff; color: #e23c7e; border-color: #e23c7e; }

/* ===== 主内容区 ===== */
.content { flex: 1; padding: 28px 32px; max-width: 1100px; }

.view { display: none; animation: fade 0.25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-header { margin-bottom: 20px; position: relative; }
.view-header h1 { font-size: 24px; font-weight: 800; letter-spacing: 0.3px; }
.view-desc { color: var(--text-soft); margin-top: 4px; }
.header-actions { position: absolute; top: 0; right: 0; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 14px;
}
.muted { color: var(--muted); font-weight: 400; font-size: 12px; }

/* 按钮 */
.btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s ease;
}
.btn:hover { background: #f0f2f7; border-color: #d6dae2; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

/* 表单 */
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input, .inline-form select { flex: 1; min-width: 140px; }

.grid-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.grid-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-soft); }
.grid-form label.full { grid-column: 1 / -1; }
.grid-form input, .grid-form select { width: 100%; }
.form-actions { grid-column: 1 / -1; }

input, select, textarea {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.12);
}

/* 空状态 */
.empty { color: var(--muted); padding: 18px; text-align: center; font-size: 13px; }

/* 新闻列表 */
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.news-item .ni-main { flex: 1; min-width: 0; }
.news-item a { color: var(--primary); text-decoration: none; font-weight: 600; word-break: break-word; }
.news-item a:hover { text-decoration: underline; }
.news-item .ni-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.news-item .ni-desc { font-size: 12px; color: var(--text-soft); margin-top: 6px; line-height: 1.5; }
.news-item .ni-audio { color: var(--ok); text-decoration: none; font-weight: 600; white-space: nowrap; }
.news-item .ni-audio:hover { text-decoration: underline; }
.news-item .ni-del { color: var(--muted); cursor: pointer; border: none; background: none; font-size: 16px; }
.news-item .ni-del:hover { color: var(--accent); }

/* 快速入口（阅读模块）*/
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbff;
  text-decoration: none; color: var(--text);
  transition: all 0.15s ease;
}
.entry-btn:hover { border-color: var(--primary); background: #eef2ff; }
.eb-ico { font-size: 24px; width: 30px; text-align: center; }
.eb-txt { display: flex; flex-direction: column; }
.eb-txt b { font-size: 15px; }
.eb-txt small { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* 统计卡 */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.stat-card .sc-val { font-size: 24px; font-weight: 800; }
.stat-card .sc-label { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* 图表 */
.chart-wrap { width: 100%; overflow-x: auto; }
.chart-wrap svg { display: block; max-width: 100%; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th { color: var(--text-soft); font-weight: 600; background: #fafbfe; }
.data-table tr:hover td { background: #f7f9fd; }
.data-table .del-btn { color: var(--muted); cursor: pointer; border: none; background: none; }
.data-table .del-btn:hover { color: var(--accent); }

/* 进度条 */
.progress-bar { height: 12px; background: #eef1f8; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), #4fd99a); transition: width 0.3s ease; }

/* 活动清单 */
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.activity-item.done { opacity: 0.6; background: #fafbfe; }
.activity-item .ai-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff; font-size: 14px;
}
.activity-item.done .ai-check { background: var(--ok); border-color: var(--ok); }
.activity-item .ai-main { flex: 1; min-width: 0; }
.activity-item.done .ai-name { text-decoration: line-through; }
.activity-item .ai-time { font-size: 12px; color: var(--muted); }
.activity-item .ai-cat { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef1f8; color: var(--text-soft); }
.activity-item .ai-del { color: var(--muted); cursor: pointer; border: none; background: none; font-size: 16px; }
.activity-item .ai-del:hover { color: var(--accent); }

/* 每日金句卡 */
.daily-card { text-align: center; background: linear-gradient(135deg, #eef2ff, #f5f0ff); border: none; }
.daily-quote { padding: 10px 0; }
.quote-en { font-size: 22px; font-weight: 800; color: var(--primary-dark); }
.quote-zh { font-size: 15px; color: var(--text-soft); margin-top: 8px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1f2533; color: #fff;
  padding: 11px 20px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: all 0.25s ease; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 响应式：始终保留左侧纵向导航栏布局 */
@media (max-width: 900px) {
  .sidebar { width: 180px; }
  .brand { padding: 18px 14px 14px; }
  .brand-title { font-size: 15px; }
  .nav { padding: 12px 10px; }
  .nav-item { padding: 11px 12px; font-size: 13px; }
  .sidebar-footer { padding: 14px 12px; }
  .content { padding: 18px 18px; }
  .grid-form { grid-template-columns: 1fr 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .entry-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sidebar { width: 132px; }
  .brand-logo { font-size: 22px; }
  .brand-title { font-size: 13px; }
  .nav-label { font-size: 12px; }
  .nav-item { gap: 8px; padding: 10px 9px; }
  .content { padding: 14px 12px; }
  .grid-form { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .view-header h1 { font-size: 20px; }
  .header-actions { position: static; margin-top: 10px; }
}

/* ===== 健身双栏：视频 + 每日进度 ===== */
.fit-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; align-items: start; }
.video-card { margin-bottom: 18px; }

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}
.video-source { display: flex; gap: 10px; }
.video-source input { flex: 1; min-width: 0; }

.progress-card .btn-done {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--ok);
  color: var(--ok);
  padding: 11px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.15s ease;
  margin-bottom: 14px;
}
.progress-card .btn-done:hover { background: #f1fbf6; }
.progress-card .btn-done.done {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.fit-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.fit-stats .stat-card { padding: 12px 10px; border-left-width: 3px; }
.fit-stats .stat-card .sc-val { font-size: 18px; }
.fit-stats .stat-card .sc-label { font-size: 11px; }

.fit-week { display: flex; justify-content: space-between; gap: 6px; }
.fit-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.fit-day .fd-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #f0f2f7; color: var(--muted); font-size: 13px; font-weight: 700;
}
.fit-day.on .fd-dot { background: var(--ok); color: #fff; }
.fit-day .fd-label { font-size: 11px; color: var(--muted); }
.fit-hint { margin-top: 14px; line-height: 1.5; }

@media (max-width: 760px) {
  .fit-grid { grid-template-columns: 1fr; }
}
