/**
 * style.css —— 全局样式
 * ------------------------------------------------------------------
 * 设计规范：圆角卡片、宽松间距、家长孩子都好操作；
 *           三色主题：家长绿 / 男孩蓝 / 女孩粉（body.theme-* 覆盖变量），奖励色暖橙；
 *           浅色背景不花哨；响应式适配电脑 + 平板（≤960px 单列）。
 * 说明：图标一律 emoji，不引外部图标库/字体/在线 CSS。
 */

/* ============ CSS 变量 ============ */
/* 默认主题 = 家长绿（login 页等无会话页面沿用，与品牌统一） */
:root {
  --primary: #2f9e6e;
  --primary-soft: #e2f4ec;
  --accent: #ff9500;
  --accent-soft: #fff3e2;
  --bg: #f2f7f4;
  --bg-grad1: #eef7f1;
  --bg-grad2: #e8f2ea;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #8a94a6;
  --ok: #22c55e;
  --ok-soft: #e8f9ef;
  --warn: #f59e0b;
  --warn-soft: #fef4e0;
  --danger: #ef4444;
  --danger-soft: #fdeaea;
  --border: #e8edf3;
  --shadow: 0 6px 20px rgba(31, 41, 55, .06);
  --radius: 16px;
  --radius-sm: 8px;
  /* 按钮渐变与辉光（随主题覆盖） */
  --grad1: #3db98a;
  --grad2: #2f9e6e;
  --accent-grad1: #ffb04d;
  --accent-grad2: #ff9500;
  --primary-glow: rgba(47, 158, 110, .35);
  --accent-glow: rgba(255, 149, 0, .35);
}

/* ============ 三色主题（body.theme-* 覆盖同一组变量，全站换肤） ============ */
body.theme-parent {
  --primary: #2f9e6e;
  --primary-soft: #e2f4ec;
  --bg: #f2f7f4;
  --bg-grad1: #eef7f1;
  --bg-grad2: #e8f2ea;
  --accent: #ff9500;
  --accent-soft: #fff3e2;
  --grad1: #3db98a;
  --grad2: #2f9e6e;
  --accent-grad1: #ffb04d;
  --accent-grad2: #ff9500;
  --primary-glow: rgba(47, 158, 110, .35);
  --accent-glow: rgba(255, 149, 0, .35);
}
body.theme-boy {
  --primary: #1e7bff;
  --primary-soft: #e3f0ff;
  --bg: #f0f5fc;
  --bg-grad1: #eef4fd;
  --bg-grad2: #e9f1fb;
  --accent: #ffb020;
  --accent-soft: #fff3e2;
  --grad1: #4a90ff;
  --grad2: #1e7bff;
  --accent-grad1: #ffc866;
  --accent-grad2: #ffb020;
  --primary-glow: rgba(30, 123, 255, .35);
  --accent-glow: rgba(255, 176, 32, .35);
}
body.theme-girl {
  --primary: #ff5c8a;
  --primary-soft: #ffe4ee;
  --bg: #fdf2f6;
  --bg-grad1: #fdf1f5;
  --bg-grad2: #fbebf1;
  --accent: #ffb020;
  --accent-soft: #fff3e2;
  --grad1: #ff7ba0;
  --grad2: #ff5c8a;
  --accent-grad1: #ffc866;
  --accent-grad2: #ffb020;
  --primary-glow: rgba(255, 92, 138, .35);
  --accent-glow: rgba(255, 176, 32, .35);
}

/* ============ 基础 ============ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: linear-gradient(170deg, var(--bg-grad1), var(--bg) 45%, var(--bg-grad2)) fixed;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { opacity: .85; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* ============ 页面氛围装饰（漂浮 emoji，纯装饰：不挡点击、不降对比） ============ */
body::before, body::after, #shell::before {
  position: fixed; z-index: 0; pointer-events: none; user-select: none; line-height: 1;
}
body::before {
  content: '🎈'; top: 88px; right: 5vw; font-size: 130px; opacity: .12;
  animation: decor-float 7s ease-in-out infinite;
}
body::after {
  content: '⭐'; bottom: 4vh; left: 3vw; font-size: 108px; opacity: .16;
  animation: decor-twinkle 6s ease-in-out infinite;
}
#shell::before {
  content: '🌸'; top: 16vh; left: 2vw; font-size: 120px; opacity: .12;
  animation: decor-float 9s ease-in-out infinite;
}
@keyframes decor-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}
@keyframes decor-twinkle {
  0%, 100% { opacity: .10; }
  50% { opacity: .20; }
}
@keyframes empty-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after, #shell::before, .empty-state .empty-icon { animation: none !important; }
}

