:root {
  color-scheme: light;
  --ink: #17231e;
  --muted: #66716b;
  --subtle: #8b958f;
  --paper: #f4f6f1;
  --surface: #ffffff;
  --surface-soft: #edf1eb;
  --line: #dce2db;
  --accent: #2f6b4f;
  --accent-strong: #24543e;
  --accent-soft: #dcece2;
  --sidebar: #17241f;
  --warning: #a5641b;
  --danger: #a33f3f;
  --radius-card: 16px;
  --radius-control: 10px;
  --shadow: 0 18px 50px rgba(31, 52, 42, 0.08);
  font-family: "Segoe UI Variable", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  min-width: 1040px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(47, 107, 79, 0.22);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  color: #eaf1ed;
  background:
    radial-gradient(circle at 20% 0%, rgba(102, 155, 126, 0.18), transparent 30%),
    var(--sidebar);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 32px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: #d9f0e2;
  font-size: 20px;
  font-weight: 700;
}
.brand strong { display: block; font-size: 18px; letter-spacing: .08em; }
.brand span:last-child { display: block; margin-top: 3px; color: #9eb1a7; font-size: 11px; }

.nav-list { display: grid; gap: 6px; }
.nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius-control);
  color: #adbbb4;
  background: transparent;
  text-align: left;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { color: #f4faf6; background: rgba(255,255,255,.06); }
.nav-item:active { transform: translateY(1px); }
.nav-item.is-active { color: white; background: rgba(126, 184, 151, .16); }
.nav-index { color: #709381; font-family: Consolas, monospace; font-size: 10px; }
.nav-item.is-active .nav-index { color: #b9d8c6; }

.sidebar-foot { margin-top: auto; padding: 0 8px; color: #859b90; font-size: 11px; line-height: 1.5; }
.sidebar-foot p { margin: 0 0 10px; }
.sidebar-actions { display: flex; gap: 12px; }
.text-button { padding: 0; border: 0; color: #bbcbc3; background: none; font-size: 11px; }
.text-button:hover { color: white; text-decoration: underline; }

.main-content { margin-left: 232px; min-height: 100vh; padding: 34px 44px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin: 0 auto 32px; max-width: 1440px; }
.today-label { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.topbar h1 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.topbar-actions { display: flex; gap: 10px; }

.button {
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-weight: 650;
  white-space: nowrap;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.button:active { transform: translateY(1px); }
.button-primary { color: white; background: var(--accent); }
.button-primary:hover { background: var(--accent-strong); }
.button-secondary { color: var(--ink); border-color: var(--line); background: var(--surface); }
.button-secondary:hover { border-color: #bcc8c0; background: #fbfcfa; }
.button-dark { color: white; background: var(--ink); }
.button-dark:hover { background: #293831; }
.button-danger { color: var(--danger); border-color: #e4c8c8; background: #fff8f8; }
.button-danger:hover { background: #fbeeee; }
.button-wide { width: 100%; }

.view { display: none; max-width: 1440px; margin: 0 auto; }
.view.is-visible { display: block; animation: enter .24s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.summary-card {
  position: relative;
  min-height: 132px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.summary-card::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -34px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--accent-soft);
  opacity: .55;
}
.summary-label { margin: 0; color: var(--muted); font-size: 12px; }
.summary-value { position: relative; z-index: 1; margin: 14px 0 6px; font-size: 30px; line-height: 1; letter-spacing: -.04em; }
.summary-note { position: relative; z-index: 1; margin: 0; color: var(--subtle); font-size: 11px; }
.today-deadline-banner { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; padding: 14px 18px; border: 1px solid #d7e1da; border-radius: var(--radius-card); background: var(--surface); }
.today-deadline-banner > div { display: flex; align-items: center; gap: 14px; }
.today-deadline-banner strong { display: block; font-size: 14px; }
.today-deadline-banner p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.today-deadline-mark { display: grid; min-width: 56px; height: 32px; place-items: center; border-radius: 8px; color: var(--accent-strong); background: var(--accent-soft); font-family: Consolas, monospace; font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.today-deadline-banner.has-tasks { border-color: #e5cfaa; background: #fffaf1; }
.today-deadline-banner.has-tasks .today-deadline-mark { color: #80561d; background: #f7e7ca; }
.today-deadline-banner.is-complete { border-color: #bcd8c6; background: #f1faf4; }
.today-congrats { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: white; background: var(--accent); font-size: 18px; }
.today-habit-banner { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 20px; margin: -4px 0 14px; padding: 13px 18px; border: 1px solid #d5e0d8; border-radius: var(--radius-card); background: #f8faf7; }
.today-habit-banner > div { display: flex; align-items: center; gap: 14px; }
.today-habit-banner strong { display: block; font-size: 13px; }
.today-habit-banner p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.habit-ledger-mark { display: grid; min-width: 56px; height: 34px; place-items: center; border: 1px solid #bdd2c3; border-radius: 7px; color: var(--accent-strong); background: repeating-linear-gradient(90deg, #e4f0e8 0 5px, #f4f8f5 5px 9px); font-family: Consolas, monospace; font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.today-habit-banner.has-habits { background: #f4f8f5; }
.today-habit-banner.is-complete { border-color: #b9d5c2; background: #eef8f1; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.course-overview-panel, .deadline-panel, .week-panel { padding: 22px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-kicker { margin: 0 0 5px; color: var(--accent); font-family: Consolas, monospace; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.section-heading h2, .review-builder h2, .review-callout h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.link-button { padding: 4px 0; border: 0; color: var(--accent); background: transparent; font-size: 12px; }
.link-button:hover { text-decoration: underline; }
.link-button:disabled { color: var(--subtle); cursor: not-allowed; text-decoration: none; }
.section-note { color: var(--muted); font-size: 11px; }

.course-progress-list { display: grid; gap: 18px; }
.progress-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.5fr) 70px; align-items: center; gap: 18px; }
.progress-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-title span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.progress-track { height: 7px; overflow: hidden; border-radius: 7px; background: #e7ece8; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.progress-meta { color: var(--muted); font-size: 11px; text-align: right; }
.progress-meta strong { display: block; color: var(--ink); font-size: 14px; }

.deadline-list { display: grid; gap: 4px; }
.deadline-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf0ed; }
.deadline-item:last-child { border-bottom: 0; }
.deadline-item strong { display: block; font-size: 13px; }
.deadline-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.due-label { align-self: center; padding: 4px 7px; border-radius: 7px; color: var(--warning); background: #fff4e6; font-size: 10px; white-space: nowrap; }
.due-label.is-overdue { color: var(--danger); background: #fff0f0; }

.week-panel { min-height: 260px; }
.week-chart { height: 170px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 12px; padding-top: 10px; }
.chart-day { height: 100%; display: grid; grid-template-rows: 1fr auto; gap: 8px; align-items: end; text-align: center; }
.bar-shell { height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: min(34px, 70%); min-height: 3px; border-radius: 7px 7px 3px 3px; background: var(--accent); transition: height .25s ease; }
.chart-label { color: var(--muted); font-size: 10px; }
.chart-value { display: block; color: var(--ink); font-size: 9px; }

.review-callout { padding: 26px; color: #e7f1eb; background: var(--sidebar); border-color: var(--sidebar); }
.review-callout .section-kicker { color: #8fc0a5; }
.review-callout h2 { font-size: 22px; }
.review-callout p:not(.section-kicker) { max-width: 38ch; margin: 14px 0 24px; color: #afbeb6; line-height: 1.7; }
.review-callout .button-dark { color: var(--ink); background: #dcece2; }
.review-callout .button-dark:hover { background: white; }

.view-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.view-toolbar p { margin: 0; color: var(--muted); }
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.course-card { display: flex; min-height: 250px; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.course-card-head { display: flex; justify-content: space-between; gap: 16px; }
.course-card h3 { margin: 0; font-size: 18px; }
.course-card-type { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.status-tag { align-self: flex-start; padding: 4px 8px; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: 10px; white-space: nowrap; }
.status-tag.is-paused { color: #68716c; background: #edf0ed; }
.status-tag.is-planned { color: #75651c; background: #f7f2d8; }
.course-big-progress { margin: 28px 0 20px; }
.course-big-progress strong { display: block; margin-bottom: 10px; font-size: 32px; letter-spacing: -.04em; }
.course-card-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: auto; }
.course-card-stats div { padding-top: 12px; border-top: 1px solid #e8ece9; }
.course-card-stats span { display: block; color: var(--muted); font-size: 10px; }
.course-card-stats strong { display: block; margin-top: 4px; font-size: 13px; }
.course-card-actions { display: flex; gap: 14px; margin-top: 18px; }
.course-task-link { margin-right: auto; font-weight: 650; }
.course-task-link span { display: inline-grid; min-width: 18px; height: 18px; margin-left: 4px; place-items: center; border-radius: 9px; color: white; background: var(--accent); font-size: 9px; }
.course-outline-note { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--muted); font-size: 10px; }
.course-outline-note span { padding: 3px 7px; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.course-task-system-note { padding: 13px 15px; border: 1px solid #d4e0d7; border-radius: 10px; background: #f5f9f6; }
.course-task-system-note strong { display: block; color: var(--accent-strong); font-size: 11px; }
.course-task-system-note p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.habit-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.habit-summary div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.habit-summary span { display: block; color: var(--muted); font-size: 10px; }
.habit-summary strong { display: block; margin-top: 6px; font-size: 18px; }
.habit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.habit-card { position: relative; min-height: 235px; padding: 20px; overflow: hidden; border: 1px solid #d5dfd7; border-radius: var(--radius-card); background: var(--surface); }
.habit-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: repeating-linear-gradient(180deg, #4e8063 0 10px, #a9c6b3 10px 15px); }
.habit-card.is-paused { opacity: .68; }
.habit-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.habit-card-head span { color: var(--accent); font-family: Consolas, monospace; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.habit-card-head h3 { margin: 5px 0 0; font-size: 17px; }
.habit-card-head b { padding: 4px 7px; border-radius: 6px; color: var(--accent-strong); background: var(--accent-soft); font-size: 9px; white-space: nowrap; }
.habit-number { display: flex; align-items: baseline; gap: 7px; margin: 28px 0 13px; }
.habit-number strong { font-size: 34px; letter-spacing: -.05em; }
.habit-number span { color: var(--muted); font-size: 11px; }
.habit-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e7ece8; }
.habit-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f6b4f, #85af93); transition: width .2s ease; }
.habit-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 23px; }
.habit-card-foot > span { color: var(--muted); font-family: Consolas, monospace; font-size: 9px; }
.habit-card-foot > div { display: flex; align-items: center; gap: 12px; }
.habit-card-foot .button { min-height: 34px; padding: 7px 11px; font-size: 10px; }

.segmented-control { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.segmented-control button { padding: 7px 14px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; }
.segmented-control button.is-active { color: var(--ink); background: var(--surface-soft); font-weight: 650; }
.task-filter-bar { display: flex; align-items: end; gap: 10px; margin: -4px 0 14px; padding: 12px 14px; border: 1px solid #d8e2da; border-radius: var(--radius-control); background: #f8faf7; }
.task-filter-field { display: grid; min-width: 190px; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 650; }
.task-filter-field select { min-height: 36px; padding-top: 7px; padding-bottom: 7px; background: white; }
.task-custom-dates { display: flex; align-items: end; gap: 7px; }
.task-custom-dates[hidden] { display: none; }
.task-custom-dates > span { padding-bottom: 10px; color: var(--subtle); }
.task-custom-dates label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 650; }
.task-custom-dates input { width: 132px; min-height: 36px; padding-top: 7px; padding-bottom: 7px; }
.task-filter-meta { display: flex; align-items: center; gap: 13px; margin-left: auto; padding-bottom: 5px; white-space: nowrap; }
.task-filter-meta strong { color: var(--muted); font-family: Consolas, monospace; font-size: 10px; font-weight: 600; }
.task-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.task-table { width: 100%; border-collapse: collapse; }
.task-table th { padding: 13px 18px; color: var(--muted); background: #f9faf8; font-size: 10px; font-weight: 650; text-align: left; }
.task-table td { padding: 15px 18px; border-top: 1px solid #e8ece9; vertical-align: middle; }
.task-name-cell strong { display: block; }
.task-name-cell span { display: block; max-width: 300px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-kind { display: inline-block; margin-right: 6px; padding: 2px 5px; border-radius: 5px; color: var(--accent); background: var(--accent-soft); font-size: 9px; }
.task-kind-assessment { color: var(--danger); background: #fff0f0; }
.task-kind-appendix { color: #6c5c18; background: #f7f2d8; }
.task-kind-habit { color: #315f78; background: #e7f1f5; }
.table-select { min-width: 92px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.task-progress-cell { min-width: 150px; }
.task-progress-cell > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.task-progress-cell strong { color: var(--accent-strong); font-family: Consolas, monospace; font-size: 12px; }
.task-progress-cell span { color: var(--muted); font-size: 9px; }
.task-progress-track { height: 6px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #e5ebe6; }
.task-progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3a7b5c, #78a98b); transition: width .2s ease; }
.task-row-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.priority { font-size: 11px; }
.priority-high { color: var(--danger); }
.priority-medium { color: var(--warning); }
.priority-low { color: var(--muted); }

.calendar-shell { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.calendar-head { display: flex; align-items: flex-start; justify-content: space-between; min-width: 700px; gap: 24px; padding: 24px 26px 20px; border-bottom: 1px solid #e2e8e3; }
.calendar-head h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.calendar-head p:not(.section-kicker) { max-width: 68ch; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.calendar-controls { display: flex; align-items: center; gap: 7px; }
.calendar-controls .button { min-width: 38px; min-height: 38px; padding: 7px 11px; }
.calendar-summary { display: grid; grid-template-columns: repeat(3, 1fr); min-width: 700px; border-bottom: 1px solid #e5eae6; }
.calendar-summary div { position: relative; padding: 15px 20px; }
.calendar-summary div + div { border-left: 1px solid #e5eae6; }
.calendar-summary div::before { content: ""; position: absolute; top: 15px; bottom: 15px; left: 0; width: 3px; border-radius: 3px; background: transparent; }
.calendar-summary div.is-complete::before { background: #4e8a65; }
.calendar-summary div.is-missed::before { background: #bc5a52; }
.calendar-summary span { display: block; color: var(--muted); font-size: 9px; }
.calendar-summary strong { display: block; margin-top: 5px; font-size: 17px; }
.calendar-weekdays, .calendar-grid { display: grid; min-width: 700px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { color: var(--muted); background: #f8faf8; border-bottom: 1px solid #e1e7e2; }
.calendar-weekdays span { padding: 10px 12px; font-family: Consolas, "Microsoft YaHei UI", monospace; font-size: 9px; text-align: right; }
.calendar-day { position: relative; display: grid; min-height: 108px; align-content: space-between; justify-items: start; padding: 12px; border: 0; border-right: 1px solid #e5eae6; border-bottom: 1px solid #e5eae6; color: var(--ink); background: #fff; text-align: left; transition: background .16s ease, box-shadow .16s ease, transform .16s ease; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:hover { z-index: 1; background: #f7faf8; box-shadow: inset 0 0 0 2px #a8c1b1; }
.calendar-day:active { transform: scale(.985); }
.calendar-day.is-complete { background: #eff8f1; }
.calendar-day.is-complete:hover { background: #e6f4e9; box-shadow: inset 0 0 0 2px #5e9871; }
.calendar-day.is-missed { background: #fff1ef; }
.calendar-day.is-missed:hover { background: #fde9e6; box-shadow: inset 0 0 0 2px #be6961; }
.calendar-day.is-outside { opacity: .42; }
.calendar-day.is-today { z-index: 2; box-shadow: inset 0 0 0 2px var(--accent); }
.calendar-day-number { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; font-family: Consolas, monospace; font-size: 13px; font-weight: 700; }
.calendar-day.is-today .calendar-day-number { color: white; background: var(--accent); }
.calendar-day-count { align-self: end; color: var(--ink); font-family: Consolas, monospace; font-size: 11px; font-weight: 700; }
.calendar-day-status { color: var(--muted); font-size: 9px; }
.calendar-day.is-complete .calendar-day-status { color: #356e4b; }
.calendar-day.is-missed .calendar-day-status { color: #9f4742; }
.calendar-legend { display: flex; min-width: 700px; align-items: center; gap: 20px; padding: 14px 20px; color: var(--muted); background: #fafbf9; font-size: 9px; }
.calendar-legend span { display: flex; align-items: center; gap: 7px; }
.calendar-legend i { width: 10px; height: 10px; border: 1px solid #d5dcd7; border-radius: 3px; background: white; }
.calendar-legend i.is-complete { border-color: #89b298; background: #dcefe1; }
.calendar-legend i.is-missed { border-color: #d49a94; background: #f9deda; }
.calendar-legend small { margin-left: auto; color: var(--subtle); }

.review-layout { display: grid; gap: 14px; align-items: start; }
.daily-review-panel { padding: 24px; }
.daily-review { padding: 20px; border: 1px solid #cdded2; border-radius: 13px; background: linear-gradient(145deg, #f8fbf8, #f1f6f2); }
.daily-review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.daily-review-head h2 { margin: 0; font-size: 18px; }
.daily-review-actions { display: flex; align-items: center; gap: 12px; }
.auto-badge { padding: 5px 8px; border-radius: 7px; color: var(--accent-strong); background: var(--accent-soft); font-size: 9px; }
.auto-badge b { font-weight: 650; }
.daily-review-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.daily-review-stats div { padding: 10px 11px; border: 1px solid #dce6df; border-radius: 9px; background: rgba(255,255,255,.8); }
.daily-review-stats span { display: block; color: var(--muted); font-size: 9px; }
.daily-review-stats strong { display: block; margin-top: 5px; font-size: 13px; }
.daily-review-text { margin: 14px 2px 16px; color: #425149; font-size: 11px; line-height: 1.7; }
.date-range { display: grid; gap: 13px; margin-bottom: 18px; }
.date-range label, .reflection-field { color: var(--muted); font-size: 11px; }
.date-range input { width: 100%; margin-top: 6px; }
.review-timeline { margin-bottom: 0; overflow: hidden; border: 1px solid #d2dfd6; border-radius: 12px; background: #fff; }
.review-timeline[hidden] { display: none; }
.review-timeline-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 17px; border-bottom: 1px solid #dce5de; }
.review-timeline-head h3 { margin: 0; font-size: 15px; }
.review-timeline-head > span { padding: 4px 8px; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-family: Consolas, monospace; font-size: 9px; }
#review-timeline-items { max-height: 330px; overflow: auto; padding: 4px 16px 8px; }
.timeline-item { display: grid; grid-template-columns: 112px 18px minmax(0, 1fr); gap: 10px; min-height: 72px; padding: 12px 0; }
.timeline-when { text-align: right; }
.timeline-when strong { display: block; font-size: 10px; }
.timeline-when span { display: block; margin-top: 4px; color: var(--muted); font-family: Consolas, monospace; font-size: 9px; }
.timeline-rail { position: relative; display: flex; justify-content: center; }
.timeline-rail i { position: relative; z-index: 1; width: 9px; height: 9px; margin-top: 3px; border: 2px solid white; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #bcd4c5; }
.timeline-item.is-habit .timeline-rail i { background: #3b7fa8; box-shadow: 0 0 0 2px #b9d5e5; }
.timeline-item:not(:last-child) .timeline-rail::after { content: ""; position: absolute; top: 14px; bottom: -15px; width: 1px; background: #c9d8ce; }
.timeline-content { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 0 0 11px; border-bottom: 1px solid #e5ebe6; }
.timeline-item:last-child .timeline-content { border-bottom: 0; }
.timeline-content strong { display: block; font-size: 12px; }
.timeline-content span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.timeline-content p { max-width: 52ch; margin: 7px 0 0; color: #49574f; font-size: 10px; line-height: 1.55; }
.timeline-result { display: grid; flex: 0 0 auto; justify-items: end; gap: 5px; }
.timeline-result b { padding: 4px 7px; border-radius: 6px; color: var(--accent-strong); background: var(--accent-soft); font-family: Consolas, monospace; font-size: 9px; }
.timeline-item.is-habit .timeline-result b { color: #285f82; background: #e5f1f7; }
.timeline-item.is-habit .timeline-content > div:first-child > span { color: #39769b; }
.timeline-result span { margin: 0; color: var(--muted); font-size: 9px; }
.timeline-empty { padding: 26px 12px; color: var(--muted); font-size: 11px; line-height: 1.6; text-align: center; }
.weekly-review-workspace { overflow: hidden; }
.weekly-review-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 22px 24px; border-bottom: 1px solid #dfe6e1; background: #f8faf8; }
.weekly-review-head h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.weekly-review-head > div:first-child > p:not(.section-kicker) { max-width: 54ch; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.weekly-review-controls { display: flex; align-items: end; gap: 10px; }
.weekly-review-controls .date-range { display: grid; grid-template-columns: repeat(2, 150px); gap: 8px; margin: 0; }
.weekly-review-controls .date-range label { font-size: 9px; }
.weekly-review-controls .date-range input { min-height: 38px; margin-top: 4px; }
.weekly-review-controls > .button { min-height: 38px; white-space: nowrap; }
.weekly-review-body { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .65fr); gap: 0; }
.weekly-review-document { min-width: 0; padding: 24px; border-right: 1px solid #e0e6e1; }
.weekly-review-document .section-heading { margin-bottom: 14px; }
.weekly-review-document .section-heading h2 { margin: 0; font-size: 17px; }
.weekly-review-document > textarea { width: 100%; min-height: 430px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--ink); background: #fbfcfa; font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif; font-size: 11px; line-height: 1.85; resize: vertical; }
.weekly-reflection-panel { display: flex; min-width: 0; flex-direction: column; padding: 24px; background: linear-gradient(180deg, #f3f7f4, #edf4ef); }
.weekly-reflection-panel h3 { margin: 0; font-size: 16px; }
.weekly-reflection-panel > div > p:not(.section-kicker) { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.reflection-field { display: block; flex: 1; margin: 18px 0 14px; }
.reflection-field textarea { width: 100%; min-height: 260px; height: 100%; padding: 14px; border-color: #cbd8ce; background: rgba(255,255,255,.82); line-height: 1.75; }
.weekly-reflection-panel > .button { width: 100%; }
.history-section { margin-top: 34px; }
.review-history { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.review-history-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.review-history-card h3 { margin: 0; font-size: 15px; }
.review-history-card p { display: -webkit-box; margin: 10px 0 16px; overflow: hidden; color: var(--muted); line-height: 1.6; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }

.modal { width: min(650px, calc(100vw - 48px)); max-height: calc(100vh - 48px); padding: 0; overflow: auto; border: 0; border-radius: var(--radius-card); color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.modal-course { width: min(960px, calc(100vw - 48px)); }
.modal-completion { width: min(560px, calc(100vw - 48px)); }
.modal-habit { width: min(590px, calc(100vw - 48px)); }
.modal::backdrop { background: rgba(17, 28, 23, .54); backdrop-filter: blur(3px); }
.modal form { padding: 24px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.modal-head h2 { margin: 0; font-size: 21px; }
.close-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; font-size: 21px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.field-span-2 { grid-column: span 2; }
input, select, textarea { min-height: 40px; padding: 9px 11px; border: 1px solid #cfd7d1; border-radius: var(--radius-control); color: var(--ink); background: white; }
input.is-invalid { border-color: var(--danger); background: #fff8f8; box-shadow: 0 0 0 3px rgba(163, 63, 63, .1); }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #939d97; }
.field-hint { margin-top: -2px; color: var(--subtle); font-size: 10px; }
.check-field { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.check-field input { width: 17px; height: 17px; min-height: 0; accent-color: var(--accent); }
.task-current-progress { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 5px 18px; padding: 13px 15px; border: 1px solid #d5e1d8; border-radius: 10px; background: #f5f9f6; }
.task-current-progress span { color: var(--muted); font-size: 10px; }
.task-current-progress strong { color: var(--accent-strong); font-family: Consolas, monospace; font-size: 19px; }
.task-current-progress p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.modal-actions { display: flex; gap: 9px; margin-top: 24px; }
.action-spacer { flex: 1; }
.completion-task-name { display: grid; gap: 5px; padding: 13px 15px; border: 1px solid #d6e1d9; border-radius: 10px; background: #f5f9f6; }
.completion-task-name span { color: var(--muted); font-size: 9px; }
.completion-task-name strong { font-size: 14px; }
.completion-intro { margin: 14px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.progress-submit-row { display: grid; grid-template-columns: 130px 1fr; align-items: start; gap: 14px; }
.progress-submit-row > div { display: grid; gap: 5px; padding: 13px 15px; border: 1px solid #d8e1da; border-radius: 10px; background: #fafbf9; }
.progress-submit-row > div span { color: var(--muted); font-size: 9px; }
.progress-submit-row > div strong { color: var(--accent-strong); font-family: Consolas, monospace; font-size: 20px; }
.progress-preview-track { height: 8px; margin: 14px 0 18px; overflow: hidden; border-radius: 999px; background: #e5ebe6; }
.progress-preview-track div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f6b4f, #80ad91); transition: width .2s ease; }
.habit-progress-overview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0 0; }
.habit-progress-overview div { padding: 12px 14px; border: 1px solid #d8e2da; border-radius: 9px; background: #f8faf8; }
.habit-progress-overview span { display: block; color: var(--muted); font-size: 9px; }
.habit-progress-overview strong { display: block; margin-top: 5px; font-size: 17px; }
.habit-time-entry { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.habit-time-entry[hidden] { display: none; }
#habit-entry-amount-field[hidden] { display: none; }
.completion-duration { margin-top: 14px; padding: 10px 12px; border-radius: 8px; color: var(--accent-strong); background: var(--accent-soft); font-size: 11px; }
.completion-duration.is-error { color: var(--danger); background: #fff0f0; }

.outline-import { padding: 18px; border: 1px solid #cfdcd3; border-radius: 13px; background: #f8faf7; }
.outline-import-head { display: flex; align-items: flex-start; gap: 18px; }
.outline-import-head > div { flex: 1; }
.outline-import-head h3 { margin: 0; font-size: 15px; }
.outline-import-head p:not(.section-kicker) { max-width: 58ch; margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.outline-empty { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px; border: 1px dashed #cbd6ce; border-radius: 10px; color: var(--muted); background: white; }
.outline-empty p { margin: 0; font-size: 11px; line-height: 1.5; }
.outline-empty-mark { display: grid; width: 38px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-family: Consolas, monospace; font-size: 9px; font-weight: 700; }
.outline-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 16px; }
.outline-summary div { padding: 10px 12px; border: 1px solid #e0e6e1; border-radius: 9px; background: white; }
.outline-summary span, .outline-summary small { display: block; color: var(--muted); font-size: 9px; }
.outline-summary strong { display: inline-block; margin: 4px 4px 0 0; font-size: 18px; line-height: 1; }
.outline-summary small { display: inline; }
.outline-controls { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 14px 0 10px; }
.outline-controls .field { width: 260px; }
.outline-control-actions { display: flex; align-items: center; gap: 12px; }
.outline-control-actions .button { min-height: 36px; padding: 7px 12px; font-size: 11px; }
.outline-warning { margin: 10px 0; padding: 10px 12px; border-left: 3px solid #d39a42; border-radius: 0 8px 8px 0; color: #76531f; background: #fff7e9; font-size: 10px; }
.outline-warning p { margin: 0; }
.outline-warning p + p { margin-top: 5px; }
.outline-preview { max-height: 390px; overflow: auto; border: 1px solid #dce3dd; border-radius: 10px; background: white; }
.outline-group + .outline-group { border-top: 1px solid #e5eae6; }
.outline-group summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; color: var(--ink); background: #f7f9f6; cursor: pointer; list-style: none; }
.outline-group summary::-webkit-details-marker { display: none; }
.outline-group summary span { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.outline-group summary b { color: #789083; font-family: Consolas, monospace; font-size: 9px; }
.outline-group summary small { color: var(--muted); font-size: 9px; font-weight: 400; }
.outline-group[open] summary { color: var(--accent-strong); border-bottom: 1px solid #e5eae6; }
.outline-group-items { display: grid; }
.outline-item { position: relative; display: grid; grid-template-columns: 24px 70px minmax(220px, 1fr) 108px 126px; align-items: center; gap: 8px; padding: 8px 12px; }
.outline-item + .outline-item { border-top: 1px solid #f0f2f0; }
.outline-item:hover { background: #fbfcfa; }
.outline-item.is-duplicate { padding-right: 72px; background: #f6f7f5; opacity: .72; }
.outline-check { display: grid; place-items: center; }
.outline-check input { width: 16px; height: 16px; min-height: 0; accent-color: var(--accent); }
.outline-code { overflow: hidden; color: var(--accent); font-family: Consolas, "Microsoft YaHei UI", monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.outline-item input, .outline-item select { min-height: 34px; padding: 6px 8px; border-color: #d9dfda; border-radius: 7px; font-size: 10px; }
.outline-duplicate-label { position: absolute; right: 13px; padding: 3px 6px; border-radius: 5px; color: var(--muted); background: #e6e9e6; font-size: 9px; }

.empty-state { padding: 54px 24px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 15px; }
.empty-state p { max-width: 45ch; margin: 0 auto 16px; line-height: 1.6; }

.toast-region { position: fixed; z-index: 20; right: 24px; bottom: 24px; display: grid; gap: 8px; }
.toast { min-width: 240px; padding: 12px 16px; border: 1px solid #b8cfbf; border-radius: var(--radius-control); color: #143422; background: #eef8f1; box-shadow: var(--shadow); animation: toast-in .2s ease both; }
.toast.is-error { color: #6d2525; border-color: #e2bbbb; background: #fff1f1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1180px) {
  .main-content { padding-right: 28px; padding-left: 28px; }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .habit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .weekly-review-head { display: grid; }
  .weekly-review-controls { justify-content: space-between; }
  .weekly-review-body { grid-template-columns: 1fr; }
  .weekly-review-document { border-right: 0; border-bottom: 1px solid #e0e6e1; }
  .reflection-field textarea { min-height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