/* ============ 布局：左侧导航（桌面） ============ */
/* ============ 布局：顶栏功能导航 + 左侧信息栏 ============ */
body.app-layout { display: flex; flex-direction: column; min-height: 100vh; }
body.app-layout #shell { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* 顶部功能导航（单行，不换行成两排） */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: #fff; box-shadow: 0 2px 12px rgba(31, 41, 55, .06);
}
.topbar-inner {
  max-width: 1400px; margin: 0 auto; padding: 8px 18px;
  display: flex; align-items: center; gap: 18px;
  flex-wrap: nowrap;
}
.topbar-inner .brand { flex-shrink: 0; font-size: 19px; font-weight: 800; }
.top-nav {
  display: flex; align-items: center; gap: 2px;
  flex: 1; min-width: 0;
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
  padding: 2px 0; scrollbar-width: none;
}
.top-nav::-webkit-scrollbar { display: none; }
.top-nav .nav-link {
  padding: 7px 14px; border-radius: 999px; color: var(--muted);
  font-size: 14.5px; white-space: nowrap; transition: all .15s; flex-shrink: 0;
}
.top-nav .nav-link:hover { background: var(--primary-soft); color: var(--primary); }
.top-nav .nav-link.active { background: var(--primary); color: #fff; font-weight: 600; }

/* 下方：左侧信息栏 + 右侧内容区 */
.layout-row { display: flex; flex: 1; min-height: 0; }
.side-info {
  width: 236px; flex-shrink: 0; background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  border-right: 1px solid var(--border);
  padding: 16px 14px 20px;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}
.side-title {
  font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: 1px; margin-top: 4px;
}
.side-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.side-account { justify-content: space-between; }
.side-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px;
}
.side-card.family-card { border-color: var(--primary-soft); }
.family-card .family-name { font-weight: 700; font-size: 15px; }
.family-card .family-address { font-size: 12.5px; color: var(--primary); font-weight: 600; margin-top: 4px; }
.family-card .family-city, .family-card .family-sem { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.family-card.child-note { font-weight: 600; }
/* 左侧孩子切换：竖排卡样式 */
.side-info .child-switcher { flex-direction: column; gap: 8px; width: 100%; }
.side-info .child-chip {
  width: 100%; justify-content: flex-start;
  border-radius: 12px; padding: 8px 12px 8px 8px; font-size: 14.5px;
}
.side-info .child-chip.active { box-shadow: 0 0 0 1px var(--chip-color, var(--primary)); }
.side-info .mode-switch { padding: 2px 0; }
.content-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content-col main#app { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 24px 64px; }
.brand { color: var(--text); white-space: nowrap; }
.nav { display: flex; gap: 4px; }
/* 退出按钮在左侧底部 */
.side-account .logout-btn { margin-left: auto; }

/* 学期 chip */
.semester-chip {
  font-size: 13px; color: var(--muted); background: var(--bg);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}

/* 孩子切换器 */
.child-switcher { display: flex; gap: 6px; }
.child-chip {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  border: 2px solid var(--border); background: #fff; border-radius: 999px;
  padding: 4px 12px 4px 5px; font-size: 14px; transition: all .15s;
}
.child-chip:hover { border-color: var(--chip-color, var(--primary)); }
.child-chip.active { border-color: var(--chip-color, var(--primary)); background: var(--primary-soft); }
.chip-avatar { font-size: 20px; line-height: 1; }
.chip-name { font-weight: 600; }

/* 模式开关 */
.mode-switch { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.mode-label { color: var(--muted); }
.mode-toggle { display: none; }
.switch-slider {
  width: 40px; height: 22px; border-radius: 999px; background: var(--border);
  position: relative; transition: background .2s; flex-shrink: 0;
}
.switch-slider::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.mode-toggle:checked + .switch-slider { background: var(--accent); }
.mode-toggle:checked + .switch-slider::after { left: 21px; }

.mode-banner {
  background: var(--accent-soft); color: #b26a00; text-align: center;
  padding: 8px 16px; font-size: 14px;
}

/* 账号显示 + 退出 */
.account-chip {
  font-size: 13px; font-weight: 600; color: var(--text); background: var(--bg);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis;
}
.logout-btn { white-space: nowrap; }

/* ============ 布局 ============ */
main#app { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 3px 0 var(--grad1);
  padding: 22px 24px; margin-bottom: 20px; transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(31, 41, 55, .09), inset 0 3px 0 var(--grad1); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.card-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title .hint { font-size: 13px; color: var(--muted); font-weight: 400; }

/* 栅格 */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 240px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: 14px; font-weight: 600; transition: all .15s;
  font-family: inherit;
}
.btn-primary { background: linear-gradient(135deg, var(--grad1), var(--grad2)); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 14px var(--primary-glow); transform: translateY(-1px); }
.btn-accent { background: linear-gradient(135deg, var(--accent-grad1), var(--accent-grad2)); color: #fff; }
.btn-accent:hover { box-shadow: 0 4px 14px var(--accent-glow); transform: translateY(-1px); }
.btn-ghost { background: #f2f5f9; color: var(--text); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ============ 表单 ============ */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text); background: #fff; transition: border .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; min-height: 70px; }
.form-group { margin-bottom: 14px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.form-grid .full { grid-column: 1 / -1; }
.req { color: var(--danger); }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 3px; }

/* 工具栏（搜索/筛选） */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search-input { flex: 1; min-width: 180px; max-width: 320px; }
.toolbar select { width: auto; min-width: 130px; }
.toolbar .spacer { flex: 1; }

/* ============ Tab ============ */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 8px 16px; border-radius: 999px; background: #fff; color: var(--muted);
  cursor: pointer; border: 1px solid var(--border); font-size: 14px; font-weight: 600;
}
.tab:hover { color: var(--primary); }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 锚点 chips */
.anchor-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.anchor-chips a {
  padding: 5px 12px; border-radius: 999px; background: #fff; color: var(--muted);
  font-size: 13px; border: 1px solid var(--border);
}
.anchor-chips a:hover { color: var(--primary); border-color: var(--primary); }

/* ============ 统计卡 ============ */
.stat-card {
  display: flex; align-items: center; gap: 14px; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
}
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; box-shadow: 0 4px 12px var(--primary-glow); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: .5px; line-height: 1.2; }
.stat-sub { font-size: 12px; color: var(--muted); }

/* ============ 徽章 ============ */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.7;
}
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-success, .badge-done { background: var(--ok-soft); color: var(--ok); }
.badge-warn, .badge-pending { background: var(--warn-soft); color: #b26a00; }
.badge-danger, .badge-missed { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: #b26a00; }
.badge-gray { background: #f2f5f9; color: var(--muted); }
.badge-orange { background: #fff1e0; color: #d97706; }

/* ============ P5b 错题复习弹窗 ============ */
.review-mistake .rm-subject { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.review-mistake .rm-desc { font-size: 14px; line-height: 1.6; padding: 10px 12px; background: var(--warn-soft); border-radius: 8px; margin: 8px 0; }
.review-mistake .rm-exam { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.review-mistake .rm-count { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

/* ============ 进度条 ============ */
.progress { display: flex; align-items: center; gap: 8px; }
.progress-track { flex: 1; height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .3s; }
.progress-label { font-size: 12px; color: var(--muted); min-width: 34px; text-align: right; }

/* 进度环 */
.ring-bg { fill: none; stroke: #eef2f7; stroke-width: 8; }
.ring-fg { fill: none; stroke-width: 8; stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset .4s; }
.ring-text { font-size: 12px; fill: var(--text); font-weight: 700; text-anchor: middle; }

/* ============ 空状态 ============ */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-icon { font-size: 58px; margin-bottom: 10px; display: inline-block; animation: empty-float 3.5s ease-in-out infinite; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); }
.empty-desc { font-size: 13px; margin-top: 4px; }
.empty-action { margin-top: 14px; }

/* ============ 图表 ============ */
.chart-box { height: 280px; width: 100%; }
.chart-box.tall { height: 320px; }
.chart-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; background: var(--primary-soft); }
tbody tr:hover { background: var(--primary-soft); }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn { margin-left: 4px; }

/* ============ Toast ============ */
#kl-toast-box { position: fixed; top: 76px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 11px 18px; border-radius: 10px; color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(31,41,55,.18); opacity: 0; transform: translateX(20px);
  transition: all .3s; max-width: 320px;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-info { background: var(--primary); }
.toast-success { background: var(--ok); }
.toast-warn { background: var(--warn); }
.toast-error { background: var(--danger); }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(31,41,55,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 520px;
  max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(31,41,55,.25);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-close { border: none; background: none; cursor: pointer; font-size: 18px; color: var(--muted); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); }
.confirm-text { margin: 0; font-size: 15px; }

/* ============ 列表 / 卡片型列表 ============ */
.list { display: flex; flex-direction: column; gap: 12px; }
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
}
.list-item .li-icon { font-size: 26px; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; }
.list-item .li-sub { font-size: 13px; color: var(--muted); }
.list-item .li-side { text-align: right; flex-shrink: 0; }

/* 科目卡 */
.course-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.course-card .cc-top { display: flex; align-items: center; gap: 12px; }
.course-card .cc-icon { font-size: 30px; }
.course-card .cc-name { font-weight: 700; font-size: 16px; }
.course-card .cc-meta { font-size: 13px; color: var(--muted); }

/* 任务卡 / 考试卡 */
.task-card, .exam-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap;
}
.task-card .tc-main, .exam-card .ec-main { flex: 1; min-width: 200px; }
.task-card .tc-title { font-weight: 600; }
.task-card .tc-meta { font-size: 13px; color: var(--muted); }
.task-card .tc-actions, .exam-card .ec-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* 兑换奖品卡 */
.reward-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px; position: relative;
}
.reward-card .rc-icon { font-size: 34px; }
.reward-card .rc-name { font-weight: 700; }
.reward-card .rc-cost { color: var(--accent); font-weight: 700; }
.reward-card.disabled { opacity: .55; }

/* 勋章墙 */
.badge-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.badge-item {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px;
  text-align: center; transition: all .15s;
}
.badge-item.earned { border-color: #ffdca8; background: linear-gradient(180deg, #fffaf0, #fff); }
.badge-item.locked { filter: grayscale(1); opacity: .55; }
.badge-icon { font-size: 34px; }
.badge-name { font-weight: 700; margin-top: 6px; }
.badge-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.badge-date { font-size: 12px; color: var(--ok); margin-top: 6px; }
.badge-lock { font-size: 12px; color: var(--muted); margin-top: 6px; }
.badge-item .progress { margin-top: 8px; }

/* P5c 限定徽章：赛季分组 + 稀有度边框（common 灰 / rare 蓝 / epic 金） */
.badge-season { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; }
.badge-season-title { font-weight: 700; font-size: 14px; }
.badge-season-count { font-size: 12px; color: var(--muted); }
.rarity-chip { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-top: 4px; }
.rarity-chip.rarity-rare { background: #eff6ff; color: #2563eb; }
.rarity-chip.rarity-epic { background: #fffbeb; color: #b45309; }
.badge-item.rarity-common.earned { border-color: #cbd5e1; }
.badge-item.rarity-rare.earned { border-color: #3b82f6; background: linear-gradient(180deg, #eff6ff, #fff); box-shadow: 0 0 0 1px rgba(59,130,246,.25); }
.badge-item.rarity-epic.earned { border-color: #f59e0b; background: linear-gradient(180deg, #fffbeb, #fff); box-shadow: 0 0 0 1px rgba(245,158,11,.4); }

/* P5c 我的纪录卡 */
.record-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.record-item { background: var(--primary-soft); border-radius: 12px; padding: 12px; text-align: center; }
.record-icon { font-size: 20px; display: block; }
.record-val { font-size: 18px; font-weight: 800; display: block; margin-top: 4px; }
.record-label { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }

/* 任务类型分类 chip（P3b） */
.type-chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 600; line-height: 1.7; border: 1px solid transparent;
}

/* 心愿图标选择（P3b） */
.wish-icons { display: flex; gap: 8px; flex-wrap: wrap; }
.wish-icon-opt {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.wish-icon-opt.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }

/* 孩子卡片 */
.child-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}
.child-card .child-avatar { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.child-card .child-info { flex: 1; }
.child-card .child-name { font-weight: 700; font-size: 16px; }
.child-card .child-meta { font-size: 13px; color: var(--muted); }
.child-card .child-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 快捷入口 */
.quick-links { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.quick-link {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
  transition: all .15s; text-align: center;
}
.quick-link:hover { border-color: var(--primary); background: var(--primary-soft); }
.quick-link .ql-icon { font-size: 28px; }
.quick-link .ql-label { font-size: 14px; font-weight: 600; color: var(--text); }

/* 导航小红点角标（今日待办） */
.top-nav .nav-link { position: relative; }
.nav-dot {
  position: absolute; top: -2px; right: -2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px #fff; white-space: nowrap;
}

/* 周学习综合评分卡 */
.ws-score { display: flex; align-items: center; gap: 20px; margin-bottom: 12px; }
.ws-num { font-size: 46px; font-weight: 800; line-height: 1; color: var(--text); }
.ws-num .unit { font-size: 18px; font-weight: 600; color: var(--muted); }
.ws-meta { display: flex; flex-direction: column; gap: 4px; }
.ws-summary { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.ws-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ws-bar:last-child { margin-bottom: 0; }
.ws-bar-title { flex: 0 0 90px; font-size: 13px; font-weight: 600; color: var(--text); }
.ws-bar .progress { flex: 1; }
.ws-bar-empty { flex: 1; font-size: 12px; color: var(--muted); }

/* 薄弱科目预警卡 */
.weak-item {
  border: 1px solid var(--border); border-left: 4px solid var(--warn);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: #fff;
}
.weak-item:last-child { margin-bottom: 0; }
.weak-item.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.weak-item.danger { border-left-color: var(--danger); background: var(--danger-soft); }
.weak-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.weak-name a { color: var(--text); }
.weak-name a:hover { color: var(--primary); }
.weak-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.weak-suggest { font-size: 13px; color: var(--text); margin-top: 4px; }
.weak-all-ok {
  padding: 18px 16px; border-radius: 12px; background: var(--ok-soft);
  color: var(--ok); font-weight: 700; text-align: center; font-size: 15px;
}

/* 时间线 */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 8px 0 8px 10px; }
.tl-item::before { content: ''; position: absolute; left: -20px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.tl-item .tl-icon { font-size: 18px; margin-right: 6px; }
.tl-item .tl-text { font-size: 14px; }
.tl-item .tl-sub { font-size: 12px; color: var(--muted); }

/* 竞赛报名跟踪 */
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.contest-card { margin-bottom: 14px; }
.contest-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.contest-title { font-size: 16px; font-weight: 700; }
.contest-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.contest-organizer { font-size: 13px; color: var(--muted); margin-top: 6px; }
.contest-meta { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 10px; }
.meta-item { font-size: 13px; color: var(--text); background: #f7f9fc; border-radius: 8px; padding: 4px 10px; }
.contest-note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.contest-link-line { font-size: 13px; margin-top: 6px; word-break: break-all; }
.contest-link-line a { color: var(--primary); text-decoration: underline; }
.contest-url-text { color: var(--muted); }
.contest-detail { margin-top: 8px; background: #f7f9fc; border-radius: 8px; padding: 8px 10px; }
.contest-detail-title { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.contest-detail-text { font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.contest-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* 赛事库（公共赛事目录） */
.catalog-info-bar {
  background: var(--primary-soft); border: 1px solid var(--primary-soft); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: var(--primary); margin-bottom: 14px;
}
.catalog-card { margin-bottom: 14px; }
.catalog-grades { font-size: 13px; color: var(--muted); margin-top: 6px; }
.catalog-enroll-hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.catalog-fee { font-size: 13px; color: var(--muted); margin-top: 4px; }
.catalog-source { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.catalog-source-text { font-size: 12px; color: var(--muted); }

/* 首页竞赛提醒 */
.contest-alert {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 10px;
  background: var(--accent-soft); border: 1px solid #ffe1b8; border-radius: 12px;
}
.contest-alert .ca-icon { font-size: 24px; }
.contest-alert .ca-main { flex: 1; min-width: 0; }
.contest-alert .ca-name { font-weight: 700; font-size: 15px; }
.contest-alert .ca-sub { font-size: 13px; color: #b26a00; }
.contest-alert .ca-days {
  font-size: 13px; font-weight: 700; color: #fff; background: var(--accent);
  border-radius: 999px; padding: 4px 12px; white-space: nowrap;
}
.contest-alert.ca-urgent { background: var(--danger-soft); border-color: #ffcdc9; }
.contest-alert.ca-urgent .ca-sub { color: var(--danger); }
.contest-alert.ca-urgent .ca-days { background: var(--danger); }

/* 课表 */
.timetable-grid { display: grid; gap: 8px; grid-template-columns: repeat(7, 1fr); }
.tt-cell {
  background: #fff; border: 1px solid var(--border); border-radius: 10px; min-height: 96px;
  padding: 8px; overflow: hidden;
}
.tt-cell .tt-day { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.tt-cell.weekend { background: #fafbfd; }
.tt-slot {
  display: block; margin-top: 6px; padding: 7px 8px; border-radius: 8px; cursor: pointer;
  font-size: 12px; line-height: 1.4; border-left: 4px solid var(--primary);
  transition: all .12s;
}
.tt-slot:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(31,41,55,.1); }
.tt-slot .tt-name { font-weight: 700; }
.tt-slot .tt-time { color: var(--muted); font-size: 11px; }

/* 规则编辑 chip */
.rule-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rule-row:last-child { border-bottom: none; }
.rule-name { font-weight: 600; }
.rule-stepper { display: flex; align-items: center; gap: 8px; }
.rule-stepper button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 16px; font-weight: 700; color: var(--primary); }
.rule-stepper .rule-val { min-width: 32px; text-align: center; font-weight: 700; }

/* 星期选择 */
.weekday-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.weekday-picker .wd {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 600; background: #fff;
}
.weekday-picker .wd.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 分割线 */
.hr { height: 1px; background: var(--border); margin: 16px 0; }

/* ============ 滚动条美化（桌面观感提升） ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-soft); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--grad1); }
* { scrollbar-width: thin; scrollbar-color: var(--grad1) transparent; }

/* ============ 首页欢迎卡（渐变 hero） ============ */
.hero {
  background: linear-gradient(135deg, var(--grad1), var(--grad2));
  color: #fff; border-radius: var(--radius); padding: 26px 28px;
  margin-bottom: 20px; box-shadow: 0 10px 26px var(--primary-glow);
}
.hero h1 { font-size: 26px; color: #fff; }
.hero .sub { color: rgba(255, 255, 255, .94); }
.hero .sub.slogan { opacity: .9; }

/* ============ 儿童模式（大字体/大按钮，仅 CSS 层） ============ */
body.mode-child { font-size: 16px; }
body.mode-child main#app { font-size: 16px; }
body.mode-child .btn { padding: 11px 20px; font-size: 15px; }
body.mode-child .btn-sm { padding: 7px 14px; font-size: 14px; }
body.mode-child .stat-value { font-size: 28px; }
body.mode-child .card-title { font-size: 18px; }

/* ============ 页内区块导航条（自动生成，全站通用） ============ */
.secnav {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 6px 2px 8px; margin-bottom: 2px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  position: sticky; top: 62px; z-index: 40;
  background: linear-gradient(180deg, var(--bg) 82%, rgba(255,255,255,0));
}
.secnav::-webkit-scrollbar { height: 4px; }
.secnav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.secnav-btn {
  flex-shrink: 0; white-space: nowrap;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  font-size: 13.5px; font-weight: 600; padding: 6px 13px; border-radius: 999px;
  cursor: pointer; transition: all .15s; font-family: inherit; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis;
}
.secnav-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.secnav-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 3px 10px var(--primary-glow); }
.sec-block { scroll-margin-top: 110px; }

/* 窄屏：吸顶固定会遮内容 → 取消吸顶、随页滚动 */
@media (max-width: 960px) {
  .secnav { position: static; background: none; padding-bottom: 6px; }
  .secnav-btn { font-size: 13px; padding: 5px 11px; }
}

/* ============ 设置页横向标题栏 ============ */
.settings-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 18px; padding-bottom: 2px;
}
.settings-tab {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 999px;
  cursor: pointer; transition: all .15s; white-space: nowrap; font-family: inherit;
}
.settings-tab:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.settings-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============ 响应式 ============ */
/* 窄屏：左侧信息栏折叠为顶部一行（孩子切换/账号横排）或收起；功能导航仍在顶栏单行横滚 */
@media (max-width: 960px) {
  /* 兜底：任何容器不得横向撑破页面 */
  html, body { max-width: 100%; overflow-x: hidden; }
  main#app, .content-col, .card, .layout-row, .side-info { max-width: 100%; }
  .card { overflow-x: hidden; }
  .table-wrap { max-width: 100%; }

  /* 规则/列表行：窄屏允许换行,按钮不把页面撑宽 */
  .rule-row { flex-wrap: wrap; }
  .rule-row .rule-name { min-width: 0; flex: 1 1 auto; }
  .rule-row .rule-stepper, .rule-row .btn-group, .rule-row > div:last-child { flex-shrink: 1; }
  .list-item { flex-wrap: wrap; }
  .list-item .li-side { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .list-item .li-side .btn { white-space: nowrap; }

  /* 左侧信息栏折叠为顶部一行（孩子切换/账号横排）或收起；功能导航仍在顶栏单行横滚 */
  .layout-row { flex-direction: column; }
  .side-info {
    width: 100%; border-right: none; border-bottom: 1px solid var(--border);
    flex-direction: row; align-items: center; gap: 12px;
    padding: 8px 12px; overflow-x: auto; overflow-y: hidden;
    flex-wrap: nowrap;
  }
  .side-info .family-card, .side-info .side-title { display: none; } /* 窄屏隐藏家庭卡与区块标题 */
  .side-info .child-switcher { flex-direction: row; gap: 6px; width: auto; }
  .side-info .child-chip { width: auto; border-radius: 999px; padding: 4px 10px 4px 5px; font-size: 13px; }
  .side-info .side-row { flex: 0 0 auto; }
  .side-info .mode-switch { font-size: 12px; }
  .topbar-inner { gap: 10px; padding: 6px 10px; }
  .topbar-inner .brand { font-size: 16px; }
  .top-nav { gap: 0; }
  .top-nav .nav-link { font-size: 13.5px; padding: 6px 10px; }
  .content-col main#app { padding: 16px 12px 48px; }
  .form-grid { grid-template-columns: 1fr; }
  .timetable-grid { grid-template-columns: repeat(2, 1fr); }
  td, th { padding: 9px 8px; }
  .stat-value { font-size: 22px; }
}

/* ============ 小镇广场 + 楼房装修（T2/T3） ============ */
.town-street { margin-bottom: 22px; }
.street-label {
  display: inline-block; font-size: 13px; font-weight: 700; color: var(--muted);
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 14px; margin-bottom: 12px;
}
.street-row {
  display: flex; gap: 16px; flex-wrap: nowrap; overflow-x: auto;
  padding: 8px 4px 18px; align-items: flex-end; scrollbar-width: thin;
}
.town-house {
  flex-shrink: 0; width: 116px; display: flex; flex-direction: column; align-items: center;
  cursor: pointer; position: relative; transition: transform .16s ease;
}
.town-house:hover { transform: translateY(-4px); }
.town-house.is-mine { filter: drop-shadow(0 0 10px var(--primary-glow)); }
.th-mine-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 2px 8px; white-space: nowrap; z-index: 3;
}
.th-roof {
  width: 88px; height: 32px; position: relative;
  background: linear-gradient(180deg, #e8895a, #d26a3c);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.th-roof-icon { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); font-size: 16px; line-height: 1; }
.th-body {
  width: 78px; background: var(--primary); border-radius: 6px 6px 4px 4px;
  display: flex; flex-direction: column; align-items: center; padding: 8px 6px 7px;
  border-left: 3px solid rgba(0,0,0,.08); border-right: 3px solid rgba(0,0,0,.08);
}
.th-windows { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; width: 100%; }
.th-window {
  width: 100%; aspect-ratio: 1; background: #fff6cf; border: 1px solid #d9c97c;
  border-radius: 3px; box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
}
.th-door { font-size: 15px; margin-top: 6px; line-height: 1; }
.th-plaque {
  margin-top: 5px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 8px; font-size: 12px; font-weight: 700; color: var(--text);
}
.th-label { margin-top: 4px; font-size: 12px; color: var(--muted); }
.th-yard { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; margin-top: 4px; font-size: 14px; line-height: 1; }
.th-yard-icon { filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
.town-hint {
  font-size: 13px; color: var(--muted); background: var(--primary-soft);
  border-radius: 10px; padding: 10px 14px; margin-top: 4px;
}

/* 装修面板 */
.house-status { display: flex; gap: 8px 22px; flex-wrap: wrap; }
.hs-item { font-size: 15px; font-weight: 600; }
.palette-row { display: flex; gap: 10px; flex-wrap: wrap; }
.palette-swatch {
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  border: 3px solid transparent; box-shadow: 0 2px 6px rgba(31,41,55,.12); transition: all .15s;
}
.palette-swatch:hover { transform: scale(1.08); }
.palette-swatch.active { border-color: var(--text); }
.decor-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.decor-item {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; transition: all .15s;
}
.decor-item:hover { border-color: var(--primary); box-shadow: 0 6px 16px rgba(31,41,55,.08); }
.decor-item.locked { opacity: .5; }
.decor-item.owned { border-color: var(--ok); background: linear-gradient(180deg, #f4fdf7, #fff); }
.di-icon { font-size: 34px; }
.di-name { font-weight: 700; font-size: 14px; }
.di-meta { font-size: 12px; color: var(--muted); }
.di-lock { font-size: 12px; color: var(--warn); font-weight: 600; }
.di-buy { margin-top: 4px; }

/* 他家只读弹窗 */
.other-house-modal { display: flex; flex-direction: column; gap: 10px; }
.oh-item { font-size: 15px; font-weight: 600; }
.oh-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ============ 小镇三 Tab（T4 活动/公告栏） ============ */
.town-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 6px; width: fit-content; box-shadow: 0 2px 8px rgba(31,41,55,.05);
}
.town-tab {
  border: none; background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 10px;
  cursor: pointer; transition: all .15s;
}
.town-tab:hover { background: var(--primary-soft); color: var(--primary); }
.town-tab.active { background: var(--primary); color: #fff; }

/* 活动卡 */
.event-card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 20px; margin-bottom: 16px; transition: all .15s;
}
.event-card:hover { border-color: var(--primary); box-shadow: 0 8px 22px rgba(31,41,55,.08); }
.ev-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ev-title { font-size: 17px; font-weight: 700; }
.ev-badges { display: flex; gap: 6px; flex-shrink: 0; }
.ev-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 10px; }
.ev-meta-item { font-size: 13px; color: var(--muted); }
.ev-note { font-size: 13px; color: var(--text); margin-top: 8px; background: var(--primary-soft); border-radius: 8px; padding: 6px 10px; }
.ev-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.ev-enroll-count { font-size: 13px; color: var(--muted); }
.ev-foot-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ev-my { font-size: 13px; font-weight: 600; color: var(--ok); }

/* 活动卡内榜单 / 公告栏榜单 */
.ev-board { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.ev-board-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.ev-board-empty { font-size: 13px; color: var(--muted); margin-top: 12px; }
.board-row, .board-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  border-radius: 10px; background: #fafbfc;
}
.board-row + .board-row, .board-item + .board-item { margin-top: 6px; }
.br-rank, .bi-rank {
  width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0; color: #fff;
}
.rank-1 { background: #f5a623; }
.rank-2 { background: #9aa5b1; }
.rank-3 { background: #c98a5e; }
.rank-n { background: var(--primary); }
.br-alias, .bi-alias { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-score, .bi-score { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.bi-title { flex: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }

/* 公告 */
.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice-item {
  border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: 10px; padding: 12px 14px; background: #fbfdfc;
}
.ni-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ni-title { font-weight: 700; font-size: 15px; }
.ni-time { font-size: 12px; color: var(--muted); }
.ni-content { font-size: 13.5px; color: var(--text); margin-top: 6px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* ============ 知鉴阁（P3a 祝福墙/点赞短句） ============ */
.bless-wall { display: flex; gap: 10px; flex-wrap: wrap; }
.bless-chip {
  background: linear-gradient(180deg, #fff8e6, #fff3d1); border: 1px solid #f2dfae;
  border-radius: 999px; padding: 7px 14px; font-size: 13.5px; color: #8a6a1f;
  box-shadow: 0 2px 6px rgba(138,106,31,.08);
}
.sticker-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.sticker-btn { border-radius: 999px; }
.board-item .ev-foot-right { margin-left: auto; }

/* ============ P4 成长档案 / 薄弱复盘 / 月度报告 ============ */
.weak-rank { display: inline-block; min-width: 26px; font-weight: 800; color: var(--muted); }
.weak-action { display: flex; gap: 8px; flex-wrap: wrap; }
.master-toggle {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px;
  color: var(--text); cursor: pointer; white-space: nowrap;
}
.master-toggle input { accent-color: var(--ok); width: 16px; height: 16px; cursor: pointer; }
.mk-mastered td { opacity: .55; }
.mk-mastered td:nth-child(2) { text-decoration: line-through; }
.report-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.report-note {
  width: 100%; min-height: 120px; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; font-size: 14px; font-family: inherit; resize: vertical; color: var(--text);
}
.report-note-view { white-space: pre-wrap; line-height: 1.7; color: var(--text); }
.rp-up { color: var(--ok); font-weight: 600; }
.rp-down { color: var(--danger); font-weight: 600; }

/* ============ P5a 学习目标 / 周复盘 ============ */
.rp-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.rp-tabs .tab { padding: 10px 20px; font-size: 15px; }
.goal-tpls { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.weekly-banner {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  border: 1px solid var(--primary);
}
.weekly-banner .wb-main { display: flex; align-items: center; gap: 12px; flex: 1; }
.weekly-banner .wb-icon { font-size: 28px; }
.weekly-banner .wb-title { font-weight: 700; font-size: 15px; }
.weekly-banner .wb-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ============ P5d 学习健康 / 周报摘要 ============ */
.health-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 16px;
}
.health-bar-label { font-weight: 700; font-size: 14px; }
.health-bar-text { font-size: 13px; color: var(--muted); }
.health-bar-text b { color: var(--primary); font-size: 15px; }
.health-rest {
  background: linear-gradient(135deg, var(--ok-soft), #fff7e6);
  border: 1px solid var(--ok); color: #1f7a3d;
  border-radius: var(--radius); padding: 12px 16px; font-size: 15px; font-weight: 700;
  margin-bottom: 16px; text-align: center;
}
.digest-body { display: flex; flex-direction: column; gap: 8px; }
.digest-row { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.6; }
.digest-row .digest-ico { flex-shrink: 0; }
.digest-row.alert { color: #b26a00; background: var(--warn-soft); border-radius: 8px; padding: 8px 10px; }

@media (prefers-reduced-motion: reduce) {
  .toast, .modal-overlay, .card, .switch-slider { transition: none !important; animation: none !important; }
}

/* ============ 打印 / 导出 PDF（月度报告） ============ */
@media print {
  body { background: #fff !important; }
  body::before, body::after, #shell::before { display: none !important; }
  .topbar, .side-info, .mode-banner { display: none !important; }
  .no-print, .report-controls { display: none !important; }
  .layout-row { display: block !important; }
  .content-col { width: 100% !important; padding: 0 !important; }
  main#app { padding: 8px 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #d9dde3 !important; page-break-inside: avoid; }
  .btn, button { display: none !important; }
  .report-title { font-size: 22px; text-align: center; }
  .chart-box { max-height: 300px; }
}
