:root {
  color-scheme: light;
  --bg: #f3f6f4;
  --surface: #fbfcfb;
  --surface-strong: #ffffff;
  --surface-muted: #f0f4f1;
  --ink: #1f2b28;
  --muted: #596963;
  --line: #dde5e1;
  --line-strong: #cfdad5;
  --shadow: 0 18px 48px rgba(41, 62, 54, 0.12);
  --shadow-soft: 0 8px 24px rgba(41, 62, 54, 0.07);
  --accent: #476f61;
  --accent-ink: #ffffff;
  --accent-text: #365c50;
  --accent-soft: #e6f1eb;
  --accent-faint: #f3f8f5;
  --study: #7c9dc9;
  --revision: #b9a6d4;
  --exam: #d96f67;
  --assignment: #dd914a;
  --matter: #80aec8;
  --danger: #a33a2c;
  --radius: 8px;
  --panel-radius: 14px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

/* No elastic "rubber band" bounce: on a Mac it pulled the calendar down and showed a
   blank gap above it when scrolling up past the top. */
html,
body,
.sidebar,
.calendar-panel,
.detail-panel,
.menu-sheet,
.day-modal-list {
  overscroll-behavior: none;
}

/* While the wheel is moving, cells under the pointer don't restyle on hover. */
body.is-scrolling:not(.is-dragging-study) #calendar-grid {
  pointer-events: none;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-theme="paper"] {
  --bg: #f5f3ed;
  --surface: #fcfbf7;
  --surface-muted: #f1eee6;
  --line: #e4dfd2;
  --line-strong: #d5cebd;
}

body[data-theme="studio"] {
  --bg: #f2f4f7;
  --surface: #fbfcfd;
  --surface-muted: #eef1f5;
  --line: #dfe4eb;
  --line-strong: #ced6e0;
}

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

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:active {
  transform: translateY(1px);
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(650px, 1fr) 292px;
  gap: 10px;
  min-height: 100dvh;
  padding: 10px;
  transition: grid-template-columns 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.left-collapsed .app-shell {
  grid-template-columns: 0 minmax(700px, 1fr) 292px;
}

body.right-collapsed .app-shell {
  grid-template-columns: 224px minmax(700px, 1fr) 0;
}

body.left-collapsed.right-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}

.sidebar,
.calendar-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
  box-shadow: none;
}

.sidebar,
.detail-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: calc(100dvh - 20px);
  padding: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

body.left-collapsed .sidebar,
body.right-collapsed .detail-panel {
  border: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.calendar-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: calc(100dvh - 20px);
  padding: 20px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.brand {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 30px;
  align-items: center;
  column-gap: 10px;
  min-height: 42px;
}

/* The tagline runs under the name and the collapse button, so it fits on one line. */
.brand-text {
  display: contents;
}

.brand-name {
  grid-column: 2;
  grid-row: 1;
}

.brand-tagline {
  grid-column: 2 / 4;
  grid-row: 2;
}

.brand-mark {
  grid-row: 1 / 3;
}

.brand .collapse-tab {
  grid-column: 3;
  grid-row: 1;
}

.brand-mark {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  letter-spacing: 0;
}

.brand-name {
  max-width: none;
  font-size: 1rem;
  font-weight: 780;
  line-height: 1.2;
}

.brand-tagline {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand .collapse-tab {
  position: static;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
}

.brand .collapse-tab:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.brand .collapse-tab svg,
.app-nav svg,
.mobile-tabbar svg,
.view-search svg,
.list-delete svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 16ch;
  font-size: 0.93rem;
  line-height: 1.3;
}

h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.topbar {
  position: sticky;
  top: -20px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -20px -20px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 18px 20px 14px;
}

.topbar-context,
.selected-context {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 680;
}

.topbar h2 {
  font-size: 1.85rem;
  font-weight: 760;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.tool-group,
.section-head button,
.chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: none;
}

.tool-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
}

.button-row {
  display: flex;
  gap: 6px;
}

.toolbar button {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
  line-height: 1;
  box-shadow: none;
}

.toolbar .icon-button {
  width: 34px;
}

.toolbar svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toolbar button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.toolbar button.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.view-switch {
  gap: 2px;
}

.view-switch button {
  min-width: 42px;
  padding: 0 10px;
}

#expand-left,
#expand-right {
  display: none;
  font-size: 0.95rem;
}

body.left-collapsed #expand-left,
body.right-collapsed #expand-right {
  display: inline-grid;
  place-items: center;
}

.collapse-tab {
  position: absolute;
  top: 14px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 1.1rem;
}

.collapse-left {
  right: 12px;
}

.collapse-right {
  right: 12px;
}

.composer {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  margin-top: 14px;
  padding: 16px 0;
}

.app-nav {
  display: grid;
  gap: 2px;
  margin-top: 14px;
}

.app-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  border-radius: var(--radius);
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.9rem;
  font-weight: 680;
  text-decoration: none;
}

.app-nav a:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.app-nav a.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 780;
}

.app-nav a:focus-visible,
.mobile-tabbar a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 36px;
  padding: 0 10px;
}

textarea {
  resize: vertical;
  min-height: 66px;
  padding: 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(14, 111, 104, 0.72);
  box-shadow: 0 0 0 4px rgba(14, 111, 104, 0.12);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 0.78fr;
  gap: 10px;
}

.composer-more {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.composer-more summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  list-style: none;
}

.composer-more summary::-webkit-details-marker {
  display: none;
}

.composer-more summary::after {
  content: "+";
  float: right;
  color: var(--accent-text);
}

.composer-more[open] summary::after {
  content: "−";
}

.composer-more-fields {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 740;
}

.metrics {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.metrics .metric-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  min-height: 56px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 8px 0;
  box-shadow: none;
}

.metrics .metric-row + .metric-row {
  border-top: 1px solid var(--line);
}

.metrics span {
  display: block;
  font-size: 1.2rem;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.command-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.command-card {
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--accent-faint);
  box-shadow: none;
  padding: 16px;
}

.focus-card-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  align-items: center;
  gap: 14px;
}

.focus-pie {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface-strong) 55%, transparent 56%),
    conic-gradient(var(--accent) var(--pie-value, 0%), var(--line) 0);
}

.focus-pie span {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 820;
}

.focus-stats {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.focus-stats span {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 760;
}

.focus-stats b {
  color: var(--ink);
}

.command-card.primary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.52fr);
  grid-template-rows: auto 1fr auto;
  column-gap: 20px;
  background: var(--accent-faint);
}

.command-card.primary > .eyebrow {
  grid-column: 1;
}

.command-card.primary > .focus-card-layout {
  grid-column: 1;
}

.command-card.primary > .focus-stats {
  grid-column: 1;
}

.command-card.primary > .focus-day-items {
  grid-column: 2;
  grid-row: 1 / 4;
  align-content: start;
  margin-top: 0;
  border-top: 0;
  border-left: 1px solid var(--line);
  padding-top: 0;
  padding-left: 16px;
}

.command-card.primary.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.command-card.urgent {
  border-color: rgba(194, 75, 64, 0.24);
}

.command-card strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.35rem, 2vw, 2.2rem);
  line-height: 1;
}

.command-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.focus-day-items {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  border-top: 1px solid rgba(59, 82, 75, 0.1);
  padding-top: 10px;
}

.focus-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 820;
}

.focus-items-head span,
.focus-items-head b {
  display: inline;
  margin: 0;
  font-size: inherit;
}

.focus-day-task,
.focus-more {
  width: 100%;
  min-height: 32px;
  border: 1px solid rgba(59, 82, 75, 0.1);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 7px 9px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 740;
}

.focus-day-task {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 7px;
  align-items: start;
}

.focus-day-task span {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: 1.35;
}

.focus-day-task .dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--study);
}

.focus-day-task[data-type="revision"] .dot {
  background: var(--event-color, var(--revision));
}

.focus-day-task[data-type="exam"] .dot {
  background: var(--exam);
}

.focus-day-task[data-type="assignment"] .dot {
  background: var(--assignment);
}

.focus-day-task[data-type="matter"] .dot {
  background: var(--matter);
}

.focus-day-task.done {
  color: #8a8780;
  background: rgba(235, 234, 230, 0.66);
  text-decoration: line-through;
}

.focus-more {
  color: var(--muted);
}

.focus-items-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.metrics p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.metrics small {
  display: block;
  margin-top: 6px;
  color: var(--accent-text);
  font-size: 0.68rem;
  font-weight: 760;
  line-height: 1.25;
}

.agenda,
.study-rings {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.study-rings {
  border-bottom: 0;
}

.agenda .section-head,
.study-rings .section-head {
  margin-bottom: 8px;
}

.sidebar > .agenda .section-head button,
.sidebar > .study-rings .section-head button {
  min-height: 30px;
  background: transparent;
  box-shadow: none;
  font-size: 0.74rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-head button {
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.chip {
  flex: 0 0 auto;
  padding: 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.chip.active {
  border-color: rgba(14, 111, 104, 0.28);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.month-stack {
  display: grid;
  gap: 26px;
}

.month-section {
  display: grid;
  gap: 6px;
}

.month-section-title {
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 800;
}

.week-section {
  display: grid;
  gap: 12px;
}

.week-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.week-title h3 {
  font-size: 1.35rem;
}

.week-title button,
.add-project-card {
  border: 1px solid rgba(109, 155, 137, 0.28);
  border-radius: var(--radius);
  background: rgba(230, 241, 235, 0.86);
  color: var(--accent-text);
  padding: 10px 12px;
  font-weight: 820;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.week-day {
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
  padding: 10px;
}

.week-day.is-selected {
  border-color: rgba(14, 111, 104, 0.38);
  box-shadow: inset 0 0 0 1px rgba(14, 111, 104, 0.16);
}

.week-day header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-weight: 820;
}

.week-safe {
  margin: 10px 0;
  border-radius: 999px;
  background: rgba(109, 155, 137, 0.12);
  color: #55786c;
  padding: 5px 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.week-safe.under {
  background: rgba(217, 111, 103, 0.12);
  color: #a4534d;
}

.week-items {
  display: grid;
  gap: 6px;
}

.week-items p {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 10px;
  font-size: 0.78rem;
}

.week-item {
  border-left: 2px solid var(--event-color);
  border-radius: 6px;
  background: color-mix(in srgb, var(--event-color) 12%, white);
  padding: 7px 8px;
  font-size: 0.76rem;
  line-height: 1.35;
}

.week-item.done {
  opacity: 0.62;
  text-decoration: line-through;
}

.weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdays {
  gap: 0;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.weekdays span {
  padding: 0 10px;
}

.calendar-grid {
  align-content: start;
  flex: 0 0 auto;
  min-height: 0;
  gap: 0;
  grid-auto-rows: 128px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 10px;
}

.day-cell {
  display: flex;
  flex-direction: column;
  min-height: 128px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-strong);
  overflow: hidden;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

/* No position/z-index change on hover: switching stacking on every cell the pointer
   crosses made fast wheel scrolling flash. */
.day-cell:hover {
  background: var(--accent-faint);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
  transform: none;
}

.day-cell.drag-over {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.detail-panel.drag-over,
.study-pool.drag-over {
  outline: 2px dashed rgba(109, 155, 137, 0.64);
  outline-offset: -5px;
  background: rgba(230, 241, 235, 0.48);
}

body.is-dragging-study .day-cell,
body.is-dragging-study .day-cell:hover,
body.is-dragging-study .command-card {
  box-shadow: none;
  transform: none;
  transition: border-color 80ms ease, background 80ms ease;
}

.day-cell.is-muted {
  background: var(--surface-muted);
  color: var(--muted);
  opacity: 0.62;
}

.day-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.day-cell.is-selected {
  background: var(--accent-faint);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 52%, transparent);
}

.day-cell.has-focus-day {
  background: color-mix(in srgb, var(--focus-color) 11%, var(--surface-strong));
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 7px 8px 3px;
}

.day-number {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  font-size: 0.82rem;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.day-cell.is-today .day-number {
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.day-load {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.day-events {
  display: grid;
  gap: 5px;
  padding: 4px 6px 8px;
}

.focus-marker {
  border: 1px solid color-mix(in srgb, var(--marker-color) 28%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--marker-color) 14%, var(--surface-strong));
  color: #26332f;
  padding: 5px 7px;
  font-size: 0.72rem;
  font-weight: 820;
  cursor: grab;
}

.day-budget {
  margin: 0 6px 4px;
  border-radius: 999px;
  background: rgba(109, 155, 137, 0.12);
  color: #55786c;
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 760;
}

.day-budget.under {
  background: rgba(217, 111, 103, 0.12);
  color: #a4534d;
}

.calendar-event {
  --event-color: var(--revision);
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 5px;
  align-items: start;
  min-height: 22px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 5px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.25;
}

.calendar-event .time {
  display: block;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 760;
}

.calendar-event[data-type="revision"] {
  background: color-mix(in srgb, var(--event-color) 13%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--event-color) 28%, transparent);
}

.calendar-event[data-type="exam"] {
  background: rgba(217, 111, 103, 0.14);
  border-color: rgba(217, 111, 103, 0.32);
}

.calendar-event .dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--study);
}

.calendar-event.done {
  color: #8a8780;
  background: rgba(235, 234, 230, 0.70);
  text-decoration: line-through;
}

.calendar-event.just-done,
.day-row.just-done {
  animation: quickStrike 520ms ease;
}



.calendar-event.is-due {
  border-color: rgba(163, 58, 44, 0.22);
}

.calendar-event[data-type="revision"] .dot,
.task-item[data-type="revision"] .check-button {
  background: var(--event-color, var(--revision));
}

.calendar-event[data-type="exam"] .dot,
.task-item[data-type="exam"] .check-button {
  background: var(--exam);
}

.calendar-event[data-type="assignment"] .dot,
.task-item[data-type="assignment"] .check-button {
  background: var(--assignment);
}

.calendar-event[data-type="matter"] .dot,
.task-item[data-type="matter"] .check-button {
  background: var(--matter);
}

.agenda-list,
.task-stack {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.agenda-list {
  max-height: 220px;
}

.task-stack {
  max-height: calc(100vh - 230px);
}

.task-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 10px;
}

.check-button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: var(--study);
  color: #fff;
}

.check-button::after {
  content: "";
}

.task-item.done {
  color: #8d8982;
  background: rgba(235, 234, 230, 0.62);
}

.task-item.done h3 {
  text-decoration: line-through;
}

.task-item.done .check-button::after {
  content: "✓";
  font-weight: 900;
}

.task-item.done .check-button {
  background: #a7a39a;
}

.task-copy {
  min-width: 0;
}

.task-copy h3 {
  font-size: 0.9rem;
  line-height: 1.3;
}

.task-copy p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.task-type {
  border-radius: 999px;
  background: rgba(22, 22, 22, 0.06);
  color: var(--muted);
  padding: 4px 7px;
  font-size: 0.72rem;
  font-weight: 750;
}

.selected-day {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 4px 0 16px;
}

.selected-day h2 {
  font-size: 1.25rem;
  font-weight: 760;
  letter-spacing: 0;
}

.roast {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.daily-note-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.daily-note-box label {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.daily-note-box textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.daily-note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.daily-note-actions span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 720;
}

.daily-note-actions button {
  min-height: 32px;
  border: 1px solid rgba(109, 155, 137, 0.28);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
}

.empty-state {
  border: 1px dashed rgba(32, 31, 29, 0.18);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 16px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.recovery-state {
  display: grid;
  gap: 10px;
}

.recovery-state p {
  margin: 0;
}

.restore-memory-button {
  min-height: 36px;
  border: 1px solid rgba(109, 155, 137, 0.32);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 820;
}

.timeline-item {
  display: grid;
  gap: 4px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  padding: 10px;
  text-align: left;
}

.timeline-item span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.timeline-item strong {
  font-size: 0.86rem;
  line-height: 1.25;
}

.timeline-item.done strong {
  color: #8a8780;
  text-decoration: line-through;
}

.insight-panel,
.selected-day,
.detail-panel > section:not(.selected-day) {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 16px 0;
}

.selected-day {
  border-bottom: 1px solid var(--line);
}

.pressure-list {
  display: grid;
  gap: 8px;
}

.pressure-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 10px;
}

.pressure-item::before {
  content: "";
  grid-row: 1 / 3;
  width: 3px;
  border-radius: 2px;
  background: var(--course-color);
}

.pressure-item {
  grid-template-columns: 3px minmax(0, 1fr) auto;
}

.pressure-item em {
  grid-column: 2 / -1;
}

.pressure-item strong {
  font-size: 0.88rem;
}

.pressure-item p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.pressure-item span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.pressure-item em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}

.study-rings {
  min-height: 0;
}

.course-rings,
.study-pool {
  display: grid;
  gap: 10px;
}

.course-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
}

.add-project-card {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
}

.add-project-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 680;
}

.ring {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 58%, transparent 59%),
    conic-gradient(var(--ring-color) var(--ring-value), var(--line) 0);
}

.ring strong {
  max-width: 44px;
  font-size: 0.72rem;
  line-height: 1;
  text-align: center;
}

.course-card h3,
.module-card h3 {
  font-size: 0.92rem;
}

.course-card p,
.module-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.progress-line {
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  margin-top: 8px;
  overflow: hidden;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ring-color);
}

.module-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  padding: 11px;
}

.course-project {
  display: grid;
  gap: 8px;
}

.course-project > .module-card {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 0 0;
}

.course-project > .module-head {
  align-items: center;
}

.course-edit,
.course-toggle,
.module-add {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 760;
}

.module-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.module-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.focus-plan-card {
  background: transparent;
}

.focus-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.focus-plan-chip {
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--marker-color) 28%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--marker-color) 14%, var(--surface-strong));
  color: #26332f;
  font-size: 0.74rem;
  font-weight: 820;
  cursor: grab;
}

.focus-plan-chip.wide {
  grid-column: 1 / -1;
  border-radius: 10px;
  text-align: center;
}

.study-check-row {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: stretch;
  max-width: 100%;
}

.study-check-row.long {
  width: 100%;
}

.study-check {
  text-align: left;
  width: 100%;
  max-width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  padding: 0 9px;
  font-size: 0.76rem;
  font-weight: 750;
}

.study-check-row .study-check {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.study-check.long {
  width: 100%;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 8px 10px;
  line-height: 1.35;
}

.study-send {
  width: 30px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 900;
}

.study-check-row.long .study-send {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.study-send:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Overlay instead of a new grid row: growing the card mid-drag pushed the calendar
   down under the pointer, which made drags cancel and the page flicker. */
body.is-dragging-study .command-card.primary::after {
  content: "也可以松手放到当前选中的日期";
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  display: block;
  border: 1px dashed rgba(109, 155, 137, 0.42);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--accent-text);
  padding: 8px;
  font-size: 0.76rem;
  font-weight: 820;
  pointer-events: none;
}

.study-check.done {
  border-color: rgba(95, 167, 121, 0.45);
  background: rgba(95, 167, 121, 0.16);
  color: #326f48;
  text-decoration: line-through;
}

.day-modal,
.app-menu {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(35, 48, 44, 0.36);
  backdrop-filter: blur(5px);
  padding: 18px;
}

.day-modal.open,
.app-menu.open {
  display: flex;
}

.day-sheet,
.menu-sheet {
  width: min(760px, 100%);
  max-height: min(820px, 92vh);
  overflow: auto;
  border: 0;
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 18px;
}

.menu-sheet {
  width: min(860px, 100%);
}

.course-editor-sheet {
  width: min(900px, 100%);
}

.day-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.day-sheet-head h2 {
  font-size: 1.7rem;
}

.day-sheet-head p:last-child {
  margin-top: 6px;
  color: var(--muted);
}

#close-day-modal,
#close-app-menu,
#close-course-editor {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  font-size: 1.1rem;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.menu-grid-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.menu-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  padding: 10px;
}

.menu-group .eyebrow {
  grid-column: 1 / -1;
}

.menu-grid button,
.editor-row button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 760;
}

.menu-output,
.editor-module {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  padding: 12px;
  margin-top: 10px;
}

.menu-output p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.print-actions,
.settings-grid,
.project-meta-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.settings-grid,
.project-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid label,
.project-meta-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.print-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.print-actions button {
  min-height: 48px;
  border: 1px solid rgba(109, 155, 137, 0.28);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 820;
}

.backup-actions button {
  min-height: 38px;
  border: 1px solid rgba(109, 155, 137, 0.28);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: 0 12px;
  font-weight: 820;
}

.cloud-sync-card {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

.cloud-sync-card h3 {
  margin: 0;
}

.cloud-sync-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.cloud-sync-card input {
  min-height: 38px;
}

.sync-advanced {
  opacity: 0.72;
}

.sync-status {
  border: 1px solid rgba(109, 155, 137, 0.2);
  border-radius: var(--radius);
  background: rgba(230, 241, 235, 0.5);
  padding: 10px;
}

.sync-help {
  color: var(--muted);
  font-size: 0.82rem;
}

.sync-help summary {
  cursor: pointer;
  font-weight: 800;
}

.sync-help pre {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  padding: 12px;
  font-size: 0.72rem;
  line-height: 1.45;
}

.import-error {
  border: 1px solid rgba(217, 111, 103, 0.28);
  border-radius: var(--radius);
  background: rgba(217, 111, 103, 0.1);
  color: var(--danger) !important;
  padding: 10px;
}

.editor-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.editor-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 88px auto auto;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  padding: 7px;
}

.editor-row span {
  min-width: 0;
  font-size: 0.84rem;
}

.editor-row input {
  height: 34px;
  border-radius: 8px;
}

.module-name-input {
  width: min(260px, 100%);
  height: 36px;
  border-radius: var(--radius);
  font-weight: 820;
}

.editor-row strong {
  color: var(--muted);
  font-size: 0.78rem;
}

.editor-add-module {
  width: 100%;
  margin-top: 10px;
}

.day-modal-list {
  display: grid;
  gap: 8px;
}

.day-row {
  display: grid;
  grid-template-columns: 30px 1fr 104px auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  padding: 10px;
}

.day-row.done {
  color: #8a8780;
  background: rgba(235, 234, 230, 0.72);
}

.day-row.done h3 {
  text-decoration: line-through;
}

.day-row h3 {
  font-size: 0.92rem;
}

.day-row p {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 3px;
}

.day-row button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 750;
}

.day-time-field {
  height: 32px;
  border-radius: 999px;
  font-size: 0.78rem;
  padding: 0 10px;
}

.day-quick-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.day-quick-form button {
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 14px;
  font-weight: 750;
}

.celebration {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  transform: translate(-50%, 16px);
  opacity: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  color: #55786c;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  font-weight: 760;
  text-align: center;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

/* Layout rules like `label { display: grid }` would otherwise override the hidden attribute. */
[hidden] {
  display: none !important;
}

/* Pointer-drag: the page draws the dragged card itself. */
.drag-source {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
}

body.is-dragging-study,
body.is-dragging-study * {
  cursor: grabbing !important;
}

.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  padding: 6px 10px;
  font-size: 0.84rem;
  outline: 2px solid var(--accent);
  outline-offset: 0;
  box-shadow: 0 8px 20px rgba(31, 43, 40, 0.16);
  pointer-events: none;
  will-change: transform;
}

.drag-origin {
  display: none !important;
}

.drag-placeholder {
  flex-shrink: 0;
  max-width: 100%;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
}

.undo-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 38;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  border-radius: 999px;
  background: #24332f;
  box-shadow: var(--shadow);
  color: #fff;
  padding: 8px 8px 8px 18px;
  font-weight: 720;
}

.undo-toast span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.undo-toast button {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #24332f;
  padding: 6px 14px;
  font-weight: 850;
}

.series-delete-choice {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 6px;
  margin-top: 6px;
}

.series-delete-choice button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 760;
}

.series-delete-choice button[data-scope="rest"] {
  border-color: rgba(217, 111, 103, 0.4);
  color: var(--danger);
}

.project-meta-grid .span-2 {
  grid-column: 1 / -1;
}

.celebration.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.context-menu {
  position: fixed;
  z-index: 35;
  display: none;
  width: 190px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 6px;
}

.context-menu.open {
  display: grid;
}

.context-menu button {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 0 10px;
  font-weight: 760;
}

.context-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(33, 46, 43, 0.34);
  pointer-events: auto;
}

.onboarding.open {
  display: block;
}

.onboarding-spotlight {
  position: fixed;
  z-index: 41;
  border: 2px solid var(--accent);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 9999px rgba(33, 46, 43, 0.26),
    0 18px 52px rgba(35, 53, 49, 0.18);
  transition: opacity 180ms ease;
  pointer-events: none;
}

.onboarding-card {
  position: fixed;
  z-index: 42;
  width: min(480px, calc(100vw - 36px));
  border: 0;
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: left 220ms ease, top 220ms ease;
}

.onboarding-card h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.onboarding-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
}

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

.onboarding-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  padding: 0 14px;
  font-weight: 820;
}

#next-onboarding {
  border-color: rgba(109, 155, 137, 0.34);
  background: var(--accent);
  color: var(--accent-ink);
}

.tour-target {
  scroll-margin: 120px;
}

@keyframes quickStrike {
  0% {
    transform: translateX(0);
    filter: saturate(1);
  }
  48% {
    transform: translateX(4px);
    filter: saturate(0.45);
  }
  100% {
    transform: translateX(0);
  }
}

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

.print-layout {
  display: none;
}

.print-page {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-content: start;
  gap: 8px;
  min-height: 100vh;
  background: #fff;
  color: #161616;
  padding: 14px 18px;
  page-break-after: always;
}

.print-page:last-child {
  page-break-after: auto;
}

.print-page > .eyebrow,
.print-page > h2,
.print-page > p,
.print-page > .print-summary {
  grid-column: 1 / -1;
}

.print-page h2 {
  color: var(--print-color);
  font-size: 1.32rem;
  margin-bottom: 4px;
}

.print-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 6px 0;
}

.print-summary div,
.print-module {
  border: 1px solid #d7d2c8;
  border-radius: 8px;
  padding: 5px;
}

.print-summary strong {
  display: block;
  font-size: 1rem;
}

.print-module {
  break-inside: avoid;
}

.print-module.wide {
  grid-column: 1 / -1;
}

.print-module h3 {
  margin-bottom: 5px;
  font-size: 0.86rem;
}

.print-checks {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.print-checks span {
  display: block;
  border: 1px solid #d7d2c8;
  border-radius: 6px;
  min-height: 24px;
  padding: 4px 6px;
  font-size: 0.68rem;
  line-height: 1.18;
}

.print-checks.compact {
  grid-template-columns: repeat(4, 1fr);
}

.print-checks.compact span {
  min-height: 24px;
}

.print-week-page {
  grid-template-columns: 1fr;
}

.print-week-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.print-week-day {
  border: 1px solid #d7d2c8;
  border-radius: 8px;
  padding: 8px;
  break-inside: avoid;
}

.print-week-day h3 {
  margin-bottom: 6px;
  color: #161616;
}

.print-week-lines {
  grid-template-columns: 1fr;
}

.print-checks span.done,
.print-month-item.done {
  color: #8a8a8a;
  text-decoration: line-through;
}

.print-checks span.blank {
  color: #b9b4aa;
}

.print-month-page {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto 1fr;
}

.print-month-weekdays,
.print-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.print-month-weekdays span {
  padding: 2px 5px;
  color: #6b6b6b;
  font-size: 0.68rem;
  font-weight: 750;
}

.print-month-grid {
  grid-template-rows: repeat(var(--print-weeks, 5), minmax(0, 1fr));
  border-top: 1px solid #d7d2c8;
  border-left: 1px solid #d7d2c8;
}

.print-month-day {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid #d7d2c8;
  border-bottom: 1px solid #d7d2c8;
  padding: 4px 5px;
}

.print-month-day.is-muted {
  background: #f5f4f1;
  color: #a3a3a3;
}

.print-month-day strong {
  font-size: 0.78rem;
}

.print-month-item {
  display: -webkit-box;
  flex-shrink: 0;
  overflow: hidden;
  border-left: 2px solid var(--print-color);
  padding-left: 4px;
  font-size: 0.6rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.print-month-item[data-type="exam"],
.print-month-item[data-type="assignment"] {
  border-left-color: #c24b40;
  font-weight: 750;
}

.print-month-item.more {
  border-left-color: transparent;
  color: #6b6b6b;
}

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

/* ---------- Page switching ---------- */

body:not([data-view="calendar"]) .view-switch,
body:not([data-view="calendar"]) .toolbar [aria-label="月份导航"] {
  display: none;
}

.main-view {
  display: grid;
  align-content: start;
  gap: 14px;
  padding-bottom: 24px;
}

.view-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.view-toolbar select {
  width: auto;
  min-width: 140px;
}

.view-toolbar .primary-action {
  width: auto;
  margin-left: auto;
  padding: 0 16px;
}

.view-hint {
  color: var(--muted);
  font-size: 0.84rem;
}

.view-search {
  position: relative;
  display: block;
  flex: 1 1 220px;
}

.view-search svg {
  position: absolute;
  top: 50%;
  left: 10px;
  color: var(--muted);
  transform: translateY(-50%);
}

.view-search input {
  padding-left: 34px;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 3px;
}

.segmented button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 0.84rem;
  font-weight: 720;
  white-space: nowrap;
}

.segmented button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.view-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  padding: 40px 20px;
  text-align: center;
}

.view-empty strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.view-empty .primary-action {
  width: auto;
  margin-top: 6px;
  padding: 0 18px;
}

/* ---------- 清单 ---------- */

.list-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.list-group h3 span {
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  padding: 1px 8px;
  font-size: 0.74rem;
}

.list-group.overdue h3 {
  color: var(--danger);
}

.list-rows {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
}

.list-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-left: 3px solid var(--event-color, transparent);
  padding: 8px 10px;
}

.list-row + .list-row {
  border-top: 1px solid var(--line);
}

.list-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 900;
}

.list-check:hover {
  border-color: var(--accent);
}

.list-row.done .list-check {
  border-color: var(--accent);
  background: var(--accent);
}

.list-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 2px 0;
  text-align: left;
}

.list-main strong {
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row.done .list-main strong {
  color: var(--muted);
  text-decoration: line-through;
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--muted);
  font-size: 0.76rem;
}

.list-meta .late,
.list-meta .chip-due {
  color: var(--danger);
  font-weight: 760;
}

.list-meta .chip-project {
  color: var(--event-color, var(--muted));
  font-weight: 760;
}

.list-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.45;
  transition: opacity 120ms ease;
}

.list-row:hover .list-actions,
.list-row:focus-within .list-actions {
  opacity: 1;
}

.list-date input {
  width: 132px;
  min-height: 30px;
  padding: 2px 6px;
  font-size: 0.8rem;
}

.list-delete {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
}

.list-delete:hover {
  background: rgba(217, 111, 103, 0.12);
  color: var(--danger);
}

/* ---------- 计划项目 ---------- */

.project-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.project-card {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--course-color);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 14px;
}

.project-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-card h3 {
  font-size: 1.05rem;
}

.project-card header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.level-badge {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 800;
}

.level-badge.calm,
.level-badge.idle { background: var(--accent-soft); color: var(--accent-text); }
.level-badge.ok { background: rgba(201, 166, 66, 0.16); color: #7a6117; }
.level-badge.warn { background: rgba(217, 130, 43, 0.16); color: #8a4e12; }
.level-badge.danger { background: rgba(194, 75, 64, 0.14); color: var(--danger); }

.project-card-body {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.progress-ring,
.mini-ring {
  width: 100%;
}

.ring-track {
  fill: none;
  stroke: var(--surface-muted);
  stroke-width: 8;
}

.ring-value {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-width: 8;
}

.progress-ring text {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
}

.project-stats dt {
  color: var(--muted);
  font-size: 0.74rem;
}

.project-stats dd {
  margin: 1px 0 0;
  font-size: 1rem;
  font-weight: 800;
}

.project-upcoming {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.project-upcoming p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
}

.project-upcoming ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.84rem;
}

.project-upcoming li span {
  display: inline-block;
  min-width: 64px;
  color: var(--muted);
  font-size: 0.78rem;
}

.project-upcoming small {
  color: var(--muted);
  font-size: 0.78rem;
}

.project-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-card footer button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 760;
}

.project-card footer button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------- 数据统计 ---------- */

.stats-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stats-nav strong {
  min-width: 120px;
  font-size: 0.95rem;
  text-align: center;
}

.stats-nav button,
.stats-today {
  min-width: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  font-weight: 800;
}

.stats-today {
  padding: 0 12px;
  font-size: 0.8rem;
}

.stats-headline {
  border-radius: 12px;
  background: var(--accent-faint);
  color: var(--accent-text);
  padding: 12px 14px;
  font-size: 0.95rem;
  font-weight: 760;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 12px 14px;
}

.stat-card p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.stat-card strong {
  display: block;
  margin: 2px 0;
  font-size: 1.6rem;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.stat-card strong small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.stat-card > div > small {
  color: var(--muted);
  font-size: 0.74rem;
}

.stat-card .mini-ring {
  flex-shrink: 0;
  width: 44px;
}

.stat-card .mini-ring .ring-track,
.stat-card .mini-ring .ring-value {
  stroke-width: 6;
}

.delta {
  font-weight: 800;
}

.delta.up { color: #3f8a5a; }
.delta.down { color: #b0613b; }

.stats-achievements {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
}

.stats-achievements div {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
}

.stats-achievements div + div {
  border-left: 1px solid var(--line);
}

.stats-achievements span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 720;
}

.stats-achievements b {
  font-size: 0.95rem;
}

.stats-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chart-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 14px;
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card header h3 {
  font-size: 0.95rem;
}

.chart-card header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
}

.grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.axis-text {
  fill: var(--muted);
  font-size: 11px;
}

.bar {
  fill: color-mix(in srgb, var(--accent) 55%, transparent);
}

.bar.current {
  fill: var(--accent);
}

.line-main {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.line-area {
  fill: color-mix(in srgb, var(--accent) 12%, transparent);
}

.line-prev {
  fill: none;
  stroke: var(--line-strong);
  stroke-dasharray: 5 5;
  stroke-width: 2;
}

.line-dot {
  fill: var(--surface-strong);
  stroke: var(--accent);
  stroke-width: 2;
}

.chart-empty {
  color: var(--muted);
  padding: 24px 0;
  font-size: 0.84rem;
  text-align: center;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.donut-track {
  fill: none;
  stroke: var(--surface-muted);
  stroke-width: 22;
}

.donut-seg {
  fill: none;
  stroke-width: 22;
}

.donut-total {
  fill: var(--ink);
  font-size: 18px;
  font-weight: 820;
}

.donut-caption {
  fill: var(--muted);
  font-size: 11px;
}

.chart-legend {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.84rem;
}

.chart-legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto 38px;
  align-items: center;
  gap: 8px;
}

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

.chart-legend span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-legend em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.hbars {
  display: grid;
  gap: 8px;
}

.hbar {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
}

.hbar div {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: var(--surface-muted);
}

.hbar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.hbar[data-type="study"] i { background: var(--study); }
.hbar[data-type="revision"] i { background: var(--revision); }
.hbar[data-type="exam"] i { background: var(--exam); }
.hbar[data-type="assignment"] i { background: var(--assignment); }
.hbar[data-type="matter"] i { background: var(--matter); }

.hbar b {
  text-align: right;
}

.done-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.done-list li {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: 10px;
  border-left: 3px solid var(--event-color);
  padding: 4px 8px;
  font-size: 0.86rem;
}

.done-time,
.done-hours {
  color: var(--muted);
}

.heat.l0, .heat-cell.l0, .heat-legend .l0 { fill: var(--surface-muted); background: var(--surface-muted); }
.heat.l1, .heat-cell.l1, .heat-legend .l1 { fill: color-mix(in srgb, var(--accent) 25%, var(--surface-muted)); background: color-mix(in srgb, var(--accent) 25%, var(--surface-muted)); }
.heat.l2, .heat-cell.l2, .heat-legend .l2 { fill: color-mix(in srgb, var(--accent) 50%, var(--surface-muted)); background: color-mix(in srgb, var(--accent) 50%, var(--surface-muted)); }
.heat.l3, .heat-cell.l3, .heat-legend .l3 { fill: color-mix(in srgb, var(--accent) 75%, var(--surface-muted)); background: color-mix(in srgb, var(--accent) 75%, var(--surface-muted)); }
.heat.l4, .heat-cell.l4, .heat-legend .l4 { fill: var(--accent); background: var(--accent); }

.heat-scroll {
  overflow-x: auto;
}

.heat-year {
  width: 100%;
}

.heat-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.heat-head {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.heat-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1.6;
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 720;
}

.heat-cell.l3,
.heat-cell.l4 {
  color: var(--accent-ink);
}

.heat-cell.outside {
  background: transparent;
}

.heat-cell.today {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.heat-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.heat-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* ---------- Mobile bottom tab bar ---------- */

.mobile-tabbar {
  display: none;
}

@media (max-width: 760px) {
  .sidebar .app-nav {
    display: none;
  }

  .mobile-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: repeat(2, 1fr) 56px repeat(2, 1fr);
    align-items: center;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    backdrop-filter: blur(14px);
  }

  .mobile-tabbar a {
    display: grid;
    justify-items: center;
    gap: 2px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 720;
    text-decoration: none;
  }

  .mobile-tabbar a:nth-of-type(3),
  .mobile-tabbar a:nth-of-type(4) {
    order: 2;
  }

  .mobile-tabbar .tab-add {
    order: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
  }

  .mobile-tabbar .tab-add svg {
    width: 22px;
    height: 22px;
  }

  .mobile-tabbar a.active {
    color: var(--accent-text);
  }

  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .undo-toast,
  .celebration {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .stats-cards,
  .stats-achievements {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-achievements div:nth-child(3) {
    border-left: 0;
  }

  .stats-achievements div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .stats-charts {
    grid-template-columns: minmax(0, 1fr);
  }

  .donut-wrap {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .list-actions {
    opacity: 1;
  }

  .list-date input {
    width: 112px;
  }

  .view-toolbar .primary-action {
    width: 100%;
    margin-left: 0;
  }

  .menu-grid-tools {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1100px) and (min-width: 761px) {
  .stats-cards,
  .stats-achievements {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-achievements div:nth-child(3) {
    border-left: 0;
  }

  .stats-achievements div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 214px minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    height: auto;
    overflow: visible;
  }

  .task-stack {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  .sidebar,
  .calendar-panel,
  .detail-panel {
    width: 100%;
    height: auto;
    margin: 0;
    border-width: 0 0 1px;
    border-radius: 0;
    overflow: visible;
  }

  .sidebar {
    order: 2;
  }

  .calendar-panel {
    order: 1;
  }

  .detail-panel {
    order: 3;
  }

  .sidebar .metrics,
  .sidebar .agenda,
  .sidebar .study-rings {
    display: none;
  }

  .sidebar .composer {
    padding-bottom: 0;
  }

  .sidebar,
  .detail-panel {
    padding: 16px;
  }

  .calendar-panel {
    padding: 16px 12px;
  }

  .calendar-grid {
    min-width: 0;
    grid-auto-rows: 74px;
  }

  .month-section {
    padding-bottom: 6px;
  }

  .weekdays {
    min-width: 0;
    font-size: 0.7rem;
  }

  .weekdays span {
    padding: 0;
    text-align: center;
  }

  .day-cell {
    min-height: 74px;
  }

  .day-head {
    min-height: 28px;
    padding: 5px 5px 2px;
  }

  .day-load {
    display: none;
  }

  .day-events {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 3px;
    padding: 3px 6px 5px;
  }

  .calendar-event {
    display: block;
    width: 7px;
    min-height: 7px;
    height: 7px;
    border: 0;
    border-radius: 50%;
    background: var(--study);
    padding: 0;
  }

  .calendar-event[data-type="revision"] {
    background: var(--event-color, var(--revision));
  }

  .calendar-event[data-type="exam"] {
    background: var(--exam);
  }

  .calendar-event[data-type="assignment"] {
    background: var(--assignment);
  }

  .calendar-event[data-type="matter"] {
    background: var(--matter);
  }

  .calendar-event > * {
    display: none;
  }

  .focus-marker {
    width: 20px;
    height: 6px;
    border: 0;
    border-radius: 3px;
    background: var(--marker-color);
    padding: 0;
    color: transparent;
    font-size: 0;
  }

  .day-budget {
    display: none;
  }

  .topbar h2 {
    font-size: 1.38rem;
    white-space: nowrap;
  }

  .topbar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    margin: -16px -12px 14px;
    padding: 14px 12px 12px;
  }

  .toolbar {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin-top: 8px;
  }

  .toolbar > .tool-group:first-child {
    display: none;
  }

  .toolbar > .tool-group:last-child {
    margin-left: auto;
  }

  .tool-group {
    gap: 1px;
    padding: 2px;
  }

  .toolbar button,
  .toolbar .icon-button {
    min-width: 30px;
    width: 30px;
    height: 30px;
  }

  .view-switch button {
    width: auto;
    min-width: 34px;
    padding: 0 7px;
  }

  .command-card {
    min-height: 108px;
  }

  .command-card.primary {
    display: block;
  }

  .command-card.primary > .focus-day-items {
    margin-top: 12px;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 10px;
    padding-left: 0;
  }

  .day-quick-form,
  .day-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 9mm;
  }

  body {
    background: #fff;
  }

  .app-shell,
  .app-menu,
  .day-modal,
  .celebration,
  .undo-toast,
  .mobile-tabbar,
  .drag-ghost,
  .context-menu,
  .onboarding {
    display: none !important;
  }

  .print-layout {
    display: block;
  }

  .print-page {
    min-height: auto;
    height: 279mm;
    overflow: hidden;
  }
}

/* =====================================================================
   Redesign (2026-09-26): two-column shell, 今天 page, day drawer,
   任务池 tray, welcome wizard. Placed last so it overrides older rules.
   ===================================================================== */

.app-shell {
  grid-template-columns: 232px minmax(0, 1fr) 300px;
}

body:not([data-view="calendar"]) .app-shell,
body.right-collapsed .app-shell {
  grid-template-columns: 232px minmax(0, 1fr) 0;
}

body.left-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr) 300px;
}

body.left-collapsed:not([data-view="calendar"]) .app-shell,
body.left-collapsed.right-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}

body:not([data-view="calendar"]) .detail-panel {
  display: none;
}

body:not([data-view="calendar"]) .calendar-only,
.mobile-only {
  display: none !important;
}

#expand-left {
  display: none;
}

body.left-collapsed #expand-left {
  display: inline-grid;
}

/* ---------- Sidebar ---------- */

.sidebar {
  gap: 14px;
  padding: 14px 12px;
}

.new-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 12px;
  font-size: 0.95rem;
  font-weight: 780;
}

.new-button:hover {
  background: var(--accent-text);
}

.new-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.new-button kbd {
  margin-left: auto;
  border: 1px solid color-mix(in srgb, var(--accent-ink) 35%, transparent);
  border-radius: 5px;
  padding: 0 5px;
  font-family: inherit;
  font-size: 0.72rem;
  opacity: 0.8;
}

.app-nav {
  margin-top: 0;
}

.nav-count {
  margin-left: auto;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 7px;
  font-size: 0.72rem;
  line-height: 18px;
}

.nav-count:empty {
  display: none;
}

.sidebar-projects {
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 4px;
}

.sidebar-section-head h2 {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.sidebar-section-head button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.sidebar-section-head button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.sidebar-section-head svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.sidebar-project {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  border-radius: var(--radius);
  color: var(--ink);
  padding: 0 10px;
  font-size: 0.86rem;
  text-decoration: none;
}

.sidebar-project:hover {
  background: var(--surface-muted);
}

.sidebar-project i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--course-color);
}

.sidebar-project span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-project small {
  color: var(--muted);
  font-size: 0.74rem;
}

.sidebar-empty {
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.78rem;
  line-height: 1.5;
}

.sidebar-footer {
  display: grid;
  gap: 2px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.sidebar-footer button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.84rem;
  font-weight: 680;
  text-align: left;
}

.sidebar-footer button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.sidebar-footer svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* ---------- Top bar ---------- */

.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-title .icon-button {
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--muted);
}

.topbar-title svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.toolbar {
  align-items: center;
}

.toolbar .tool-button {
  display: inline-flex;
  gap: 6px;
  width: auto;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  padding: 0 12px;
}

.toolbar .tool-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.toolbar .tool-button b {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: 0 6px;
  font-size: 0.72rem;
  line-height: 18px;
}

.toolbar .tool-button b:empty {
  display: none;
}

#toggle-tray[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* ---------- Calendar cells ---------- */

.calendar-more,
.calendar-done-count {
  overflow: hidden;
  color: var(--muted);
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.calendar-done-count {
  color: color-mix(in srgb, var(--accent-text) 80%, var(--muted));
}

.day-load {
  display: inline;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
}

.week-day.is-today {
  border-color: var(--accent);
}

.week-empty {
  color: var(--line-strong);
}

/* ---------- 任务池 tray ---------- */

.detail-panel {
  gap: 12px;
}

.tray-head {
  align-items: flex-start;
}

.tray-head h2 {
  font-size: 1.05rem;
}

.tray-hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.tray-head .icon-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
}

.study-pool {
  display: grid;
  gap: 12px;
}

.tray-project {
  display: grid;
  gap: 8px;
}

.tray-toggle {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.tray-toggle i {
  grid-row: 1 / 3;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--course-color);
}

.tray-toggle strong {
  font-size: 0.92rem;
}

.tray-toggle span {
  color: var(--muted);
  font-size: 0.74rem;
}

.tray-toggle[aria-expanded="false"] strong::after {
  content: " ›";
  color: var(--muted);
}

.tray-project .focus-plan-chip {
  justify-self: start;
  border: 1px dashed var(--marker-color);
  border-radius: 999px;
  background: color-mix(in srgb, var(--marker-color) 10%, transparent);
  color: var(--ink);
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 760;
}

.tray-items {
  display: grid;
  gap: 6px;
}

.tray-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
}

.tray-item .study-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--course-color);
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface-strong);
  padding: 6px 10px;
  font-size: 0.84rem;
  line-height: 1.35;
}

.tray-item .study-check small {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.tray-item .study-send {
  width: 32px;
  min-height: 36px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.tray-empty,
.tray-done {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.tray-empty {
  display: grid;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 14px;
}

/* ---------- Day drawer (click a day) ---------- */

.day-modal {
  justify-content: flex-end;
  align-items: stretch;
  background: rgba(35, 48, 44, 0.18);
  backdrop-filter: none;
  padding: 0;
}

.day-modal .day-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(440px, 100vw);
  max-height: none;
  height: 100dvh;
  border-radius: 16px 0 0 16px;
  padding: 20px;
  animation: drawer-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.day-modal .day-sheet-head {
  margin-bottom: 0;
}

.day-modal .day-sheet-head h2 {
  font-size: 1.4rem;
}

#day-safe-line:empty {
  display: none;
}

.day-modal .day-quick-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0;
}

.day-modal .day-modal-list {
  flex: 1;
  align-content: start;
  overflow-y: auto;
}

.day-modal .day-row {
  grid-template-columns: 28px minmax(0, 1fr) 96px auto;
  background: var(--surface-strong);
}

.day-modal .daily-note-box {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ---------- Pages: 今天 ---------- */

.today-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 1fr);
  align-items: start;
  gap: 18px;
}

.today-main,
.today-side {
  display: grid;
  gap: 16px;
}

.today-summary {
  color: var(--muted);
  font-size: 0.95rem;
}

.quick-bar {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 6px 6px 6px 12px;
}

.quick-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.quick-bar svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 2;
}

.quick-bar input {
  min-height: 34px;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  outline: none;
}

.quick-bar button {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 14px;
  font-weight: 780;
}

.parse-preview {
  grid-column: 1 / -1;
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.parse-preview:empty {
  display: none;
}

.quick-bar .parse-preview {
  padding: 0 0 2px 30px;
}

.today-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.today-tile {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 12px 14px;
}

.today-tile p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.today-tile strong {
  display: block;
  margin: 2px 0;
  font-size: 1.5rem;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.today-tile strong small {
  color: var(--muted);
  font-size: 0.85rem;
}

.today-tile > small {
  color: var(--muted);
  font-size: 0.74rem;
}

.today-section h3 {
  justify-content: flex-start;
}

.section-action {
  margin-left: auto;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 760;
}

.section-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.section-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent-text);
  font-size: 0.82rem;
  font-weight: 760;
  text-decoration: none;
}

.pending-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.pending-chip {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  padding: 8px 10px;
  text-align: left;
}

.pending-chip:hover {
  border-color: var(--course-color);
}

.pending-chip i {
  grid-row: 1 / 3;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--course-color);
}

.pending-chip span {
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-chip small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.74rem;
}

.pending-chip b {
  grid-column: 3;
  grid-row: 1 / 3;
  color: var(--accent-text);
  font-size: 0.76rem;
}

.today-tomorrow ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.today-tomorrow li {
  border-left: 3px solid var(--event-color);
  padding: 3px 10px;
  font-size: 0.86rem;
}

.today-tomorrow li b {
  margin-right: 8px;
  color: var(--muted);
  font-weight: 700;
}

.today-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 14px;
}

.today-card h3 {
  font-size: 0.95rem;
}

.today-card .primary-action {
  width: auto;
  justify-self: start;
  padding: 0 14px;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 4px 8px;
  color: var(--ink);
  text-decoration: none;
}

.progress-row > div:first-child {
  display: grid;
  grid-column: 1 / -1;
}

.progress-row strong {
  font-size: 0.88rem;
}

.progress-row span {
  color: var(--muted);
  font-size: 0.74rem;
}

.progress-bar {
  overflow: hidden;
  height: 6px;
  align-self: center;
  border-radius: 999px;
  background: var(--surface-muted);
}

.progress-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--course-color);
}

.progress-row small {
  color: var(--muted);
  font-size: 0.74rem;
  text-align: right;
}

.today-card textarea {
  resize: vertical;
}

.note-status {
  color: var(--muted);
  font-size: 0.74rem;
}

/* ---------- Welcome wizard ---------- */

.welcome {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: none;
  place-items: center;
  background: rgba(33, 46, 43, 0.4);
  padding: 18px;
}

.welcome.open {
  display: grid;
}

.welcome-card {
  width: min(560px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 26px;
}

.welcome-step {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.welcome-card h2 {
  margin: 6px 0 8px;
  font-size: 1.5rem;
}

.welcome-copy {
  color: var(--muted);
  line-height: 1.6;
}

.welcome-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.welcome-options button {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px;
  text-align: left;
}

.welcome-options button:hover,
.welcome-options button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-faint);
}

.welcome-options strong {
  font-size: 1rem;
}

.welcome-options span {
  color: var(--muted);
  font-size: 0.8rem;
}

.welcome-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.welcome-preview {
  border-radius: 12px;
  background: var(--surface-muted);
  padding: 12px 14px;
}

.welcome-preview p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.welcome-preview ul {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.welcome-preview li {
  display: grid;
  gap: 2px;
  font-size: 0.84rem;
}

.welcome-preview li span {
  color: var(--muted);
  padding-left: 10px;
}

.welcome-tips {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.welcome-tips li {
  display: grid;
  gap: 2px;
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.welcome-tips b {
  color: var(--ink);
}

.welcome-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.welcome-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 16px;
  font-weight: 760;
}

.welcome-actions .primary-action {
  width: auto;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
}

.welcome-skip {
  border: 0 !important;
  background: transparent !important;
  color: var(--muted);
}

/* ---------- Tablet ---------- */

@media (max-width: 1100px) and (min-width: 761px) {
  .app-shell {
    grid-template-columns: 208px minmax(0, 1fr) 0;
  }

  .detail-panel {
    display: none;
  }

  .today-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Phone ---------- */

@media (max-width: 760px) {
  .sidebar {
    display: none;
  }

  .mobile-only {
    display: inline-grid !important;
  }

  body:not([data-view="calendar"]) .detail-panel,
  body.right-collapsed .detail-panel {
    display: none;
  }

  .detail-panel {
    order: 2;
    border-top: 1px solid var(--line);
  }

  .topbar {
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  body[data-view="calendar"] .topbar {
    flex-wrap: wrap;
  }

  .topbar {
    display: flex;
    justify-content: space-between;
  }

  body:not([data-view="calendar"]) .toolbar {
    width: auto;
    margin-top: 0;
  }

  body[data-view="calendar"] .toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .toolbar > .tool-group:first-child {
    display: inline-flex;
  }

  .topbar-title {
    flex: 1;
  }

  .list-row {
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: start;
  }

  .list-row .list-check {
    margin-top: 2px;
  }

  .list-row .list-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .toolbar .tool-button span {
    display: none;
  }

  #print-calendar {
    display: none !important;
  }

  .today-layout,
  .today-tiles {
    grid-template-columns: minmax(0, 1fr);
  }

  .today-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .today-tile {
    padding: 10px;
  }

  .today-tile strong {
    font-size: 1.2rem;
  }

  .today-tile > small {
    display: none;
  }

  .welcome-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .day-modal .day-sheet {
    width: 100vw;
    border-radius: 0;
  }

  .mobile-tabbar {
    grid-template-columns: repeat(2, 1fr) 56px repeat(2, 1fr);
  }
}

@media print {
  .sidebar-footer,
  .welcome {
    display: none !important;
  }
}

/* ---------- Calendar is the home; other pages are tools (2026-09-26) ---------- */

.app-nav .nav-home {
  min-height: 40px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 780;
}

.nav-group-title {
  margin: 12px 10px 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
}

.app-nav a:not(.nav-home) {
  min-height: 32px;
  font-size: 0.86rem;
}

.back-to-calendar {
  display: none;
  align-items: center;
  gap: 2px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  padding: 0 10px 0 6px;
  font-size: 0.84rem;
  font-weight: 760;
  text-decoration: none;
}

.back-to-calendar svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

body:not([data-view="calendar"]) .back-to-calendar {
  display: inline-flex;
}

/* ---------- Focus day: a flag on the day, not a task ---------- */

.day-cell.has-focus-day,
.week-day.has-focus-day {
  background: color-mix(in srgb, var(--focus-color) 7%, var(--surface-strong));
  box-shadow: inset 0 3px 0 var(--focus-color);
}

.day-cell.has-focus-day.is-today {
  box-shadow: inset 0 3px 0 var(--focus-color), inset 0 0 0 2px var(--accent);
}

.day-head {
  gap: 6px;
}

.focus-flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
  margin-right: auto;
  color: color-mix(in srgb, var(--marker-color) 70%, var(--ink));
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.focus-flag span {
  color: var(--marker-color);
  font-size: 0.8rem;
}

.day-cell > .focus-flag {
  display: flex;
  flex-shrink: 0;
  min-height: 16px;
  margin: -2px 0 2px;
  padding: 0 8px;
}

.day-cell > .day-head {
  flex-shrink: 0;
}

.week-day .focus-flag {
  margin: 0 0 6px;
  font-size: 0.74rem;
}

.tray-project .tray-flag {
  justify-self: start;
  border: 1px dashed color-mix(in srgb, var(--marker-color) 55%, transparent);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.76rem;
}

@media (max-width: 760px) {
  .day-cell > .focus-flag {
    padding: 0 4px;
    font-size: 0;
  }

  .day-cell > .focus-flag span {
    font-size: 0.75rem;
  }

  .mobile-tabbar a:nth-of-type(2) {
    order: 0;
  }
}

/* ---------- Export menu ---------- */

.export-menu {
  position: fixed;
  z-index: 40;
  display: grid;
  gap: 2px;
  width: 280px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 8px;
}

.export-title {
  padding: 4px 8px 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
}

.export-menu button {
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  padding: 8px;
  text-align: left;
}

.export-menu button:hover,
.export-menu button:focus-visible {
  background: var(--surface-muted);
}

.export-menu strong {
  font-size: 0.9rem;
}

.export-menu span {
  color: var(--muted);
  font-size: 0.76rem;
}

/* ---------- Task pool: add form + loose items ---------- */

.pool-add {
  display: grid;
  gap: 6px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 8px;
}

.pool-add input {
  min-height: 34px;
}

.pool-add-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.pool-add .pool-add-more {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 700;
}

.pool-add select {
  min-height: 32px;
  padding: 2px 6px;
  font-size: 0.78rem;
}

.pool-add button {
  min-height: 32px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 12px;
  font-weight: 780;
}

.tray-loose {
  --course-color: var(--line-strong);
}

.tray-loose .tray-toggle {
  cursor: default;
}

/* ---------- Time field (quick add) ---------- */

.time-field {
  display: grid;
  gap: 8px;
}

.field-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.time-field .segmented {
  justify-self: start;
}

.time-range {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.time-range label {
  display: grid;
  gap: 4px;
}

.time-range input {
  width: 120px;
}

.time-range > span {
  padding-bottom: 10px;
  color: var(--muted);
}

.duration-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.duration-chips button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  padding: 0 10px;
  font-size: 0.78rem;
}

.duration-chips button:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.check-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  align-self: end;
  min-height: 40px;
  color: var(--ink) !important;
  font-weight: 680 !important;
}

.check-label input {
  width: auto;
  min-height: 0;
}

.project-meta-grid input:disabled,
.project-meta-grid select:disabled {
  opacity: 0.45;
}

/* ---------- Tags drive colors (replaces fixed type colors) ---------- */

.calendar-event,
.calendar-event[data-type] {
  background: color-mix(in srgb, var(--event-color) 12%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--event-color) 26%, transparent);
}

.calendar-event .dot,
.calendar-event[data-type] .dot {
  background: var(--event-color);
}

.calendar-event.is-deadline {
  border-color: color-mix(in srgb, var(--exam) 55%, transparent);
  font-weight: 760;
}

.calendar-event.done,
.calendar-event.done[data-type] {
  background: rgba(235, 234, 230, 0.7);
  border-color: transparent;
}

.calendar-event.done .dot {
  background: #a7a39a;
}

@media (max-width: 760px) {
  .calendar-event,
  .calendar-event[data-type] {
    background: var(--event-color);
  }
}

/* Which projects a day's tasks belong to: a light strip on top of the cell. */
.project-strip {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
  height: 4px;
  margin: 0 0 -4px;
  opacity: 0.55;
}

.project-strip i {
  display: block;
  min-width: 6px;
  height: 100%;
}

.project-strip i:first-child {
  border-top-left-radius: 2px;
}

.week-day .project-strip {
  margin: -8px -8px 6px;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.today-section.deadline h3 {
  color: var(--danger);
}

/* ---------- Tag chips ---------- */

.tag-field {
  display: grid;
  gap: 8px;
}

.tag-chips,
.tag-manage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink) !important;
  padding: 0 12px;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  cursor: pointer;
}

.tag-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tag-chip i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--tag-color);
}

.tag-chip small {
  color: var(--danger);
  font-size: 0.68rem;
}

.tag-chip:has(input:checked) {
  border-color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 16%, var(--surface-strong));
}

.tag-chip:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.tag-chip.static {
  cursor: default;
}

.tag-chip.static button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 0 0 2px;
  font-size: 1rem;
}

.tag-new {
  min-height: 32px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.tag-new-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tag-new-form input[type="text"] {
  width: 180px;
}

.tag-new-form .check-label {
  min-height: 32px;
}

.tag-new-save {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 12px;
  font-weight: 760;
}

.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chip-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--tag-color);
}

.settings-subtitle {
  margin-top: 18px;
}

/* ---------- Duration (hours + minutes) ---------- */

.duration-field {
  display: grid;
  gap: 8px;
}

.field-title small {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 600;
}

.duration-inputs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.duration-inputs label {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  color: var(--ink) !important;
}

.duration-inputs input {
  width: 70px;
}

.duration-inputs select {
  width: 70px;
}

.duration-clear {
  border-style: dashed !important;
  color: var(--muted);
}

/* ---------- Duration stepper ---------- */

.duration-stepper {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-strong);
}

.duration-stepper button {
  width: 36px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font-size: 1.15rem;
  font-weight: 700;
}

.duration-stepper button:hover {
  background: var(--accent-soft);
}

.duration-stepper output {
  min-width: 96px;
  font-size: 0.88rem;
  font-weight: 760;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.duration-stepper.empty output {
  color: var(--muted);
  font-weight: 600;
}

.duration-stepper.compact button {
  width: 26px;
  height: 28px;
  font-size: 1rem;
}

.duration-stepper.compact output {
  min-width: 70px;
  font-size: 0.78rem;
}

/* ---------- Project editor: one save ---------- */

.editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 8px;
}

.editor-row-remove,
.module-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.editor-row-remove {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  font-size: 1.1rem;
}

.editor-row-remove:hover,
.module-remove:hover {
  background: rgba(217, 111, 103, 0.12);
  color: var(--danger);
}

.module-remove {
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 0.78rem;
}

.editor-add-item,
.editor-add-module {
  justify-self: start;
  margin-top: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent-text);
  padding: 6px 12px;
  font-weight: 760;
}

.editor-add-module {
  width: 100%;
}

.editor-footer {
  position: sticky;
  bottom: -18px;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  margin: 14px -18px -18px;
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 12px 18px;
}

.editor-footer button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 0 16px;
  font-weight: 760;
}

.editor-footer .project-delete {
  border-color: transparent;
  color: var(--danger);
}

.editor-footer .editor-save {
  width: auto;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
}

.editor-footer .editor-save.has-changes::after {
  content: " ·";
}

/* ---------- Tag management ---------- */

.tag-deadline-toggle {
  border: 1px solid var(--line) !important;
  border-radius: 999px;
  color: var(--muted) !important;
  padding: 0 6px !important;
  font-size: 0.68rem !important;
}

.tag-deadline-toggle.on {
  border-color: color-mix(in srgb, var(--exam) 50%, transparent) !important;
  color: var(--danger) !important;
}

.settings-tag-new {
  margin-top: 10px;
}

.menu-link {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.menu-grid-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ---------- Export page ---------- */

.export-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.export-options {
  display: grid;
  gap: 18px;
}

.export-step h3,
.export-preview h3 {
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.export-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.export-choices button,
.export-formats button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  padding: 9px 6px;
  font-weight: 760;
}

.export-formats {
  display: grid;
  gap: 6px;
}

.export-formats button {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  text-align: left;
}

.export-formats span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.export-choices button[aria-pressed="true"],
.export-formats button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.export-range {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.export-preview {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
  padding: 14px;
}

.export-preview header p {
  color: var(--muted);
  font-size: 0.84rem;
}

.export-image {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.export-table {
  overflow: auto;
  max-height: 52vh;
  border-radius: 10px;
  background: var(--surface-strong);
}

.export-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.export-table th,
.export-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

.export-table th {
  position: sticky;
  top: 0;
  background: var(--surface-muted);
}

.export-table p,
.export-ics p {
  padding: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.export-ics {
  border-radius: 10px;
  background: var(--surface-strong);
}

.export-ics ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0 8px 8px;
  list-style: none;
  font-size: 0.84rem;
}

.export-ics li b,
.export-ics li span {
  margin-right: 10px;
  color: var(--muted);
}

.export-download {
  display: flex;
  justify-self: start;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 0 18px;
}

.export-download small {
  opacity: 0.8;
  font-weight: 600;
}

@media (max-width: 900px) {
  .export-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Day drawer rows: title on top, time / duration / delete underneath. */
.day-modal .day-row {
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  grid-template-areas:
    "check title title title"
    "check when dur del";
  row-gap: 8px;
}

.day-modal .day-row > .day-done { grid-area: check; align-self: start; }
.day-modal .day-row > div { grid-area: title; }
.day-modal .day-row > .day-time-field { grid-area: when; width: 130px; min-height: 30px; font-size: 0.8rem; }
.day-modal .day-row > .duration-stepper { grid-area: dur; }
.day-modal .day-row > .day-delete {
  grid-area: del;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
}

.day-modal .day-row > .day-delete:hover {
  color: var(--danger);
}

/* ---------- Duration wheel (double-click the stepper) ---------- */

.duration-stepper output {
  cursor: pointer;
  user-select: none;
}

.duration-wheel {
  position: fixed;
  z-index: 70;
  width: 240px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 10px;
}

.wheel-body {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 4px;
}

.wheel-highlight {
  position: absolute;
  top: 72px;
  right: 0;
  left: 0;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  pointer-events: none;
}

.wheel-column {
  position: relative;
  height: 180px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  outline: none;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}

.wheel-column::-webkit-scrollbar {
  display: none;
}

.wheel-pad {
  height: 72px;
}

.wheel-item {
  display: grid;
  place-items: center;
  height: 36px;
  scroll-snap-align: center;
  color: var(--muted);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.wheel-item.picked {
  color: var(--ink);
  font-weight: 800;
}

.wheel-unit {
  position: relative;
  color: var(--accent-text);
  font-size: 0.82rem;
  font-weight: 760;
}

.wheel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.wheel-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 0 14px;
  font-weight: 760;
}

.wheel-actions .wheel-done {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------- 安全线 panel on top of the calendar ---------- */

.pace-panel {
  flex-shrink: 0;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
}

body:not([data-view="calendar"]) .pace-panel {
  display: none;
}

.pace-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: left;
}

.pace-summary b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pace-day {
  color: var(--ink);
  font-weight: 800;
}

.pace-bar {
  display: inline-block;
  overflow: hidden;
  width: 90px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-muted);
}

.pace-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--course-color, var(--accent));
}

.pace-summary .pace-short {
  color: #a35f1d;
}

.pace-summary .pace-ok {
  color: var(--accent-text);
}

.pace-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
}

.pace-projects {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding: 10px 14px 12px;
}

.pace-project {
  display: grid;
  grid-template-columns: 8px minmax(80px, 1fr) auto auto 90px;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.pace-project > i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--course-color);
}

.pace-project strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .pace-project {
    grid-template-columns: 8px minmax(0, 1fr) auto;
  }

  .pace-project > span:nth-of-type(2),
  .pace-project .pace-bar {
    display: none;
  }
}

/* ---------- Export page additions ---------- */

.export-choices {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.export-range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  align-items: end;
}

.export-pages {
  display: grid;
  gap: 12px;
  max-height: 64vh;
  overflow-y: auto;
  padding-right: 4px;
}

.export-pages .export-image {
  max-height: none;
}

/* ---------- 时间闭环: safety line sentence, capacity, buffer, health, actual time ---------- */

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent-text);
  padding: 0 2px;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.pace-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 4px;
}

.pace-headline {
  flex: 1;
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

.pace-headline b {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.pace-label {
  margin-right: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.pace-toggle {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
}

.pace-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding: 0 14px 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.pace-meta b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pace-capacity,
.day-capacity {
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 1px 9px;
  font: inherit;
  cursor: pointer;
}

.pace-capacity:hover,
.day-capacity:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.pace-status.warn { color: #9a5314; font-weight: 700; }
.pace-status.info { color: var(--muted); }
.pace-status.ok { color: var(--accent-text); font-weight: 700; }

.pace-panel.collapsed .pace-head {
  padding-bottom: 2px;
}

.pace-project {
  grid-template-columns: 8px minmax(70px, 140px) auto minmax(0, 1fr) auto 80px;
}

.pace-project-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pace-project-need {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.health-badge {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.health-badge.safe,
.health-badge.done { background: #e5f3ea; color: #2f6b45; }
.health-badge.tight { background: #fbf0d6; color: #7a5a0f; }
.health-badge.danger { background: #f9e1de; color: var(--danger); }

.project-health-text {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.plan-finish-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.buffer-field {
  display: flex;
  gap: 6px;
}

.buffer-field select {
  flex: 1;
  min-width: 0;
}

.buffer-field input {
  width: 64px;
}

.editor-row {
  grid-template-columns: minmax(0, 1fr) auto auto 30px;
}

.kind-chip {
  max-width: 180px;
  overflow: hidden;
  border: 1px dashed transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 2px 8px;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.55;
}

.kind-chip.on {
  border-color: var(--line-strong);
  opacity: 1;
}

.kind-chip:hover,
.kind-chip:focus-visible {
  border-color: var(--accent);
  opacity: 1;
}

.kind-input {
  width: 160px;
  font-size: 0.78rem;
}

.kind-intro,
.kind-empty {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.kind-group {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.kind-title {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0 0 6px;
  font-size: 0.86rem;
}

.kind-title span {
  color: var(--muted);
  font-size: 0.8rem;
}

.kind-group ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kind-group li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.kind-group li span:nth-child(2) {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kind-group li.excluded span {
  text-decoration: line-through;
  opacity: 0.6;
}

.actual-suggest {
  margin-top: 8px;
  border-radius: var(--radius);
  background: var(--accent-faint);
  padding: 8px 10px;
}

.actual-suggest p {
  margin: 0 0 6px;
}

.actual-suggest div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.actual-card {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: min(380px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  color: var(--ink);
  font-size: 0.86rem;
}

.actual-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.actual-card header strong {
  overflow-wrap: anywhere;
}

.actual-close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

.actual-card p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.actual-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.actual-choices button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  padding: 5px 11px;
  font-variant-numeric: tabular-nums;
}

.actual-choices button:first-child {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 800;
}

.actual-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.actual-skip {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.actual-note {
  color: var(--muted);
  font-size: 0.8rem;
}

.capacity-week {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}

.capacity-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.settings-check {
  margin-bottom: 12px;
}

@media (max-width: 760px) {
  .pace-project {
    grid-template-columns: 8px minmax(0, 1fr) auto;
  }

  .pace-project-text,
  .pace-project-need {
    display: none;
  }

  .actual-card {
    right: 16px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .editor-row {
    grid-template-columns: minmax(0, 1fr) auto 30px;
  }

  .editor-row .kind-chip {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.editor-row .kind-chip {
  min-height: 0;
  border: 1px dashed transparent;
  background: transparent;
  box-shadow: none;
  padding: 2px 8px;
  font-weight: 600;
}

.editor-row .kind-chip.on {
  border-color: var(--line-strong);
}

.capacity-day > span {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- Day drawer v2: compact rows, click to edit in place ---------- */

.day-modal .day-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-areas: "check main" ". editor";
  gap: 4px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  padding: 8px 10px;
}

.day-modal .day-row.expanded {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-faint);
}

.day-modal .day-row > .day-done {
  grid-area: check;
  align-self: center;
}

.day-modal .day-row .day-row-main {
  grid-area: main;
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 2px 4px;
  color: var(--ink);
  text-align: left;
  font-weight: 400;
}

.day-modal .day-row .day-row-main:hover {
  background: var(--surface-muted);
}

.day-row-title {
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-row.done .day-row-title {
  color: var(--muted);
  text-decoration: line-through;
}

.day-row-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.day-row-meta > i {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--event-color, var(--line-strong));
}

.day-editor {
  grid-area: editor;
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding: 12px 4px 4px;
}

.day-editor label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.day-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.day-editor-project {
  display: grid;
  gap: 5px;
  margin: 0;
  font-size: 0.86rem;
}

.day-editor-project span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.day-editor-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.day-editor-actions span {
  flex: 1;
}

.day-modal .day-editor-actions button {
  min-height: 32px;
}

.day-modal .day-editor-actions .day-delete {
  border-color: transparent;
  background: transparent;
}

.day-modal .day-editor-actions .day-delete:hover {
  color: var(--danger);
}

.day-modal .day-editor-actions .primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.day-carry {
  justify-self: start;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 5px 12px;
  font-size: 0.8rem;
}

.day-carry:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

/* 时间: 要花多久 / 几点到几点 (either one) */

.time-plan {
  display: grid;
  gap: 8px;
}

.time-plan .segmented {
  justify-self: start;
}

.time-plan-length,
.time-plan-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.time-plan [hidden] {
  display: none;
}

.time-button {
  min-width: 76px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.time-button:hover {
  border-color: var(--accent);
}

.time-plan-total {
  color: var(--muted);
  font-size: 0.82rem;
}

.day-modal .day-row > .day-editor {
  grid-area: editor;
}

.day-modal .day-row > .day-row-main {
  grid-area: main;
}

.day-modal .daily-note-box textarea {
  min-height: 52px;
  height: 52px;
  resize: vertical;
}

/* ---------- 今日概览 v2: today's list first ---------- */

.today-block {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  padding: 16px;
}

.today-block header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.today-block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1rem;
}

.today-block h3 span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.today-all-done {
  color: var(--accent-text);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 700;
}

.today-task-list {
  display: grid;
  gap: 2px;
}

.today-task {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 4px 6px;
}

.today-task:hover {
  background: var(--surface-muted);
}

.today-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent-ink);
  padding: 0;
  font-size: 0.72rem;
  font-weight: 900;
}

.today-task.done .today-check {
  border-color: var(--accent);
  background: var(--accent);
}

.today-task-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 4px 0;
  color: var(--ink);
  text-align: left;
}

.today-task-title {
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-task.done .today-task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.today-task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.today-task-meta i {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--event-color, var(--line-strong));
}

.today-block .quick-bar {
  margin-top: 4px;
}

.today-pace-line {
  margin: 6px 0 10px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.5;
}

.today-pace dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.today-pace dt {
  color: var(--muted);
  font-size: 0.74rem;
}

.today-pace dd {
  margin: 2px 0 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.today-pace-warn {
  margin: 10px 0 0;
  color: #9a5314;
  font-size: 0.82rem;
  font-weight: 700;
}

.today-project {
  display: grid;
  gap: 5px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
  color: var(--ink);
  text-decoration: none;
}

.today-project:first-of-type {
  border-top: 0;
}

.today-project-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.today-project-head i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--course-color);
}

.today-project-head strong {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-project p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ---------- 系列 (series): chip menu and "加一组相似任务" ---------- */

.editor-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-add-series {
  justify-self: start;
  margin-top: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  font-weight: 700;
}

.editor-add-series:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.series-add {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  padding: 12px;
}

.series-add p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.series-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px auto;
  gap: 10px;
  align-items: end;
}

.series-add label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.series-add-actions {
  display: flex;
  gap: 8px;
}

.kind-menu {
  position: fixed;
  z-index: 80;
  display: grid;
  gap: 2px;
  width: 240px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 8px;
}

.kind-menu p {
  margin: 2px 6px 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.kind-menu > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 7px 8px;
  color: var(--ink);
  font-size: 0.86rem;
  text-align: left;
}

.kind-menu > button:hover,
.kind-menu > button[aria-checked="true"] {
  background: var(--accent-faint);
}

.kind-menu > button[aria-checked="true"]::after {
  content: "✓";
  color: var(--accent-text);
}

.kind-menu > button small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.74rem;
}

.kind-menu > button:last-child {
  color: var(--muted);
}

.kind-new {
  display: flex;
  gap: 6px;
  margin: 4px 0;
}

.kind-new input {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
}

@media (max-width: 760px) {
  .series-add-row {
    grid-template-columns: minmax(0, 1fr) 70px;
  }

  .series-add-row label:last-child {
    grid-column: 1 / -1;
  }
}

.actual-mute {
  margin: 8px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.actual-mute .link-button {
  color: var(--muted);
  font-weight: 600;
}

.settings-project-asks {
  display: grid;
  gap: 6px;
  margin: 0 0 12px 24px;
}

.settings-project-asks i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 999px;
}

.danger-title {
  color: var(--danger);
}

.danger-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.danger-zone input {
  width: 150px;
}

.danger-action {
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: var(--danger);
  color: #fff;
  padding: 6px 14px;
  font-weight: 800;
}

.danger-action:disabled {
  border-color: var(--line-strong);
  background: var(--surface-muted);
  color: var(--muted);
  cursor: not-allowed;
}

.export-download {
  max-width: 100%;
  white-space: nowrap;
}

.export-download b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.export-download small {
  flex-shrink: 0;
}

/* Phone cells are too narrow for "5小时40分"; the project strip already shows the load. */
@media (max-width: 760px) {
  .day-load {
    display: none;
  }
}

/* ---------- Task editor pop-up (same editor as the day drawer) ---------- */

.tray-loose .tray-item {
  grid-template-columns: minmax(0, 1fr) 30px 30px;
}

.study-edit {
  display: grid;
  place-items: center;
  width: 30px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-left: 0;
  background: var(--surface-strong);
  color: var(--muted);
  padding: 0;
}

.study-edit svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.study-edit:hover {
  color: var(--accent-text);
}

.task-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(24, 34, 31, 0.32);
  padding: 16px;
}

.task-modal-sheet {
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 18px 20px 16px;
}

.task-modal-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-modal-sheet h2 {
  margin: 0;
  font-size: 1.1rem;
}

.task-modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.3rem;
}

.task-modal .day-editor {
  border-top: 0;
  margin-top: 4px;
  padding: 8px 0 0;
}

.task-modal .day-editor-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.task-modal .day-editor-actions .day-delete {
  border-color: transparent;
}

.task-modal .day-editor-actions .day-delete:hover {
  color: var(--danger);
}

.task-modal .day-editor-actions .primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

/* 计划项目 → 未归属项目: a plain, small list */
.loose-list {
  max-width: 520px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 12px 14px;
}

.loose-list h3 {
  margin: 0;
  font-size: 0.95rem;
}

.loose-list h3 span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.loose-list > p {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.loose-list ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.loose-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.loose-title {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loose-list li small {
  color: var(--muted);
  font-size: 0.76rem;
}

.loose-list li.done .loose-title {
  color: var(--muted);
  text-decoration: line-through;
}

.loose-list li.done .today-check {
  border-color: var(--accent);
  background: var(--accent);
}

.loose-list .loose-edit {
  border: 0;
  border-radius: 8px;
  background: transparent;
}

/* ---------- Project pies ---------- */

.project-donut {
  flex-shrink: 0;
}

.donut-track {
  stroke: var(--surface-muted);
}

.donut-text {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.donut-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 0.74rem;
}

.donut-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: -6px;
  border-radius: 3px;
  background: var(--accent);
}

.donut-legend i.light {
  opacity: 0.35;
}

.donut-legend i.track {
  background: var(--surface-muted);
  outline: 1px solid var(--line);
}

.today-project {
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.today-project-head {
  justify-content: space-between;
}

.today-note p {
  margin: 6px 0;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.55;
}

.pace-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 0 14px 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.pace-mini span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pace-projects .pace-project {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.pace-project-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.pace-project-body .pace-project-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.86rem;
}

.pace-project-body .pace-project-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .pace-projects .pace-project {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .pace-project-body .pace-project-text {
    display: block;
    white-space: normal;
  }
}

.buffer-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.buffer-custom[hidden] {
  display: none;
}

.buffer-custom input {
  width: 64px;
}

/* Sidebar: the page you're on carries the color; 新建 is a quiet outlined button. */
.new-button {
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  color: var(--ink);
}

.new-button:hover {
  border-color: var(--accent);
  background: var(--accent-faint);
  color: var(--accent-text);
}

.new-button kbd {
  border-color: var(--line-strong);
  color: var(--muted);
}

.app-nav a.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.app-nav a.active svg {
  stroke: currentColor;
}

.app-nav a.active .nav-count,
.app-nav a.active b {
  background: color-mix(in srgb, var(--accent-ink) 22%, transparent);
  color: var(--accent-ink);
}

.calendar-done-count {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.75;
}

/* Month title → jump to any month */
body[data-view="calendar"] #month-label {
  cursor: pointer;
}

body[data-view="calendar"] #month-label::after {
  content: " ▾";
  color: var(--muted);
  font-size: 0.6em;
  vertical-align: middle;
}

.month-picker {
  position: fixed;
  z-index: 80;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 10px;
}

.month-picker header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.month-picker header button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-muted);
  font-size: 1.1rem;
}

.month-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.month-picker-grid button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.month-picker-grid button.this-month {
  border-color: var(--accent);
  color: var(--accent-text);
}

.month-picker-grid button.current {
  background: var(--accent);
  color: var(--accent-ink);
}

.welcome-preview {
  max-height: 240px;
  overflow-y: auto;
}

.welcome-preview fieldset {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  border: 0;
  padding: 0;
}

.welcome-preview legend {
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.welcome-preview .check-label {
  font-size: 0.84rem;
}

.welcome-later {
  margin-left: auto;
}

.today-note .link-button {
  justify-self: start;
  padding: 0;
  font-size: 0.8rem;
}

.donut-legend i {
  background: var(--muted);
}

/* Highlighter on key numbers in short status lines */
mark.hl {
  border-radius: 3px;
  background: linear-gradient(transparent 45%, #fde68a 45%);
  color: inherit;
  font-weight: 700;
  padding: 0 1px;
}

/* Pace panel v3: folded = one line per project; the fold button sits at the bottom. */
.pace-panel {
  position: relative;
}

.pace-panel .pace-toggle {
  display: grid;
  place-items: center;
  width: 100%;
  height: 20px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.pace-panel .pace-toggle:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.pace-panel .pace-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pace-head {
  padding-bottom: 2px;
}

.pace-lines {
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--line);
  padding: 8px 14px;
}

.pace-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.pace-line i {
  flex-shrink: 0;
  align-self: center;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--course-color);
}

.pace-line strong {
  flex-shrink: 0;
  color: var(--ink);
}

.pace-line span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-health-text mark.hl,
.pace-project-body mark.hl {
  font-weight: 700;
}

@media (max-width: 760px) {
  .pace-line {
    flex-wrap: wrap;
    white-space: normal;
  }
}

/* Sidebar v3: 日历 always carries a light tint (it's the home page); the page you're on
   is a slightly stronger tint, never a solid block. */
.app-nav .nav-home {
  background: var(--accent-faint);
  color: var(--accent-text);
}

.app-nav a.active,
.app-nav .nav-home.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.app-nav a.active .nav-count,
.app-nav a.active b {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Drawer rows v3: check · name/meta/note · ✎ */
.day-modal .day-row {
  grid-template-columns: 28px minmax(0, 1fr) 30px;
  grid-template-areas: none;
}

.day-modal .day-row > .day-row-main {
  grid-area: auto;
}

.day-modal .day-row .day-row-edit {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
}

.day-modal .day-row .day-row-edit:hover {
  background: var(--surface-muted);
}

.day-row-note,
.today-task-note,
.loose-note {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-row-note::before,
.today-task-note::before,
.loose-note::before {
  content: "备注：";
}

.today-task {
  grid-template-columns: 26px minmax(0, 1fr) 30px;
}

.today-task-edit {
  border: 0;
  border-radius: 8px;
  background: transparent;
  opacity: 0.6;
}

.today-task:hover .today-task-edit {
  opacity: 1;
}

.field-hint {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

/* ---------- 功能导览 ---------- */
.tour-target {
  position: relative;
  z-index: 5;
  border-radius: 12px;
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  animation: tour-pulse 1.6s ease-in-out infinite;
}

@keyframes tour-pulse {
  50% { outline-color: color-mix(in srgb, var(--accent) 35%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .tour-target { animation: none; }
}

.tour-card {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

body.tutorial-sandbox .app-shell {
  pointer-events: none;
  user-select: none;
}

body.tutorial-sandbox #study-pool .pool-add,
body.tutorial-sandbox #study-pool .study-edit,
body.tutorial-sandbox #study-pool .study-send {
  display: none;
}

.tutorial-fly-card {
  position: fixed;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, #8f79d6 48%, var(--line));
  border-left: 4px solid #8f79d6;
  border-radius: 10px;
  background: var(--surface-strong);
  box-shadow: 0 18px 48px rgba(31, 43, 40, 0.22);
  padding: 7px 10px;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.35;
  pointer-events: none;
}

.tutorial-fly-card small {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.tour-step {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.tour-card h3 {
  margin: 4px 0 6px;
  font-size: 1.05rem;
}

.tour-card p {
  margin: 0;
  line-height: 1.55;
  font-size: 0.9rem;
}

.tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.tour-actions .tour-skip {
  margin-right: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
}

.tour-actions .tour-prev {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 6px 12px;
}

@media (max-width: 760px) {
  .tour-card {
    right: 16px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

.health-badge.empty {
  background: var(--surface-muted);
  color: var(--muted);
}

.day-modal .day-row > .day-done {
  grid-area: auto;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.day-modal .day-row > .day-row-main {
  grid-column: 2;
  grid-row: 1;
}

.day-modal .day-row > .day-row-edit {
  grid-column: 3;
  grid-row: 1;
}

/* 任务池: tasks grouped under their 模块 */
.tray-module {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 2px 2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.tray-module:first-child {
  margin-top: 2px;
}

.tray-module span {
  color: var(--muted);
  font-weight: 500;
}

/* Key numbers: darker and a little bolder than the muted text around them (no marker). */
mark.hl {
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  padding: 0;
}

.day-modal .day-row {
  grid-template-columns: 28px minmax(0, 1fr);
}

.today-task {
  grid-template-columns: 26px minmax(0, 1fr);
}

.loose-list li {
  grid-template-columns: 26px minmax(0, 1fr) auto;
}

.loose-list .loose-title {
  display: block;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 2px 0;
  color: var(--ink);
  text-align: left;
}

.loose-list .loose-title:hover {
  color: var(--accent-text);
}

/* ---------- Calendar cells v4: every item listed; finished items as small grey lines ---------- */
.calendar-grid {
  grid-auto-rows: minmax(128px, auto);
}

.day-cell {
  overflow: visible;
}

.calendar-event.done {
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.7;
  text-decoration: none;
}

.calendar-event.done .done-mark {
  flex-shrink: 0;
  margin-right: 3px;
  font-size: 0.62rem;
}

.calendar-event.done span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event .note-mark {
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.6;
}

/* Hover card */
.task-hovercard {
  position: fixed;
  z-index: 95;
  width: 240px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: 0 10px 30px rgba(31, 43, 40, 0.14);
  padding: 10px 12px;
  pointer-events: none;
  animation: hovercard-in 120ms ease-out;
}

@keyframes hovercard-in {
  from { opacity: 0; transform: translateY(2px); }
}

.task-hovercard p {
  margin: 0;
}

.hovercard-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.hovercard-title i {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--event-color, var(--accent));
}

.hovercard-meta {
  margin-top: 3px !important;
  color: var(--muted);
  font-size: 0.76rem;
}

.hovercard-note {
  margin-top: 8px !important;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.week-item {
  cursor: grab;
}

.week-item.done {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  opacity: 0.7;
  text-decoration: none;
}

.donut-ring-track {
  stroke: color-mix(in srgb, var(--line) 70%, transparent);
}

.project-donut .donut-text {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.project-donut .donut-unit {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.calendar-event:has(.note-mark) {
  grid-template-columns: 14px minmax(0, 1fr) 6px;
}

.calendar-event .note-mark {
  align-self: center;
  margin-left: 0;
}

/* ---------- Date picker ---------- */
.date-button {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.date-button:hover {
  border-color: var(--accent);
}

.date-button.empty {
  color: var(--muted);
  font-weight: 500;
}

.date-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.date-field {
  display: block;
}

.date-picker {
  position: fixed;
  z-index: 100;
  width: 280px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: 0 16px 40px rgba(31, 43, 40, 0.16);
  padding: 12px;
  animation: hovercard-in 120ms ease-out;
}

.date-picker header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.date-picker header strong {
  font-size: 0.95rem;
}

.date-picker header button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 1.2rem;
}

.date-picker header button:hover {
  background: var(--surface-muted);
}

.date-picker-week,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.date-picker-week span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 0;
}

.date-picker-grid button {
  aspect-ratio: 1;
  margin: 1px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.date-picker-grid button:hover:not(:disabled) {
  background: var(--surface-muted);
}

.date-picker-grid button.outside {
  color: var(--muted);
  opacity: 0.45;
}

.date-picker-grid button.today {
  color: var(--accent-text);
  font-weight: 800;
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.date-picker-grid button.chosen {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  opacity: 1;
}

.date-picker-grid button:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.date-picker footer {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.date-picker footer button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 4px 12px;
  font-size: 0.8rem;
}

.date-picker footer button:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.day-cell.is-outside {
  background: var(--surface);
  pointer-events: none;
}

/* Save button: no extra dot when there are changes; it simply becomes active. */
.editor-footer .editor-save.has-changes::after {
  content: none;
}

/* 颜色 picker */
.color-field {
  display: grid;
  gap: 6px;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-swatches button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 34px;
  border: 0;
  background: transparent;
  padding: 2px;
  color: var(--muted);
}

.color-swatches i {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.color-swatches i.none {
  background: var(--surface-muted);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

.color-swatches button[aria-checked="true"] i {
  box-shadow: 0 0 0 2px var(--surface-strong), 0 0 0 4px var(--ink);
}

.color-swatches small {
  max-width: 48px;
  min-height: 1em;
  overflow: hidden;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-color[hidden] {
  display: none;
}

.tray-item {
  grid-template-columns: minmax(0, 1fr) 30px 30px;
}

.editor-row {
  grid-template-columns: minmax(0, 1fr) auto 30px 30px;
}

.editor-row .editor-row-edit {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
}

.editor-row .editor-row-edit:hover {
  background: var(--surface-muted);
}

.task-modal-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.task-modal-kicker i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--course-color);
}

@media (max-width: 760px) {
  .editor-row {
    grid-template-columns: minmax(0, 1fr) auto 30px 30px;
  }
}

/* ---------- Calendar item popover ---------- */
.event-popover {
  position: fixed;
  z-index: 96;
  width: 280px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: 0 16px 40px rgba(31, 43, 40, 0.18);
  padding: 12px 14px 12px;
  animation: hovercard-in 120ms ease-out;
}

.event-popover header {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) 24px;
  gap: 10px;
  align-items: start;
}

.event-popover header > i {
  align-self: stretch;
  border-radius: 999px;
  background: var(--event-color, var(--accent));
}

.event-popover h3 {
  margin: 0 0 2px;
  font-size: 0.98rem;
  line-height: 1.35;
}

.event-popover h3.is-done {
  color: var(--muted);
  text-decoration: line-through;
}

.event-popover header p,
.event-popover-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.event-popover-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

.event-popover-note {
  margin: 10px 0 0;
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 8px 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.event-popover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.event-popover-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  padding: 0 14px;
  font-size: 0.82rem;
  font-weight: 700;
}

.event-popover-actions .primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------- 设置 / 数据与备份: grouped rows ---------- */
.settings-page {
  display: grid;
  gap: 14px;
}

.set-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  padding: 12px 16px;
}

.set-group h4 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.set-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9rem;
}

.set-group h4 + .set-row,
.set-hint + .set-row {
  border-top: 0;
}

.set-row > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.set-row.sub {
  min-height: 38px;
  padding-left: 14px;
  font-size: 0.84rem;
}

.set-row input[type="text"],
.set-row select {
  width: min(220px, 55%);
}

.set-row input[type="color"] {
  width: 44px;
  height: 30px;
  padding: 2px;
}

.set-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

/* iOS-style switch on a checkbox */
input.switch {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: var(--line-strong);
  appearance: none;
  cursor: pointer;
  transition: background 160ms ease;
}

input.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 160ms ease;
}

input.switch:checked {
  background: var(--accent);
}

input.switch:checked::after {
  transform: translateX(18px);
}

input.switch:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.color-names {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.color-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-name-row i {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 999px;
}

.color-name-row input {
  min-width: 0;
  flex: 1;
}

.set-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.set-buttons button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-strong);
  padding: 0 16px;
  font-weight: 700;
}

.set-buttons .primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.settings-save {
  position: sticky;
  bottom: -18px;
  display: flex;
  justify-content: flex-end;
  background: linear-gradient(transparent, var(--surface) 35%);
  padding: 14px 0 4px;
}

.set-details summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.set-details .cloud-sync-card {
  margin-top: 10px;
  border: 0;
  padding: 0;
}

.set-group.danger h4 {
  color: var(--danger);
}

.capacity-week {
  margin: 0;
}

.menu-grid-tools .mobile-only {
  display: none;
}

@media (max-width: 760px) {
  .menu-grid-tools .mobile-only {
    display: inline-flex;
  }
}

/* ---------- Tour demos (display only) ---------- */
.tour-card.has-demo {
  width: min(400px, calc(100vw - 32px));
}

.tour-demo {
  position: relative;
  margin: 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.demo-drag {
  height: 150px;
}

.demo-pool {
  position: absolute;
  top: 10px;
  bottom: 30px;
  left: 10px;
  width: 78px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-strong);
}

.demo-pool span {
  display: block;
  padding: 5px 7px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.demo-cal {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 30px;
  left: 98px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.demo-cal span {
  display: grid;
  align-content: start;
  gap: 1px;
  border-right: 1px solid var(--line);
  padding: 4px 3px;
  font-size: 0.62rem;
}

.demo-cal span:last-child {
  border-right: 0;
}

.demo-cal small {
  color: var(--muted);
  font-size: 0.56rem;
}

.demo-card,
.demo-cursor {
  position: absolute;
  animation: demo-drag 7.2s ease-in-out infinite;
}

.demo-card {
  top: 34px;
  left: 16px;
  z-index: 2;
  width: 44px;
  text-align: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-strong));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
  padding: 4px 5px;
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
}

.demo-cursor {
  top: 44px;
  left: 50px;
  z-index: 3;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--ink);
  opacity: 0.55;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

/* card path: pool → 周二 → 周五 → pool (the caption changes every 2.4s) */
@keyframes demo-drag {
  0%, 8% { transform: translate(0, 0); }
  26%, 33% { transform: translate(var(--to-tue, 116px), 22px); }
  59%, 66% { transform: translate(var(--to-fri, 236px), 22px); }
  92%, 100% { transform: translate(0, 0); }
}

.demo-caption {
  position: absolute;
  right: 10px;
  bottom: 6px;
  left: 10px;
  margin: 0 !important;
  color: var(--accent-text);
  font-size: 0.76rem !important;
  font-weight: 700;
  text-align: center;
}

.demo-type {
  padding: 12px;
}

.demo-input {
  display: flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  padding: 0 10px;
  font-size: 0.86rem;
}

.demo-caret {
  width: 1.5px;
  height: 16px;
  margin-left: 1px;
  background: var(--ink);
  animation: demo-blink 1s steps(1) infinite;
}

@keyframes demo-blink {
  50% { opacity: 0; }
}

.demo-result {
  min-height: 1.4em;
  margin: 8px 2px 0 !important;
  color: var(--accent-text);
  font-size: 0.8rem !important;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .demo-card,
  .demo-cursor,
  .demo-caret {
    animation: none;
  }
}

.danger-zone input {
  width: 180px;
}

.menu-grid-tools button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.project-card.flash {
  animation: card-flash 1.4s ease-out;
}

@keyframes card-flash {
  0%, 30% { box-shadow: 0 0 0 3px var(--accent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* 小事 on the calendar: lighter than project tasks (no tile, just a dot and the text). */
.calendar-event.is-small:not(.done) {
  border-color: transparent;
  background: transparent;
  padding-top: 2px;
  padding-bottom: 2px;
  color: var(--ink);
  font-weight: 500;
}

.calendar-event.is-small:not(.done):hover {
  background: var(--surface-muted);
}

.week-item.is-small:not(.done) {
  border-color: transparent;
  background: transparent;
  font-weight: 500;
}

/* Tour v2: card next to the spot it explains, with an arrow */
.tour-card.at-target {
  right: auto;
  bottom: auto;
}

.tour-card.at-target::before {
  content: "";
  position: absolute;
  top: -7px;
  left: calc(var(--arrow-x, 40px) - 7px);
  width: 14px;
  height: 14px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface-strong);
  transform: rotate(45deg);
}

.tour-card.at-target.above::before {
  top: auto;
  bottom: -7px;
  transform: rotate(225deg);
}

/* Drag demo: calendar on the left, task pool on the right */
.demo-cal {
  right: 98px;
  left: 10px;
}

.demo-pool {
  right: 10px;
  left: auto;
}

.demo-pool,
.demo-cal {
  z-index: 1;
}

/* ---------- Dialog system v1 (2026-09-28) ----------
   One look for every pop-up: soft blurred backdrop, 18px corners, hairline border,
   layered shadow, a quiet title block, a button row separated by a hairline, and a short
   fade-and-rise entry. Floating cards (item card, date picker, wheel, menus) share the
   same surface at a smaller radius. */
:root {
  --dialog-radius: 18px;
  --float-radius: 14px;
  --dialog-shadow: 0 1px 2px rgba(20, 30, 27, 0.06), 0 12px 32px rgba(20, 30, 27, 0.14), 0 32px 64px rgba(20, 30, 27, 0.10);
  --float-shadow: 0 1px 2px rgba(20, 30, 27, 0.06), 0 10px 28px rgba(20, 30, 27, 0.14);
  --backdrop: rgba(24, 34, 31, 0.28);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes backdrop-in {
  from { opacity: 0; }
}

.app-menu,
.task-modal {
  background: var(--backdrop);
  backdrop-filter: blur(6px) saturate(1.1);
  -webkit-backdrop-filter: blur(6px) saturate(1.1);
  animation: backdrop-in 160ms ease-out;
}

.menu-sheet,
.task-modal-sheet,
.welcome-card,
#onboarding .welcome-body {
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--dialog-radius);
  box-shadow: var(--dialog-shadow);
  animation: dialog-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.menu-sheet {
  padding: 20px 22px 18px;
}

.menu-sheet .day-sheet-head {
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.menu-sheet .day-sheet-head h2,
.task-modal-sheet h2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.menu-sheet .day-sheet-head .eyebrow,
#course-editor-kicker {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

/* Round close buttons everywhere */
#close-app-menu,
#close-course-editor,
#close-day-modal,
.task-modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

#close-app-menu:hover,
#close-course-editor:hover,
#close-day-modal:hover,
.task-modal-close:hover {
  background: var(--line);
  color: var(--ink);
}

.task-modal-sheet {
  padding: 20px 22px 16px;
}

.task-modal-sheet header {
  margin-bottom: 4px;
}

/* Button row at the bottom of editors */
.task-modal .day-editor-actions,
.editor-footer {
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.task-modal .day-editor-actions button,
.event-popover-actions button,
.set-buttons button {
  min-height: 34px;
  border-radius: 10px;
  font-weight: 700;
}

.task-modal .day-editor-actions .primary-action,
.event-popover-actions .primary-action {
  min-width: 72px;
}

/* Form fields inside dialogs: same height and corner */
.task-modal input[type="text"],
.task-modal select,
.menu-sheet input[type="text"],
.menu-sheet select,
.course-editor-sheet input[type="text"],
.course-editor-sheet select {
  min-height: 38px;
  border-radius: 10px;
}

.day-editor label,
.task-modal .field-title {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

/* Floating cards */
.event-popover,
.date-picker,
.duration-wheel,
.kind-menu,
.month-picker,
.actual-card,
.tour-card {
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--float-radius);
  box-shadow: var(--float-shadow);
}

.duration-wheel,
.month-picker,
.actual-card,
.tour-card {
  animation: dialog-in 160ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .app-menu,
  .task-modal,
  .menu-sheet,
  .task-modal-sheet,
  .event-popover,
  .date-picker,
  .duration-wheel,
  .month-picker,
  .actual-card,
  .tour-card {
    animation: none;
  }
}

@media (max-width: 760px) {
  /* On phones the editor slides up from the bottom like a sheet. */
  .task-modal {
    align-items: end;
    padding: 0;
  }

  .task-modal-sheet {
    width: 100%;
    max-height: 88vh;
    border-radius: var(--dialog-radius) var(--dialog-radius) 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* ---------- Onboarding and settings refinement ---------- */

.sidebar-section-head > #sidebar-projects-title {
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  text-decoration: none;
}

.sidebar-section-head > #sidebar-projects-title:hover,
.sidebar-section-head > #sidebar-projects-title:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.welcome-card {
  width: min(680px, 100%);
}

.welcome-example {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.welcome-example > header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.welcome-example > header div {
  display: grid;
  gap: 2px;
}

.welcome-example > header small,
.welcome-example-note {
  color: var(--muted);
  font-size: 0.76rem;
}

.welcome-example-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.welcome-example-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.welcome-example-modules section {
  padding: 16px;
}

.welcome-example-modules section + section {
  border-left: 1px solid var(--line);
}

.welcome-example-modules h3 {
  margin: 0 0 10px;
  font-size: 0.82rem;
}

.welcome-example-modules ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.welcome-example-modules li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-size: 0.82rem;
}

.welcome-example-modules li span {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.welcome-example-note {
  margin: 10px 2px 0;
}

.settings-index {
  position: sticky;
  top: -4px;
  z-index: 2;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 4px 0 12px;
}

.settings-index button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.settings-index button:hover,
.settings-index button:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.set-group[id] {
  scroll-margin-top: 60px;
}

.demo-flow {
  position: absolute;
  top: 13px;
  right: 92px;
  z-index: 3;
  color: var(--accent-text);
  font-size: 0.72rem;
  font-weight: 800;
  pointer-events: none;
}

.demo-pool span,
.demo-cal span,
.demo-card {
  font-size: 0.72rem;
}

.demo-cal small {
  font-size: 0.68rem;
}

.demo-flow::before {
  content: "←";
  margin-right: 4px;
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .mobile-tabbar .tab-item {
    font-size: 0.72rem;
  }

  .settings-index {
    display: grid;
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .settings-index button {
    width: 100%;
    white-space: nowrap;
  }

  .welcome-example-modules {
    grid-template-columns: 1fr;
  }

  .welcome-example-modules section + section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .demo-flow {
    right: 86px;
  }
}

.delay-cost {
  margin-top: 2px !important;
  color: #9a5314 !important;
  font-size: 0.76rem !important;
}

.delay-cost mark.hl {
  color: #7a3f0c;
}

#sidebar-projects-title {
  border-radius: 8px;
  padding: 2px 6px;
  color: var(--muted);
  text-decoration: none;
}

#sidebar-projects-title:hover {
  color: var(--ink);
}

#sidebar-projects-title.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* One place for a form's buttons: bottom right, 取消 then the main action. */
.form-actions {
  position: sticky;
  bottom: -18px;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 14px -4px 0;
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 12px 4px 4px;
}

.form-actions button {
  min-width: 76px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  padding: 0 18px;
  color: var(--ink);
  font-weight: 700;
}

.form-actions .primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.form-actions .primary-action:hover {
  background: var(--accent-text);
}

/* ---------- Avatar / profile ---------- */
.avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 999px;
  object-fit: cover;
}

.avatar-letter {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 800;
}

.profile-chip {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 6px 8px;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

.profile-chip:hover {
  background: var(--surface-muted);
}

#profile-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-gear {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.topbar-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0;
}

.topbar-avatar:hover {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

@media (max-width: 760px) {
  .topbar-avatar {
    display: none;
  }
}

/* ---------- Settings v3: left menu + one page at a time ---------- */
.settings-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 0;
  display: grid;
  gap: 2px;
}

.settings-nav button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
}

.settings-nav button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.settings-nav button[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.settings-index,
.settings-save {
  display: none !important;
}

.set-row small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.set-row > span {
  display: grid;
  gap: 1px;
}

.me-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.me-card-body {
  display: grid;
  flex: 1;
  gap: 8px;
}

.me-card-body input {
  min-height: 40px;
  font-size: 1.05rem;
  font-weight: 700;
}

.mode-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mode-choices button {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 64px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 700;
}

.mode-choices button span {
  font-size: 1.2rem;
}

.mode-choices button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-faint);
  color: var(--accent-text);
}

.accent-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.accent-choices button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
}

.accent-choices button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--surface-strong), 0 0 0 4px var(--ink);
}

.accent-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.accent-custom input {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

@media (max-width: 760px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-nav {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .settings-nav button {
    flex-shrink: 0;
  }

  .mode-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- 夜间 / 护眼 modes: swap the color tokens ---------- */
body[data-mode="dark"] {
  color-scheme: dark;
  --bg: #121615;
  --surface: #171c1b;
  --surface-strong: #1d2322;
  --surface-muted: #252c2b;
  --ink: #e4ebe8;
  --muted: #98a6a1;
  --line: #2c3533;
  --line-strong: #3a4442;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.35);
  --dialog-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --float-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  --backdrop: rgba(0, 0, 0, 0.5);
  background: var(--bg);
  color: var(--ink);
}

body[data-mode="warm"] {
  --bg: #f4ecdc;
  --surface: #f8f1e3;
  --surface-strong: #fbf6ea;
  --surface-muted: #efe5d1;
  --ink: #3b3226;
  --muted: #7a6c58;
  --line: #e2d5bb;
  --line-strong: #d3c3a3;
  background: var(--bg);
  color: var(--ink);
}

body[data-mode="dark"] .app-shell,
body[data-mode="warm"] .app-shell {
  background: var(--bg);
}

body[data-mode="dark"] input,
body[data-mode="dark"] select,
body[data-mode="dark"] textarea {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

body[data-mode="dark"] mark.hl,
body[data-mode="dark"] .day-number {
  color: var(--ink);
}

/* ---------- 今日概览 v3 ---------- */
.overview-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.overview-switch strong {
  min-width: 150px;
  text-align: center;
  font-size: 0.95rem;
}

.overview-switch button[data-shift] {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  font-size: 1.1rem;
}

.today-hero {
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-strong) 70%);
  border: 1px solid var(--line);
  padding: 18px 20px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hero-label {
  margin: 0;
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-line {
  margin: 6px 0 12px;
  font-size: 1.15rem;
  line-height: 1.45;
}

.hero-line b {
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}

.hero-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 80%, transparent);
}

.hero-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 300ms ease;
}

.hero-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-ok {
  color: var(--accent-text);
  font-weight: 800;
}

.streak-chip {
  border-radius: 999px;
  background: #fff1dc;
  padding: 3px 10px;
  color: #9a5314;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.today-bill {
  border: 1px solid #f0dcc0;
  border-radius: 14px;
  background: #fff8ee;
  padding: 12px 16px;
}

.today-bill.rest {
  border-color: #dfe3f2;
  background: #f6f7fd;
}

.today-bill p {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.6;
}

.today-bill .bill-title {
  margin-bottom: 2px;
  font-weight: 800;
}

.today-note-card textarea {
  width: 100%;
  min-height: 110px;
  border: 0;
  border-radius: 12px;
  background: #fffbea;
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  box-shadow: inset 0 0 0 1px #efe3b8;
}

.today-note-card .note-saved {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.today-note-card blockquote {
  margin: 12px 0 0;
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 12px;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.today-note-card blockquote span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

body[data-mode="dark"] .today-note-card textarea { background: #2a2718; box-shadow: inset 0 0 0 1px #3d3822; }
body[data-mode="dark"] .today-bill { background: #2b2419; border-color: #4a3c26; }
body[data-mode="dark"] .today-bill.rest { background: #1f2230; border-color: #33374a; }
body[data-mode="dark"] .streak-chip { background: #3a2a15; color: #f0b56b; }

/* ---------- Welcome + hands-on tutorial ---------- */
.welcome-kicker {
  margin: 0 0 4px;
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.welcome-points {
  display: grid;
  gap: 12px;
  margin: 16px 0 20px;
  padding: 0;
  list-style: none;
}

.welcome-points li {
  display: grid;
  gap: 2px;
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.welcome-points b {
  color: var(--ink);
  font-size: 0.95rem;
}

.tour-hint {
  margin-top: 6px !important;
  color: var(--muted);
  font-size: 0.76rem !important;
}

.tour-done {
  color: var(--accent-text);
  font-size: 0.85rem;
  animation: dialog-in 200ms ease-out;
}

.tour-actions .tour-demo-button {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  padding: 6px 14px;
  font-weight: 700;
}

/* Tablet / small laptop: the task pool used to be hidden with no way to open it. It now
   slides in over the calendar when 任务池 is toggled on. */
@media (max-width: 1100px) and (min-width: 761px) {
  .detail-panel {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 15;
    display: block;
    width: 300px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-strong);
    box-shadow: var(--float-shadow);
  }

  body.right-collapsed .detail-panel,
  body:not([data-view="calendar"]) .detail-panel {
    display: none;
  }
}

/* The tutorial is hands-on: the page must stay usable (drag, drop, click). */
body.tutorial-sandbox .app-shell {
  pointer-events: auto;
  user-select: auto;
}

/* ---------- 回顾之书 ---------- */
.book-card {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(120deg, #fbf8f1, var(--surface-strong) 60%);
  padding: 18px 20px;
}

.book-cover-mini {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 84px;
  height: 112px;
  border-radius: 4px 12px 12px 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 80%, #000) 0 8px, var(--accent) 8px);
  box-shadow: 0 10px 24px rgba(31, 43, 40, 0.2);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.book-card-body h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.book-card-body p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.book-periods,
.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.book-periods button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  padding: 4px 12px;
  font-size: 0.8rem;
}

.book-periods button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
}

.book-actions button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  padding: 0 16px;
  font-weight: 700;
}

.book-actions .primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.book-actions button:disabled {
  opacity: 0.45;
}

.book-count {
  color: var(--ink) !important;
  font-weight: 600;
}

.book-view {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #3a3129, #16120e);
  animation: backdrop-in 200ms ease-out;
}

.book-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.3rem;
}

.book-stage {
  perspective: 2200px;
}

.book {
  position: relative;
  width: min(440px, 86vw);
  height: min(600px, 72vh);
  cursor: pointer;
  transform: translateX(50%);
}

.book-leaf {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transition: transform 700ms cubic-bezier(0.3, 0.7, 0.2, 1);
  transform-style: preserve-3d;
}

.book-leaf.flipped {
  transform: rotateY(-180deg);
}

.book-page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 4px 14px 14px 4px;
  background: #fbf8f1;
  box-shadow: inset 12px 0 18px -12px rgba(0, 0, 0, 0.25), 0 20px 50px rgba(0, 0, 0, 0.45);
  padding: 34px 32px;
  color: #2d2720;
  backface-visibility: hidden;
}

.book-leaf.flipped .book-page {
  filter: brightness(0.92);
}

.book-cover {
  display: grid;
  align-content: center;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 78%, #000) 0 14px, var(--accent) 14px);
  color: #fff;
}

.book-cover-kicker {
  margin: 0;
  opacity: 0.8;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.book-cover h2,
.book-end h2 {
  margin: 8px 0 14px;
  font-size: 2rem;
  line-height: 1.2;
}

.book-cover-range,
.book-cover-stats {
  margin: 0 0 6px;
  opacity: 0.9;
}

.book-hint {
  margin-top: 30px;
  opacity: 0.6;
  font-size: 0.8rem;
}

.book-day-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e8dfcf;
  padding-bottom: 14px;
}

.book-day-num {
  color: var(--accent);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
}

.book-day-head b {
  display: block;
  font-size: 1rem;
}

.book-day-head small {
  color: #8a7d6b;
}

.book-done {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.book-done li {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 0.95rem;
}

.book-done i {
  width: 5px;
  height: 18px;
  border-radius: 999px;
  background: var(--event-color);
}

.book-done small {
  color: #8a7d6b;
}

.book-empty {
  color: #8a7d6b;
  font-size: 0.9rem;
}

.book-note {
  margin: 24px 0 0;
  border-left: 4px solid var(--accent);
  padding: 6px 0 6px 14px;
  color: #3b3226;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-size: 1.1rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.book-end dl {
  display: grid;
  gap: 12px;
  margin: 10px 0 0;
}

.book-end dl div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #e0d5c1;
  padding-bottom: 8px;
}

.book-end dt {
  color: #8a7d6b;
}

.book-end dd {
  margin: 0;
  font-weight: 800;
}

.book-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  color: rgba(255, 255, 255, 0.8);
}

.book-nav button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.4rem;
}

.book-nav button:disabled {
  opacity: 0.3;
}

@media (max-width: 760px) {
  .book {
    transform: none;
  }

  .book-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

.book-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  border-radius: 14px 4px 4px 14px;
  background: #f4efe4;
  box-shadow: inset -12px 0 18px -12px rgba(0, 0, 0, 0.25), 0 20px 50px rgba(0, 0, 0, 0.45);
  padding-bottom: 26px;
  color: #b9ad97;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  transform: rotateY(180deg);
  backface-visibility: hidden;
}

/* Settings keeps one size whichever page is open; the page scrolls inside. */
#app-menu .menu-sheet {
  display: flex;
  flex-direction: column;
  height: min(680px, 88vh);
}

#app-menu .menu-output {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#app-menu .settings-layout {
  height: 100%;
}

#app-menu .settings-layout > .settings-page {
  height: 100%;
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 760px) {
  #app-menu .menu-sheet {
    height: 92vh;
  }

  #app-menu .settings-layout {
    grid-template-rows: auto minmax(0, 1fr);
  }
}

/* 回顾之书 v2: a cloth-bound cover with a thin foil frame; quiet month pages. */
.book-cover {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.035) 0 2px, transparent 2px 5px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.28) 0 16px, rgba(255, 255, 255, 0.06) 16px 18px, transparent 18px),
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 88%, #fff), color-mix(in srgb, var(--accent) 70%, #000));
  color: #f6ecd2;
  text-align: center;
}

.book-cover-frame {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 72%;
  border: 1px solid rgba(240, 222, 178, 0.55);
  outline: 1px solid rgba(240, 222, 178, 0.25);
  outline-offset: 6px;
  padding: 56px 16px;
}

.book-cover .book-cover-kicker {
  opacity: 0.85;
  font-size: 0.78rem;
  letter-spacing: 0.5em;
}

.book-cover-year {
  margin: 0;
  font-family: "Didot", "Bodoni 72", "Songti SC", "STSong", serif;
  font-size: 4.2rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.book-cover-name {
  margin: 0;
  opacity: 0.9;
  font-family: "Songti SC", "STSong", serif;
  font-size: 1rem;
  letter-spacing: 0.3em;
}

.book-cover .book-cover-stats {
  margin: 0 0 8px;
  opacity: 0.7;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
}

.book-month {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.book-month-num {
  margin: 0;
  color: var(--accent);
  font-family: "Didot", "Bodoni 72", "Songti SC", serif;
  font-size: 5.5rem;
  line-height: 1;
}

.book-month-name {
  margin: 8px 0 4px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 1.2rem;
  letter-spacing: 0.4em;
}

.book-month-stats {
  margin: 0;
  color: #8a7d6b;
  font-size: 0.82rem;
}

.book {
  touch-action: none;
  user-select: none;
}

/* ---------- 奶茶对局 ---------- */
.tea-page {
  display: grid;
  gap: 14px;
  max-width: 720px;
}

.tea-mode {
  margin: 0;
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.tea-hero,
.tea-board,
.tea-result {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(160deg, #fff6ea, var(--surface-strong) 55%);
  padding: 24px;
  text-align: center;
}

.tea-emoji {
  margin: 0;
  font-size: 2.6rem;
}

.tea-hero h2,
.tea-result h2,
.tea-board h2 {
  margin: 6px 0;
  font-size: 1.35rem;
}

.tea-hero > p,
.tea-result > p {
  margin: 4px 0;
  color: var(--muted);
}

.tea-rules {
  display: grid;
  gap: 6px;
  justify-items: center;
  margin: 14px 0;
  padding: 0;
  color: var(--ink);
  font-size: 0.88rem;
  list-style: none;
}

.tea-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.tea-actions button:not(.link-button),
.tea-join button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 0 18px;
  font-weight: 700;
}

.tea-actions .primary-action {
  border-color: #b8742f;
  background: #c98a45;
  color: #fff;
}

.tea-join {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.tea-join input {
  width: 190px;
  text-align: center;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.tea-code {
  margin: 14px 0 0 !important;
  color: var(--ink) !important;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.3em;
}

.tea-board {
  text-align: left;
}

.tea-board header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.tea-board header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.tea-today {
  margin: 8px 0 16px;
  font-size: 1.05rem;
}

.tea-today b {
  color: #9a5314;
  font-size: 1.3rem;
}

.tea-players {
  display: grid;
  gap: 12px;
}

.tea-player {
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 12px 14px;
}

.tea-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.tea-name span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.tea-dots {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tea-dots li {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 44px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.tea-dots li.held { background: #c98a45; color: #fff; }
.tea-dots li.missed { background: #f1dcd7; color: #a3413a; }
.tea-dots li.today { box-shadow: inset 0 0 0 2px #c98a45; color: #9a5314; }

.tea-friend-today {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.tea-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.tea-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: -8px;
  border-radius: 999px;
  background: var(--surface-muted);
}

.tea-legend i.held { background: #c98a45; }
.tea-legend i.missed { background: #f1dcd7; }
.tea-legend i.today { box-shadow: inset 0 0 0 2px #c98a45; background: transparent; }

.tea-result.won { background: linear-gradient(160deg, #fff1d6, var(--surface-strong) 60%); }
.tea-result.lost { background: linear-gradient(160deg, #fdeee9, var(--surface-strong) 60%); }

.tea-owe-state,
.tea-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.tea-line {
  display: block;
  margin: 10px 0 4px;
  border-radius: 10px;
  background: #fff3e2;
  padding: 7px 12px;
  color: #8a4e12;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

body[data-mode="dark"] .tea-hero,
body[data-mode="dark"] .tea-board,
body[data-mode="dark"] .tea-result { background: var(--surface-strong); }
body[data-mode="dark"] .tea-line { background: #3a2a15; color: #f0b56b; }

.tea-actions button.primary-action {
  border-color: #b8742f;
  background: #c98a45;
  color: #fff;
}

.tea-actions button.primary-action:hover {
  background: #b8742f;
}

.tea-join input {
  letter-spacing: normal;
}

.tea-join input:not(:placeholder-shown) {
  letter-spacing: 0.2em;
}

.today-bill.ahead {
  border-color: #cfe5d6;
  background: #f1f8f3;
}

.hero-ahead {
  margin: 8px 0 0;
  color: var(--accent-text);
  font-size: 0.86rem;
  font-weight: 600;
}

body[data-mode="dark"] .today-bill.ahead { background: #1b2a21; border-color: #2c4435; }

/* 回顾之书: soft paper instead of heavy dark shadows. One gentle shadow under each page,
   and only a faint fold where the two pages meet. */
.book-page {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  background-image: linear-gradient(90deg, rgba(60, 45, 25, 0.07), transparent 22px);
}

.book-back {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  background-image: linear-gradient(270deg, rgba(60, 45, 25, 0.07), transparent 22px);
}

.book-leaf.flipped .book-page {
  filter: none;
}

.book-cover {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

/* Shadows fall straight down only (negative spread), so stacked pages don't paint a grey
   band across the middle of the open book. */
.book-page,
.book-back {
  box-shadow: 0 16px 22px -12px rgba(0, 0, 0, 0.45);
}

.book-cover {
  box-shadow: 0 18px 26px -12px rgba(0, 0, 0, 0.5);
}

/* 回顾之书 cover v3: oat-linen cloth, cocoa type, a fine antique-gold frame. Opaque (the
   page underneath must never show through). */
.book-page.book-cover {
  background-color: #e6d9c4;
  background-image:
    linear-gradient(90deg, rgba(74, 55, 39, 0.22) 0 14px, rgba(255, 255, 255, 0.25) 14px 15px, transparent 15px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(74, 55, 39, 0.05) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 30% 20%, #efe5d4, #dccbb0);
  color: #4a3727;
}

.book-page.book-cover .book-cover-frame {
  gap: 14px;
  width: 70%;
  border-color: rgba(168, 135, 86, 0.75);
  outline-color: rgba(168, 135, 86, 0.35);
  padding: 60px 16px 54px;
}

.book-page.book-cover .book-cover-kicker {
  color: #8a6d4a;
  opacity: 1;
  font-size: 0.72rem;
  letter-spacing: 0.45em;
  padding-left: 0.45em;
}

.book-page.book-cover .book-cover-year {
  color: #4a3727;
  font-size: 3.8rem;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.book-page.book-cover .book-cover-name {
  position: relative;
  color: #6b5237;
  opacity: 1;
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  padding-top: 14px;
}

.book-page.book-cover .book-cover-name::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 28px;
  height: 1px;
  background: rgba(168, 135, 86, 0.8);
  transform: translateX(-50%);
}

.book-page.book-cover .book-cover-stats {
  color: #8a6d4a;
  opacity: 1;
  letter-spacing: 0.12em;
}

.book-cover-mini {
  background:
    linear-gradient(90deg, rgba(74, 55, 39, 0.25) 0 7px, transparent 7px),
    radial-gradient(120% 90% at 30% 20%, #efe5d4, #d8c6a8);
  color: #4a3727;
  box-shadow: 0 10px 22px -8px rgba(74, 55, 39, 0.5), inset 0 0 0 1px rgba(168, 135, 86, 0.4);
}

/* ---------- 奶茶对局 v2: two columns + the big cup ---------- */
.tea-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 24px;
  align-items: start;
}

.tea-page {
  display: flex;
  flex-direction: column;
  max-width: none;
}

.tea-page > .tea-pool-card {
  order: 99;
}

.tea-side {
  position: sticky;
  top: 12px;
}

.tea-art {
  margin: 0;
  text-align: center;
  cursor: pointer;
  animation: tea-in 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes tea-in {
  from { opacity: 0; transform: translateY(14px); }
}

.tea-art-svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  overflow: visible;
}

.tea-cup {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 420ms cubic-bezier(0.3, 0.7, 0.3, 1);
}

.tea-art:hover .tea-cup {
  animation: tea-sway 1.6s ease-in-out infinite;
}

@keyframes tea-sway {
  0%, 100% { transform: translateY(-6px) rotate(0deg); }
  30% { transform: translateY(-7px) rotate(-1.6deg); }
  70% { transform: translateY(-5px) rotate(1.4deg); }
}

.tea-art .tea-shadow {
  transition: transform 420ms ease, opacity 420ms ease;
  transform-box: fill-box;
  transform-origin: center;
}

.tea-art:hover .tea-shadow {
  opacity: 0.14;
  transform: scale(0.9);
}

.tea-straw {
  transform-box: fill-box;
  transform-origin: 50% 95%;
}

.tea-art:hover .tea-straw {
  animation: tea-straw 900ms cubic-bezier(0.3, 1.6, 0.4, 1) 1;
}

@keyframes tea-straw {
  0% { transform: rotate(0deg); }
  35% { transform: rotate(-4deg); }
  65% { transform: rotate(2deg); }
  100% { transform: rotate(0deg); }
}

.tea-pearl {
  animation: tea-pearl 4.2s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

@keyframes tea-pearl {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2.5px); }
}

.tea-liquid {
  transition: transform 500ms ease;
}

/* Click = a small sip: the level dips, pearls bob up, then settle. */
.tea-art.sip .tea-liquid {
  animation: tea-sip 900ms ease-in-out 1;
}

.tea-art.sip .tea-pearl {
  animation: tea-sip-pearl 900ms ease-in-out 1;
}

@keyframes tea-sip {
  40% { transform: translateY(10px); }
}

@keyframes tea-sip-pearl {
  40% { transform: translateY(-14px); }
}

.tea-art figcaption {
  margin-top: 6px;
  color: #8a6d4a;
  font-size: 0.84rem;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .tea-art,
  .tea-pearl,
  .tea-art:hover .tea-cup,
  .tea-art:hover .tea-straw,
  .tea-art.sip .tea-liquid,
  .tea-art.sip .tea-pearl {
    animation: none;
  }
}

@media (max-width: 900px) {
  .tea-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tea-side {
    position: static;
    order: -1;
  }

  .tea-art-svg {
    max-width: 170px;
  }
}

/* ---------- 陌生人奶茶池 card ---------- */
.tea-pool-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  border: 1px solid #f1dfc6;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffaf2, #fff3e3);
  padding: 16px 40px 16px 16px;
  transition: opacity 200ms ease, transform 200ms ease;
}

.tea-pool-card.closing {
  opacity: 0;
  transform: translateY(6px);
}

.tea-pool-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #b49774;
  font-size: 1rem;
  line-height: 1;
}

.tea-pool-close:hover {
  background: rgba(180, 151, 116, 0.14);
  color: #7a5b3a;
}

.tea-pool-badge svg {
  width: 44px;
  height: 44px;
  transform: rotate(-8deg);
}

.tea-pool-body p {
  margin: 0 0 6px;
  color: #6b5237;
  font-size: 0.86rem;
  line-height: 1.6;
}

.tea-pool-body .tea-pool-title {
  color: #4a3727;
  font-size: 0.98rem;
  font-weight: 800;
}

.tea-pool-title span {
  margin-left: 6px;
  border-radius: 999px;
  background: #f6e2c6;
  padding: 2px 8px;
  color: #9a6a33;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: 2px;
}

.tea-pool-body .tea-pool-first {
  color: #8a6d4a;
  font-size: 0.8rem;
}

.tea-pool-cta {
  margin-top: 4px;
  border: 1px solid #e4c8a2;
  border-radius: 999px;
  background: #fff;
  padding: 6px 16px;
  color: #8a5a26;
  font-weight: 700;
}

.tea-pool-cta:hover {
  border-color: #c98a45;
}

/* ---------- 首发守线员 welcome ---------- */
.founder-welcome {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  background: rgba(40, 30, 20, 0.35);
  backdrop-filter: blur(6px);
  animation: backdrop-in 200ms ease-out;
}

.founder-card {
  width: min(380px, calc(100vw - 32px));
  border-radius: 22px;
  background: linear-gradient(170deg, #fffaf1, #fff);
  box-shadow: var(--dialog-shadow);
  padding: 28px 26px 22px;
  text-align: center;
  animation: dialog-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.founder-medal {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #fbe4b8, #d9a55f 70%, #b98440);
  box-shadow: 0 10px 24px -8px rgba(185, 132, 64, 0.7), inset 0 0 0 4px rgba(255, 255, 255, 0.45);
  color: #5a3a14;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.founder-kicker {
  margin: 0;
  color: #9a6a33;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.founder-card h2 {
  margin: 6px 0 10px;
  color: #3b2a1c;
  font-size: 1.3rem;
}

.founder-card p {
  margin: 0 0 8px;
  color: #6b5237;
  font-size: 0.9rem;
  line-height: 1.6;
}

.founder-card button {
  margin-top: 8px;
  min-width: 140px;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: #c98a45;
  color: #fff;
  font-weight: 800;
}

/* Brand: the moon-and-sun emblem + 日有回响 · DayEcho */
.brand-mark.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f7efe3;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(184, 149, 114, 0.25);
}

.brand-en {
  margin-left: 4px;
  color: #b0885c;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.welcome-logo {
  display: block;
  width: min(300px, 70%);
  margin: -8px auto 6px;
  border-radius: 16px;
}

/* Expanded pace panel: projects side by side */
.pace-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 6px 18px;
}

.pace-projects .donut-legend {
  grid-column: 1 / -1;
}

/* ---------- 陌生人奶茶池 card v2 ---------- */
:root {
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .18  0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.tea-pool-card {
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  border: 1px solid rgba(226, 198, 160, 0.7);
  border-radius: 18px;
  background:
    var(--paper-grain),
    radial-gradient(120% 140% at 0% 0%, #fff8ee 0%, #fdf0dc 55%, #f9e7cc 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 10px 26px -18px rgba(150, 105, 55, 0.55);
  padding: 18px 44px 18px 18px;
  transition: transform 220ms ease, box-shadow 220ms ease, opacity 200ms ease;
}

.tea-pool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 16px 30px -18px rgba(150, 105, 55, 0.6);
}

.tea-pool-badge svg {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 4px 6px rgba(150, 105, 55, 0.22));
  transform: rotate(-9deg);
  transition: transform 320ms cubic-bezier(0.3, 1.4, 0.4, 1);
}

.tea-pool-card:hover .tea-pool-badge svg {
  transform: rotate(-4deg) translateY(-3px);
}

.tea-pool-close {
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.tea-pool-close svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: #a88760;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.tea-pool-close:hover {
  border-color: rgba(201, 138, 69, 0.35);
  background: #fff;
  transform: rotate(90deg);
}

.tea-pool-body .tea-pool-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #3f2d1f;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.tea-pool-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  border: 1px solid rgba(201, 138, 69, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #fbeedd);
  padding: 2px 9px;
  color: #a4692c;
  font-size: 0.7rem;
  font-weight: 800;
  vertical-align: 0;
}

.tea-pool-tag i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #d98e42;
  animation: pool-dot 1.8s ease-in-out infinite;
}

@keyframes pool-dot {
  50% { opacity: 0.35; }
}

.tea-pool-body p {
  color: #6b5237;
  line-height: 1.7;
}

.tea-pool-body .tea-pool-first {
  margin-top: 8px;
  border-top: 1px dashed rgba(201, 160, 110, 0.45);
  padding-top: 10px;
  color: #7a5e40;
  font-size: 0.84rem;
}

.tea-pool-first b {
  color: #4a3727;
}

.tea-title-chip {
  display: inline-block;
  margin: 0 3px;
  border-radius: 6px;
  background: linear-gradient(180deg, #f9e2bd, #f1cf9c);
  padding: 0 6px;
  color: #6a4213;
  font-weight: 800;
}

.tea-pool-remind {
  margin-top: 2px;
  border: 0;
  background: transparent;
  padding: 2px 0;
  color: #a4692c;
  font-size: 0.86rem;
  font-weight: 700;
}

.tea-pool-remind:hover {
  color: #7a4a17;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tea-pool-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tea-pool-form[hidden] {
  display: none;
}

.tea-pool-form input {
  flex: 1;
  min-width: 160px;
  border-color: #ecd6b6;
  background: #fffdf9;
}

.tea-pool-form button {
  border: 0;
  border-radius: 10px;
  background: #c98a45;
  padding: 0 16px;
  color: #fff;
  font-weight: 700;
}

.tea-pool-form small {
  flex-basis: 100%;
  color: #a88760;
  font-size: 0.72rem;
}

.tea-pool-done {
  margin-top: 4px !important;
  color: #7a8a4a !important;
  font-size: 0.82rem !important;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .tea-pool-tag i { animation: none; }
}

/* ---------- 回顾之书 v3: soft thick paper that bends ---------- */
:root {
  --paper-fiber: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .22' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .38  0 0 0 0 .28  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23f)'/%3E%3C/svg%3E");
}

.book-stage2 {
  display: grid;
  place-items: center;
  perspective: 2600px;
  perspective-origin: 50% 40%;
}

.book2 {
  --w: min(420px, 44vw);
  --h: calc(var(--w) * 1.36);
  --stack-right: 0;
  --stack-left: 0;
  position: relative;
  width: calc(var(--w) * 2);
  height: var(--h);
  transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(0.3, 0.7, 0.2, 1);
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.book2:active {
  cursor: grabbing;
}

/* Closed: only the cover, centred. */
.book2.closed {
  transform: translateX(calc(var(--w) * -0.5));
}

.book2-paper {
  background-color: #fbfaf6;
  background-image:
    var(--paper-fiber),
    var(--paper-grain),
    radial-gradient(140% 120% at 50% 40%, rgba(255, 255, 255, 0.6), rgba(236, 229, 216, 0.35));
}

.book2-side {
  position: absolute;
  top: 0;
  width: var(--w);
  height: var(--h);
}

.book2-side.left { left: 0; }
.book2-side.right { left: var(--w); }

.book2-side.empty .book2-sheet {
  visibility: hidden;
}

.book2-sheet {
  position: absolute;
  inset: 0;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(110, 90, 60, 0.07),
    inset 0 0 8px rgba(120, 100, 70, 0.07),
    inset 0 -14px 16px -14px rgba(90, 70, 45, 0.16),
    0 22px 30px -20px rgba(0, 0, 0, 0.6);
}

.book2-side.right .book2-sheet {
  border-radius: 2px 11px 11px 2px;
}

.book2-side.left .book2-sheet {
  border-radius: 11px 2px 2px 11px;
}

/* Crease where the pages meet the spine. */
.book2-side.right .book2-sheet::after,
.book2-side.left .book2-sheet::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34px;
  pointer-events: none;
}

.book2-side.right .book2-sheet::after {
  left: 0;
  background: linear-gradient(90deg, rgba(70, 52, 30, 0.2), rgba(70, 52, 30, 0.06) 40%, transparent);
}

.book2-side.left .book2-sheet::after {
  right: 0;
  background: linear-gradient(270deg, rgba(70, 52, 30, 0.2), rgba(70, 52, 30, 0.06) 40%, transparent);
}

/* Thickness: the edges of the pages still to come (right) and already read (left). */
.book2-stack {
  position: absolute;
  top: 2px;
  width: var(--w);
  height: calc(var(--h) - 4px);
  border-radius: 3px 10px 10px 3px;
  background: repeating-linear-gradient(90deg, #e9e3d7 0 1px, #fbf9f4 1px 2.5px);
  box-shadow: 0 20px 26px -20px rgba(0, 0, 0, 0.6);
}

.book2-stack.right {
  left: var(--w);
  transform: translate(calc(var(--stack-right) * 1.3px), calc(var(--stack-right) * 0.6px));
}

.book2-stack.left {
  left: 0;
  border-radius: 10px 3px 3px 10px;
  transform: translate(calc(var(--stack-left) * -1.3px), calc(var(--stack-left) * 0.6px));
}

/* The shadow a lifting page throws onto the page beneath. */
.book2-cast {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--cast-width, 0%);
  opacity: var(--cast, 0);
  pointer-events: none;
}

.book2-side.right .book2-cast {
  left: 0;
  background: linear-gradient(90deg, rgba(40, 28, 14, 0.45), rgba(40, 28, 14, 0.12) 55%, transparent);
}

.book2-side.left .book2-cast {
  right: 0;
  background: linear-gradient(270deg, rgba(40, 28, 14, 0.45), rgba(40, 28, 14, 0.12) 55%, transparent);
}

/* The turning page: hinged strips. */
.book2-leaf-host {
  position: absolute;
  top: 0;
  left: var(--w);
  width: var(--w);
  height: var(--h);
  transform-style: preserve-3d;
  pointer-events: none;
}

.book2-leaf {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.book2-seg {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--w) / 4);
  height: var(--h);
  transform-origin: 0 50%;
  transform-style: preserve-3d;
}

.book2-seg .book2-seg {
  left: 100%;
}

.book2-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.book2-face.back {
  transform: rotateY(180deg);
}

.book2-inner {
  position: absolute;
  top: 0;
  width: var(--w);
  height: var(--h);
}

.book2-face.front .book2-inner {
  left: calc(var(--w) / -4 * var(--k));
}

.book2-face.back .book2-inner {
  left: calc(var(--w) / -4 * (3 - var(--k)));
}

/* Soft edge on the free end of the turning page. */
.book2-seg[style*="--k: 3"] > .book2-face.front,
.book2-seg[style*="--k:3"] > .book2-face.front {
  border-radius: 0 11px 11px 0;
}

.book2-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(45, 32, 18, 0.85), rgba(45, 32, 18, 0.55));
  opacity: 0;
  pointer-events: none;
}

/* Pages inside the new book use its paper instead of their own background. */
.book2 .book-page:not(.book-cover) {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.book2 .book-page.book-cover {
  border-radius: 2px 11px 11px 2px;
}

.book2-endpaper {
  background:
    radial-gradient(120% 90% at 30% 20%, #efe5d4, #dccbb0) !important;
}

.book2-backpage {
  display: grid;
  place-items: end center;
  padding-bottom: 26px;
}

.book2-backpage span {
  color: #cbbfa9;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
}

@media (max-width: 760px) {
  .book2 {
    --w: 46vw;
  }
}

/* =====================================================================
   Visual v4 (2026-09-29): cream paper everywhere, one palette for accents only,
   quieter brand, Echo Line, lighter cards / pool / calendar.
   Brand language: small dots, soft arcs, ripples, cream paper.
   ===================================================================== */
:root {
  --line-warm: #dcb48c;
  --line-cool: #a3b8cc;
  --line-mid: #b6aa9e;
  --line-cool-text: #66727f;
}

body[data-mode="light"] {
  --bg: #f6f2eb;
  --surface: #fbf8f3;
  --surface-strong: #fffdf9;
  --surface-muted: #f2ede4;
  --ink: #2d2a26;
  --muted: #7d756b;
  --line: #ebe4d8;
  --line-strong: #ddd4c5;
  --shadow: 0 18px 48px rgba(92, 72, 48, 0.1);
  --shadow-soft: 0 8px 24px rgba(92, 72, 48, 0.06);
  background-color: var(--bg);
  background-image: var(--paper-grain, none);
}

/* ---------- Brand (top-left) ---------- */
.brand {
  grid-template-columns: 44px minmax(0, 1fr) 30px;
  column-gap: 9px;
}

.brand-mark.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  box-shadow: 0 0 0 1px rgba(184, 149, 114, 0.18), 0 4px 12px rgba(120, 90, 60, 0.08);
}

.brand-name {
  align-self: end;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.25;
}

.brand-name .brand-en {
  display: none;
}

.brand-tagline {
  align-self: start;
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.brand-tagline .brand-tagline-en {
  color: var(--accent-text);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ---------- 设置 → 主题 ---------- */
.palette-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}

.palette-choices button {
  display: grid;
  gap: 8px;
  justify-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.palette-choices button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.palette-choices button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-faint);
}

.palette-swatches {
  display: flex;
  gap: 4px;
}

.palette-swatches i {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.palette-name {
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Today hero: paper, not a coloured gradient. */
.today-hero {
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--line-warm) 9%, transparent), transparent 60%),
    radial-gradient(90% 80% at 100% 100%, color-mix(in srgb, var(--line-cool) 8%, transparent), transparent 60%),
    var(--surface-strong);
  padding: 18px 22px 12px;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.hero-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--line-warm);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--line-warm) 22%, transparent);
}

/* ---------- Projects: name, status, deadline, today's suggestion ---------- */
.project-status {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}

.project-status i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #9bb89a;
  box-shadow: 0 0 0 3px color-mix(in srgb, #9bb89a 22%, transparent);
}

.project-status.tight i { background: #e0b565; box-shadow: 0 0 0 3px color-mix(in srgb, #e0b565 24%, transparent); }
.project-status.danger i { background: #d98276; box-shadow: 0 0 0 3px color-mix(in srgb, #d98276 24%, transparent); }
.project-status.empty i { background: var(--line-strong); box-shadow: none; }
.project-status.danger { color: #b0584b; }

.project-deadline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.project-deadline mark.hl {
  background: none;
  color: var(--ink);
  font-weight: 600;
}

.project-suggest {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.project-suggest b {
  margin-left: 2px;
  color: var(--accent-text);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.today-project {
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  border-top: 0;
  border-radius: 12px;
  padding: 10px 8px;
  transition: background 160ms ease;
}

.today-project:hover {
  background: var(--surface-muted);
}

.project-card {
  gap: 8px;
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  padding: 16px 18px;
  transition: box-shadow 200ms ease, transform 200ms ease;
}

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

.project-card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0;
  font-size: 1.08rem;
  font-weight: 650;
}

.project-card h3::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--course-color);
}

.project-card header .progress-ring {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}

.project-card .project-suggest {
  font-size: 0.86rem;
}

.project-card .project-suggest b {
  font-size: 1.2rem;
}

.project-card .project-health-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.project-facts {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  opacity: 0.85;
}

.project-card .project-upcoming {
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

.pace-project-head .project-status {
  margin-left: 6px;
}

/* ---------- 任务池: whitespace, hairlines and hover instead of boxes ---------- */
.detail-panel {
  border-color: transparent;
  background: var(--surface);
}

.tray-item .study-check {
  border: 0;
  border-left: 2px solid color-mix(in srgb, var(--course-color) 70%, transparent);
  border-radius: 8px;
  background: transparent;
  transition: background 150ms ease;
}

.tray-item:hover .study-check {
  background: var(--surface-muted);
}

.tray-item .study-send,
.tray-item .tray-edit,
.tray-item > button {
  border: 0;
  background: transparent;
  opacity: 0.55;
  transition: opacity 150ms ease, background 150ms ease;
}

.tray-item:hover > button {
  opacity: 1;
}

.tray-item > button:hover {
  background: var(--surface-muted);
}

.tray-project + .tray-project,
.tray-loose {
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding-top: 12px;
}

/* ---------- Calendar: paper, hairlines, today as a faint tint ---------- */
.calendar-grid {
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
}

.day-cell {
  border-color: color-mix(in srgb, var(--line) 62%, transparent);
  background: var(--surface-strong);
}

.day-cell.is-today {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-strong));
  box-shadow: none;
}

.day-cell.is-today .day-number {
  background: var(--accent);
  color: var(--accent-ink);
}

.day-cell.has-focus-day,
.day-cell.has-focus-day.is-today {
  background: var(--surface-strong);
}

.day-cell:hover {
  background: color-mix(in srgb, var(--accent) 3%, var(--surface-strong));
  box-shadow: none;
}

.day-cell.is-selected {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-strong));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.app-nav .nav-home {
  background: transparent;
  color: var(--ink);
}

.app-nav a.active,
.app-nav .nav-home.active {
  background: var(--accent-faint);
  color: var(--accent-text);
}

/* Quiet chips and bills: paper with a thin left arc of colour, no coloured boxes. */
.streak-chip {
  background: color-mix(in srgb, var(--line-warm) 14%, var(--surface-strong));
  color: color-mix(in srgb, var(--line-warm) 45%, var(--ink));
  font-weight: 600;
}

.today-bill,
.today-bill.rest,
.today-bill.ahead {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-warm);
  background: var(--surface-strong);
}

.today-bill.rest { border-left-color: var(--line-cool); }
.today-bill.ahead { border-left-color: var(--line-cool); }

.today-bill .bill-title {
  font-weight: 650;
}

.hero-ahead {
  color: var(--muted);
}

.brand-tagline {
  overflow: visible;
  letter-spacing: 0;
  text-overflow: clip;
}

.tray-item .study-check {
  border-left: 0;
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--course-color, var(--line-strong)) 65%, transparent);
  border-radius: 2px 8px 8px 2px;
}

/* =====================================================================
   Echo Line v5 (after the user's reference card): 日出 sun → 日落 moon on one line.
   ===================================================================== */
:root {
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif", serif;
}

.today-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 22px;
  background:
    radial-gradient(60% 70% at 4% 55%, color-mix(in srgb, var(--line-warm) 16%, transparent), transparent 70%),
    radial-gradient(50% 70% at 98% 50%, color-mix(in srgb, var(--line-cool) 16%, transparent), transparent 70%),
    linear-gradient(180deg, #fffdf9, #fcf8f1);
  box-shadow: 0 18px 40px rgba(120, 92, 60, 0.07), 0 2px 6px rgba(120, 92, 60, 0.04);
  padding: 20px 24px 14px;
}

body[data-mode="dark"] .today-hero {
  background:
    radial-gradient(60% 70% at 4% 55%, color-mix(in srgb, var(--line-warm) 14%, transparent), transparent 70%),
    radial-gradient(50% 70% at 98% 50%, color-mix(in srgb, var(--line-cool) 16%, transparent), transparent 70%),
    var(--surface-strong);
}

.el5 {
  position: relative;
  margin: 0;
}

.el5 .sl-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.el5 .sl-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: color-mix(in srgb, var(--line-warm) 30%, #4b3a2b);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.el5 .sl-kicker i {
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--line-warm), color-mix(in srgb, var(--line-warm) 60%, #b86a2a));
}

.el5 .sl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin-top: 10px;
}

.el5 .sl-title {
  margin: 0;
  color: color-mix(in srgb, var(--line-warm) 18%, #3b2e24);
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

body[data-mode="dark"] .el5 .sl-title,
body[data-mode="dark"] .el5 .sl-kicker {
  color: var(--ink);
}

.el5 .sl-title b {
  margin: 0 2px;
  color: color-mix(in srgb, var(--line-warm) 70%, #a35a1c);
  font-size: 2.2em;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  font-variant-numeric: lining-nums;
}

.el5 .sl-title em {
  color: var(--line-cool-text);
  font-style: normal;
}

.el5.state-held .sl-title,
.el5.state-ahead .sl-title {
  color: var(--line-cool-text);
}

.el5 .sl-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.el5 .sl-buffer-chip {
  flex-shrink: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line-cool) 14%, #fffdf9);
  padding: 4px 12px;
  color: var(--line-cool-text);
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line-cool) 24%, transparent);
}

.el5 .sl-stage {
  position: relative;
  height: 150px;
  margin: 4px -8px 0;
}

.el5.compact .sl-stage {
  height: 46px;
  margin: 2px 0 0;
}

.el5 .sl-orbits,
.el5 .sl-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.el5 .sl-orbits path {
  fill: none;
  stroke-width: 1px;
  opacity: 0.7;
}

.el5 .sl-planet {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #fbe3c4, color-mix(in srgb, var(--line-warm) 80%, #e7b67a));
  opacity: 0.75;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: sl-float 7s ease-in-out infinite;
}

.el5 .sl-planet.cool {
  background: radial-gradient(circle at 35% 35%, #eef0f4, color-mix(in srgb, var(--line-cool) 60%, #c6ccd6));
}

.el5 .sl-planet.small {
  width: 8px;
  height: 8px;
  animation-delay: -3s;
}

.el5 .sl-spark {
  position: absolute;
  width: 18px;
  height: 18px;
  background: color-mix(in srgb, var(--line-warm) 85%, #d99a55);
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  opacity: 0.8;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: sl-twinkle 4.5s ease-in-out infinite;
}

.el5 .sl-spark.small {
  width: 11px;
  height: 11px;
  animation-delay: -2s;
}

.el5 .sl-svg line {
  stroke-linecap: round;
}

.el5 .sl-track {
  stroke-width: 2px;
  opacity: 0.22;
}

.el5 .sl-done {
  stroke-width: 4px;
}

.el5 .sl-done-glow {
  stroke-width: 8px;
  opacity: 0.3;
  transition: opacity 260ms ease;
}

.el5 .sl-stage:hover .sl-done-glow {
  opacity: 0.55;
}

.el5 .sl-gap {
  stroke: color-mix(in srgb, var(--line-mid) 80%, #9a8f86);
  stroke-width: 2.5px;
  stroke-dasharray: 0.5 6;
}

.el5 .sl-rest {
  stroke-width: 3px;
  opacity: 0.85;
  transition: opacity 260ms ease;
}

.el5 .sl-stage:hover .sl-rest,
.el5 .sl-stage:hover .sl-track {
  opacity: 1;
}

.el5 .sl-buffer-fill {
  stroke: var(--line-cool);
  stroke-width: 4px;
  stroke-dasharray: 2 5;
}

.el5 .sl-buffer-glow {
  stroke: var(--line-cool);
  stroke-width: 10px;
  opacity: 0.25;
  animation: sl-breathe 3.6s ease-in-out infinite;
}

.el5 .sl-layer {
  position: absolute;
  inset: 0;
}

.el5 .sl-layer > * {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* 日出: a glowing sun. */
.el5 .sl-sun {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: radial-gradient(circle at 38% 34%, #ffe7bf 0%, #f7c078 38%, color-mix(in srgb, var(--line-warm) 70%, #e89a4a) 100%);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--line-warm) 14%, transparent), 0 0 34px 14px color-mix(in srgb, var(--line-warm) 34%, transparent);
  pointer-events: none;
  animation: sl-sun 6s ease-in-out infinite;
}

.el5 .sl-sun i {
  position: absolute;
  inset: -22px;
  border-radius: 999px;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--line-warm) 34%, transparent) 0 1.2deg, transparent 1.2deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 42%, #000 46%, transparent 72%);
  mask: radial-gradient(circle, transparent 42%, #000 46%, transparent 72%);
  opacity: 0.8;
}

/* 日落: a crescent moon. */
.el5 .sl-moon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  box-shadow: inset 11px -3px 0 0 color-mix(in srgb, var(--line-cool) 80%, #56627a), 0 0 30px 8px color-mix(in srgb, var(--line-cool) 22%, transparent);
  pointer-events: none;
}

.el5 .sl-moon i {
  position: absolute;
  top: 6px;
  right: 2px;
  width: 7px;
  height: 7px;
  background: #fff8ea;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: sl-twinkle 3.6s ease-in-out infinite;
}

.el5.compact .sl-sun {
  width: 16px;
  height: 16px;
  box-shadow: 0 0 10px 3px color-mix(in srgb, var(--line-warm) 34%, transparent);
}

.el5.compact .sl-sun i,
.el5.compact .sl-moon i {
  display: none;
}

.el5.compact .sl-moon {
  width: 16px;
  height: 16px;
  box-shadow: inset 4px -1px 0 0 color-mix(in srgb, var(--line-cool) 80%, #56627a);
}

.el5 .sl-end-label {
  top: calc(50% + 44px);
  color: color-mix(in srgb, var(--line-warm) 55%, #8a5a2c);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  pointer-events: none;
}

.el5 .sl-end-label.cool {
  color: var(--line-cool-text);
}

.el5 .sl-bead {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--line-warm);
  box-shadow: 0 0 0 2px #fffdf9;
  pointer-events: none;
}

.el5 .sl-bead.cool {
  background: var(--line-cool);
}

/* Nodes */
.el5 .sl-mark,
.el5 .sl-point {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.el5 .sl-mark > span {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: radial-gradient(circle at 38% 34%, #b7bcc8, color-mix(in srgb, var(--line-cool) 80%, #6e7488));
  box-shadow: 0 0 0 3px #fffdf9, 0 0 0 4px color-mix(in srgb, var(--line-cool) 30%, transparent), 0 3px 10px rgba(70, 76, 96, 0.25);
  transition: transform 220ms cubic-bezier(.3, 1.5, .5, 1);
}

.el5 .sl-tick {
  position: absolute;
  left: 50%;
  bottom: 30px;
  height: 22px;
  border-left: 2px dotted color-mix(in srgb, var(--line-cool) 70%, transparent);
  transform: translateX(-50%);
}

.el5.compact .sl-tick {
  display: none;
}

.el5 .sl-point > span {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at 38% 32%, #ffe2b5, color-mix(in srgb, var(--line-warm) 85%, #e0913f));
  box-shadow: 0 0 0 3px #fffdf9, 0 4px 14px color-mix(in srgb, var(--line-warm) 60%, transparent);
  transition: transform 220ms cubic-bezier(.3, 1.5, .5, 1);
}

.el5.compact .sl-mark > span { width: 12px; height: 12px; }
.el5.compact .sl-point > span { width: 14px; height: 14px; }

.el5 .sl-halo {
  position: absolute;
  inset: -14px;
  border-radius: 999px;
  background: radial-gradient(circle, transparent 42%, color-mix(in srgb, var(--line-warm) 16%, transparent) 43%, transparent 60%, color-mix(in srgb, var(--line-warm) 10%, transparent) 62%, transparent 76%);
  pointer-events: none;
}

.el5.compact .sl-halo { display: none; }

.el5.state-held .sl-point > span,
.el5.state-ahead .sl-point > span {
  background: radial-gradient(circle at 38% 32%, #eef1f6, color-mix(in srgb, var(--line-cool) 85%, #6e7488));
  box-shadow: 0 0 0 3px #fffdf9, 0 4px 14px color-mix(in srgb, var(--line-cool) 55%, transparent);
}

.el5.state-held .sl-halo,
.el5.state-ahead .sl-halo {
  background: radial-gradient(circle, transparent 42%, color-mix(in srgb, var(--line-cool) 16%, transparent) 43%, transparent 60%, color-mix(in srgb, var(--line-cool) 10%, transparent) 62%, transparent 76%);
}

.el5.state-start .sl-point,
.el5.state-held .sl-mark > span {
  opacity: 0;
}

.el5.state-start .sl-point {
  pointer-events: none;
}

.el5 .sl-point.near > span,
.el5 .sl-point:hover > span,
.el5 .sl-mark.near > span,
.el5 .sl-mark:hover > span {
  transform: scale(1.18);
}

.el5 .sl-ripple,
.el5 .sl-wave,
.el5 .sl-echo {
  position: absolute;
  inset: 6px;
  border: 1.5px solid var(--line-cool);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
}

.el5 .sl-mark.pulse .sl-ripple {
  animation: sl-ripple 1.3s cubic-bezier(.2, .6, .3, 1) 1;
}

.el5 .sl-mark.pulse .sl-ripple.r2 { animation-delay: 0.22s; }
.el5 .sl-mark.arrive .sl-ripple { animation-duration: 2.2s; }
.el5 .sl-mark.arrive .sl-ripple.r2 { animation-delay: 0.5s; }

.el5 .sl-echo {
  border-color: var(--line-warm);
  animation: sl-ripple 3.2s ease-out infinite;
}

.el5.state-held .sl-echo,
.el5.state-ahead .sl-echo {
  border-color: var(--line-cool);
}

.el5 .sl-wave {
  animation: sl-wave 3.4s ease-out infinite;
}

.el5 .sl-wave.w2 { animation-delay: 1.7s; }

.el5 .sl-pill {
  top: calc(50% + 38px);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.92);
  padding: 4px 12px;
  color: var(--line-cool-text);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line-cool) 18%, transparent), 0 4px 12px rgba(90, 70, 50, 0.08);
  pointer-events: none;
}

.el5 .sl-pill.warm {
  color: color-mix(in srgb, var(--line-warm) 45%, #6b4424);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line-warm) 26%, transparent), 0 4px 12px rgba(150, 100, 50, 0.1);
}

/* Hover helpers */
.el5 .sl-follow {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--line-mid) 60%, transparent), transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, width 200ms ease, height 200ms ease;
}

.el5 .sl-stage:hover .sl-follow { opacity: 1; }
.el5 .sl-follow.snapped { width: 40px; height: 40px; }

.el5 .sl-runner {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #fffdf9;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--line-warm) 70%, transparent), 0 0 12px 3px color-mix(in srgb, var(--line-warm) 60%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.el5 .sl-runner.on { opacity: 1; }

.el5 .sl-trail {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--line-mid);
  pointer-events: none;
  animation: sl-trail 0.8s ease-out forwards;
}

.el5 .sl-tip {
  z-index: 3;
  top: calc(50% + 22px);
  display: grid;
  gap: 2px;
  min-width: 150px;
  border-radius: 10px;
  background: #3a3029;
  padding: 8px 11px;
  color: #fffaf2;
  font-size: 0.76rem;
  line-height: 1.45;
  text-align: left;
  transform: translate(-50%, 0);
  box-shadow: 0 10px 24px rgba(40, 30, 20, 0.18);
  pointer-events: none;
}

.el5 .sl-tip[hidden] { display: none; }
.el5 .sl-tip span { opacity: 0.78; }

/* 已完成 · 安全线 · 今日可投入 */
.el5 .sl-stats {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  margin: 6px auto 0;
  max-width: 560px;
}

.el5 .sl-stats div {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 2px 8px;
}

.el5 .sl-stats div + div {
  border-left: 1px solid color-mix(in srgb, var(--line-strong) 70%, transparent);
}

.el5 .sl-stats span {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.el5 .sl-stats b {
  color: #3b2e24;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  font-variant-numeric: lining-nums;
}

body[data-mode="dark"] .el5 .sl-stats b { color: var(--ink); }
.el5 .sl-stats b.warm { color: color-mix(in srgb, var(--line-warm) 70%, #a35a1c); }
.el5 .sl-stats b.cool { color: var(--line-cool-text); }

.el5 .sl-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 0;
  color: color-mix(in srgb, var(--line-warm) 30%, #7a6250);
  font-family: var(--serif);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  justify-content: center;
}

.el5 .sl-foot span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--line-warm) 40%, transparent));
}

.el5 .sl-foot span:last-child {
  background: linear-gradient(90deg, color-mix(in srgb, var(--line-warm) 40%, transparent), transparent);
}

.el5.compact .sl-head {
  margin-top: 0;
}

.el5.compact .sl-title {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.el5.compact .sl-title b {
  font-size: 1.3em;
}

.el5.compact .sl-buffer-chip {
  padding: 2px 8px;
  font-size: 0.74rem;
}

.pace-panel .el5 {
  padding: 4px 14px 2px;
}

@keyframes sl-ripple {
  0% { opacity: 0.55; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(2.8); }
}

@keyframes sl-wave {
  0% { opacity: 0.45; transform: translateX(0) scale(0.9); }
  100% { opacity: 0; transform: translateX(18px) scale(2.4); }
}

@keyframes sl-breathe {
  0%, 100% { opacity: 0.14; }
  50% { opacity: 0.32; }
}

@keyframes sl-trail {
  0% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
}

@keyframes sl-float {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -4px; }
}

@keyframes sl-twinkle {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.35; }
}

@keyframes sl-sun {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .el5 .sl-echo, .el5 .sl-wave, .el5 .sl-buffer-glow, .el5 .sl-mark.pulse .sl-ripple,
  .el5 .sl-planet, .el5 .sl-spark, .el5 .sl-sun, .el5 .sl-moon i {
    animation: none;
  }
}

@media (max-width: 600px) {
  .today-hero { padding: 16px 16px 12px; }
  .el5 .sl-title { font-size: 1.2rem; }
  .el5 .sl-stage { height: 130px; margin: 4px -4px 0; }
  .el5 .sl-sun, .el5 .sl-moon { width: 30px; height: 30px; }
  .el5 .sl-moon { box-shadow: inset 7px -2px 0 0 color-mix(in srgb, var(--line-cool) 80%, #56627a); }
  .el5 .sl-stats b { font-size: 1.2rem; }
  .el5 .sl-pill { font-size: 0.7rem; padding: 3px 8px; }
}

/* Lighter paper for every palette (large areas stay almost white cream). */
body[data-mode="light"] {
  --bg: #fbf9f5;
  --surface: #fdfbf8;
  --surface-strong: #fffefb;
  --surface-muted: #f7f3ed;
  --line: #efe9df;
  --line-strong: #e3dbce;
  --muted: #847c72;
}

/* The done check: a soft tint of the palette with a darker tick, not a solid dark disc. */
.today-check {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
  color: var(--accent-text);
  font-size: 0.7rem;
  font-weight: 700;
}

.today-task.done .today-check,
.loose-list li.done .today-check {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-strong));
  color: color-mix(in srgb, var(--accent-text) 85%, #000);
}

.today-task.done .today-task-title {
  color: var(--muted);
  text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent);
}

.brand {
  grid-template-columns: 34px minmax(0, 1fr) 30px;
}

.brand-mark.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.el5 .sl-pill.lean-left { transform: translate(calc(-100% + 16px), -50%); }
.el5 .sl-pill.lean-right { transform: translate(-16px, -50%); }

/* =====================================================================
   回响之书 v4: a closed hardcover that opens into week spreads on cotton card paper.
   One colour family: cream paper, sand linen, soft grey-brown ink, a touch of grey-blue.
   ===================================================================== */
.wb-view {
  --wb-paper: #f8f2e7;
  --wb-paper-deep: #f1e8d9;
  --wb-edge: #e6d9c4;
  --wb-ink: #4b4037;
  --wb-muted: #928575;
  --wb-line: #e3d6c1;
  --wb-sand: #dccbb0;
  --wb-sand-deep: #cdb999;
  --wb-deboss: #a99273;
  --wb-blue: #9fb4c9;
  --wb-sage: #97a28b;
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: center;
  justify-items: center;
  gap: 10px;
  padding: 24px 16px 18px;
  background:
    radial-gradient(80% 60% at 50% 45%, rgba(255, 250, 240, 0.96), rgba(236, 226, 210, 0.97));
  backdrop-filter: blur(6px);
  animation: wb-fade 260ms ease;
}

@keyframes wb-fade {
  from { opacity: 0; }
}

.wb-close {
  position: absolute;
  z-index: 2; /* Above the full-size perspective stage, which otherwise eats clicks. */
  top: 16px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.9);
  color: var(--wb-ink);
  font-size: 1.3rem;
  box-shadow: 0 0 0 1px var(--wb-line);
  cursor: pointer;
}

.wb-stage {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  perspective: 2400px;
}

.wb-book {
  --W: 460px;
  --H: 598px;
  --stack-l: 0;
  --stack-r: 0;
  position: relative;
  width: calc(var(--W) * 2);
  height: var(--H);
  transform-style: preserve-3d;
  transition: transform 1000ms cubic-bezier(.5, 0, .3, 1);
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.wb-book:active {
  cursor: grabbing;
}

/* Closed: only the cover, centred. */
.wb-book.closed {
  transform: translateX(calc(var(--W) * -0.5));
}

.wb-book.closed .wb-page.left,
.wb-page.left.blank {
  visibility: hidden;
}

/* Cotton card paper: warm cream, faint fibres and grain, matte. */
.wb-paper {
  background-color: var(--wb-paper);
  background-image:
    var(--paper-fiber),
    var(--paper-grain),
    radial-gradient(120% 90% at 50% 40%, rgba(255, 253, 248, 0.7), transparent 70%),
    linear-gradient(180deg, #faf5ec, var(--wb-paper-deep));
  color: var(--wb-ink);
}

.wb-page {
  position: absolute;
  top: 0;
  width: var(--W);
  height: var(--H);
  box-shadow: 0 1px 0 rgba(120, 95, 65, 0.08);
}

.wb-page.left {
  left: 0;
  border-radius: 6px 2px 2px 6px;
  box-shadow: -18px 22px 40px -18px rgba(70, 50, 30, 0.35);
}

.wb-page.right {
  left: var(--W);
  border-radius: 2px 6px 6px 2px;
  box-shadow: 18px 22px 40px -18px rgba(70, 50, 30, 0.35);
}

.wb-page-host {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

/* The page block: thin cream sheets stacked outside each page. */
.wb-page::after {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 2px;
  width: calc(var(--s) * 1.6px);
  background: repeating-linear-gradient(90deg, #e7dbc6 0 0.6px, #fbf6ec 0.6px 1.6px);
  pointer-events: none;
}

.wb-page.left::after {
  --s: var(--stack-l);
  right: 100%;
  border-radius: 3px 0 0 3px;
}

.wb-page.right::after {
  --s: var(--stack-r);
  left: 100%;
  border-radius: 0 3px 3px 0;
}

/* The shadow a turning page throws on the page below. */
.wb-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: rgba(60, 42, 25, calc(var(--cast, 0) * 0.4));
  pointer-events: none;
}

/* Near the spine: the paper curves into the binding. */
.wb-gutter {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 16%;
  pointer-events: none;
}

.wb-page.left .wb-gutter {
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(110, 85, 60, 0.05) 55%, rgba(90, 65, 40, 0.16) 92%, rgba(70, 50, 30, 0.24));
}

.wb-page.right .wb-gutter {
  left: 0;
  background: linear-gradient(270deg, transparent, rgba(110, 85, 60, 0.05) 55%, rgba(90, 65, 40, 0.14) 92%, rgba(70, 50, 30, 0.22));
}

.wb-page.is-cover {
  background: none;
  box-shadow: 16px 24px 44px -16px rgba(70, 50, 30, 0.45), 2px 2px 0 #eee4d3, 4px 4px 0 #e2d5bf;
}

.wb-page.is-cover .wb-gutter {
  display: none;
}

.wb-settle {
  animation: wb-settle 520ms cubic-bezier(.3, 1.4, .5, 1);
}

@keyframes wb-settle {
  0% { transform: translateY(-2px); }
  60% { transform: translateY(0.6px); }
  100% { transform: none; }
}

/* ---------- the turning layer ---------- */
.wb-turn {
  position: absolute;
  top: 0;
  left: var(--W);
  z-index: 5;
  width: 0;
  height: var(--H);
  transform-style: preserve-3d;
}

.wb-leaf-up,
.wb-leaf-down {
  position: absolute;
  top: 0;
  width: var(--W);
  height: var(--H);
  overflow: hidden;
}

.wb-leaf-down-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  filter: drop-shadow(0 6px 12px rgba(60, 40, 20, 0.18)) drop-shadow(0 1px 1px rgba(60, 40, 20, 0.12));
}

.wb-leaf-down {
  left: 0;
  transform-origin: 0 0;
}

.wb-fx {
  position: absolute;
  top: 0;
  overflow: visible;
  pointer-events: none;
}

/* The hard cover board. */
.wb-board {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--W);
  height: var(--H);
  transform-origin: 0 50%;
  transform-style: preserve-3d;
}

.wb-board-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 2px 6px 6px 2px;
  backface-visibility: hidden;
}

.wb-board-face.back {
  border-radius: 6px 2px 2px 6px;
  transform: rotateY(180deg);
}

.wb-board-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(60, 40, 20, 0.5), rgba(60, 40, 20, 0.2));
  opacity: 0;
  pointer-events: none;
}

/* ---------- page content ---------- */
.wb-page-in {
  position: absolute;
  inset: 0;
  font-size: calc(var(--W) / 32);
  line-height: 1.45;
}

.wb-kicker {
  margin: 0;
  color: var(--wb-muted);
  font-size: 0.72em;
  letter-spacing: 0.24em;
}

/* Cover: sand linen, a blind-stamped frame, the title in soft cocoa. */
.wb-cover {
  display: grid;
  place-items: center;
  border-radius: 2px 6px 6px 2px;
  background-color: var(--wb-sand);
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(90, 70, 45, 0.05) 0 1px, transparent 1px 3px),
    var(--paper-fiber),
    radial-gradient(120% 90% at 30% 20%, rgba(255, 248, 235, 0.45), transparent 60%),
    linear-gradient(160deg, #e3d4bb, var(--wb-sand-deep));
  color: #5d4d3d;
  text-align: center;
}

.wb-cover-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 7%;
  background: linear-gradient(90deg, rgba(90, 68, 45, 0.28), rgba(90, 68, 45, 0.08) 70%, rgba(255, 250, 240, 0.35) 88%, rgba(90, 68, 45, 0.12));
}

.wb-cover-frame {
  position: absolute;
  inset: 8% 9% 8% 13%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.9em;
  border: 1px solid rgba(169, 146, 115, 0.7);
  box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 6px rgba(169, 146, 115, 0.4), 0 1px 0 rgba(255, 250, 240, 0.5);
}

.wb-cover-kicker {
  margin: 0;
  color: #8a735a;
  font-size: 0.72em;
  letter-spacing: 0.3em;
}

.wb-cover h2 {
  margin: 0.2em 0 0;
  color: #574535;
  font-family: var(--serif);
  font-size: 2.7em;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-shadow: 0 1px 0 rgba(255, 250, 240, 0.55), 0 -1px 0 rgba(80, 60, 40, 0.18);
}

.wb-emblem {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.4;
}

.wb-emblem circle {
  fill: currentColor;
  stroke: none;
}

.wb-cover .wb-emblem {
  color: #9c8465;
}

.wb-cover-year {
  margin: 0;
  color: #6b5846;
  font-family: var(--serif);
  font-size: 1.9em;
  letter-spacing: 0.2em;
}

.wb-cover-name {
  margin: 1.6em 0 0;
  padding-top: 0.8em;
  border-top: 1px solid rgba(169, 146, 115, 0.6);
  color: #5d4d3d;
  font-family: var(--serif);
  font-size: 1.15em;
  letter-spacing: 0.3em;
}

.wb-cover-stats {
  margin: 0;
  color: #8a735a;
  font-size: 0.72em;
  letter-spacing: 0.12em;
}

/* Endpapers and title pages. */
.wb-endpaper {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.4em;
  background:
    radial-gradient(circle at 20% 30%, transparent 0 30px, rgba(169, 146, 115, 0.14) 31px 32px, transparent 33px 52px, rgba(169, 146, 115, 0.1) 53px 54px, transparent 55px),
    radial-gradient(circle at 80% 75%, transparent 0 40px, rgba(159, 180, 201, 0.14) 41px 42px, transparent 43px 70px, rgba(159, 180, 201, 0.1) 71px 72px, transparent 73px),
    linear-gradient(180deg, rgba(220, 203, 176, 0.22), rgba(220, 203, 176, 0.32));
  color: var(--wb-muted);
  text-align: center;
}

.wb-endpaper p {
  margin: 0;
  font-size: 0.8em;
  letter-spacing: 0.3em;
}

.wb-endpaper h3 {
  margin: 0;
  color: var(--wb-ink);
  font-family: var(--serif);
  font-size: 1.6em;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.wb-title {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1em;
  padding: 12%;
  text-align: center;
}

.wb-title h2 {
  margin: 0;
  color: var(--wb-ink);
  font-family: var(--serif);
  font-size: 2em;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.wb-title .wb-emblem {
  color: var(--wb-deboss);
}

.wb-title dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em 2em;
  width: 100%;
  margin: 0.6em 0;
  padding: 1.2em 0;
  border-top: 1px solid var(--wb-line);
  border-bottom: 1px solid var(--wb-line);
}

.wb-title dt {
  color: var(--wb-muted);
  font-size: 0.74em;
  letter-spacing: 0.12em;
}

.wb-title dd {
  margin: 0.2em 0 0;
  color: var(--wb-ink);
  font-family: var(--serif);
  font-size: 1.5em;
}

.wb-title-line {
  margin: 0;
  color: var(--wb-muted);
  font-family: var(--serif);
  font-size: 0.92em;
  letter-spacing: 0.08em;
  line-height: 1.8;
}

/* ---------- the week spread ---------- */
.wb-week {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.8em;
  padding: 7% 6% 5% 7%;
}

.wb-week.right {
  padding: 7% 7% 5% 6%;
}

.wb-week-head {
  display: grid;
  gap: 0.2em;
  padding-bottom: 0.7em;
  border-bottom: 1px solid var(--wb-line);
}

.wb-week-head.right {
  justify-items: end;
  text-align: right;
}

.wb-week-head h3 {
  margin: 0;
  color: var(--wb-ink);
  font-family: var(--serif);
  font-size: 1.3em;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.wb-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 0;
}

.wb-day {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0 0.55em;
}

.wb-day + .wb-day {
  border-left: 1px dashed rgba(169, 146, 115, 0.35);
}

.wb-day:first-child {
  padding-left: 0;
}

.wb-day:last-child {
  padding-right: 0;
}

.wb-day header {
  display: flex;
  align-items: baseline;
  gap: 0.35em;
}

.wb-day header b {
  color: var(--wb-ink);
  font-family: var(--serif);
  font-size: 1.9em;
  font-weight: 500;
  line-height: 1;
}

.wb-day header span {
  display: grid;
  line-height: 1.15;
}

.wb-day header em {
  color: var(--wb-ink);
  font-size: 0.78em;
  font-style: normal;
}

.wb-day header small {
  color: var(--wb-muted);
  font-size: 0.56em;
  letter-spacing: 0.16em;
}

.wb-day.today header b {
  position: relative;
}

.wb-day.today header b::after {
  content: "";
  position: absolute;
  inset: -0.12em -0.22em;
  border: 1px solid rgba(159, 180, 201, 0.7);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.wb-day.quiet header b,
.wb-day.quiet header em {
  color: var(--wb-muted);
}

.wb-day-meta {
  margin: 0.35em 0 0.5em;
  padding-bottom: 0.45em;
  border-bottom: 1px solid rgba(169, 146, 115, 0.25);
  color: var(--wb-muted);
  font-size: 0.64em;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.wb-day ul {
  display: grid;
  gap: 0.45em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wb-day li {
  display: grid;
  grid-template-columns: 0.9em minmax(0, 1fr);
  column-gap: 0.3em;
  font-size: 0.74em;
  line-height: 1.35;
}

.wb-day li small {
  grid-column: 2;
  color: var(--wb-muted);
  font-size: 0.82em;
}

.wb-dot {
  width: 0.45em;
  height: 0.45em;
  margin-top: 0.42em;
  border: 1px solid var(--c);
  border-radius: 999px;
}

.wb-text {
  overflow-wrap: anywhere;
}

/* Finished: the words stay, struck through by hand with a soft pencil line. */
.wb-day li.done .wb-text {
  color: rgba(75, 64, 55, 0.62);
}

.wb-day li.done s {
  text-decoration: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='10' viewBox='0 0 90 10'%3E%3Cpath d='M0 5.2C9 4.1 17 5.9 27 5 37 4.2 44 6.1 55 5.3 66 4.5 76 5.8 90 5.2' fill='none' stroke='%23806b58' stroke-opacity='.72' stroke-width='1.25' stroke-linecap='round'/%3E%3Cpath d='M3 6C20 5.6 36 6.5 52 5.9 67 5.4 80 6.2 88 5.8' fill='none' stroke='%23806b58' stroke-opacity='.25' stroke-width='.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 90px 0.72em;
  background-position: var(--sx, 0) var(--sy, 55%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.wb-tick {
  position: relative;
  width: 0.62em;
  height: 0.62em;
  margin-top: 0.34em;
}

.wb-tick::before {
  content: "";
  position: absolute;
  left: 0.12em;
  top: -0.02em;
  width: 0.26em;
  height: 0.5em;
  border-right: 1.3px solid var(--wb-sage);
  border-bottom: 1.3px solid var(--wb-sage);
  transform: rotate(40deg);
  opacity: 0.9;
}

.wb-rest {
  margin: 0.2em 0 0;
  color: rgba(146, 133, 117, 0.7);
  font-family: var(--serif);
  font-size: 0.68em;
  letter-spacing: 0.1em;
}

.wb-more {
  margin: 0.4em 0 0;
  color: var(--wb-muted);
  font-size: 0.64em;
}

.wb-note {
  position: relative;
  margin: auto 0 0;
  padding: 0.7em 0 0 0.7em;
  color: #7a6a5c;
  font-family: var(--serif);
  font-size: 0.68em;
  line-height: 1.55;
}

.wb-note::before {
  content: "";
  position: absolute;
  top: 0.9em;
  bottom: 0.1em;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(159, 180, 201, 0.7), rgba(159, 180, 201, 0.1));
}

.wb-summary {
  border-radius: 0.5em;
  background: linear-gradient(180deg, rgba(220, 203, 176, 0.18), rgba(220, 203, 176, 0.08));
  padding: 0.6em 0.6em 0.8em !important;
}

.wb-summary header {
  align-items: center;
  color: var(--wb-deboss);
}

.wb-summary dl {
  display: grid;
  gap: 0.55em;
  margin: 0.8em 0;
}

.wb-summary dl div {
  display: grid;
}

.wb-summary dt {
  color: var(--wb-muted);
  font-size: 0.6em;
  letter-spacing: 0.14em;
}

.wb-summary dd {
  margin: 0;
  color: var(--wb-ink);
  font-family: var(--serif);
  font-size: 1.05em;
}

.wb-summary-line {
  margin: auto 0 0;
  color: #7a6a5c;
  font-family: var(--serif);
  font-size: 0.66em;
  line-height: 1.6;
}

.wb-folio {
  color: rgba(146, 133, 117, 0.8);
  font-size: 0.6em;
  letter-spacing: 0.24em;
}

.wb-folio.right {
  text-align: right;
}

/* ---------- controls ---------- */
.wb-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wb-nav button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.9);
  color: #5d4d3d;
  font-size: 1.2rem;
  box-shadow: 0 0 0 1px #e3d6c1;
  cursor: pointer;
}

.wb-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}

.wb-progress {
  min-width: 150px;
  color: #6b5846;
  font-family: var(--serif);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-align: center;
}

.wb-hint {
  margin: 0;
  color: #9a8a78;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

/* The small book on the export card, same family as the real one. */
.book-cover-mini.wb-mini {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border-radius: 2px 6px 6px 2px;
  background:
    linear-gradient(90deg, rgba(90, 68, 45, 0.22), transparent 12%),
    linear-gradient(160deg, #e3d4bb, #cdb999);
  box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 6px rgba(169, 146, 115, 0.45), 3px 4px 0 #efe6d6, 8px 12px 20px -8px rgba(70, 50, 30, 0.35);
  color: #574535;
}

.book-cover-mini.wb-mini span {
  font-family: var(--serif);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
}

.book-cover-mini.wb-mini small {
  color: #8a735a;
  font-family: var(--serif);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}

@media (max-width: 760px) {
  .wb-page-in {
    font-size: calc(var(--W) / 30);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wb-book { transition: none; }
}

/* ---------- Echo Line v6: moon → sun. Grey until the line is held; then the sun lights up
   and anything past the line (缓冲) turns warm. ---------- */
:root {
  --line-grey: #b0b0b3;
}

.el5 .sl-point > span {
  background: radial-gradient(circle at 38% 32%, #f4f5f7, color-mix(in srgb, var(--line-cool) 80%, #8fa6bd));
  box-shadow: 0 0 0 3px #fffdf9, 0 4px 12px color-mix(in srgb, var(--line-cool) 45%, transparent);
}

.el5 .sl-halo {
  background: radial-gradient(circle, transparent 42%, color-mix(in srgb, var(--line-cool) 16%, transparent) 43%, transparent 60%, color-mix(in srgb, var(--line-cool) 10%, transparent) 62%, transparent 76%);
}

.el5 .sl-echo {
  border-color: var(--line-cool);
}

.el5.state-held .sl-point > span,
.el5.state-ahead .sl-point > span {
  background: radial-gradient(circle at 38% 32%, #fff0d2, color-mix(in srgb, var(--line-warm) 85%, #e0913f));
  box-shadow: 0 0 0 3px #fffdf9, 0 4px 14px color-mix(in srgb, var(--line-warm) 60%, transparent);
}

.el5.state-held .sl-halo,
.el5.state-ahead .sl-halo {
  background: radial-gradient(circle, transparent 42%, color-mix(in srgb, var(--line-warm) 18%, transparent) 43%, transparent 60%, color-mix(in srgb, var(--line-warm) 11%, transparent) 62%, transparent 76%);
}

.el5.state-held .sl-echo,
.el5.state-ahead .sl-echo,
.el5.state-ahead .sl-wave {
  border-color: var(--line-warm);
}

.el5.state-held .sl-ripple,
.el5.state-ahead .sl-ripple {
  border-color: var(--line-warm);
}

.el5 .sl-buffer-fill {
  stroke: var(--line-warm);
}

.el5 .sl-buffer-glow {
  stroke: var(--line-warm);
}

.el5 .sl-title b,
.el5 .sl-stats b.warm {
  color: var(--line-cool-text);
}

.el5.state-held .sl-title,
.el5.state-ahead .sl-title,
.el5.state-held .sl-title em,
.el5.state-ahead .sl-title em {
  color: color-mix(in srgb, var(--line-warm) 55%, #7a4a20);
}

.el5.state-held .sl-stats b.warm,
.el5.state-ahead .sl-stats b.warm {
  color: color-mix(in srgb, var(--line-warm) 70%, #a35a1c);
}

.el5 .sl-buffer-chip {
  background: color-mix(in srgb, var(--line-warm) 14%, #fffdf9);
  color: color-mix(in srgb, var(--line-warm) 45%, #7a4a20);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line-warm) 30%, transparent);
}

.el5 .sl-runner {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--line-cool) 70%, transparent), 0 0 12px 3px color-mix(in srgb, var(--line-cool) 55%, transparent);
}

/* The sun: warm core in two soft wavy halos. */
.el5 .sl-sun {
  width: 76px;
  height: 76px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  animation: none;
  transition: filter 600ms ease, opacity 600ms ease;
}

.el5 .sl-sun svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.el5 .sun-halo {
  fill: none;
  stroke: #f3b267;
  stroke-width: 1.6;
  stroke-opacity: 0.6;
  transform-box: fill-box;
  transform-origin: center;
  animation: sl-halo 28s linear infinite;
}

.el5 .sun-halo.h2 {
  stroke-width: 1.1;
  stroke-opacity: 0.32;
  animation-duration: 40s;
  animation-direction: reverse;
}

.el5 .sun-glow {
  opacity: 0.8;
}

/* Not held yet: a pale grey sun waiting at the end of the line. */
.el5:not(.state-held):not(.state-ahead):not(.state-free) .sl-sun {
  filter: grayscale(1) brightness(1.12);
  opacity: 0.5;
}

.el5:not(.state-held):not(.state-ahead):not(.state-free) .sun-halo {
  animation-play-state: paused;
}

.el5.state-ahead .sun-glow {
  opacity: 1;
  transform: scale(1.12);
  transform-box: fill-box;
  transform-origin: center;
}

.el5.state-ahead .sl-sun {
  filter: drop-shadow(0 0 14px rgba(245, 170, 90, 0.45));
}

.el5 .sl-moon {
  box-shadow: inset 11px -3px 0 0 color-mix(in srgb, var(--line-cool) 80%, #56627a), 0 0 26px 6px color-mix(in srgb, var(--line-cool) 18%, transparent);
}

.el5.compact .sl-sun {
  width: 26px;
  height: 26px;
}

@keyframes sl-halo {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .el5 .sun-halo { animation: none; }
}

@media (max-width: 600px) {
  .el5 .sl-sun { width: 48px; height: 48px; }
}

/* Keep the latest desktop composition from overriding the narrow-screen stack. */
@media (min-width: 1101px) {
  .today-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr);
  }
}

.today-hero {
  padding: 18px 20px 12px;
}

.el5 .sl-stage {
  height: 132px;
}

.el5 .sl-title {
  font-size: 1.4rem;
}

/* ---------- 回响之书 v5: thick stiff sheets (no curl), a smooth cloth cover ---------- */
.wb-sheet {
  --t: 3px;
  position: absolute;
  top: 0;
  left: 0;
  width: var(--W);
  height: var(--H);
  transform-origin: 0 50%;
  transform-style: preserve-3d;
  will-change: transform;
}

.wb-sheet.cover {
  --t: 7px;
}

.wb-sheet-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 2px 6px 6px 2px;
  backface-visibility: hidden;
  transform: translateZ(calc(var(--t) / 2));
  box-shadow: inset -1px 0 0 rgba(150, 125, 95, 0.18), inset 0 -1px 0 rgba(150, 125, 95, 0.12);
}

.wb-sheet-face.back {
  border-radius: 6px 2px 2px 6px;
  transform: rotateY(180deg) translateZ(calc(var(--t) / 2));
  box-shadow: inset 1px 0 0 rgba(150, 125, 95, 0.18), inset 0 -1px 0 rgba(150, 125, 95, 0.12);
}

.wb-sheet-shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(90deg, rgba(70, 50, 30, 0.42), rgba(70, 50, 30, 0.12) 70%, rgba(70, 50, 30, 0.2));
  opacity: 0;
  pointer-events: none;
}

/* The sheet's outer edge: layered cream fibres, visible while it stands up. */
.wb-sheet-edge {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: calc(var(--W) - var(--t) / 2);
  width: var(--t);
  background: repeating-linear-gradient(90deg, #efe5d4 0 0.7px, #fbf6ec 0.7px 1.5px);
  transform: rotateY(90deg);
}

.wb-sheet.cover .wb-sheet-edge {
  background: linear-gradient(90deg, #c9b597, #dccab0);
}

/* Thicker page block on both sides, with a bottom edge too. */
.wb-page::after {
  width: calc(var(--s) * 2.2px);
  background: repeating-linear-gradient(90deg, #e2d4bc 0 0.8px, #fbf6ec 0.8px 2.2px);
  box-shadow: 0 2px 3px rgba(90, 70, 45, 0.12);
}

.wb-paper {
  box-shadow: inset 0 0 0 1px rgba(255, 252, 245, 0.6), inset 0 -2px 3px rgba(150, 125, 95, 0.08);
}

.wb-page.left,
.wb-page.right {
  box-shadow: 0 2px 0 #eadfcd, 0 3px 0 #f7f0e3, 0 4px 0 #e3d6c1, 0 24px 44px -18px rgba(70, 50, 30, 0.38);
}

/* Cover: smooth sand cloth, no grid — soft light, faint fibres, a blind-stamped frame. */
.wb-cover {
  background-color: var(--wb-sand);
  background-image:
    var(--paper-fiber),
    radial-gradient(90% 70% at 28% 18%, rgba(255, 249, 238, 0.55), transparent 62%),
    radial-gradient(80% 60% at 85% 95%, rgba(150, 120, 85, 0.16), transparent 60%),
    linear-gradient(165deg, #e6d8c1, #d6c4a6);
}

.wb-page.is-cover {
  box-shadow: 0 2px 0 #eadfcd, 0 3px 0 #f7f0e3, 0 4px 0 #e3d6c1, 6px 0 0 -1px #efe6d6, 18px 26px 46px -16px rgba(70, 50, 30, 0.45);
}

.wb-day.quiet {
  opacity: 0.55;
}

/* =====================================================================
   Echo Line v7 (reference card 2): 日落 moon → 日出 sun, header on one line, light-drawn
   sun and moon shared by the hero card and the calendar's thin line.
   ===================================================================== */
.today-hero {
  background:
    radial-gradient(45% 80% at 2% 58%, color-mix(in srgb, var(--line-cool) 16%, transparent), transparent 70%),
    radial-gradient(45% 80% at 99% 58%, color-mix(in srgb, var(--line-warm) 20%, transparent), transparent 70%),
    linear-gradient(180deg, #fffdf9, #fcf8f1);
}

.el5 .sl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 0;
}

.el5 .sl-kicker {
  flex-shrink: 0;
  font-size: 1rem;
}

.el5 .sl-divider {
  width: 1px;
  height: 18px;
  background: color-mix(in srgb, var(--line-strong) 90%, transparent);
}

.el5 .sl-title {
  font-size: 1.3rem;
}

.el5 .sl-title b {
  font-size: 1.75em;
}

.el5 .sl-head-extra {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.el5 .sl-head-extra:empty {
  display: none;
}

.el5 .sl-sub {
  margin-top: 4px;
}

/* The line: slate from the moon to the safety node, warm on toward the sun. */
.el5 .sl-done {
  stroke: color-mix(in srgb, var(--line-cool) 85%, #4a5670);
}

.el5 .sl-done-glow {
  stroke: var(--line-cool);
}

.el5 .sl-rest {
  opacity: 0.7;
}

.el5 .sl-track {
  opacity: 0.18;
}

/* ---- Moon ---- */
.sl-moon2 {
  --m: 30px;
  position: relative;
  display: block;
  width: var(--m);
  height: var(--m);
}

.sl-moon2 i {
  position: absolute;
  pointer-events: none;
}

.moon-haze {
  inset: -110%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--line-cool) 30%, transparent), transparent 62%);
}

/* A dark disc with its lit crescent on the right. */
.moon-disc {
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 40%, #56647f, #2f3a52 75%);
  box-shadow:
    inset calc(var(--m) * -0.2) calc(var(--m) * 0.04) 0 0 #f3e9d4,
    inset calc(var(--m) * -0.26) calc(var(--m) * 0.06) calc(var(--m) * 0.14) 0 rgba(243, 233, 212, 0.45),
    0 0 calc(var(--m) * 0.5) rgba(120, 140, 180, 0.25);
}

.moon-star {
  top: -8%;
  right: -26%;
  width: calc(var(--m) * 0.22);
  height: calc(var(--m) * 0.22);
  background: #f6ecd8;
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  opacity: 0.9;
  animation: sl-twinkle 3.8s ease-in-out infinite;
}

.moon-star.s2 {
  top: auto;
  right: auto;
  bottom: 6%;
  left: -30%;
  width: calc(var(--m) * 0.14);
  height: calc(var(--m) * 0.14);
  animation-delay: -1.6s;
}

/* ---- Sun ---- */
.sl-sun2 {
  --s: 30px;
  position: relative;
  display: block;
  width: var(--s);
  height: var(--s);
}

.sl-sun2 i {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.sun-haze {
  inset: -90%;
  background: radial-gradient(circle, rgba(255, 196, 120, 0.42), rgba(255, 196, 120, 0.12) 45%, transparent 68%);
  transition: opacity 600ms ease, transform 600ms ease;
}

.sun-rays {
  inset: -62%;
  background: repeating-conic-gradient(from 4deg, rgba(255, 190, 110, 0.5) 0 0.8deg, transparent 0.8deg 11deg);
  -webkit-mask: radial-gradient(circle, transparent 36%, #000 40%, transparent 70%);
  mask: radial-gradient(circle, transparent 36%, #000 40%, transparent 70%);
  opacity: 0;
  transition: opacity 600ms ease;
}

.sun-disc {
  inset: 0;
  background: radial-gradient(circle at 36% 32%, #fff3dc 0%, #ffd494 28%, #f3a655 68%, #e2873a 100%);
  box-shadow: inset 0 -2px 4px rgba(180, 90, 20, 0.18), 0 3px 12px rgba(235, 150, 70, 0.35);
}

/* Before the line is held: a quiet dawn (never grey). */
.el5 .sl-sun2 .sun-haze {
  opacity: 0.55;
  transform: scale(0.75);
}

.el5 .sl-sun2 .sun-disc {
  filter: saturate(0.85);
}

.el5.state-held .sl-sun2 .sun-haze,
.el5.state-ahead .sl-sun2 .sun-haze,
.el5.state-free .sl-sun2 .sun-haze {
  opacity: 1;
  transform: none;
}

.el5.state-held .sl-sun2 .sun-disc,
.el5.state-ahead .sl-sun2 .sun-disc {
  filter: none;
}

.el5.state-held .sun-rays {
  opacity: 0.35;
}

.el5.state-ahead .sun-rays {
  opacity: 0.55;
  animation: sl-halo 60s linear infinite;
}

.el5.state-ahead .sun-haze {
  animation: sl-sunbreathe 4.5s ease-in-out infinite;
}

@keyframes sl-sunbreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.el5 .sl-end-label {
  top: calc(50% + 32px);
  font-size: 0.76rem;
}

/* Compact (calendar): small, thin and light. */
.el5.compact .sl-moon2 { --m: 13px; }
.el5.compact .sl-sun2 { --s: 12px; }
.el5.compact .moon-star.s2 { display: none; }
.el5.compact .moon-haze { inset: -80%; }
.el5.compact .sun-haze { inset: -80%; }
.el5.compact .sun-rays { inset: -70%; }
.el5.compact .sl-stage { height: 34px; }
.el5.compact .sl-done { stroke-width: 3px; }
.el5.compact .sl-rest,
.el5.compact .sl-track { stroke-width: 1.5px; }
.el5.compact .sl-mark,
.el5.compact .sl-point { width: 20px; height: 20px; }
.el5.compact .sl-mark > span { width: 10px; height: 10px; }
.el5.compact .sl-point > span { width: 11px; height: 11px; }
.el5.compact .sl-echo { inset: 4px; }

.brand {
  grid-template-columns: 30px minmax(0, 1fr) 30px;
}

.brand-mark.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

@media (prefers-reduced-motion: reduce) {
  .el5 .sun-rays, .el5 .sun-haze, .moon-star { animation: none !important; }
}

.el5 .sl-head { justify-content: flex-start; }

/* =====================================================================
   回响之书 v6: a book on a desk (slight top-away tilt, visible page block), deep book-cloth
   cover with a blind-stamped sprig and dark-gold foil, day rows, quick smooth turns.
   ===================================================================== */
.wb-view {
  --wb-cloth: #3e5657;
  --wb-cloth-deep: #2f4445;
  --wb-gold: #b8945a;
  --wb-gold-deep: #8c6a36;
}

.wb-view.leaving {
  animation: wb-leave 220ms ease forwards;
}

@keyframes wb-leave {
  to { opacity: 0; transform: scale(0.985); }
}

.wb-close {
  z-index: 10;
  transition: background 160ms ease, transform 160ms ease;
}

.wb-close:hover {
  background: #fff;
  transform: scale(1.06);
}

.wb-close:active {
  transform: scale(0.94);
}

/* Paper: pre-drawn cotton texture (see wbTextures) over warm cream. */
.wb-paper {
  background-color: var(--wb-paper);
  background-image:
    var(--wb-paper-tex),
    radial-gradient(120% 90% at 50% 40%, rgba(255, 253, 248, 0.6), transparent 70%),
    linear-gradient(180deg, #faf5ec, var(--wb-paper-deep));
  background-size: 256px 256px, auto, auto;
}

/* The desk angle: top edge a little further away, bottom edge closer. */
.wb-stage {
  perspective: 2200px;
  perspective-origin: 50% 10%;
}

.wb-book {
  transform: rotateX(12deg);
  transition: transform 820ms cubic-bezier(.45, 0, .25, 1);
}

.wb-book.closed {
  transform: rotateX(12deg) translateX(calc(var(--W) * -0.5));
}

/* A soft desk shadow under the book. */
.wb-book::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -26px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(60, 42, 25, 0.28), transparent);
  filter: blur(6px);
  transform: translateZ(-30px);
  pointer-events: none;
}

.wb-book.closed::before {
  left: 52%;
  right: 2%;
}

/* The page block's front edge, seen because the book tilts away from you. */
.wb-edge {
  position: absolute;
  top: var(--H);
  width: var(--W);
  transform-origin: 50% 0;
  transform: rotateX(-90deg);
  background:
    linear-gradient(180deg, transparent calc(100% - 3px), var(--wb-cloth-deep) calc(100% - 3px)),
    repeating-linear-gradient(180deg, #e9ddc8 0 0.7px, #fbf6ec 0.7px 1.7px);
  pointer-events: none;
}

.wb-edge.left {
  left: 0;
  height: calc(6px + var(--stack-l) * 2px);
  border-radius: 0 0 0 4px;
}

.wb-edge.right {
  left: var(--W);
  height: calc(6px + var(--stack-r) * 2px);
  border-radius: 0 0 4px 0;
}

.wb-book.closed .wb-edge.left {
  display: none;
}

.wb-book.closed .wb-edge.right {
  height: calc(12px + var(--stack-r) * 2px);
  background:
    linear-gradient(180deg, var(--wb-cloth-deep) 0 3px, transparent 3px calc(100% - 3px), var(--wb-cloth-deep) calc(100% - 3px)),
    repeating-linear-gradient(180deg, #e9ddc8 0 0.7px, #fbf6ec 0.7px 1.7px);
}

.wb-page::after {
  background: repeating-linear-gradient(90deg, #e2d4bc 0 0.8px, #fbf6ec 0.8px 2px);
}

/* Sheets carry the same gutter as the pages, so a landed sheet matches the page below. */
.wb-sheet-face.front .wb-gutter {
  left: 0;
  background: linear-gradient(270deg, transparent, rgba(110, 85, 60, 0.05) 55%, rgba(90, 65, 40, 0.14) 92%, rgba(70, 50, 30, 0.22));
}

.wb-sheet-face.back .wb-gutter {
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(110, 85, 60, 0.05) 55%, rgba(90, 65, 40, 0.16) 92%, rgba(70, 50, 30, 0.24));
}

.wb-page,
.wb-sheet-face {
  box-shadow: none;
}

.wb-page.left,
.wb-page.right {
  box-shadow: 0 18px 40px -22px rgba(70, 50, 30, 0.35);
}

.wb-sheet.cover .wb-sheet-edge {
  background: linear-gradient(90deg, var(--wb-cloth-deep), var(--wb-cloth));
}

/* ---------- Cover: deep book cloth, blind-stamped sprig, dark-gold foil ---------- */
.wb-cover {
  border-radius: 3px 7px 7px 3px;
  background-color: var(--wb-cloth);
  background-image:
    var(--wb-cloth-tex),
    radial-gradient(90% 70% at 30% 20%, rgba(255, 255, 255, 0.08), transparent 60%),
    radial-gradient(80% 70% at 85% 100%, rgba(0, 0, 0, 0.22), transparent 60%),
    linear-gradient(165deg, #46605f, var(--wb-cloth-deep));
  background-size: 192px 192px, auto, auto, auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 0 30px rgba(0, 0, 0, 0.18);
  color: var(--wb-gold);
}

.wb-page.is-cover {
  box-shadow: 0 22px 44px -18px rgba(40, 30, 20, 0.5);
}

.wb-cover-spine {
  width: 8%;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.08) 60%, rgba(255, 255, 255, 0.1) 82%, rgba(0, 0, 0, 0.15));
}

.wb-cover-frame {
  inset: 7% 8% 7% 13%;
  gap: 0.4em;
  border: 1.5px solid color-mix(in srgb, var(--wb-gold) 85%, transparent);
  box-shadow:
    inset 0 0 0 5px transparent,
    inset 0 0 0 6px color-mix(in srgb, var(--wb-gold) 55%, transparent),
    0 1px 0 rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(0, 0, 0, 0.25);
  align-content: end;
  padding-bottom: 14%;
}

/* Blind stamp: the motif pressed into the cloth (dark lower edge, light upper edge). */
.wb-cover-motif {
  position: absolute;
  top: 9%;
  left: 50%;
  width: 58%;
  transform: translateX(-50%);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wb-cover-motif g {
  stroke-width: 2.2;
}

.wb-cover-motif .lo { stroke: rgba(255, 255, 255, 0.1); fill: rgba(255, 255, 255, 0.04); }
.wb-cover-motif .hi { stroke: rgba(0, 0, 0, 0.35); fill: rgba(0, 0, 0, 0.12); }
.wb-cover-motif .mid { stroke: #4d6a69; fill: #45605f; }

.wb-cover-year,
.wb-cover h2,
.wb-cover-name {
  margin: 0;
  background: linear-gradient(175deg, #e3c68c 0%, #b8945a 40%, #8c6a36 70%, #c8a86c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--serif);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.35));
}

.wb-cover-year {
  font-size: 3.6em;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
}

.wb-cover h2 {
  font-size: 1.35em;
  font-weight: 500;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  text-shadow: none;
}

.wb-cover-name {
  margin-top: 1.4em;
  padding-top: 0;
  border-top: 0;
  font-size: 0.85em;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
}

/* ---------- Week pages: one day per row ---------- */
.wb-week {
  grid-template-rows: auto 1fr auto;
  gap: 0.5em;
}

.wb-week.right {
  grid-template-rows: auto 1fr auto auto;
}

.wb-rows {
  display: grid;
  min-height: 0;
}

.wb-rows.four { grid-template-rows: repeat(4, minmax(0, 1fr)); }
.wb-rows.three { grid-template-rows: repeat(3, minmax(0, 1fr)); }

.wb-row {
  display: grid;
  grid-template-columns: 3.4em minmax(0, 1fr);
  column-gap: 0.9em;
  min-height: 0;
  overflow: hidden;
  padding: 0.7em 0 0.5em;
  border-top: 1px solid rgba(169, 146, 115, 0.28);
}

.wb-row:first-child {
  border-top: 0;
}

.wb-row-date {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 0.1em;
}

.wb-row-date b {
  position: relative;
  color: var(--wb-ink);
  font-family: var(--serif);
  font-size: 2em;
  font-weight: 500;
  line-height: 1;
}

.wb-row-date em {
  color: var(--wb-ink);
  font-size: 0.72em;
  font-style: normal;
  letter-spacing: 0.1em;
}

.wb-row-date small {
  color: var(--wb-muted);
  font-size: 0.58em;
  white-space: nowrap;
}

.wb-row.today .wb-row-date b::after {
  content: "";
  position: absolute;
  inset: -0.14em -0.24em;
  border: 1px solid rgba(159, 180, 201, 0.7);
  border-radius: 50%;
  transform: rotate(-8deg);
}

/* A whole day struck through: a small sage seal by the date. */
.wb-row.all-done .wb-row-date em::after {
  content: " ✓";
  color: var(--wb-sage);
}

.wb-row.quiet .wb-row-date b,
.wb-row.quiet .wb-row-date em {
  color: rgba(146, 133, 117, 0.6);
}

.wb-row-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.wb-row-body ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35em 1em;
  margin: 0.15em 0 0;
  padding: 0;
  list-style: none;
}

.wb-row-body li {
  display: grid;
  grid-template-columns: 0.9em minmax(0, 1fr) auto;
  column-gap: 0.35em;
  align-items: baseline;
  font-size: 0.78em;
  line-height: 1.35;
}

.wb-row-body li small {
  grid-column: auto;
  color: var(--wb-muted);
  font-size: 0.82em;
  white-space: nowrap;
}

.wb-row-body .wb-text {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.wb-row-body .wb-note {
  margin: auto 0 0;
  padding: 0.35em 0 0 0.7em;
  font-size: 0.68em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.wb-row-body .wb-note::before {
  top: 0.5em;
}

.wb-row-body .wb-more {
  margin: 0.3em 0 0;
}

.wb-week-sum {
  display: flex;
  align-items: center;
  gap: 1em;
  border-radius: 0.5em;
  background: linear-gradient(90deg, rgba(220, 203, 176, 0.22), rgba(220, 203, 176, 0.08));
  padding: 0.6em 0.9em;
  color: var(--wb-deboss);
}

.wb-week-sum dl {
  display: flex;
  gap: 1.4em;
  margin: 0;
}

.wb-week-sum dt {
  color: var(--wb-muted);
  font-size: 0.58em;
  letter-spacing: 0.14em;
}

.wb-week-sum dd {
  margin: 0;
  color: var(--wb-ink);
  font-family: var(--serif);
  font-size: 1em;
}

.wb-week-sum dd small {
  color: var(--wb-muted);
  font-size: 0.7em;
}

.wb-week-sum p {
  margin: 0 0 0 auto;
  color: #7a6a5c;
  font-family: var(--serif);
  font-size: 0.66em;
}

/* The small book on the export card matches the real cover. */
.book-cover-mini.wb-mini {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.3), transparent 14%),
    linear-gradient(165deg, #46605f, #2f4445);
  box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 6px rgba(184, 148, 90, 0.6), 3px 4px 0 #efe6d6, 8px 12px 20px -8px rgba(40, 30, 20, 0.4);
  color: #d4b47a;
}

.book-cover-mini.wb-mini small {
  color: #b8945a;
}

.wb-row-body .wb-note {
  margin-top: 0.45em;
}

/* Still until the pointer is over the line: every loop and one-off echo only plays on hover. */
.el5:not(:hover) :is(.sl-echo, .sl-wave, .sl-planet, .sl-spark, .moon-star, .sun-rays, .sun-haze, .sl-buffer-glow, .sl-ripple) {
  animation: none !important;
}

/* =====================================================================
   动态安全线 v8: A horizon (hero) and B thread (calendar), one moon and one sun.
   Still until hovered; motion and extra light only on :hover.
   ===================================================================== */
.el8 .sl-sky-wrap {
  position: relative;
  margin: 2px -6px 0;
}

.el8 .sl-sky {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.el8 .sl-horizon {
  stroke: color-mix(in srgb, var(--line-strong) 85%, #cbbfae);
  stroke-width: 1;
}

.el8 .sl-lit {
  stroke-width: 2.2;
  stroke-linecap: round;
}

.el8 .sl-lit-glow {
  stroke-width: 6;
  opacity: 0.25;
  transition: opacity 400ms ease;
}

.el8 .sl-buffer {
  stroke: #e7a562;
  stroke-width: 2.6;
  stroke-linecap: round;
}

.el8 .s8-buffer-glow {
  stroke: #f2b574;
  stroke-width: 9;
  opacity: 0.35;
}

.el8 .sl-path {
  fill: none;
  stroke: #e4b27c;
  stroke-width: 1;
  stroke-dasharray: 1.4 2.6;
  opacity: 0.35;
  transition: opacity 400ms ease;
}

.el8 .s8-tick line {
  stroke: color-mix(in srgb, var(--wb-ink, #4b4037) 55%, transparent);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.el8 .s8-tick text {
  fill: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-anchor: middle;
}

.el8 .s8-tick-ripple {
  fill: none;
  stroke: #d9a56c;
  stroke-width: 1;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.el8 .sun-rays line {
  stroke: #f0b06a;
  stroke-width: 1;
  stroke-linecap: round;
}

.el8 .sun-rays {
  opacity: 0;
  transition: opacity 500ms ease;
}

.el8 .sun-body {
  transition: transform 300ms cubic-bezier(.3, 1.4, .5, 1);
  transform-box: fill-box;
  transform-origin: center;
}

.el8 .sun-glow {
  opacity: 0.55;
  transition: opacity 500ms ease;
}

.el8.state-held .sun-glow,
.el8.state-ahead .sun-glow {
  opacity: 1;
}

.el8.state-held .sun-rays { opacity: 0.4; }
.el8.state-ahead .sun-rays { opacity: 0.6; }

.el8 .moon-glow {
  opacity: 0.6;
  transition: opacity 500ms ease;
}

.el8 .sl-star {
  fill: #eee6d6;
  opacity: 0;
  transition: opacity 500ms ease;
}

.el8 .s8-follow {
  fill: #fff8ec;
  stroke: #e8b27a;
  stroke-width: 1;
  opacity: 0;
  transition: opacity 200ms ease, r 200ms ease;
}

.el8 .s8-follow.snapped {
  r: 5px;
}

.el8 .sl-hit {
  fill: transparent;
  cursor: pointer;
}

.el8 .sl-tip {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 2px;
  min-width: 150px;
  border-radius: 10px;
  background: #3a3029;
  padding: 8px 11px;
  color: #fffaf2;
  font-size: 0.76rem;
  line-height: 1.45;
  transform: translate(-50%, -100%);
  box-shadow: 0 10px 24px rgba(40, 30, 20, 0.18);
  pointer-events: none;
}

.el8 .sl-tip[hidden] { display: none; }
.el8 .sl-tip span { opacity: 0.78; }

/* Hover: everything wakes up. */
.el8:hover .sl-path {
  opacity: 0.75;
  stroke-dashoffset: 0;
  animation: sl-path-draw 1.4s ease-out;
}

.el8:hover .sl-lit-glow { opacity: 0.55; }
.el8:hover .sun-rays { opacity: 0.75; animation: sl-halo 40s linear infinite; transform-box: fill-box; transform-origin: center; }
.el8:hover .sun-glow { opacity: 1; }
.el8:hover .moon-glow { opacity: 1; }
.el8:hover .sl-star { opacity: 0.9; animation: sl-twinkle 2.8s ease-in-out infinite; }
.el8:hover .sl-star.s2 { animation-delay: -0.9s; }
.el8:hover .sl-star.s3 { animation-delay: -1.8s; }

.el8 .s8-sun.near .sun-body { transform: scale(1.12); }
.el8:hover .s8-buffer-glow { animation: sl-breathe 3.2s ease-in-out infinite; }
.el8 .s8-tick.pulse .s8-tick-ripple { animation: sl-tick-ripple 1.2s ease-out 1; }
.el8 .s8-tick.pulse .s8-tick-ripple.r2 { animation-delay: 0.25s; }
.el8.arrive:hover .s8-tick .s8-tick-ripple { animation: sl-tick-ripple 1.8s ease-out 1; }

@keyframes sl-path-draw {
  from { stroke-dashoffset: 40; }
  to { stroke-dashoffset: 0; }
}

@keyframes sl-tick-ripple {
  0% { opacity: 0.7; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(3.2); }
}

/* ---------- B: the thread (calendar) ---------- */
.el8.compact {
  display: flex;
  align-items: center;
  gap: 14px;
}

.el8 .sl-caption {
  flex-shrink: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.el8 .sl-caption b {
  color: var(--ink);
  font-weight: 650;
}

.el8.state-held .sl-caption,
.el8.state-ahead .sl-caption {
  color: color-mix(in srgb, #e2a060 60%, #6b4424);
}

.el8 .sl-thread {
  position: relative;
  flex: 1;
  height: 22px;
}

.el8 .sl-thread > * {
  position: absolute;
  top: 50%;
}

.el8 .sl-end {
  width: 20px;
  height: 20px;
  overflow: visible;
  transform: translate(-50%, -50%);
}

.el8 .sl-end.moon { left: 0; }
.el8 .sl-end.sun { left: 100%; width: 26px; height: 26px; }

.el8 .sl-thread-base {
  left: 3%;
  right: 3%;
  height: 1px;
  background: color-mix(in srgb, var(--line-strong) 85%, #cbbfae);
  transform: translateY(-50%);
}

.el8 .sl-thread-lit {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--line-cool), #e2ad72);
  box-shadow: 0 0 6px rgba(226, 173, 114, 0.35);
  transform: translateY(-50%);
}

.el8 .sl-thread-buffer {
  height: 2px;
  border-radius: 2px;
  background: #e7a562;
  box-shadow: 0 0 8px rgba(242, 181, 116, 0.55);
  transform: translateY(-50%);
}

.el8 .sl-thread-head {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff6e6;
  box-shadow: 0 0 0 1px rgba(226, 173, 114, 0.7), 0 0 8px 2px rgba(242, 181, 116, 0.45);
  transform: translate(-50%, -50%);
}

.el8 .sl-thread-tick {
  width: 14px;
  height: 18px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.el8 .sl-thread-tick i {
  position: absolute;
  left: 50%;
  top: 3px;
  bottom: 3px;
  width: 1.2px;
  background: color-mix(in srgb, #4b4037 55%, transparent);
  transform: translateX(-50%);
}

.el8 .sl-thread-follow {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff8ec;
  box-shadow: 0 0 0 1px rgba(232, 178, 122, 0.8), 0 0 8px rgba(242, 181, 116, 0.6);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 200ms ease, width 200ms ease, height 200ms ease;
  pointer-events: none;
}

.el8 .sl-thread:hover .sl-thread-follow { opacity: 1; }
.el8 .sl-thread-follow.snapped { width: 10px; height: 10px; }
.el8.compact:hover .sl-thread-lit { box-shadow: 0 0 10px rgba(226, 173, 114, 0.6); }
.el8.compact:hover .sun-rays { opacity: 0.7; }

.pace-panel .el8.compact {
  padding: 2px 16px 6px;
}

@media (prefers-reduced-motion: reduce) {
  .el8 *, .el8:hover * { animation: none !important; }
}

/* =====================================================================
   回响之书 v7: front view like the reference (pages open up a little from the spine, the
   beige cloth boards showing around them), beige cover with the debossed 日有回响 mark.
   ===================================================================== */
.wb-view {
  --wb-cloth: #dccdb3;
  --wb-cloth-deep: #cdbb9c;
  --wb-gold: #a8844c;
}

.wb-stage {
  perspective: 1800px;
  perspective-origin: 50% 50%;
}

.wb-book,
.wb-book.closed {
  transition: transform 820ms cubic-bezier(.45, 0, .25, 1);
}

.wb-book {
  transform: none;
}

.wb-book.closed {
  transform: translateX(calc(var(--W) * -0.5));
}

.wb-edge {
  display: none;
}

/* Pages open up from the spine: outer edges nearer, so top and bottom edges slope. */
.wb-page {
  transition: transform 820ms cubic-bezier(.45, 0, .25, 1);
}

.wb-page.left {
  transform-origin: 100% 50%;
  transform: rotateY(7deg);
}

.wb-page.right {
  transform-origin: 0 50%;
  transform: rotateY(-7deg);
}

.wb-book.closed .wb-page.right,
.wb-page.right.is-cover {
  transform: none;
}

/* The cloth boards (the case) behind the page block. */
.wb-case {
  position: absolute;
  top: -10px;
  width: calc(var(--W) + 12px);
  height: calc(var(--H) + 20px);
  background-color: var(--wb-cloth);
  background-image:
    var(--wb-cloth-tex),
    linear-gradient(165deg, #e2d5bf, var(--wb-cloth-deep));
  background-size: 192px 192px, auto;
  box-shadow: 0 26px 50px -22px rgba(70, 50, 30, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  transition: transform 820ms cubic-bezier(.45, 0, .25, 1), opacity 300ms ease;
  pointer-events: none;
}

.wb-case.left {
  left: -12px;
  border-radius: 8px 2px 2px 8px;
  transform-origin: calc(100% - 0px) 50%;
  transform: rotateY(7deg) translateZ(-4px);
}

.wb-case.right {
  left: var(--W);
  border-radius: 2px 8px 8px 2px;
  transform-origin: 0 50%;
  transform: rotateY(-7deg) translateZ(-4px);
}

.wb-book.closed .wb-case,
.wb-book.closing .wb-case {
  opacity: 0;
}

.wb-book::before {
  bottom: -30px;
}

/* ---------- Cover: beige book cloth, pressed-in mark, dark-gold hairline ---------- */
.wb-cover {
  background-color: var(--wb-cloth);
  background-image:
    var(--wb-cloth-tex),
    radial-gradient(100% 80% at 28% 16%, rgba(255, 251, 242, 0.5), transparent 58%),
    radial-gradient(90% 70% at 90% 100%, rgba(120, 95, 60, 0.16), transparent 60%),
    linear-gradient(165deg, #e4d7c1, #d3c2a4);
  background-size: 192px 192px, auto, auto, auto;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(120, 95, 60, 0.25),
    inset 0 0 28px rgba(120, 95, 60, 0.12);
  color: #6d5a44;
}

.wb-cover-spine {
  width: 9%;
  background:
    linear-gradient(90deg, rgba(110, 85, 55, 0.2), rgba(110, 85, 55, 0.04) 55%, transparent 70%),
    linear-gradient(90deg, transparent calc(100% - 3px), rgba(110, 85, 55, 0.22) calc(100% - 3px), rgba(255, 250, 240, 0.45) calc(100% - 1px));
}

.wb-cover-frame {
  inset: 8% 9% 8% 15%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(150, 118, 68, 0.75);
  box-shadow: inset 0 0 0 4px transparent, inset 0 0 0 5px rgba(150, 118, 68, 0.35);
}

.wb-cover-mark {
  position: static;
  width: 46%;
  height: auto;
  margin-bottom: 1.6em;
  transform: none;
}

.wb-cover-year,
.wb-cover h2,
.wb-cover-name {
  filter: none;
}

.wb-cover-year {
  margin: 0;
  background: linear-gradient(172deg, #caa36a 0%, #9c7640 45%, #7d5c2e 70%, #b89058 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--serif);
  font-size: 3.1em;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1;
  text-shadow: none;
}

/* Title and name blind-stamped: the cloth colour, pressed in. */
.wb-cover h2,
.wb-cover-name {
  background: none;
  color: #c9b695;
  text-shadow: 0 1px 0 rgba(255, 251, 242, 0.75), 0 -1px 0 rgba(110, 85, 55, 0.35);
  font-family: var(--serif);
}

.wb-cover h2 {
  margin: 0.7em 0 0;
  font-size: 1.15em;
  font-weight: 500;
  letter-spacing: 0.55em;
  text-indent: 0.55em;
}

.wb-cover-name {
  margin: 2.2em 0 0;
  font-size: 0.78em;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
}

.wb-sheet.cover .wb-sheet-edge {
  background: linear-gradient(90deg, #c7b391, #dccdb3);
}

.book-cover-mini.wb-mini {
  background:
    linear-gradient(90deg, rgba(110, 85, 55, 0.2), transparent 14%),
    linear-gradient(165deg, #e4d7c1, #d3c2a4);
  box-shadow: inset 0 0 0 4px transparent, inset 0 0 0 5px rgba(150, 118, 68, 0.5), 3px 4px 0 #efe6d6, 8px 12px 20px -8px rgba(70, 50, 30, 0.35);
  color: #8a6a3c;
}

.book-cover-mini.wb-mini small {
  color: #a8844c;
}

.wb-cover h2 { color: #a8926d; }
.wb-cover-name { color: #b19d7b; }

/* ---------- 动态安全线 v9: dawn sky, hour ruler, labels, readouts ---------- */
.el8 .sl-ruler line {
  stroke: color-mix(in srgb, var(--line-strong) 90%, #bcae98);
  stroke-width: 1;
}

.el8 .sl-ruler line.major {
  stroke: color-mix(in srgb, var(--muted) 45%, transparent);
}

.el8 .sl-ruler text {
  fill: color-mix(in srgb, var(--muted) 70%, transparent);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
}

.el8 .s8-tick .flag {
  stroke: color-mix(in srgb, #a07a48 55%, transparent);
  stroke-width: 1;
  stroke-dasharray: 2 2.5;
}

.el8 .s8-tick .flag-text {
  fill: #8a6a3c;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.el8.state-held .s8-tick .flag-text,
.el8.state-ahead .s8-tick .flag-text {
  fill: #b27a3a;
}

.el8 .sl-now {
  fill: color-mix(in srgb, #e2a060 55%, #6b4424);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-anchor: middle;
}

.el8 .sl-reflect line {
  stroke: #f0b474;
  stroke-width: 1.2;
  stroke-linecap: round;
}

.el8:hover .sl-reflect {
  animation: sl-shimmer 2.4s ease-in-out infinite;
}

@keyframes sl-shimmer {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px); }
}

.el8 .sl-sky-bg {
  transition: opacity 400ms ease;
}

.el8 .s8-follow line {
  stroke: #e8b27a;
  stroke-width: 1;
  opacity: 0.6;
}

.el8 .s8-follow circle {
  fill: #fff8ec;
  stroke: #e8b27a;
  stroke-width: 1;
}

.el8 .s8-follow {
  opacity: 0;
  transition: opacity 200ms ease;
}

.el8:hover .s8-follow {
  opacity: 1;
}

.el8 .s8-follow.snapped circle {
  r: 5px;
}

.el8 .sl-readout,
.el8 .sl-thread-readout {
  position: absolute;
  z-index: 3;
  display: flex;
  gap: 6px;
  align-items: baseline;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.96);
  padding: 3px 10px;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
  transform: translate(-50%, 0);
  box-shadow: 0 0 0 1px rgba(200, 180, 150, 0.35), 0 6px 16px rgba(90, 70, 50, 0.1);
  pointer-events: none;
}

.el8 .sl-readout b,
.el8 .sl-thread-readout b {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.el8 .sl-readout[hidden],
.el8 .sl-thread-readout[hidden] {
  display: none;
}

/* ---------- Thread labels and head ---------- */
.el8.compact {
  gap: 18px;
  padding-top: 4px;
}

.el8 .sl-caption {
  display: grid;
  gap: 1px;
  line-height: 1.3;
}

.el8 .sl-caption span {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.el8 .sl-caption b {
  font-size: 0.92rem;
}

.el8 .sl-thread {
  height: 40px;
}

.el8 .sl-thread > * {
  top: 42%;
}

.el8 .sl-thread-head {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: #fff6e6;
  box-shadow: 0 0 0 1.5px rgba(226, 173, 114, 0.85), 0 0 10px 2px rgba(242, 181, 116, 0.45);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.el8 .sl-thread-label {
  top: calc(42% + 9px) !important;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.el8 .sl-thread-label.now {
  color: color-mix(in srgb, #e2a060 60%, #6b4424);
}

.el8 .sl-thread-label.lean-left { transform: translateX(calc(-100% + 6px)); }
.el8 .sl-thread-label.lean-right { transform: translateX(-6px); }

.el8 .sl-thread-readout {
  top: auto !important;
  bottom: calc(58% + 10px);
}

.el8 .sl-thread:hover .sl-thread-label {
  opacity: 0.35;
}

.el8.compact:hover .sl-thread-lit {
  background-size: 200% 100%;
  animation: sl-thread-shine 2.2s linear infinite;
  background-image: linear-gradient(90deg, var(--line-cool), #e2ad72, #fff1dc, #e2ad72);
}

@keyframes sl-thread-shine {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* Open/close is driven frame by frame from book.js: no CSS transitions to drift apart. */
.wb-book,
.wb-book.closed,
.wb-page,
.wb-case {
  transition: none;
}

.wb-book::before {
  display: none;
}

.el8 .sl-caption { min-width: 84px; }
.el8 .sl-caption b { white-space: nowrap; }

/* =====================================================================
   数据统计 dashboard: one screen, no scrolling. Paper cards, thin grids, quiet colour.
   ===================================================================== */
.stats-dash {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto auto minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.dash-top {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.dash-headline {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.dash-top .stats-nav button:disabled {
  opacity: 0.3;
}

.dash-kpis {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.kpi,
.dash-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: 0 1px 0 rgba(120, 95, 65, 0.03), 0 10px 28px -20px rgba(90, 70, 50, 0.25);
}

.kpi {
  display: grid;
  align-content: start;
  gap: 4px;
  overflow: hidden;
  padding: 14px 16px 12px;
}

.kpi-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.kpi-value {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
}

.kpi-value small {
  margin-left: 3px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.8rem;
}

.kpi-delta {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  font-size: 0.74rem;
  font-weight: 650;
}

.kpi-delta em {
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
}

.kpi-delta.up { color: #5f9a7a; }
.kpi-delta.down { color: #c0795f; }
.kpi-delta.flat { color: var(--muted); font-weight: 400; }

.kpi-spark {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 42%;
  height: 30px;
}

.kpi-spark path.spark-line {
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-meter {
  height: 5px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-muted));
}

.kpi-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.kpi-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.dash-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 14px 16px 12px;
  overflow: hidden;
}

.dash-card > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 8px;
}

.dash-card h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.dash-card > header p {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.dash-body {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.dash-trend { grid-column: span 8; }
.dash-share { grid-column: span 4; }
.dash-heat { grid-column: span 4; }
.dash-rhythm { grid-column: span 4; }
.dash-projects { grid-column: span 4; }

.stats-dash .grid-line {
  stroke: color-mix(in srgb, var(--line) 80%, transparent);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.stats-dash .axis-text {
  fill: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.stats-dash .axis-text.count {
  fill: color-mix(in srgb, var(--muted) 60%, transparent);
}

.stats-dash .axis-text.value {
  fill: var(--ink);
  font-size: 10px;
}

.trend-bar {
  fill: color-mix(in srgb, var(--accent) 16%, transparent);
}

.stats-dash .line-main {
  fill: none;
  stroke: var(--accent-text);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stats-dash .line-prev {
  fill: none;
  stroke: color-mix(in srgb, var(--muted) 45%, transparent);
  stroke-width: 1.2;
  stroke-dasharray: 3 4;
}

.line-today {
  fill: var(--surface-strong);
  stroke: var(--accent-text);
  stroke-width: 2;
}

.cross-line {
  stroke: color-mix(in srgb, var(--ink) 30%, transparent);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.cross-dot {
  fill: var(--surface-strong);
  stroke: var(--accent-text);
  stroke-width: 2;
}

.trend-cross {
  transition: opacity 150ms ease;
  pointer-events: none;
}

.trend-tip {
  position: absolute;
  top: 6px;
  z-index: 2;
  display: grid;
  gap: 3px;
  min-width: 132px;
  border-radius: 10px;
  background: rgba(58, 48, 41, 0.94);
  padding: 8px 11px;
  color: #fffaf2;
  font-size: 0.74rem;
  pointer-events: none;
}

.trend-tip[hidden] { display: none; }

.trend-tip span,
.dash-card > header p {
  display: flex;
  align-items: center;
  gap: 6px;
}

.k-h, .k-c, .k-p {
  display: inline-block;
  width: 10px;
  height: 3px;
  border-radius: 2px;
}

.k-h { background: var(--accent-text); }
.k-c { height: 8px; width: 6px; background: color-mix(in srgb, var(--accent) 30%, transparent); }
.k-p { background: repeating-linear-gradient(90deg, var(--muted) 0 3px, transparent 3px 5px); }

.dash-donut {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}

.dash-donut svg {
  flex-shrink: 0;
}

.dash-donut .donut-seg {
  fill: none;
  stroke-linecap: round;
}

.dash-donut .donut-track {
  fill: none;
  stroke: var(--surface-muted);
}

.dash-donut .donut-total {
  fill: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
}

.dash-donut .donut-caption {
  fill: var(--muted);
  font-size: 10.5px;
}

.dash-legend {
  display: grid;
  flex: 1;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  font-size: 0.82rem;
}

.dash-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dash-legend span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-legend b {
  font-variant-numeric: tabular-nums;
}

.dash-legend em {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}

.heat-grid .heat {
  fill: color-mix(in srgb, var(--line) 70%, var(--surface-muted));
}

.heat-grid .heat.l1 { fill: color-mix(in srgb, var(--accent) 22%, var(--surface-strong)); }
.heat-grid .heat.l2 { fill: color-mix(in srgb, var(--accent) 45%, var(--surface-strong)); }
.heat-grid .heat.l3 { fill: color-mix(in srgb, var(--accent) 70%, var(--surface-strong)); }
.heat-grid .heat.l4 { fill: var(--accent-text); }
.heat-grid .heat.today { stroke: var(--ink); stroke-width: 1.2; }

.dash-heat .heat-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.7rem;
}

.dash-heat .heat-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--line) 70%, var(--surface-muted));
}

.dash-heat .heat-legend i.l1 { background: color-mix(in srgb, var(--accent) 22%, var(--surface-strong)); }
.dash-heat .heat-legend i.l2 { background: color-mix(in srgb, var(--accent) 45%, var(--surface-strong)); }
.dash-heat .heat-legend i.l3 { background: color-mix(in srgb, var(--accent) 70%, var(--surface-strong)); }
.dash-heat .heat-legend i.l4 { background: var(--accent-text); }

.rhythm-bar {
  fill: color-mix(in srgb, var(--accent) 30%, var(--surface-muted));
}

.rhythm-bar.best {
  fill: var(--accent-text);
}

.pp-list {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.pp-head {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto auto;
  column-gap: 8px;
  align-items: baseline;
  font-size: 0.8rem;
}

.pp-head i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

.pp-head span {
  color: var(--muted);
  font-size: 0.72rem;
}

.pp-head em {
  font-style: normal;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.pp-bar {
  display: flex;
  height: 6px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.pp-bar .done { background: var(--c); }
.pp-bar .sched { background: color-mix(in srgb, var(--c) 30%, transparent); }

.records {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.records dt {
  color: var(--muted);
  font-size: 0.68rem;
}

.records dd {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.records dd small {
  margin-left: 2px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.68rem;
}

@media (max-width: 1100px) {
  .stats-dash {
    height: auto !important;
    grid-template-rows: auto;
  }

  .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-trend, .dash-share, .dash-heat, .dash-rhythm, .dash-projects { grid-column: 1 / -1; min-height: 240px; }
}

.dchart { display: block; overflow: visible; }

.dash-heat .dash-body {
  display: grid;
  align-content: center;
  justify-items: center;
}

/* The full mark (moon, sun and orbit ring) is wide: show it wide, never cropped. */
.brand {
  grid-template-columns: 46px minmax(0, 1fr) 30px;
}

.brand-mark.brand-logo {
  width: 46px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background: #f8eee4;
  box-shadow: none;
}

/* ---------- 动态安全线 v10: an orbit like the logo's, hover replay, lighter calendar ---------- */
.el8 .sl-orbit ellipse {
  fill: none;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: opacity 400ms ease;
  opacity: 0.8;
}

.el8 .sl-orbit .planet.cool {
  fill: color-mix(in srgb, var(--line-cool) 85%, #5f6f86);
  opacity: 0.75;
}

.el8 .sl-orbit .planet.warm {
  fill: #e0b07a;
  opacity: 0.8;
}

.el8:hover .sl-orbit ellipse {
  opacity: 1;
}

/* No sparkles or ray bursts: glow only. */
.el8 .sun-rays,
.el8:hover .sun-rays {
  display: none;
}

.el8 .sl-now {
  transition: opacity 400ms ease;
}

/* Calendar thread: a hairline arc (the orbit) and, on hover, a soft light running from the
   moon to where today is. */
.el8 .sl-thread-arc {
  top: 4px !important;
  left: 1.5%;
  right: 1.5%;
  height: 26px;
  border-top: 1px solid color-mix(in srgb, #d9b27c 45%, transparent);
  border-radius: 50% / 100% 100% 0 0;
  opacity: 0.35;
  transition: opacity 400ms ease;
  pointer-events: none;
}

.el8.compact:hover .sl-thread-arc {
  opacity: 0.7;
}

.el8 .sl-thread-comet {
  left: 2%;
  width: 18px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #fff3e0 70%, #ffffff);
  box-shadow: 0 0 8px 2px rgba(242, 181, 116, 0.55);
  opacity: 0;
  transform: translate(-100%, -50%);
  pointer-events: none;
}

.el8.compact:hover .sl-thread-comet {
  animation: sl-comet 1.8s cubic-bezier(.4, 0, .2, 1) infinite;
}

@keyframes sl-comet {
  0% { left: 2%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: var(--pd); opacity: 0; }
}

/* Sheets built ahead of time: drawn (so they are ready) but not seen. */
.wb-sheet.standby {
  opacity: 0.002;
  pointer-events: none;
}

/* The export page's preview is the real cover, small. */
.wb-mini-cover {
  --W: 118px;
  --wb-cloth: #dccdb3;
  --wb-cloth-deep: #cdbb9c;
  position: relative;
  flex-shrink: 0;
  width: var(--W);
  height: calc(var(--W) * 1.3);
  overflow: hidden;
  border-radius: 3px 7px 7px 3px;
  box-shadow: 3px 0 0 -1px #efe6d6, 5px 0 0 -2px #e2d5bf, 10px 16px 26px -12px rgba(70, 50, 30, 0.45);
}

.wb-mini-cover .wb-cover-frame {
  border-width: 0.6px;
}

/* ---------- 动态安全线 v11: light trail, logo-like orbit, star trail ---------- */
.el8 .sl-path-ahead {
  fill: none;
  stroke-width: 1;
}

.el8 .sl-trail {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.el8 .sl-trail-glow {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  opacity: 0.55;
}

.el8 .sl-horizon {
  stroke-width: 1;
}

.el8 .sl-orbit .ring {
  fill: none;
  stroke-linecap: round;
}

.el8 .sl-orbit .ring.back {
  stroke-width: 0.8;
  opacity: 0.45;
}

.el8 .sl-orbit .ring.front {
  stroke-width: 1.4;
  opacity: 0.9;
}

.el8 .sl-orbit .ring.front-glow {
  stroke-width: 4;
  opacity: 0.3;
}

.el8 .sl-orbit .planet {
  opacity: 0.9;
}

.el8:hover .sl-orbit .ring.front-glow {
  opacity: 0.55;
}

.el8 .sl-sun-under {
  opacity: 0.28;
}

.el8 .s8-tick .flag {
  stroke: color-mix(in srgb, #a07a48 60%, transparent);
  stroke-width: 1;
  stroke-dasharray: none;
}

.el8 .s8-tick .node {
  fill: #fffaf2;
  stroke: #b8894f;
  stroke-width: 1.2;
}

.el8.state-held .s8-tick .node,
.el8.state-ahead .s8-tick .node {
  fill: #e8a960;
  stroke: #d99450;
}

.el8 .sl-spark {
  fill: #f6c88f;
  pointer-events: none;
  animation: sl-spark 1.4s ease-out forwards;
}

.el8 .sl-spark.s1 { fill: #fff0d6; animation-duration: 1.2s; }
.el8 .sl-spark.s2 { style: none; fill: color-mix(in srgb, var(--line-cool) 80%, #fff); animation-duration: 1.6s; }

@keyframes sl-spark {
  0% { opacity: 0.9; transform: translate(0, 0); }
  100% { opacity: 0; transform: translate(-14px, 3px); }
}

.el8 .sl-spark {
  transform-box: fill-box;
}

/* Calendar: numbers only at the two key points; a faint star trail in between. */
.el8 .sl-thread-spark {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f6c88f;
  box-shadow: 0 0 5px 1px rgba(246, 200, 143, 0.6);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: sl-thread-spark 1.1s ease-out forwards;
}

@keyframes sl-thread-spark {
  0% { opacity: 0.9; margin-left: 0; }
  100% { opacity: 0; margin-left: -12px; margin-top: -4px; }
}

.el8 .sl-thread:hover .sl-thread-label {
  opacity: 1;
}

/* Compact enough to fit a laptop screen in one view. */
.stats-dash { gap: 10px; }
.dash-kpis { gap: 10px; }
.kpi { padding: 10px 14px 10px; gap: 2px; }
.kpi-value { font-size: 1.5rem; }
.dash-card { padding: 12px 14px 10px; }
.dash-card > header { margin-bottom: 4px; }

.pp-list { gap: 7px; margin-bottom: 8px; }
.pp-bar { margin-top: 3px; height: 5px; }
.records { padding-top: 6px; }
.records dd { font-size: 0.95rem; }

.dash-heat .dash-body.heat-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.dash-heat [data-chart="heat"] {
  display: grid;
  justify-items: center;
  min-height: 0;
  height: 100%;
  align-content: center;
}

.dash-heat .records {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 8px;
  border-top: 0;
  border-left: 1px dashed var(--line);
  padding: 0 0 0 12px;
}

.el8 .sun-swirl {
  fill: none;
  stroke: #fff8ec;
  stroke-width: 0.9;
  stroke-linecap: round;
  opacity: 0.45;
}

.el8 .sun-swirl.s2 {
  opacity: 0.28;
}

.el8 .sun-rim {
  fill: none;
  stroke-width: 1;
}

.el8 .sun-star {
  fill: #fffdf6;
  opacity: 0.9;
}

.el8.compact .sun-swirl,
.el8.compact .sun-star {
  display: none;
}

.brand-name .brand-en {
  display: inline;
  margin-left: 6px;
  color: var(--accent-text);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  vertical-align: 1px;
}

.brand-tagline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-name { white-space: nowrap; }

/* Sun v3: light around it, not on it. */
.el8 .sun-swirl,
.el8 .sun-star {
  display: none;
}

.el8 .sun-rays,
.el8:hover .sun-rays {
  display: inline;
  opacity: 0.55;
  animation: none;
  transform-box: view-box;
  transform-origin: 0 0;
}

.el8 .sun-rays line {
  stroke-width: 0.6;
  stroke-linecap: round;
}

.el8 .sun-rays line.long {
  stroke-width: 0.8;
}

.el8.state-held .sun-rays,
.el8.state-ahead .sun-rays {
  opacity: 0.85;
}

.el8:hover .sun-rays {
  animation: sl-sun-turn 60s linear infinite;
}

@keyframes sl-sun-turn {
  to { transform: rotate(360deg); }
}

.el8 .sun-halo {
  fill: none;
  stroke: #f2c28a;
  stroke-width: 0.6;
  opacity: 0.55;
}

.el8.compact .sun-halo {
  opacity: 0.35;
}

/* Square logo box; the whole mark (orbit ring included) is shown, never cropped. */
.brand {
  grid-template-columns: 38px minmax(0, 1fr) 30px;
}

.brand-mark.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
  background: #f8eee4;
}

/* ======================================================================
   今日概览 / 数据统计 / 我的项目 — polish and hover life (Claude, 2026-09-29)
   ====================================================================== */

/* A soft light that follows the pointer on any card marked .spot (set by views.js). */
.spot {
  position: relative;
  isolation: isolate;
}
.spot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, -300px) var(--my, -300px), color-mix(in srgb, var(--course-color, #f0b27c) 13%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 260ms ease;
  pointer-events: none;
}
.spot:hover::after { opacity: 1; }

@keyframes de-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes de-pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes de-ring {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--event-color, var(--accent)) 45%, transparent); }
  to { box-shadow: 0 0 0 10px transparent; }
}

/* ---------- 今日概览 ---------- */
.today-layout .today-block,
.today-layout .today-card,
.today-layout .today-bill {
  border-color: color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface-strong), color-mix(in srgb, var(--surface-strong) 70%, var(--bg)));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 10px 30px -22px rgba(60, 45, 30, 0.45);
  transition: box-shadow 240ms ease, transform 240ms ease;
}
.today-layout .today-block:hover,
.today-layout .today-card:hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 18px 40px -24px rgba(60, 45, 30, 0.5);
}
.today-layout.enter .today-main > *,
.today-layout.enter .today-side > * {
  animation: de-rise 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.today-layout.enter .today-main > :nth-child(2),
.today-layout.enter .today-side > :nth-child(2) { animation-delay: 70ms; }
.today-layout.enter .today-main > :nth-child(3),
.today-layout.enter .today-side > :nth-child(3) { animation-delay: 140ms; }
.today-layout.enter .today-main > :nth-child(n + 4) { animation-delay: 200ms; }
.today-layout.enter .today-task {
  animation: de-rise 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(120ms + var(--i, 0) * 32ms);
}

.today-block header h3::before,
.today-card h3::before {
  content: "";
  width: 4px;
  height: 15px;
  margin-right: 2px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f3be86, #e2a063);
}
.today-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.today-block h3 span {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 0.74rem;
}

/* the day's progress ring in the list header */
.today-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}
.today-progress svg { width: 30px; height: 30px; }
.today-progress .tp-track { fill: none; stroke: var(--surface-muted); stroke-width: 4; }
.today-progress .tp-value {
  fill: none;
  stroke: #e2a063;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dasharray 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.today-progress b { color: var(--ink); font-size: 0.95rem; }

/* task rows: tinted by their project, a colour edge slides in on hover */
.today-layout .today-task {
  position: relative;
  padding: 5px 8px;
  border-radius: 12px;
  transition: background 180ms ease, transform 180ms ease;
}
.today-layout .today-task::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--event-color, var(--accent));
  transform: scaleY(0);
  transition: transform 200ms ease;
}
.today-layout .today-task:hover {
  background: color-mix(in srgb, var(--event-color, var(--accent)) 8%, var(--surface-strong));
  transform: translateX(3px);
}
.today-layout .today-task:hover::before { transform: scaleY(1); }
.today-layout .today-check {
  position: relative;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.today-layout .today-task:not(.done) .today-check::after {
  content: "✓";
  color: var(--event-color, var(--accent));
  opacity: 0;
  transition: opacity 160ms ease;
}
.today-layout .today-task:not(.done) .today-check:hover {
  border-color: var(--event-color, var(--accent));
  transform: scale(1.1);
}
.today-layout .today-task:not(.done) .today-check:hover::after { opacity: 0.6; }
.today-layout .today-task.done .today-check {
  border-color: var(--event-color, var(--accent));
  background: var(--event-color, var(--accent));
}
.today-task.just-done .today-check { animation: de-pop 380ms cubic-bezier(0.2, 0.8, 0.2, 1), de-ring 600ms ease-out; }
.today-task.just-done .today-task-title { animation: de-rise 300ms ease both; }

/* the note: lined paper, a warm glow when writing */
.today-note-card textarea {
  border-radius: 14px;
  background:
    repeating-linear-gradient(180deg, transparent 0 27px, color-mix(in srgb, var(--line) 70%, transparent) 27px 28px),
    color-mix(in srgb, #fff8ea 70%, var(--surface-strong));
  line-height: 28px;
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
.today-note-card textarea:focus {
  border-color: #e9b27a;
  box-shadow: 0 0 0 4px rgba(240, 178, 124, 0.18);
  outline: none;
}

/* ---------- 数据统计 ---------- */
.stats-dash { position: relative; }
.stats-dash .kpi,
.stats-dash .dash-card {
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 240ms ease, border-color 240ms ease;
  animation: de-rise 460ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.stats-dash .kpi:nth-child(2) { animation-delay: 40ms; }
.stats-dash .kpi:nth-child(3) { animation-delay: 80ms; }
.stats-dash .kpi:nth-child(4) { animation-delay: 120ms; }
.stats-dash .kpi:nth-child(5) { animation-delay: 160ms; }
.stats-dash .dash-trend { animation-delay: 120ms; }
.stats-dash .dash-share { animation-delay: 170ms; }
.stats-dash .dash-heat { animation-delay: 220ms; }
.stats-dash .dash-rhythm { animation-delay: 260ms; }
.stats-dash .dash-projects { animation-delay: 300ms; }
.stats-dash .kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -24px rgba(60, 45, 30, 0.55);
}
.stats-dash .dash-card:hover { box-shadow: 0 18px 40px -28px rgba(60, 45, 30, 0.5); }

.dash-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 30;
  display: grid;
  gap: 2px;
  min-width: 120px;
  max-width: 260px;
  padding: 8px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  color: #fffaf2;
  font-size: 0.78rem;
  line-height: 1.45;
  box-shadow: 0 14px 30px -12px rgba(30, 20, 10, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 90ms linear;
}
.dash-tip.show { opacity: 1; }
.dash-tip b { font-size: 0.82rem; }
.dash-tip span { opacity: 0.85; }

/* sparklines draw in, and show a guide under the pointer */
.kpi-spark .spark-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: de-draw 900ms 200ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.kpi-spark .spark-guide { stroke: var(--ink); stroke-opacity: 0; stroke-width: 1; stroke-dasharray: 2 2; }
.kpi-spark.hovering .spark-guide { stroke-opacity: 0.5; }
@keyframes de-draw { to { stroke-dashoffset: 0; } }

/* trend: the line draws in, bars rise, the bar under the pointer lights */
.dchart.trend .line-main {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: de-draw 1100ms 150ms cubic-bezier(0.3, 0.7, 0.2, 1) forwards;
}
.dchart.trend .trend-bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: de-grow 600ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: fill 140ms ease, opacity 140ms ease;
}
.dchart.trend .trend-bar.hot { fill: #e2a063; opacity: 0.9; }
@keyframes de-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.trend-cross { transition: opacity 140ms ease; }

/* donut: slices sweep in; hover one (or its legend row) to bring it forward */
/* slices: flat ends with a hairline gap (round ends used to overlap and flicker while
   they grew); the whole ring is revealed once by a mask sweeping round */
.dash-donut .donut-seg {
  cursor: pointer;
  stroke-linecap: round;
  transition: stroke-width 200ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms ease;
}
.dash-donut .donut-reveal {
  stroke-dashoffset: var(--circ);
  animation: de-reveal 900ms 120ms cubic-bezier(0.3, 0.7, 0.2, 1) forwards;
}
@keyframes de-reveal { to { stroke-dashoffset: 0; } }
.dash-donut.focusing .donut-seg:not(.on) { filter: grayscale(0.55) brightness(1.18); } /* not opacity: overlapping round ends would show through each other */
.dash-donut .donut-total { transition: fill 200ms ease; }
.dash-legend li {
  border-radius: 10px;
  cursor: default;
  transition: background 160ms ease, opacity 160ms ease, transform 160ms ease;
}
.dash-donut.focusing .dash-legend li:not(.on) { opacity: 0.4; }
.dash-legend li.on { background: var(--surface-muted); transform: translateX(3px); }

/* heatmap: cells fade in along the weeks; hover pops a cell */
.dash-heat .dash-body.heat-body {
  align-items: stretch;
  justify-items: stretch;
  grid-template-rows: minmax(0, 1fr);
}
.dash-heat .dash-body.heat-body > [data-chart="heat"] {
  width: 100%;
  height: 100%;
  min-width: 0;
  align-self: stretch;
}
.heat-grid .heat {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  animation: de-cell 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: transform 140ms ease, stroke 140ms ease;
}
.heat-grid .heat:hover {
  transform: scale(1.3);
  stroke: #e2a063;
  stroke-width: 1.5;
}
@keyframes de-cell { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
.records > div {
  border-radius: 12px;
  padding: 4px 8px;
  transition: background 160ms ease, transform 160ms ease;
}
.records > div:hover { background: var(--surface-muted); transform: translateY(-2px); }

/* weekly rhythm: bars grow; hover a day to focus it */
.dchart.rhythm .rhythm-col { cursor: pointer; }
.dchart.rhythm .rhythm-bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: de-grow 640ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: opacity 160ms ease, filter 160ms ease;
}
.dchart.rhythm.focusing .rhythm-col:not(.on) .rhythm-bar { opacity: 0.35; }
.dchart.rhythm .rhythm-col.on .rhythm-bar { filter: brightness(1.05) drop-shadow(0 6px 10px rgba(80, 60, 40, 0.25)); }
.dchart.rhythm.focusing .rhythm-col:not(.on) .axis-text.value { opacity: 0.3; }

/* project progress: bars fill in; hover a row for the breakdown */
.pp-list .pp-link {
  display: block;
  margin: -4px -8px;
  padding: 4px 8px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: background 160ms ease;
}
.pp-list .pp-link:hover { background: color-mix(in srgb, var(--c) 8%, var(--surface-strong)); }
.pp-bar i { animation: de-fill 900ms 250ms cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: left; }
@keyframes de-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.pp-more {
  max-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  opacity: 0;
  transition: max-height 220ms ease, opacity 200ms ease, margin 220ms ease;
}
.pp-link:hover .pp-more { max-height: 20px; margin-top: 4px; opacity: 1; }
.pp-link:hover .pp-bar { height: 7px; }
.pp-bar { transition: height 200ms ease; }

@media (prefers-reduced-motion: reduce) {
  .stats-dash *, .today-layout *, .project-board * { animation: none !important; }
}

/* ---------- 我的项目 ---------- */
.project-board { gap: 18px; }
.project-card.pc2 {
  display: grid;
  gap: 12px;
  align-content: start;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--course-color) 18%, var(--line));
  border-radius: 20px;
  background:
    radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--course-color) 12%, transparent), transparent 60%),
    linear-gradient(180deg, var(--surface-strong), color-mix(in srgb, var(--surface-strong) 75%, var(--bg)));
  padding: 18px 20px 16px;
  box-shadow: 0 12px 30px -24px rgba(60, 45, 30, 0.5);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 260ms ease, border-color 260ms ease;
  animation: de-rise 480ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.project-card.pc2::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--course-color), color-mix(in srgb, var(--course-color) 20%, transparent));
  opacity: 0.8;
}
.project-card.pc2:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--course-color) 40%, var(--line));
  box-shadow: 0 26px 50px -30px color-mix(in srgb, var(--course-color) 70%, rgba(60, 45, 30, 0.6));
}
.project-card.pc2 header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.project-card.pc2 .project-donut {
  flex-shrink: 0;
  transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.project-card.pc2:hover .project-donut { transform: rotate(-12deg) scale(1.06); }
.project-card.pc2:hover .project-donut .donut-text { transform: rotate(12deg); transform-origin: center; transform-box: fill-box; }

.pc-stats {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 8px;
}
.pc-stat {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--course-color) 6%, var(--surface-muted));
  transition: background 200ms ease, transform 200ms ease;
}
.pc-stat:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--course-color) 12%, var(--surface-muted)); }
.pc-stat span { color: var(--muted); font-size: 0.72rem; }
.pc-stat b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.pc-stat.main b { color: color-mix(in srgb, var(--course-color) 80%, var(--ink)); font-size: 1.3rem; }

/* the time axis: start → today → planned finish → buffer → Deadline */
.pc-time { position: relative; display: grid; gap: 5px; }
.pc-time.hovering .pc-time-labels { visibility: hidden; }
.pc-track {
  position: relative;
  height: 12px;
  margin: 8px 6px 0;
  border-radius: 999px;
  background: var(--surface-muted);
  cursor: crosshair;
}
.pc-track > i { position: absolute; top: 0; bottom: 0; display: block; }
.pc-elapsed {
  left: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--course-color) 25%, transparent), color-mix(in srgb, var(--course-color) 60%, transparent));
  animation: de-fill 900ms 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transform-origin: left;
}
.pc-buffer {
  border-radius: 0 999px 999px 0;
  background: repeating-linear-gradient(135deg, rgba(240, 178, 124, 0.45) 0 4px, transparent 4px 8px);
}
.pc-now {
  width: 2px;
  margin-left: -1px;
  top: -5px !important;
  bottom: -5px !important;
  border-radius: 2px;
  background: var(--ink);
}
.pc-now em {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -2px);
  color: var(--ink);
  font-size: 0.66rem;
  font-style: normal;
  white-space: nowrap;
}
.pc-finish {
  width: 10px;
  height: 10px;
  margin: 1px 0 0 -5px;
  top: 0 !important;
  bottom: auto !important;
  transform: rotate(45deg);
  border: 1.5px solid #b8894f;
  background: var(--surface-strong);
}
.pc-flag {
  width: 12px;
  height: 12px;
  margin: 0 0 0 -6px;
  border-radius: 999px;
  background: #e9a262;
  box-shadow: 0 0 0 3px color-mix(in srgb, #e9a262 25%, transparent);
}
.pc-hover {
  width: 1px;
  top: -6px !important;
  bottom: -6px !important;
  background: var(--course-color);
  opacity: 0;
  transition: opacity 120ms ease;
}
.pc-time.hovering .pc-hover { opacity: 1; }
.pc-time-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.68rem;
}
.pc-readout {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  margin: 0;
  padding: 2px 10px;
  text-align: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--course-color) 10%, var(--surface-muted));
  color: var(--ink);
  font-size: 0.74rem;
}

/* modules: a small bar each */
.pc-modules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pc-modules li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px auto;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 8px;
  font-size: 0.74rem;
  transition: background 160ms ease;
}
.pc-modules li:hover { background: color-mix(in srgb, var(--course-color) 9%, transparent); }
.pm-name { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.pm-bar { height: 4px; border-radius: 4px; background: var(--surface-muted); overflow: hidden; }
.pm-bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--course-color);
  animation: de-fill 800ms 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transform-origin: left;
}
.pm-count { color: var(--muted); font-variant-numeric: tabular-nums; }

.project-card.pc2 .project-upcoming li {
  border-radius: 8px;
  padding: 2px 6px;
  margin: 0 -6px;
  transition: background 160ms ease, transform 160ms ease;
}
.project-card.pc2 .project-upcoming li:hover {
  background: color-mix(in srgb, var(--course-color) 9%, transparent);
  transform: translateX(3px);
}
.project-card.pc2 footer button {
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.project-card.pc2 footer button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--course-color) 80%, transparent);
}

.loose-list {
  border-radius: 18px;
  transition: box-shadow 240ms ease;
}
.loose-list li { border-radius: 10px; transition: background 160ms ease, transform 160ms ease; }
.loose-list li:hover { background: var(--surface-muted); transform: translateX(3px); }

/* ======================================================================
   日历顶部 动态安全线 v2 (Claude, 2026-09-29): about half the height, tools at the top
   right (固定 / 展开), projects as a compact row, and an optional pinned mode that sticks
   under the calendar header while the days scroll.
   ====================================================================== */
.pace-panel.v2 {
  display: grid;
  gap: 0;
  margin-bottom: 10px;
  border-color: color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface-strong), color-mix(in srgb, var(--surface-strong) 80%, var(--bg)));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 8px 24px -22px rgba(60, 45, 30, 0.45);
  transition: box-shadow 220ms ease, border-radius 220ms ease;
}
.pace-panel.v2 .pace-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px 2px 16px;
}
.pace-panel.v2 .pace-headline { font-size: 0.9rem; line-height: 1.4; }
.pace-panel.v2 .pace-label { font-size: 0.72rem; letter-spacing: 0.04em; }
.pace-panel.v2 .pace-tools {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
}
.pace-panel.v2 .pace-pin,
.pace-panel.v2 .pace-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.74rem;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.pace-panel.v2 .pace-pin { width: 28px; padding: 0; }
.pace-panel.v2 .pace-pin svg,
.pace-panel.v2 .pace-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pace-panel.v2 .pace-pin:hover,
.pace-panel.v2 .pace-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
  color: var(--ink);
  transform: translateY(-1px);
}
.pace-panel.v2 .pace-pin[aria-pressed="true"] {
  border-color: color-mix(in srgb, #e2a063 55%, var(--line));
  background: color-mix(in srgb, #f0b27c 20%, var(--surface-strong));
  color: #a86a2c;
}
.pace-panel.v2 .pace-pin[aria-pressed="true"] svg { fill: currentColor; fill-opacity: 0.25; transform: rotate(20deg); }
.pace-panel.v2 .pace-meta {
  gap: 2px 12px;
  padding: 2px 16px 0;
  font-size: 0.76rem;
}
.pace-panel.v2 .pace-capacity { padding: 1px 9px; font-size: 0.74rem; }
/* the thread: full width, no second caption (the headline already says it) */
.pace-panel.v2 .el8.compact { padding: 0 16px 2px; }
.pace-panel.v2 .el8.compact .sl-caption { display: none; }
/* folded: the projects as one tidy row */
.pace-panel.v2 .pace-lines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 2px 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding: 6px 10px 7px;
}
.pace-panel.v2 .pace-line {
  align-items: center;
  gap: 7px;
  border-radius: 9px;
  padding: 3px 6px;
  font-size: 0.76rem;
  transition: background 160ms ease;
}
.pace-panel.v2 .pace-line:hover { background: color-mix(in srgb, var(--course-color) 9%, transparent); }
.pace-panel.v2 .pace-line strong { font-size: 0.8rem; }
/* open: small cards, three across */
.pace-panel.v2 .pace-projects {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 6px 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding: 8px 10px 10px;
}
.pace-panel.v2 .pace-project {
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 6px 8px;
  transition: background 160ms ease, transform 160ms ease;
}
.pace-panel.v2 .pace-project:hover {
  background: color-mix(in srgb, var(--course-color) 8%, transparent);
  transform: translateY(-1px);
}
.pace-panel.v2 .pace-project-body { display: grid; gap: 1px; font-size: 0.74rem; }
.pace-panel.v2 .pace-project-body p { margin: 0; }
.pace-panel.v2 .pace-project-head strong { font-size: 0.84rem; }
/* pinned: sticks under the header */
.pace-panel.v2.pinned {
  position: sticky;
  top: var(--pace-stick, 0px);
  z-index: 7;
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
  backdrop-filter: blur(10px);
}
.pace-panel.v2.pinned.is-stuck {
  border-radius: 0 0 16px 16px;
  box-shadow: 0 14px 28px -20px rgba(60, 45, 30, 0.5);
}
.pace-panel.v2.pinned.is-stuck .pace-meta { display: none; }
@media (max-width: 760px) {
  .pace-panel.v2 .pace-top { align-items: flex-start; }
  .pace-panel.v2 .pace-toggle span { display: none; }
  .pace-panel.v2 .pace-toggle { width: 28px; padding: 0; }
  .pace-panel.v2 .pace-lines { grid-template-columns: 1fr; }
}

/* ======================================================================
   新手引导 v3 (Claude, 2026-09-29): a quiet welcome and a product-tour card
   ====================================================================== */
.welcome-card {
  width: min(440px, 100%);
  border-radius: 24px;
  padding: 30px 32px 24px;
  text-align: center;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(240, 178, 124, 0.14), transparent 70%),
    var(--surface-strong);
}
.welcome-card .welcome-logo {
  width: min(220px, 64%);
  margin: -4px auto 10px;
}
.welcome-card h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}
.welcome-lede {
  margin: 8px 0 18px;
  text-wrap: balance;
  color: var(--muted);
  font-size: 0.95rem;
}
.welcome-keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.welcome-keys li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 999px;
  background: var(--surface);
  padding: 5px 12px;
  color: var(--ink);
  font-size: 0.8rem;
}
.welcome-keys i {
  color: #d9954f;
  font-style: normal;
  font-size: 0.78rem;
}
.welcome-card .welcome-actions {
  justify-content: center;
  margin-top: 0;
}
.welcome-card .welcome-actions button { min-width: 108px; border-radius: 999px; }
.welcome-card .welcome-skip { border-color: transparent; background: transparent; color: var(--muted); }

.tour-card {
  width: min(340px, calc(100vw - 32px));
  border-radius: 18px;
  padding: 14px 16px 12px;
}
.tour-card.docked {
  right: 20px;
  bottom: 20px;
}
.tour-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tour-dots { display: inline-flex; gap: 4px; }
.tour-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: width 200ms ease, background 200ms ease;
}
.tour-dots i.past { background: color-mix(in srgb, #e2a063 55%, var(--line-strong)); }
.tour-dots i.now { width: 18px; background: #e2a063; }
.tour-count { color: var(--muted); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.tour-card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 6px;
  font-size: 1rem;
}
.tour-try {
  border-radius: 999px;
  background: color-mix(in srgb, #f0b27c 22%, var(--surface-muted));
  padding: 1px 8px;
  color: #a86a2c;
  font-size: 0.7rem;
  font-weight: 700;
}
.tour-card p { font-size: 0.86rem; color: color-mix(in srgb, var(--ink) 82%, var(--muted)); }
.tour-card .tour-actions { margin-top: 12px; }
.tour-card .tour-actions button { min-height: 32px; border-radius: 999px; font-size: 0.8rem; }
.tour-card .tour-actions .primary-action,
.tour-card .tour-actions .tour-demo-button { padding: 0 14px; }
.tour-card .tour-actions .tour-prev { padding: 0 12px; }
.tour-target {
  outline-color: #e2a063;
  outline-width: 2px;
}
@keyframes tour-pulse {
  50% { outline-color: color-mix(in srgb, #e2a063 30%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .dash-donut .donut-reveal { stroke-dashoffset: 0; }
}
/* 回响之书: holding a page never selects text or starts a native drag / scroll */
.wb-book {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.wb-book img { -webkit-user-drag: none; pointer-events: none; }

/* ======================================================================
   新手导览 v4 (Claude, 2026-09-29): dimmed surroundings with a bright spot, a dashed
   path and a 拖到这里 frame for every drag, an animated pointer for 演示一下, and a
   calmer card with a thin progress line.
   ====================================================================== */
.tour-spot {
  position: fixed;
  z-index: 80;
  border-radius: 18px;
  box-shadow: 0 0 0 200vmax rgba(34, 26, 18, 0.26);
  pointer-events: none;
  transition: left 320ms cubic-bezier(0.2, 0.8, 0.2, 1), top 320ms cubic-bezier(0.2, 0.8, 0.2, 1), width 320ms cubic-bezier(0.2, 0.8, 0.2, 1), height 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tour-drop-mark {
  position: fixed;
  z-index: 81;
  display: grid;
  place-items: center;
  border: 2px dashed #e2a063;
  border-radius: 12px;
  background: rgba(240, 178, 124, 0.12);
  pointer-events: none;
  animation: tour-drop-breathe 1.6s ease-in-out infinite;
}
.tour-drop-mark span {
  border-radius: 999px;
  background: #e9a262;
  padding: 3px 10px;
  color: #fffaf2;
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: 0 6px 14px -8px rgba(190, 120, 50, 0.8);
}
@keyframes tour-drop-breathe {
  50% { background: rgba(240, 178, 124, 0.22); border-color: rgba(226, 160, 99, 0.55); }
}
.tour-path {
  position: fixed;
  inset: 0;
  z-index: 81;
  pointer-events: none;
  overflow: visible;
  transition: opacity 200ms ease;
}
.tour-path-line {
  fill: none;
  stroke: #e2a063;
  stroke-width: 2;
  stroke-dasharray: 6 7;
  stroke-linecap: round;
  animation: tour-dash 1s linear infinite;
  opacity: 0.85;
}
.tour-path-dot { fill: #e9a262; filter: drop-shadow(0 2px 4px rgba(190, 120, 50, 0.6)); }
.tour-path-end { fill: #fffaf2; stroke: #e2a063; stroke-width: 2; }
@keyframes tour-dash { to { stroke-dashoffset: -13; } }
body.is-dragging-study .tour-path,
.tour-path.demo { opacity: 0; }
.tour-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 120;
  width: 26px;
  height: 26px;
  pointer-events: none;
}
.tour-cursor svg { width: 26px; height: 26px; fill: #2e241c; stroke: #fffaf2; stroke-width: 1.6; stroke-linejoin: round; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3)); }
.tutorial-fly-card {
  z-index: 110;
  transform-origin: 30% 50%;
}

/* the card */
.tour-card {
  z-index: 90;
  width: min(330px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-strong) 96%, transparent);
  box-shadow: 0 30px 60px -28px rgba(40, 28, 16, 0.45), 0 2px 6px rgba(40, 28, 16, 0.06);
  padding: 16px 18px 14px;
  backdrop-filter: blur(12px);
}
.tour-card.docked {
  right: auto;
  left: 20px;
  bottom: 20px;
}
.tour-progress {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: color-mix(in srgb, var(--line) 60%, transparent);
}
.tour-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f3c08a, #e2a063);
  transition: width 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tour-card .tour-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 4px;
  min-height: 20px;
}
.tour-num {
  color: #c98545;
  font-family: "Songti SC", "STSong", serif;
  font-size: 1.15rem;
  font-weight: 700;
}
.tour-count { color: var(--muted); font-size: 0.72rem; }
.tour-head .tour-try,
.tour-head .tour-done { margin-left: auto; }
.tour-card h3 { margin: 6px 0 6px; font-size: 1.02rem; font-weight: 700; }
.tour-card p { margin: 0; font-size: 0.86rem; line-height: 1.6; }
.tour-card .tour-actions { margin-top: 14px; }
.tour-card .tour-actions .tour-skip { font-size: 0.78rem; }
.tour-card .tour-demo-button[disabled] { opacity: 0.5; cursor: default; }
.tour-done { color: #6f8f6a; font-size: 0.8rem; font-weight: 700; animation: dialog-in 200ms ease-out; }
.tour-card.at-target::before { background: var(--surface-strong); }

/* ======================================================================
   主题 v2 (Claude, 2026-09-29): every palette brings its own paper and an ambient glow
   in its two signature colours; the picker previews each one as a tiny page.
   ====================================================================== */
/* The glow sits on the canvas, under everything (z-index -1; body is not a stacking
   context, so its own background stays on the canvas below it). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--page-glow, none);
  pointer-events: none;
}
body[data-mode="dark"]::before { opacity: 0.35; }
.sidebar,
.calendar-panel,
.detail-panel {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.palette-choices {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.palette-choices .palette-card {
  gap: 6px;
  border-radius: 16px;
  padding: 8px 8px 10px;
}
.palette-choices .palette-card:hover {
  box-shadow: 0 12px 24px -18px rgba(40, 30, 20, 0.5);
  transform: translateY(-2px);
}
.palette-choices .palette-card[aria-pressed="true"] {
  border-color: var(--p-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-accent) 28%, transparent);
}
.palette-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--p-line);
  border-radius: 11px;
  background:
    radial-gradient(70% 90% at 0% 0%, var(--p-glow-a), transparent 70%),
    radial-gradient(70% 90% at 100% 100%, var(--p-glow-b), transparent 72%),
    var(--p-bg);
}
.pp-card {
  position: absolute;
  left: 10px;
  top: 10px;
  right: 34%;
  bottom: 10px;
  border: 1px solid var(--p-line);
  border-radius: 8px;
  background: var(--p-surface);
  box-shadow: 0 6px 12px -10px rgba(0, 0, 0, 0.4);
}
.pp-card i { position: absolute; display: block; border-radius: 3px; }
.pp-card .pp-bar { left: 7px; top: 7px; width: 16px; height: 4px; background: var(--p-accent); }
.pp-line { left: 7px; top: 16px; right: 22px; height: 3px; background: color-mix(in srgb, var(--p-ink) 35%, transparent); }
.pp-line.short { top: 24px; right: 40px; background: color-mix(in srgb, var(--p-ink) 18%, transparent); }
.pp-ring {
  right: 6px;
  bottom: 6px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--p-accent);
  border-right-color: color-mix(in srgb, var(--p-accent) 25%, transparent);
  border-radius: 999px !important;
}
.pp-echo {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 26%;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--p-warm), var(--p-cool));
}
.pp-echo::after {
  content: "";
  position: absolute;
  left: 42%;
  top: -4px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: radial-gradient(circle at 38% 34%, #fff6e6, var(--p-warm));
  box-shadow: 0 0 8px var(--p-warm);
}
.palette-card .palette-swatches i { width: 12px; height: 12px; }
.palette-card .palette-name { font-size: 0.86rem; }
.palette-mood {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

/* ======================================================================
   项目颜色 (Claude, 2026-09-29): twelve named colours that sit well together + 自定义
   ====================================================================== */
.project-meta-grid .color-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.color-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 10px 12px;
}
.color-swatch {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: var(--swatch);
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 160ms ease;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch[aria-checked="true"],
.color-swatch.custom.is-custom {
  box-shadow: 0 0 0 2px var(--surface-strong), 0 0 0 4px var(--swatch);
}
.color-swatch[aria-checked="true"]::after,
.color-swatch.custom.is-custom::after {
  content: "";
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}
.color-swatch.custom {
  overflow: hidden;
  background: conic-gradient(from 0deg, #d96f67, #dd914a, #c9a43b, #8aa65f, #5f9a8a, #4f8fb0, #8f79d6, #c67aa0, #d96f67);
}
.color-swatch.custom.is-custom { background: var(--swatch); }
.color-swatch.custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.color-name {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
@media (max-width: 760px) {
  .color-swatch { width: 32px; height: 32px; }
  .color-field { gap: 10px; }
}

/* ======================================================================
   手机 v3 (Claude, 2026-09-29)
   - 月: a clean compact month (dots, like a phone calendar); tap a day for its list.
   - 周: the week as a vertical list of full-width days — the place to plan by dragging.
   - 任务池: a bottom sheet; while a card is dragged it drops to a slim bar.
   - 长按 350ms to drag (the card sinks while held); moving first scrolls the page.
   ====================================================================== */
.tray-backdrop { display: none; }
.drag-source {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.is-pressing {
  transform: scale(0.97);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--event-color, var(--accent)) 45%, transparent), 0 10px 22px -12px rgba(40, 30, 20, 0.45) !important;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.mobile-more { position: fixed; inset: 0; z-index: 60; }
.mobile-more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 22, 14, 0.28);
  opacity: 0;
  transition: opacity 200ms ease;
}
.mobile-more-sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid;
  gap: 2px;
  border-radius: 22px;
  background: var(--surface-strong);
  padding: 8px 8px 10px;
  box-shadow: 0 30px 60px -20px rgba(30, 20, 10, 0.45);
  transform: translateY(110%);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mobile-more.open .mobile-more-backdrop { opacity: 1; }
.mobile-more.open .mobile-more-sheet { transform: none; }
.sheet-grabber {
  display: block;
  width: 38px;
  height: 4px;
  margin: 2px auto 8px;
  border-radius: 4px;
  background: var(--line-strong);
}
.mobile-more-sheet a,
.mobile-more-sheet button {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 0 14px;
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  text-decoration: none;
}
.mobile-more-sheet a:active,
.mobile-more-sheet button:active { background: var(--surface-muted); }
.mobile-more-sheet svg { width: 22px; height: 22px; fill: none; stroke: var(--accent-text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 760px) {
  /* -------- 月: compact month -------- */
  body .month-stack .weekdays { font-size: 0.72rem; }
  body .month-stack .calendar-grid { gap: 0; grid-auto-rows: minmax(66px, auto); }
  body .month-stack .day-cell {
    min-height: 62px;
    height: auto;
    padding: 6px 2px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border-radius: 12px;
  }
  body .month-stack .day-cell.is-outside { min-height: 62px; }
  body .month-stack .day-head { justify-content: center; width: 100%; }
  body .month-stack .day-number {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    font-size: 0.95rem;
  }
  body .month-stack .day-cell.is-today .day-number { background: var(--accent); color: var(--accent-ink); }
  body .month-stack .day-cell.is-selected:not(.is-today) .day-number { background: color-mix(in srgb, var(--accent) 22%, transparent); }
  body .month-stack .day-load { display: none; }
  body .month-stack .project-strip { display: none; }
  body .month-stack .day-events {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    max-width: 38px;
  }
  body .month-stack .calendar-event {
    width: 6px;
    height: 6px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--event-color, var(--accent));
    box-shadow: none;
    font-size: 0;
    overflow: hidden;
  }
  body .month-stack .calendar-event > * { display: none !important; }
  body .month-stack .calendar-event.done { opacity: 0.32; }
  body .month-stack .calendar-event:nth-child(n + 7) { display: none; }

  /* -------- 周: a list of full-width days -------- */
  body .week-grid {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
    gap: 10px;
  }
  body .week-day {
    min-height: 0;
    border-radius: 16px;
    padding: 12px 14px 12px;
  }
  body .week-day header { display: flex; align-items: baseline; gap: 8px; }
  body .week-day header strong { font-size: 1rem; }
  body .week-day header span { color: var(--muted); }
  body .week-day.is-today header strong { color: var(--accent-text); }
  body .week-day .week-safe { display: inline-block; margin: 6px 0 8px; padding: 2px 10px; font-size: 0.74rem; }
  body .week-items { display: grid; gap: 6px; }
  body .week-item {
    min-height: 40px;
    display: flex;
    align-items: center;
    border-radius: 11px;
    padding: 8px 12px;
    font-size: 0.9rem;
    line-height: 1.35;
  }
  body .week-empty { margin: 4px 0 0; color: var(--muted); font-size: 0.8rem; }

  /* -------- 任务池: bottom sheet -------- */
  body .detail-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    max-height: min(62vh, 560px);
    border: 0;
    border-radius: 22px 22px 0 0;
    background: var(--surface-strong);
    padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -20px 50px -24px rgba(30, 20, 10, 0.45);
    overflow: hidden;
    transform: none;
    transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  body .detail-panel::before {
    content: "";
    display: block;
    flex-shrink: 0;
    width: 38px;
    height: 4px;
    margin: 0 auto 6px;
    border-radius: 4px;
    background: var(--line-strong);
  }
  body .detail-panel .study-pool { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  body.right-collapsed .detail-panel,
  body:not([data-view="calendar"]) .detail-panel { display: flex; transform: translateY(110%); pointer-events: none; }
  body:not(.right-collapsed)[data-view="calendar"] .tray-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    display: block;
    background: rgba(30, 22, 14, 0.2);
  }
  /* dragging: the sheet becomes a slim bar at the bottom (still a drop target) */
  body.is-dragging-study .detail-panel { transform: translateY(calc(100% - 64px - env(safe-area-inset-bottom))); }
  body.is-dragging-study .tray-backdrop { display: none !important; }
  body.is-dragging-study .mobile-tabbar { opacity: 0; pointer-events: none; }

  /* -------- the tour: card at the top, clear of the pool sheet and the tab bar -------- */
  .tour-card,
  .tour-card.docked,
  .tour-card.at-target {
    top: 10px !important;
    bottom: auto !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
  }
  .tour-card.at-target::before { display: none; }
  .tour-card p { font-size: 0.84rem; }

  /* -------- 数据统计 -------- */
  .stats-dash .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-dash .dash-kpis .kpi:last-child { grid-column: 1 / -1; }
  .stats-dash .kpi-spark { position: static; width: 100%; height: 26px; margin-top: 4px; }
  .stats-dash .kpi-delta em { display: inline; margin-left: 4px; }
  .stats-dash .pp-list li { display: block; }
  .stats-dash .pp-bar { display: flex; width: 100%; }
  .stats-dash .dash-top { gap: 10px; }

  /* -------- 设置: a full sheet, one frame, two palettes a row -------- */
  .app-menu .menu-sheet {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    padding: calc(10px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
  }
  .app-menu .menu-output { padding: 0; border: 0; background: transparent; }
  .palette-choices { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .palette-mood { display: none; }
  .settings-nav,
  .set-nav { scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar,
  .set-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 760px) {
  /* pinned on a phone: once stuck, keep just the sentence and the thread */
  .pace-panel.v2.pinned.is-stuck .pace-lines,
  .pace-panel.v2.pinned.is-stuck .pace-projects { display: none; }
  .pace-panel.v2.pinned.is-stuck .pace-top { padding-top: 6px; }
  .pace-panel.v2.pinned.is-stuck .pace-headline { font-size: 0.82rem; }
}
.today-more {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 6px 14px;
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 700;
}
@media (max-width: 760px) {
  /* 今日概览 on a phone: the safety line, then today's list, then the rest */
  .today-layout { display: flex; flex-direction: column; gap: 12px; }
  .today-layout .today-main,
  .today-layout .today-side { display: contents; }
  .today-layout .today-main > *,
  .today-layout .today-side > * { align-self: stretch; width: 100%; min-width: 0; box-sizing: border-box; }
  .today-layout .today-hero { order: 1; }
  .today-layout .today-side > .today-block:first-child { order: 2; }
  .today-layout .today-bill { order: 3; }
  .today-layout .today-main > .today-block { order: 4; }
  .today-layout .today-note-card { order: 6; }
  .today-layout .today-task { min-height: 48px; }
  .today-layout .today-check { width: 26px; height: 26px; }
}
@media (max-width: 760px) {
  .stats-dash .dash-projects { min-height: 0; }
}
@media (max-width: 760px) {
  /* the tour: a lower pool sheet, so the days above it stay in view */
  body.tutorial-sandbox .detail-panel { max-height: 40vh; }
  body.tutorial-sandbox .tray-backdrop { display: none !important; }
  .tour-card { padding: 12px 14px 10px; }
  .tour-card h3 { margin: 4px 0 4px; }
  .tour-card .tour-actions { margin-top: 8px; }
}
@media (max-width: 760px) {
  body .week-item.done { min-height: 30px; padding: 4px 12px; font-size: 0.8rem; }
}
@media (max-width: 760px) {
  /* where a dragged card will land */
  body .week-day.drag-over,
  body .month-stack .day-cell.drag-over {
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface-strong));
  }
  body .detail-panel.drag-over { box-shadow: 0 -20px 50px -24px rgba(30, 20, 10, 0.45), inset 0 3px 0 var(--accent); }
}
.dash-donut svg { overflow: visible; }
.new-project-form .form-actions,
.project-meta-editor .form-actions { background: transparent; }
/* the 拖到这里 label sits at the top of the frame, clear of the path's end point */
.tour-drop-mark { place-items: start center; padding-top: 6px; }

/* 账号与云同步 (cloud.js) */
.cloud-login { display: flex; gap: 8px; margin-top: 8px; }
.cloud-login input { flex: 1; min-width: 0; min-height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 12px; font: inherit; }
.cloud-login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-faint); }
.cloud-login button { flex-shrink: 0; border-radius: 12px; }

/* 账号页（cloud.js）和反馈卡片 */
.account-page { display: grid; gap: 18px; }
.acct-hero { text-align: center; padding: 22px 12px 6px; }
.acct-hero h3 { margin: 12px 0 6px; font-family: "Songti SC", "Noto Serif SC", serif; font-size: 1.25rem; letter-spacing: 0.08em; color: var(--ink); }
.acct-hero p { margin: 0 auto; max-width: 30em; color: var(--muted); font-size: 0.9rem; line-height: 1.75; }
.acct-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.acct-form { display: grid; gap: 12px; max-width: 380px; width: 100%; margin: 0 auto; padding-bottom: 8px; }
.acct-field { display: grid; gap: 6px; }
.acct-field > span { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }
.acct-field input { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-strong); color: var(--ink); padding: 0 14px; font: inherit; }
.acct-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-faint); }
.cloud-code-row { display: grid; gap: 12px; }
.cloud-code-row[hidden] { display: none; }
.cloud-code { letter-spacing: 0.4em; font-size: 1.1rem; text-align: center; }
.acct-wide { min-height: 44px; border-radius: 12px; width: 100%; }
.acct-status { margin: 0; min-height: 1.4em; text-align: center; font-size: 0.84rem; color: var(--muted); }
.acct-status:empty { display: none; }
.acct-profile { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-strong); }
.acct-profile .acct-icon { margin: 0; flex-shrink: 0; font-size: 1.3rem; font-weight: 700; }
.acct-who { min-width: 0; display: grid; gap: 3px; }
.acct-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; color: var(--ink); }
.acct-who span { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
.acct-profile + .acct-status { text-align: left; display: flex; align-items: center; gap: 8px; }
.acct-profile + .acct-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); flex-shrink: 0; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.acct-actions button { min-height: 40px; border-radius: 12px; padding: 0 18px; }
.acct-danger { margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; justify-items: start; }
.acct-danger h4 { margin: 0; font-size: 0.9rem; color: var(--danger); }
.acct-danger p { margin: 0; font-size: 0.82rem; line-height: 1.7; color: var(--muted); }
.acct-danger .danger-action { min-height: 38px; border-radius: 12px; background: transparent; color: var(--danger); }
.acct-danger .danger-action:hover:not(:disabled) { background: var(--danger); color: #fff; }
.acct-danger [hidden] { display: none; }
.acct-confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acct-confirm input { min-height: 38px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-strong); color: var(--ink); padding: 0 12px; font: inherit; }
.acct-confirm button { min-height: 38px; border-radius: 12px; }
.acct-confirm .danger-action:not(:disabled) { background: var(--danger); color: #fff; }
.feedback-card { display: grid; gap: 10px; }
.feedback-mail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-strong); }
.feedback-address { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; font-size: 0.98rem; color: var(--ink); user-select: all; }
.feedback-mail button, .feedback-send { min-height: 36px; border-radius: 10px; padding: 0 14px; display: inline-grid; place-items: center; font: inherit; font-size: 0.86rem; }
.feedback-send { border: 1px solid var(--line-strong); background: transparent; color: var(--ink); text-decoration: none; }
.feedback-send:hover { border-color: var(--accent); color: var(--accent-text); }
.set-hint.small { font-size: 0.78rem; opacity: 0.85; }
@media (max-width: 760px) {
  .acct-actions button { flex: 1; }
  .feedback-mail { padding: 12px; }
  .feedback-mail button, .feedback-send { flex: 1; }
}
/* 账号页：别让格子把行撑满 */
.account-page { align-content: start; grid-auto-rows: max-content; }
.acct-form { align-content: start; grid-auto-rows: max-content; }
.acct-wide { height: 44px; }
.acct-hero { padding-bottom: 14px; }
.settings-page { align-content: start; grid-auto-rows: max-content; }
.feedback-card { align-content: start; grid-auto-rows: max-content; }
/* 账号页：状态行、重试、反馈的写信菜单 */
.acct-statusrow { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.acct-statusrow .acct-status { text-align: left; display: flex; align-items: center; gap: 8px; }
.acct-statusrow .acct-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); flex-shrink: 0; }
.acct-statusrow .acct-status:empty { display: none; }
.acct-retry { min-height: 30px; border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; color: var(--ink); padding: 0 12px; font: inherit; font-size: 0.82rem; }
.acct-retry[hidden] { display: none; }
.profile-group { margin-bottom: 4px; }
.feedback-write { position: relative; }
.feedback-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 240px; display: grid; gap: 2px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-strong); box-shadow: var(--shadow-soft); }
.feedback-menu[hidden] { display: none; }
.feedback-menu a { padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 0.88rem; }
.feedback-menu a:hover { background: var(--accent-faint); color: var(--accent-text); }
.feedback-menu small { padding: 6px 12px 4px; color: var(--muted); font-size: 0.76rem; line-height: 1.6; }
@media (max-width: 760px) {
  .feedback-write { flex: 1; }
  .feedback-write .feedback-send { width: 100%; }
  .feedback-menu { left: 0; right: 0; }
}
/* 数据与备份页 */
.data-page { display: grid; gap: 14px; align-content: start; grid-auto-rows: max-content; }
.data-intro { padding: 4px 4px 6px; }
.data-intro h3 { margin: 0 0 6px; font-family: "Songti SC", "Noto Serif SC", serif; font-size: 1.2rem; letter-spacing: 0.06em; color: var(--ink); }
.data-intro p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.75; }
.data-card { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-strong); }
.data-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; color: var(--accent-text); background: var(--accent-soft); }
.data-body { min-width: 0; display: grid; gap: 6px; }
.data-body h4 { margin: 0; font-size: 0.98rem; color: var(--ink); }
.data-body p { margin: 0; font-size: 0.84rem; line-height: 1.75; color: var(--muted); }
.data-status { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.data-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; }
.data-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.data-actions button { min-height: 38px; border-radius: 12px; padding: 0 18px; }
.data-actions [hidden] { display: none; }
.data-card.danger { background: transparent; border-style: dashed; border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.data-card.danger .data-icon { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.data-card.danger h4 { color: var(--danger); }
.data-card.danger .danger-action { background: transparent; color: var(--danger); }
.data-card.danger .danger-action:hover:not(:disabled) { background: var(--danger); color: #fff; }
.data-card.danger #settings-clear-all:not(:disabled) { background: var(--danger); color: #fff; }
.data-card .danger-zone { margin: 0; }
.data-card .danger-zone input { width: 190px; min-height: 38px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-strong); color: var(--ink); padding: 0 12px; font: inherit; }
@media (max-width: 760px) {
  .data-card { padding: 14px; gap: 12px; }
  .data-actions button, .data-card .danger-zone input { flex: 1; }
}
/* 次要按钮：账号页、数据页统一成柔和描边 */
.acct-actions button:not(.primary-action),
.data-actions button:not(.primary-action):not(.danger-action),
.acct-confirm button:not(.danger-action),
.acct-retry {
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: none;
  font-weight: 600;
}
.acct-actions button:not(.primary-action):hover,
.data-actions button:not(.primary-action):not(.danger-action):hover { border-color: var(--accent); color: var(--accent-text); }
/* 登录同意 */
.acct-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 0.8rem; line-height: 1.6; color: var(--muted); cursor: pointer; }
.acct-consent input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.acct-consent a, .acct-legal a { color: var(--accent-text); }
.acct-legal { margin: 0; font-size: 0.78rem; color: var(--muted); }
.acct-wide:disabled { opacity: 0.45; cursor: not-allowed; }

/* 夜间模式：已完成的事项别再套浅灰底色 —— 划掉后仍然要看得清 */
body[data-mode="dark"] .calendar-event.done,
body[data-mode="dark"] .calendar-event.done[data-type],
body[data-mode="dark"] .week-item.done,
body[data-mode="dark"] .task-item.done,
body[data-mode="dark"] .focus-day-task.done,
body[data-mode="dark"] .day-row.done {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: color-mix(in srgb, var(--ink) 66%, var(--surface));
  opacity: 1;
}
body[data-mode="dark"] .calendar-event.done .dot { background: color-mix(in srgb, var(--ink) 45%, transparent); }
body[data-mode="dark"] .calendar-event.done span:last-child,
body[data-mode="dark"] .week-item.done { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink) 38%, transparent); }

/* 全部事项：每条事项是一张轻卡片，悬停时和今日概览一样泛起项目色的淡淡荧光 */
.list-rows { display: grid; gap: 6px; overflow: visible; border: 0; border-radius: 0; background: transparent; }
.list-row {
  position: relative;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  padding: 8px 12px 8px 16px;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 220ms ease, transform 180ms ease;
}
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row::before {
  content: "";
  position: absolute;
  left: 6px; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--event-color, var(--line-strong));
  opacity: 0.85;
  transition: opacity 180ms ease, transform 200ms ease;
}
.list-row:hover,
.list-row:focus-within {
  background: color-mix(in srgb, var(--event-color, var(--accent)) 8%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--event-color, var(--accent)) 38%, var(--line));
  box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--event-color, var(--accent)) 55%, transparent), 0 0 0 3px color-mix(in srgb, var(--event-color, var(--accent)) 10%, transparent);
  transform: translateX(2px);
}
.list-row:hover::before { transform: scaleY(1.15); opacity: 1; }
.list-row .list-date input { border-color: transparent; background: transparent; color: var(--muted); transition: border-color 160ms ease, background 160ms ease; }
.list-row:hover .list-date input,
.list-row .list-date input:focus { border-color: var(--line-strong); background: var(--surface-strong); color: var(--ink); }
.list-row.done { opacity: 0.72; }
.list-row.done:hover { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .list-row, .list-row::before { transition: none; } .list-row:hover { transform: none; } }

/* 手机上：灰色辅助文字更深一点、别再小于 13px（对比度和字号都按可读来定） */
@media (max-width: 760px) {
  html body[data-mode], html body { --muted: color-mix(in srgb, var(--ink) 80%, var(--surface)) !important; }
  /* not inside 回响之书: its pages are laid out at a fixed size and scaled as a whole, so a
     minimum text size there breaks the page apart */
  body :is(small, dt, figcaption, .topbar-context, .note-saved, .tray-hint, .pace-capacity, .kpi-label, .kpi-delta, .kpi-note, .chart-empty, .view-hint, .section-empty, .set-hint, .list-meta, .day-row-meta, .palette-mood, .weekdays span, .dash-card header p, .heat-legend span, .mobile-tabbar .tab-item span):not(.wb-view *) {
    font-size: 0.82rem !important;
  }
  body :is(.set-hint.small, .acct-status, .data-status, .acct-who span, .acct-danger p, .data-body p) { font-size: 0.84rem; }
}

/* 回响之书页脚：像 logo 一样的字标 */
.wb-folio { display: flex; align-items: center; gap: 0.9em; }
.wb-folio.right { justify-content: flex-end; }
.wb-wordmark {
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  font-size: 1.32em;
  font-weight: 600;
  letter-spacing: 0.5em;
  margin-right: -0.5em;
  color: rgba(122, 96, 62, 0.92);
  background: linear-gradient(100deg, #8a6a3f 0%, #b78f5a 48%, #8a6a3f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.wb-wordmark.en { font-family: "Songti SC", "Times New Roman", serif; font-size: 1em; font-weight: 500; letter-spacing: 0.62em; margin-right: -0.62em; }
.wb-folio-rule { width: 1px; height: 1.1em; background: rgba(146, 133, 117, 0.45); }
.wb-folio-year { font-family: "Times New Roman", "Songti SC", serif; letter-spacing: 0.2em; color: rgba(146, 133, 117, 0.9); font-size: 0.95em; }
.install-steps { margin: 4px 0 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 0.86rem; line-height: 1.7; color: var(--muted); }
.install-steps b { color: var(--ink); font-weight: 600; }

/* 悬停提示：任何模式下都是深底浅字（夜间模式里 --ink 是浅色，原来会变成浅底浅字） */
.dash-tip {
  background: rgba(36, 30, 26, 0.96);
  color: #fffaf2;
  border: 1px solid rgba(255, 250, 242, 0.14);
}

/* ================= 今日概览 v2 (tv2) ================= */
.tv2-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 2px 2px 16px; flex-wrap: wrap; }
.tv2-date { margin: 0 0 4px; font-size: 0.8rem; letter-spacing: 0.1em; color: var(--muted); }
.tv2-hello h2 { margin: 0; font: 600 1.75rem/1.25 "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif; letter-spacing: 0.04em; color: var(--ink); }
.tv2-sub { margin: 6px 0 0; font-size: 0.92rem; color: var(--muted); }
.tv2-switch { margin: 0; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-strong); }
.tv2-switch > span { min-width: 56px; text-align: center; font-size: 0.86rem; color: var(--ink); }
.tv2-switch button[data-shift] { width: 30px; height: 30px; border: 0; background: transparent; color: var(--ink); }
.tv2-switch button[data-shift]:hover { background: var(--accent-faint); }
.tv2-switch .overview-today { padding: 0 8px; font-size: 0.84rem; }

.today-layout.tv2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(250px, 1fr); gap: 16px; align-items: start; }
.tv2 > .tv2-line, .tv2 > .tv2-bill { grid-column: 1 / -1; }
.tv2-main, .tv2-side { display: grid; gap: 16px; min-width: 0; align-content: start; grid-auto-rows: max-content; }

.tv2-card, .tv2-line, .tv2-bill {
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--surface-strong), color-mix(in srgb, var(--surface-strong) 76%, var(--bg)));
  box-shadow: 0 12px 30px -24px rgba(60, 45, 30, 0.5);
}
.tv2-card { padding: 18px 18px 14px; }
.tv2-line { padding: 10px 20px 12px; overflow: hidden; }
.tv2-line .safety-line { margin: 0 auto; max-width: 780px; background: transparent; border: 0; box-shadow: none; padding: 0; }
.tv2-line .safety-line .sl-head { padding-top: 4px; }
.tv2-line .safety-line.slim .sl-sky-wrap { margin: 0 auto; }
.tv2-line .safety-line.slim .sl-stats { display: flex; justify-content: center; gap: 28px; margin: 2px 0 0; padding: 6px 0 2px; border: 0; }
.tv2-line .safety-line.slim .sl-stats > div { display: inline-flex; align-items: baseline; gap: 8px; border: 0; padding: 0; }
.tv2-line .safety-line.slim .sl-stats > div + div { border: 0; }
.tv2-line .safety-line.slim .sl-stats span { font-size: 0.78rem; }
.tv2-line .safety-line.slim .sl-stats b { font-size: 1.05rem; }
.tv2-line .hero-ahead { margin: 6px 0 0; text-align: center; font-size: 0.86rem; color: var(--muted); }
.tv2-rest { margin: 0; padding: 14px 4px; text-align: center; font: 600 1.1rem "Songti SC", "Noto Serif SC", serif; }
.tv2-rest span { display: block; margin-top: 4px; font: 400 0.86rem -apple-system, "PingFang SC", sans-serif; color: var(--muted); }

/* the bill */
.tv2-bill { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 18px; --tone: #e8a56a; background: linear-gradient(100deg, color-mix(in srgb, var(--tone) 13%, var(--surface-strong)), var(--surface-strong) 70%); border-color: color-mix(in srgb, var(--tone) 32%, var(--line)); }
.tv2-bill.ahead { --tone: #78ad8c; }
.tv2-bill.rest { --tone: #8d9fc6; }
.tv2-bill-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; background: color-mix(in srgb, var(--tone) 22%, transparent); }
.tv2-bill-body h3 { margin: 0; font-size: 1rem; color: var(--ink); }
.tv2-bill-body p { margin: 3px 0 0; font-size: 0.86rem; color: var(--muted); line-height: 1.6; }
.tv2-bill-chips { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; justify-content: flex-end; }
.tv2-bill-chips li { display: grid; gap: 1px; padding: 6px 12px; border-radius: 12px; background: color-mix(in srgb, var(--tone) 12%, var(--surface-strong)); border: 1px solid color-mix(in srgb, var(--tone) 20%, transparent); text-align: center; }
.tv2-bill-chips span { font-size: 0.72rem; color: var(--muted); }
.tv2-bill-chips b { font-size: 0.98rem; color: var(--ink); font-variant-numeric: tabular-nums; }

/* 今天要做 — the star */
.tv2-today { padding: 20px 20px 14px; }
.tv2-today header h3 { font: 600 1.25rem "Songti SC", "Noto Serif SC", serif; letter-spacing: 0.05em; }
.tv2-today .today-task { padding: 9px 10px; }
.tv2-today .today-task-title { font-size: 1.02rem; }
.tv2-empty { display: grid; gap: 6px; padding: 24px 8px 20px; text-align: center; color: var(--muted); font-size: 0.9rem; line-height: 1.7; }
.tv2-empty b { font: 600 1.15rem "Songti SC", "Noto Serif SC", serif; color: var(--ink); }

/* 之前没做完 — folded away */
.tv2-late { padding: 12px 16px; }
.tv2-late-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tv2-late-toggle { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--ink); font: 600 1rem inherit; font-family: inherit; padding: 6px 4px; cursor: pointer; }
.tv2-late-toggle b { min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 0.78rem; text-align: center; }
.tv2-late-toggle svg { transition: transform 200ms ease; color: var(--muted); }
.tv2-late.open .tv2-late-toggle svg { transform: rotate(180deg); }
.tv2-late-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tv2-soft { min-height: 32px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: 0.82rem; cursor: pointer; transition: background 160ms ease, border-color 160ms ease; }
.tv2-soft:hover { border-color: var(--accent); background: var(--accent-faint); }
.tv2-soft.primary { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); font-weight: 600; }
.tv2-late-hint { margin: 2px 4px 4px; font-size: 0.84rem; color: var(--muted); }
.tv2-late.open .tv2-late-hint { display: none; }
.tv2-late-body { margin-top: 8px; display: grid; gap: 10px; }
.tv2-late-group h4 { display: flex; align-items: center; gap: 8px; margin: 6px 4px 2px; font-size: 0.86rem; color: var(--muted); font-weight: 600; }
.tv2-late-group h4 i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tv2-late-group h4 span { font-weight: 500; opacity: 0.8; }

/* note */
.tv2-note h3 { margin: 0 0 8px; font: 600 1.05rem "Songti SC", "Noto Serif SC", serif; letter-spacing: 0.04em; }
.tv2-note textarea { width: 100%; min-height: 110px; resize: vertical; border: 0; outline: 0; border-radius: 12px; padding: 6px 4px; color: var(--ink); font: inherit; line-height: 32px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, color-mix(in srgb, var(--line-strong) 70%, transparent) 31px, color-mix(in srgb, var(--line-strong) 70%, transparent) 32px); }
.tv2-note textarea::placeholder { color: var(--muted); opacity: 0.75; }
.tv2-note .note-saved { margin: 6px 0 0; font-size: 0.78rem; color: var(--muted); }
.tv2-note blockquote { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--accent-faint); font-size: 0.86rem; line-height: 1.7; color: var(--ink); }
.tv2-note blockquote span { display: block; margin-bottom: 2px; font-size: 0.74rem; color: var(--muted); }

/* entrance */
.tv2.enter > *, .tv2.enter .tv2-main > *, .tv2.enter .tv2-side > * { animation: de-rise 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.tv2.enter > :nth-child(2) { animation-delay: 60ms; }
.tv2.enter .tv2-main > :nth-child(2), .tv2.enter .tv2-side > :nth-child(2) { animation-delay: 140ms; }
.tv2.enter .tv2-main > :nth-child(n + 3) { animation-delay: 200ms; }

@media (max-width: 1100px) { .today-layout.tv2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .tv2-head { padding-bottom: 12px; }
  .tv2-hello h2 { font-size: 1.5rem; }
  .today-layout.tv2 { display: flex; flex-direction: column; gap: 12px; }
  .tv2-main, .tv2-side { display: contents; }
  .tv2 > .tv2-bill { order: 1; }
  .tv2-main > .tv2-today { order: 2; }
  .tv2 > .tv2-line { order: 3; }
  .tv2-main > .tv2-late { order: 4; }
  .tv2-main > .tv2-card:not(.tv2-today):not(.tv2-late) { order: 5; }
  .tv2-side > .tv2-note { order: 6; }
  .tv2 > *, .tv2-main > *, .tv2-side > * { align-self: stretch; width: 100%; min-width: 0; box-sizing: border-box; }
  .tv2-bill { grid-template-columns: auto minmax(0, 1fr); }
  .tv2-bill-chips { grid-column: 1 / -1; justify-content: flex-start; }
  .tv2-line { padding: 8px 12px 10px; }
  .tv2-late-actions { width: 100%; }
  .tv2-late-actions .tv2-soft { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .tv2.enter *, .tv2-late-toggle svg { animation: none !important; transition: none !important; } }

/* 安全线：窄长版 —— 左边是文字和数字，右边是星轨 */
.tv2-line .safety-line.slim { max-width: none; display: grid; grid-template-columns: minmax(230px, 0.85fr) minmax(0, 1.7fr); grid-template-areas: "head sky" "sub sky" "stats sky"; column-gap: 8px; align-items: center; align-content: center; }
.tv2-line .safety-line.slim .sl-head { grid-area: head; align-self: end; display: grid; gap: 6px; justify-items: start; padding-top: 0; }
.tv2-line .safety-line.slim .sl-divider { display: none; }
.tv2-line .safety-line.slim .sl-title { font-size: 1.15rem; }
.tv2-line .safety-line.slim .sl-head-extra { justify-self: start; }
.tv2-line .safety-line.slim .sl-sub { grid-area: sub; margin: 4px 0 0; align-self: start; }
.tv2-line .safety-line.slim .sl-sky-wrap { grid-area: sky; margin: 0; min-width: 0; }
.tv2-line .safety-line.slim .sl-stats { grid-area: stats; justify-content: flex-start; gap: 18px; align-self: start; padding: 8px 0 0; flex-wrap: wrap; }
@media (max-width: 900px) {
  .tv2-line .safety-line.slim { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "sub" "sky" "stats"; }
  .tv2-line .safety-line.slim .sl-stats { justify-content: center; }
}
@media (max-width: 600px) {
  /* the sky is small on a phone: its tiny labels repeat the numbers right underneath, so drop them */
  .tv2-line .safety-line.slim .sl-sky text { display: none; }
  .tv2-line .safety-line.slim .sl-sky { min-height: 60px; }
  .tv2-head { flex-wrap: nowrap; align-items: flex-start; }
  .tv2-switch { transform: scale(0.9); transform-origin: right top; flex-shrink: 0; }
  .tv2-hello { min-width: 0; }
}

/* ---- 今日概览：调小问候、账单变窄、今天要做更突出、所有卡片都有跟随鼠标的光晕 ---- */
.tv2-hello h2 { font-size: 1.3rem; letter-spacing: 0.03em; }
.tv2-sub { font-size: 0.86rem; margin-top: 4px; }
.tv2-head { padding-bottom: 12px; }

.tv2-bill { padding: 8px 14px; gap: 12px; border-radius: 16px; }
.tv2-bill-icon { width: 32px; height: 32px; border-radius: 10px; font-size: 1.05rem; }
.tv2-bill-body h3 { font-size: 0.92rem; }
.tv2-bill-body p { margin-top: 1px; font-size: 0.8rem; line-height: 1.5; }
.tv2-bill-chips { gap: 6px; }
.tv2-bill-chips li { padding: 3px 10px; border-radius: 10px; }
.tv2-bill-chips span { font-size: 0.68rem; }
.tv2-bill-chips b { font-size: 0.9rem; }

/* 今天要做：整页的视觉重心 */
.tv2-today {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--surface-strong)), var(--surface-strong) 65%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent), 0 22px 46px -26px color-mix(in srgb, var(--accent) 65%, transparent);
  padding: 22px 22px 16px;
}
.tv2-today header h3 { font-size: 1.35rem; }

/* 所有卡片：光晕颜色（跟随鼠标的 .spot 光在 styles.css 前面定义） */
.tv2-line { --course-color: #f0b27c; }
.tv2-bill { --course-color: var(--tone); }
.tv2-today { --course-color: var(--accent); }
.tv2-late, .tv2-note { --course-color: var(--accent); }
.tv2-card.spot:hover, .tv2-line.spot:hover, .tv2-bill.spot:hover {
  box-shadow: 0 18px 40px -24px color-mix(in srgb, var(--course-color, var(--accent)) 60%, transparent);
}
.tv2-today.spot:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent), 0 26px 52px -26px color-mix(in srgb, var(--accent) 75%, transparent); }
.tv2-card, .tv2-line, .tv2-bill { transition: box-shadow 240ms ease, border-color 240ms ease; }
@media (max-width: 600px) { .tv2-hello h2 { font-size: 1.15rem; } }

/* ================= 今日概览 v3：左边「今天要做」是主角，右边是安全线 / 账单 / 留言 ================= */
.today-layout.tv2 { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 18px; }
.tv2-line { padding: 14px 16px 14px; overflow: visible; }
.tv2-line .safety-line { max-width: none; }

/* 今天要做 */
.tv2-today {
  position: relative;
  padding: 0 0 12px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--accent) 70%, var(--line));
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 24%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, var(--surface-strong)), var(--surface-strong) 70%);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent), 0 34px 64px -30px color-mix(in srgb, var(--accent) 80%, transparent);
  min-height: 300px;
}
.tv2-today::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--line-warm, #edb08a), color-mix(in srgb, var(--accent) 30%, transparent));
}
.tv2-today .tv2-today-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 24px 24px 14px; }
.tv2-today-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tv2-sun { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; color: var(--accent-text); background: color-mix(in srgb, var(--accent) 24%, var(--surface-strong)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 10px 22px -10px var(--accent); }
.tv2-today-title h3 { margin: 0; font: 600 1.6rem/1.2 "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif; letter-spacing: 0.06em; color: var(--ink); }
.tv2-today-title h3::before { display: none; }
.tv2-today-title p { margin: 3px 0 0; font-size: 0.86rem; color: var(--muted); }
.tv2-ring { position: relative; width: 62px; height: 62px; flex-shrink: 0; }
.tv2-ring svg { width: 62px; height: 62px; }
.tv2-ring .tp-track { fill: none; stroke: color-mix(in srgb, var(--accent) 18%, transparent); stroke-width: 5; }
.tv2-ring .tp-value { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; transition: stroke-dasharray 500ms cubic-bezier(0.2, 0.8, 0.2, 1); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent)); }
.tv2-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.74rem; color: var(--muted); }
.tv2-ring span b { font-size: 1.05rem; color: var(--ink); margin-right: 1px; }
.tv2-today .today-task-list { display: grid; gap: 8px; padding: 0 18px; }
.tv2-today .today-task {
  padding: 13px 16px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 220ms ease;
}
.tv2-today .today-task:hover { border-color: color-mix(in srgb, var(--event-color, var(--accent)) 45%, var(--line)); box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--event-color, var(--accent)) 60%, transparent); }
.tv2-today .today-task-title { font-size: 1.08rem; }
.tv2-today .today-check { width: 28px; height: 28px; border-width: 2px; }
.tv2-today .today-task.done { opacity: 0.7; }
.tv2-today .tv2-empty { padding: 34px 18px 30px; }
.tv2-today .today-more { margin: 8px 18px 0; }

/* 账单：在窄栏里是一张普通的小卡 */
.tv2-bill { grid-template-columns: auto minmax(0, 1fr); padding: 14px 16px; gap: 10px 12px; border-radius: 20px; align-items: center; }
.tv2-bill-icon { width: 40px; height: 40px; font-size: 1.25rem; border-radius: 13px; }
.tv2-bill-body h3 { font-size: 0.98rem; }
.tv2-bill-body p { font-size: 0.84rem; line-height: 1.6; }
.tv2-bill-chips { grid-column: 1 / -1; justify-content: stretch; gap: 8px; }
.tv2-bill-chips li { flex: 1; padding: 6px 8px; }
.tv2-bill-chips b { font-size: 0.98rem; }

@media (max-width: 1100px) { .today-layout.tv2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .today-layout.tv2 { display: flex; flex-direction: column; gap: 12px; }
  .tv2-main, .tv2-side { display: contents; }
  .tv2-side > .tv2-bill { order: 1; }
  .tv2-main > .tv2-today { order: 2; }
  .tv2-side > .tv2-line { order: 3; }
  .tv2-main > .tv2-late { order: 4; }
  .tv2-main > .tv2-card:not(.tv2-today):not(.tv2-late) { order: 5; }
  .tv2-side > .tv2-note { order: 6; }
  .tv2-today { min-height: 0; }
  .tv2-today .tv2-today-head { padding: 20px 16px 10px; }
  .tv2-today-title h3 { font-size: 1.35rem; }
  .tv2-today .today-task-list { padding: 0 12px; }
  .tv2-sun { width: 40px; height: 40px; }
}

/* 今天要做：任务行不被拉高；暖色和光更足 */
.tv2-today { display: flex; flex-direction: column; min-height: 0; --sun: var(--line-warm, #edb08a); }
.tv2-today .today-task-list { flex: none; align-content: start; }
.tv2-today {
  border-color: color-mix(in srgb, var(--sun) 85%, var(--accent));
  background:
    radial-gradient(90% 70% at 8% 0%, color-mix(in srgb, var(--sun) 42%, transparent) 0%, transparent 62%),
    radial-gradient(60% 50% at 100% 100%, color-mix(in srgb, var(--sun) 18%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--sun) 12%, var(--surface-strong)), var(--surface-strong) 72%);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--sun) 24%, transparent), 0 0 46px -6px color-mix(in srgb, var(--sun) 55%, transparent), 0 36px 64px -34px color-mix(in srgb, var(--sun) 90%, transparent);
}
.tv2-today::before { background: linear-gradient(90deg, var(--sun), color-mix(in srgb, var(--sun) 55%, #fff3d6), var(--sun)); height: 6px; }
.tv2-sun { background: color-mix(in srgb, var(--sun) 38%, var(--surface-strong)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--sun) 55%, transparent), 0 0 24px -2px var(--sun); }
.tv2-ring .tp-value { stroke: var(--sun); filter: drop-shadow(0 0 7px color-mix(in srgb, var(--sun) 80%, transparent)); }
.tv2-ring .tp-track { stroke: color-mix(in srgb, var(--sun) 24%, transparent); }
.tv2-today .today-task { background: var(--surface-strong); }
.tv2-today.spot { --course-color: var(--sun); }
body[data-mode="dark"] .tv2-today { background: radial-gradient(90% 70% at 8% 0%, color-mix(in srgb, var(--sun) 26%, transparent) 0%, transparent 62%), linear-gradient(180deg, color-mix(in srgb, var(--sun) 8%, var(--surface-strong)), var(--surface-strong) 72%); }

/* 右栏的安全线：图里的小字放大一点，窄栏里才看得清 */
.tv2-line .safety-line .sl-sky text { font-size: 15px !important; }
.tv2-line .safety-line .sl-sky .sl-now { font-size: 16px !important; }

/* 暖阳色：比主题的杏色更饱和，「今天要做」靠它亮起来 */
.tv2-today { --sun: #f0a55e; border-color: #eaa163; }
.tv2-today {
  background:
    radial-gradient(85% 75% at 6% 0%, rgba(244, 170, 92, 0.34) 0%, transparent 62%),
    radial-gradient(55% 45% at 100% 100%, rgba(244, 170, 92, 0.16) 0%, transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, #f4b978 14%, var(--surface-strong)), var(--surface-strong) 70%);
  box-shadow: 0 0 0 6px rgba(240, 165, 94, 0.22), 0 0 56px -4px rgba(240, 165, 94, 0.55), 0 40px 70px -36px rgba(226, 140, 60, 0.85);
}
.tv2-today::before { background: linear-gradient(90deg, #f0a55e, #f7c98c 55%, #f0a55e); }
.tv2-sun { color: #b8641a; background: linear-gradient(145deg, #ffe2b8, #f7bd7c); box-shadow: 0 0 0 1px rgba(226, 140, 60, 0.5), 0 0 26px 0 rgba(240, 165, 94, 0.7); }
.tv2-today-title h3 { color: color-mix(in srgb, var(--ink) 92%, #7a3f0c); }
body[data-mode="dark"] .tv2-today { border-color: #d98f4e; box-shadow: 0 0 0 5px rgba(240, 165, 94, 0.2), 0 0 60px -6px rgba(240, 165, 94, 0.4); }
body[data-mode="dark"] .tv2-sun { color: #ffd9a8; background: linear-gradient(145deg, #7a4a1c, #5a3714); }

/* 进度环：数字一行、0 时不画小圆点、全部完成显示对勾 */
.tv2-ring { width: 60px; height: 60px; }
.tv2-ring svg { width: 60px; height: 60px; }
.tv2-ring .tp-track { stroke: color-mix(in srgb, #f0a55e 22%, transparent); stroke-width: 6; }
.tv2-ring .tp-value { stroke: url(#tv2RingGrad); stroke-width: 6; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(240, 165, 94, 0.55)); }
.tv2-ring .tv2-ring-text { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 19px; font-style: normal; }
.tv2-ring .tv2-ring-text b { font-size: 1.25rem; font-weight: 700; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.tv2-ring .tv2-ring-text i { font-style: normal; font-size: 0.78rem; color: var(--muted); margin-left: 1px; }
.tv2-ring.done .tv2-ring-text { align-items: center; padding-top: 0; font-size: 1.5rem; font-weight: 700; color: #d9822b; }
.tv2-ring.done .tp-value { filter: drop-shadow(0 0 8px rgba(240, 165, 94, 0.8)); }
.tv2-ring span { display: none; }

/* 账单卡：更扁 */
.tv2-bill { padding: 10px 14px 10px; gap: 6px 12px; border-radius: 16px; }
.tv2-bill-icon { width: 32px; height: 32px; font-size: 1.05rem; border-radius: 10px; }
.tv2-bill-body h3 { font-size: 0.94rem; line-height: 1.3; }
.tv2-bill-body p { margin-top: 0; font-size: 0.8rem; line-height: 1.45; }
.tv2-bill-chips { gap: 6px; }
.tv2-bill-chips li { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 4px 8px; border-radius: 999px; }
.tv2-bill-chips span { font-size: 0.72rem; }
.tv2-bill-chips b { font-size: 0.9rem; }

/* ================= 跟随主题色：今日概览、奶茶对局 ================= */
/* 今天要做 —— 暖阳色取自当前主题 */
.tv2-today { --sun: color-mix(in srgb, var(--accent) 78%, var(--line-warm, var(--accent))); border-color: var(--sun); }
.tv2-today {
  background:
    radial-gradient(85% 75% at 6% 0%, color-mix(in srgb, var(--sun) 32%, transparent) 0%, transparent 62%),
    radial-gradient(55% 45% at 100% 100%, color-mix(in srgb, var(--sun) 15%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--sun) 13%, var(--surface-strong)), var(--surface-strong) 70%);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--sun) 22%, transparent), 0 0 56px -4px color-mix(in srgb, var(--sun) 50%, transparent), 0 40px 70px -36px color-mix(in srgb, var(--sun) 85%, transparent);
}
.tv2-today::before { background: linear-gradient(90deg, var(--sun), color-mix(in srgb, var(--sun) 50%, #ffffff), var(--sun)); }
.tv2-sun { color: color-mix(in srgb, var(--sun) 45%, #3b1d00); background: linear-gradient(145deg, color-mix(in srgb, var(--sun) 30%, #ffffff), color-mix(in srgb, var(--sun) 85%, #ffffff)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--sun) 55%, transparent), 0 0 26px 0 color-mix(in srgb, var(--sun) 65%, transparent); }
.tv2-ring .tp-track { stroke: color-mix(in srgb, var(--sun) 22%, transparent); }
.tv2-ring .tp-value { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--sun) 60%, transparent)); }
.tv2-ring.done .tv2-ring-text { color: color-mix(in srgb, var(--sun) 60%, var(--ink)); }
.tv2-ring.done .tp-value { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--sun) 85%, transparent)); }
.tv2-today-title h3 { color: var(--ink); }
body[data-mode="dark"] .tv2-today { border-color: color-mix(in srgb, var(--sun) 75%, transparent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--sun) 20%, transparent), 0 0 60px -6px color-mix(in srgb, var(--sun) 40%, transparent); }
body[data-mode="dark"] .tv2-sun { color: color-mix(in srgb, var(--sun) 60%, #ffffff); background: linear-gradient(145deg, color-mix(in srgb, var(--sun) 45%, #1a1512), color-mix(in srgb, var(--sun) 28%, #1a1512)); }
/* 账单三种颜色也跟主题走 */
.tv2-bill { --tone: var(--line-warm, #e8a56a); }
.tv2-bill.ahead { --tone: var(--accent); }
.tv2-bill.rest { --tone: var(--line-cool, #8d9fc6); }

/* 奶茶对局：按钮、进度点、卡片颜色跟随主题（奶茶杯的插画保持奶茶色） */
.tea-hero, .tea-board, .tea-result { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, var(--surface-strong)), var(--surface-strong) 58%); }
.tea-result.won { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--surface-strong)), var(--surface-strong) 60%); }
body[data-mode="dark"] .tea-hero, body[data-mode="dark"] .tea-board, body[data-mode="dark"] .tea-result { background: var(--surface-strong); }
.tea-actions button.primary-action, .tea-actions .primary-action { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.tea-actions button.primary-action:hover { background: color-mix(in srgb, var(--accent) 86%, #000000); }
.tea-today b { color: var(--accent-text); }
.tea-dots li.held { background: var(--accent); color: var(--accent-ink); }
.tea-dots li.today { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent-text); }
.tea-legend i.held { background: var(--accent); }
.tea-legend i.today { box-shadow: inset 0 0 0 2px var(--accent); background: transparent; }
.tea-line, body[data-mode="dark"] .tea-line { background: var(--accent-soft); color: var(--accent-text); }
.tea-pool-card {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--paper-grain), radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 16%, var(--surface-strong)) 0%, color-mix(in srgb, var(--accent) 8%, var(--surface-strong)) 58%, var(--surface-strong) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 10px 26px -18px color-mix(in srgb, var(--accent) 65%, transparent);
}
.tea-pool-card:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 16px 30px -18px color-mix(in srgb, var(--accent) 75%, transparent); }
.tea-pool-body p { color: var(--muted); }
.tea-pool-body .tea-pool-title { color: var(--ink); }
.tea-pool-body .tea-pool-first { color: var(--muted); }
.tea-pool-body .tea-pool-first b, .tea-pool-body b { color: var(--accent-text); }
.tea-pool-tag, .tea-pool-title span { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-text); }
.tea-pool-close svg { stroke: var(--muted); }
.tea-pool-close:hover { background: var(--accent-faint); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.tea-pool-cta, .tea-pool-remind { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent-text); background: var(--surface-strong); }
.tea-pool-cta:hover, .tea-pool-remind:hover { border-color: var(--accent); }
.tea-title-chip { background: var(--accent-soft); color: var(--accent-text); }
.founder-card { background: linear-gradient(170deg, color-mix(in srgb, var(--accent) 10%, var(--surface-strong)), var(--surface-strong)); }
.founder-card button { background: var(--accent); color: var(--accent-ink); }
.founder-kicker { color: var(--accent-text); }
.founder-card h2 { color: var(--ink); }
.founder-card p { color: var(--muted); }

/* 两步确认（上线提醒） */
.consent-overlay { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 20px; background: rgba(28, 22, 16, 0.42); backdrop-filter: blur(3px); animation: de-rise 220ms ease both; }
.consent-card { width: min(440px, 100%); padding: 26px 26px 20px; border-radius: 24px; border: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--surface-strong)), var(--surface-strong) 60%); box-shadow: 0 30px 70px -24px rgba(30, 20, 10, 0.55); color: var(--ink); }
.consent-step { margin: 0 0 6px; font-size: 0.76rem; letter-spacing: 0.12em; color: var(--accent-text); }
.consent-card h2 { margin: 0 0 10px; font: 600 1.35rem/1.3 "Songti SC", "Noto Serif SC", serif; letter-spacing: 0.04em; }
.consent-card p { margin: 0 0 8px; font-size: 0.92rem; line-height: 1.75; color: var(--muted); }
.consent-card p b { color: var(--ink); }
.consent-email { padding: 10px 14px; border-radius: 12px; background: var(--accent-faint); border: 1px solid var(--line); color: var(--ink) !important; font-weight: 600; overflow-wrap: anywhere; }
.consent-field { display: grid; gap: 6px; margin: 4px 0 10px; }
.consent-field span { font-size: 0.8rem; color: var(--muted); }
.consent-input { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-strong); color: var(--ink); padding: 0 14px; font: inherit; }
.consent-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-faint); }
.consent-check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 4px; font-size: 0.86rem; line-height: 1.65; color: var(--ink); cursor: pointer; }
.consent-check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
.consent-check a { color: var(--accent-text); }
.consent-error { color: var(--danger) !important; font-size: 0.84rem !important; }
.consent-error[hidden] { display: none; }
.consent-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.consent-actions button { min-height: 40px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-strong); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.consent-actions .primary-action { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.consent-actions button:disabled { opacity: 0.45; cursor: not-allowed; }
.tea-art figcaption { color: var(--muted); }

/* 「今天要做」直接取主题主色，光更足一点 */
.tv2-today { --sun: var(--accent); border-color: var(--accent); }
.tv2-today {
  background:
    radial-gradient(85% 75% at 6% 0%, color-mix(in srgb, var(--accent) 38%, transparent) 0%, transparent 62%),
    radial-gradient(55% 45% at 100% 100%, color-mix(in srgb, var(--accent) 18%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 15%, var(--surface-strong)), var(--surface-strong) 70%);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 26%, transparent), 0 0 60px -2px color-mix(in srgb, var(--accent) 55%, transparent), 0 40px 70px -36px color-mix(in srgb, var(--accent) 90%, transparent);
}
.tv2-sun { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 45%, #ffffff), var(--accent)); color: var(--accent-ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 26px 0 color-mix(in srgb, var(--accent) 70%, transparent); }
.tv2-ring .tp-value { stroke: var(--accent); }
.tv2-ring.done .tv2-ring-text { color: var(--accent-text); }
body[data-mode="dark"] .tv2-sun { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 60%, #1a1512), color-mix(in srgb, var(--accent) 35%, #1a1512)); color: #fff; }

/* ================= 登录页 ================= */
.gate {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(380px, 0.88fr);
  overflow: auto;
  color: var(--ink);
  background:
    radial-gradient(62% 72% at 16% 32%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    radial-gradient(56% 62% at 90% 88%, color-mix(in srgb, var(--line-cool, var(--accent)) 30%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bg)), var(--bg));
  animation: gate-in 420ms ease both;
}
.gate.leaving { animation: gate-out 240ms ease both; pointer-events: none; }
@keyframes gate-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes gate-out { to { opacity: 0; } }
.gate-close { position: absolute; top: 18px; right: 22px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-strong); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.gate-close:hover { border-color: var(--accent); }

.gate-art { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 32px; text-align: center; min-width: 0; }
.gate-art-svg { width: min(560px, 100%); height: auto; overflow: visible; animation: gate-float 9s ease-in-out infinite; }
@keyframes gate-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.gate-ring { fill: none; stroke-width: 1.6; stroke-linecap: round; }
.gate-ring.glow { stroke-width: 3; opacity: 0.6; }
.gate-ring.back { opacity: 0.55; }
.gate-star { fill: #e9c48c; animation: gate-twinkle 3.6s ease-in-out infinite; }
.gate-star.s1 { animation-delay: -1.2s; }
.gate-star.s2 { animation-delay: -2.4s; }
@keyframes gate-twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.gate-art .sun-rays { animation: gate-spin 90s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes gate-spin { to { transform: rotate(360deg); } }
.gate-name { margin: 6px 0 0; font: 600 clamp(2rem, 4vw, 3rem) / 1.15 "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif; letter-spacing: 0.32em; margin-right: -0.32em; background: linear-gradient(100deg, color-mix(in srgb, var(--ink) 90%, #7a4a1a), color-mix(in srgb, var(--accent) 60%, #8a5a26)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.gate-en { margin: 8px 0 0; font: 500 0.78rem "Times New Roman", serif; letter-spacing: 0.7em; margin-right: -0.7em; color: var(--muted); }
.gate-line { margin: 22px 0 0; font-size: 1rem; color: var(--ink); opacity: 0.86; }
.gate-perks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.gate-perks li { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: color-mix(in srgb, var(--surface-strong) 70%, transparent); font-size: 0.84rem; color: var(--muted); }
.gate-perks i { font-style: normal; color: var(--accent-text); }

.gate-card { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; padding: 40px 32px; min-width: 0; }
.gate-form { width: min(420px, 100%); padding: 30px 30px 26px; border-radius: 28px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); background: color-mix(in srgb, var(--surface-strong) 88%, transparent); backdrop-filter: blur(10px); box-shadow: 0 30px 70px -34px color-mix(in srgb, var(--accent) 70%, rgba(40, 25, 10, 0.5)), 0 1px 0 rgba(255, 255, 255, 0.6) inset; }
.gate-form h2 { margin: 0; font: 600 1.5rem "Songti SC", "Noto Serif SC", serif; letter-spacing: 0.06em; }
.gate-sub { margin: 6px 0 20px; font-size: 0.9rem; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }
.gate-sub b { color: var(--ink); }
.gate-field { display: grid; gap: 6px; margin-bottom: 14px; }
.gate-field span { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }
.gate-email { min-height: 50px; border: 1.5px solid var(--line-strong); border-radius: 16px; background: var(--surface-strong); color: var(--ink); padding: 0 16px; font: inherit; font-size: 1rem; transition: border-color 160ms ease, box-shadow 160ms ease; }
.gate-email:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.gate-consent { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 16px; font-size: 0.8rem; line-height: 1.6; color: var(--muted); cursor: pointer; }
.gate-consent input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.gate-consent a { color: var(--accent-text); }
.gate-primary { width: 100%; min-height: 52px; border: 0; border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, #ffffff), var(--accent)); color: var(--accent-ink); font: 600 1rem inherit; font-family: inherit; letter-spacing: 0.12em; cursor: pointer; box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--accent) 90%, transparent); transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease; }
.gate-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 18px 32px -14px var(--accent); }
.gate-primary:disabled { opacity: 0.42; cursor: not-allowed; box-shadow: none; }
.gate-msg { margin: 0 0 12px; font-size: 0.84rem; line-height: 1.6; color: var(--danger); }
.gate-msg[hidden] { display: none; }
.gate-digits { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 14px; }
.gate-digit { width: 100%; max-width: 52px; height: 60px; text-align: center; border: 1.5px solid var(--line-strong); border-radius: 16px; background: var(--surface-strong); color: var(--ink); font: 600 1.6rem "Songti SC", "Noto Serif SC", serif; caret-color: var(--accent); transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease; }
.gate-digit:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent); transform: translateY(-2px); }
.gate-again { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 0.84rem; color: var(--muted); }
.gate-again button { border: 0; background: transparent; color: var(--accent-text); font: inherit; cursor: pointer; padding: 4px 6px; }
.gate-again button:disabled { color: var(--muted); cursor: default; }
.gate-form.shake { animation: gate-shake 360ms ease; }
@keyframes gate-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.gate-guest { width: min(420px, 100%); margin: 0; display: grid; gap: 3px; justify-items: center; text-align: center; }
.gate-guest button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.78rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 2px 6px; }
.gate-guest button:hover { color: var(--ink); }
.gate-guest span { font-size: 0.72rem; color: color-mix(in srgb, var(--danger) 70%, var(--muted)); }
.gate-guest span::before { content: "⚠ "; }

@media (max-width: 860px) {
  .gate { display: block; }
  .gate-art { padding: 30px 20px 4px; }
  .gate-art-svg { width: min(300px, 78%); }
  .gate-name { font-size: 1.7rem; }
  .gate-line { margin-top: 12px; font-size: 0.9rem; }
  .gate-perks { display: none; }
  .gate-card { padding: 14px 16px 34px; }
  .gate-form { padding: 24px 20px 20px; border-radius: 24px; }
  .gate-digit { height: 54px; font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) { .gate, .gate-art-svg, .gate-star, .gate-art .sun-rays, .gate-form.shake { animation: none !important; } }

/* 设置 → 账号：没登录时的入口 */
.acct-login-btn { margin-top: 14px; min-height: 44px; padding: 0 30px; border-radius: 14px; }
/* 首发守线员徽章 */
.founder-badge { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; padding: 4px 12px 4px 6px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: #7a4a10; background: linear-gradient(135deg, #fff1d2, #f6d9a0); border: 1px solid #e6c185; box-shadow: 0 6px 16px -10px rgba(190, 130, 50, 0.9); }
.founder-badge i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 0.7rem; color: #fff; background: radial-gradient(circle at 35% 30%, #fbe4b8, #d9a55f 70%, #b98440); }
.founder-badge[hidden] { display: none; }
body[data-mode="dark"] .founder-badge { color: #ffe3b0; background: linear-gradient(135deg, #4a3618, #6a4c22); border-color: #8a6a34; }
.gate-consent input, .acct-consent input { width: 18px; height: 18px; min-height: 0; padding: 0; flex: 0 0 18px; }
.gate-consent span { flex: 1; min-width: 0; }
.gate-art.el8 .sun-rays, .gate-art.el8 .sun-halo { opacity: 0.9; }
.gate-art-svg { width: min(680px, 100%); }
@media (max-width: 860px) { .gate-art-svg { width: min(360px, 92%); } }
.tea-mode-login { display: inline-block; margin-left: 8px; border: 0; background: transparent; color: var(--accent-text); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }
.founder-badge { justify-self: start; width: fit-content; }

/* 今日概览：右栏更紧凑，留言框不用下滑；账单在左栏 */
.tv2-line { padding: 10px 14px 10px; }
.tv2-line .safety-line .sl-head { padding-top: 0; }
.tv2-line .safety-line .sl-stats { margin-top: 0; padding: 6px 0 4px; }
.tv2-line .safety-line .sl-foot { margin-top: 4px; }
.tv2-note { padding: 14px 16px 10px; }
.tv2-note h3 { margin-bottom: 4px; }
.tv2-note textarea { min-height: 78px; line-height: 26px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 25px, color-mix(in srgb, var(--line-strong) 70%, transparent) 25px, color-mix(in srgb, var(--line-strong) 70%, transparent) 26px); }
.tv2-note .note-saved { margin-top: 2px; }
@media (max-width: 760px) {
  .tv2-main > .tv2-bill { order: 1; }
}
/* 登录页的 canvas 画面 */
.gate-canvas-wrap { width: min(680px, 100%); aspect-ratio: 640 / 340; }
.gate-canvas { display: block; width: 100%; height: 100%; }
.gate-art-svg { display: none; }
@media (max-width: 860px) { .gate-canvas-wrap { width: min(400px, 96%); } }

/* canvas 比可见画面大一圈，让光晕自然淡出 */
.gate-canvas-wrap { position: relative; }
.gate-canvas { position: absolute; left: -20.3%; top: -32.4%; width: 140.6%; height: 164.7%; pointer-events: none; }

/* ===== 2026-09-30：今日概览的两张卡颜色更淡；今天要做 > 昨天的小尾巴 ===== */
.tv2-today {
  --sun: color-mix(in srgb, var(--accent) 60%, var(--line-warm, var(--accent)));
  border-width: 1.5px;
  border-color: color-mix(in srgb, var(--sun) 55%, var(--line));
  background:
    radial-gradient(85% 75% at 6% 0%, color-mix(in srgb, var(--sun) 16%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, color-mix(in srgb, var(--sun) 6%, var(--surface-strong)), var(--surface-strong) 70%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--sun) 10%, transparent), 0 26px 50px -34px color-mix(in srgb, var(--sun) 55%, transparent);
}
.tv2-today::before { height: 4px; opacity: 0.75; }
.tv2-sun { box-shadow: 0 0 0 1px color-mix(in srgb, var(--sun) 35%, transparent), 0 0 14px 0 color-mix(in srgb, var(--sun) 35%, transparent); }
.tv2-today.spot:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--sun) 14%, transparent), 0 28px 54px -32px color-mix(in srgb, var(--sun) 60%, transparent); }
body[data-mode="dark"] .tv2-today { border-color: color-mix(in srgb, var(--sun) 45%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sun) 10%, transparent), 0 0 34px -10px color-mix(in srgb, var(--sun) 25%, transparent); }
.tv2-bill {
  background: linear-gradient(100deg, color-mix(in srgb, var(--tone) 6%, var(--surface-strong)), var(--surface-strong) 70%);
  border-color: color-mix(in srgb, var(--tone) 16%, var(--line));
  box-shadow: none;
}
.tv2-bill-icon { background: color-mix(in srgb, var(--tone) 12%, transparent); }
.tv2-bill-chips li { background: color-mix(in srgb, var(--tone) 5%, var(--surface-strong)); border-color: color-mix(in srgb, var(--tone) 12%, transparent); }
.tv2-bill.spot:hover { box-shadow: 0 12px 28px -22px color-mix(in srgb, var(--tone) 40%, transparent); }
/* 今天要做的任务行：整行点一下就完成（可撤销），右边一个小铅笔去编辑 */
.today-task-main { cursor: pointer; }
.today-edit { flex: none; align-self: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 0.95rem; cursor: pointer; opacity: 0.55; }
.today-edit:hover, .today-edit:focus-visible { opacity: 1; background: var(--accent-faint); color: var(--accent-text); }
/* 右栏：安全线和留言再高一点点 */
.tv2-note textarea { min-height: 104px; }
.tv2-today .today-task { grid-template-columns: 28px minmax(0, 1fr) 28px; }
/* 右栏两张卡再高一点 */
.tv2-line { padding: 16px 16px 16px; }
.tv2-line .safety-line .sl-stats { padding: 12px 0 8px; }
.tv2-note { padding: 18px 18px 14px; }
.tv2-note textarea { min-height: 150px; }

/* ======================================================================
   对话框 (dayechoDialog) — replaces the browser's confirm(). Claude, 2026-09-30.
   ====================================================================== */
.de-dialog { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; }
.de-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 22, 14, 0.32);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 180ms ease;
}
.de-dialog-card {
  position: relative;
  width: min(440px, 100%);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 22px;
  background:
    radial-gradient(80% 50% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--surface-strong);
  box-shadow: 0 30px 70px -30px rgba(30, 20, 10, 0.55);
  padding: 22px 22px 18px;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 200ms ease, transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.de-dialog.open .de-dialog-backdrop { opacity: 1; }
.de-dialog.open .de-dialog-card { opacity: 1; transform: none; }
.de-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 1rem;
}
.de-dialog-eyebrow { margin: 0; color: var(--accent-text); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; }
.de-dialog-card h3 { margin: 4px 0 8px; padding-right: 30px; font-size: 1.12rem; }
.de-dialog-body { color: color-mix(in srgb, var(--ink) 82%, var(--muted)); font-size: 0.9rem; line-height: 1.65; }
.de-dialog-body p { margin: 0 0 8px; }
.de-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.de-dialog-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0 18px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}
.de-dialog-actions .primary-action { border-color: transparent; background: var(--accent); color: var(--accent-ink); }
.de-dialog-actions .danger-action { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); color: var(--danger); background: transparent; }
.de-copies { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.de-copy { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 10px 12px; }
.de-copy p { margin: 0; }
.de-copy-label { font-weight: 800; color: var(--ink); }
.de-copy-when { color: var(--muted); font-size: 0.78rem; }
.de-copy-count { margin-top: 4px !important; font-family: "Songti SC", serif; font-size: 1.3rem; color: var(--accent-text); }
.de-copy-note { margin-top: 4px !important; color: var(--muted); font-size: 0.74rem; line-height: 1.45; }
@media (max-width: 760px) {
  .de-dialog { place-items: end center; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
  .de-dialog-card { width: 100%; }
  .de-dialog-actions button { flex: 1; }
}
.install-steps { margin: 8px 0; padding-left: 1.3em; }
.install-steps li { margin: 5px 0; }
.install-icon { display: inline-block; padding: 0 4px; border: 1px solid var(--line); border-radius: 6px; font-size: 0.8rem; }
.install-later { color: var(--muted); font-size: 0.78rem; }

/* ======================================================================
   触屏与手机修正 (Claude, 2026-09-30)
   ====================================================================== */
/* iPhone Safari paints date / select / button text in its system blue: follow the page. */
button, input, select, textarea { color: inherit; }
input[type="date"], input[type="month"], input[type="time"], select { color: var(--ink); -webkit-text-fill-color: var(--ink); }
input[type="date"]::-webkit-date-and-time-value,
input[type="month"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value { color: var(--ink); text-align: left; }
a[href^="tel"], a[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; }

/* Touch screens: pressing and holding must not start selecting words (only where you type). */
@media (pointer: coarse) {
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea, select, [contenteditable="true"], .privacy-text { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
  * { -webkit-tap-highlight-color: transparent; }
}

/* 安排到哪天 */
.day-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.day-chip {
  display: grid;
  gap: 1px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 6px 4px;
  color: var(--ink);
  font: inherit;
  text-align: center;
  transition: background 140ms ease, transform 140ms ease, border-color 140ms ease;
}
.day-chip b { font-size: 0.92rem; }
.day-chip span { color: var(--muted); font-size: 0.74rem; }
.day-chip:active, .day-chip:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface-strong)); }
.day-chip:active { transform: scale(0.97); }
.day-chip.current { opacity: 0.45; }
.day-chip.current span::after { content: " · 现在"; }
.day-other { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 0.84rem; }
.day-other input { min-height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 10px; font: inherit; }
.day-pool {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--accent-text);
  font: inherit;
  font-weight: 700;
}

@media (max-width: 760px) {
  /* the item card becomes a bottom sheet on a phone */
  .event-popover {
    left: 10px !important;
    right: 10px !important;
    top: auto !important;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: none !important;
    border-radius: 20px !important;
    padding: 16px !important;
    z-index: 120;
  }
  .event-popover .event-popover-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .event-popover .event-popover-actions button { min-height: 44px; border-radius: 12px; }
  /* in the pool sheet, the card itself is the button now */
  body #study-pool .study-check { cursor: pointer; }
  body #study-pool .study-check:active { background: color-mix(in srgb, var(--course-color, var(--accent)) 10%, var(--surface-strong)); }
}
.day-other { white-space: nowrap; }
.day-other input { flex: 1; min-width: 0; }

/* 回响之书 · 手机：一次一页，左右滑动 */
.wb-view.wb-phone { display: flex; flex-direction: column; justify-content: center; }
.wbp-track {
  display: flex;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.wbp-track::-webkit-scrollbar { display: none; }
.wbp-slide {
  display: grid;
  flex: 0 0 100%;
  place-items: center;
  padding: 8px 0;
  scroll-snap-align: center;
}
.wbp-slide .wb-page {
  position: relative;
  left: auto;
  top: auto;
  width: var(--W);
  height: var(--H);
  border-radius: 6px;
  box-shadow: 0 22px 44px -22px rgba(70, 50, 30, 0.45);
}
.wbp-slide .wb-page::after { display: none; }
.wb-phone .wb-nav { margin-top: 10px; }

/* ======================================================================
   手机版界面 v4 (phone.js) — Claude, 2026-09-30
   ====================================================================== */
@media (max-width: 760px) {
  /* top bar: the date strip replaces month/week and prev/next; 我的 replaces the … menu;
     the safety line lives on 今天 */
  body #prev-month, body #next-month, body .view-switch, body #topbar-avatar, body #mobile-more { display: none !important; }
  body[data-view="calendar"] #pace-panel { display: none; }
  body .main-view, body #calendar-grid { padding-bottom: 96px; }

  .ph-page { display: grid; gap: 12px; }
  .ph-block {
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    border-radius: 20px;
    background: var(--surface-strong);
    padding: 14px 14px 12px;
    box-shadow: 0 10px 28px -24px rgba(50, 35, 20, 0.45);
  }
  .ph-block > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
  .ph-block h3 { margin: 0; font-size: 1.02rem; }
  .ph-count { color: var(--muted); font-size: 0.86rem; font-variant-numeric: tabular-nums; }
  .ph-empty { margin: 4px 0; color: var(--muted); font-size: 0.88rem; line-height: 1.6; }
  .ph-link { border: 0; background: transparent; color: var(--accent-text); font: inherit; font-size: 0.86rem; font-weight: 700; padding: 4px 0; }

  /* 今天 */
  .ph-hello p { margin: 0; color: var(--muted); font-size: 0.84rem; }
  .ph-hello h2 { margin: 2px 0 0; font: 600 1.45rem/1.3 "Songti SC", "Noto Serif SC", serif; }
  .ph-safety {
    border-radius: 18px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--line-warm, #f0b27c) 18%, var(--surface-strong)), var(--surface-strong));
    border: 1px solid color-mix(in srgb, var(--line-warm, #f0b27c) 30%, var(--line));
    padding: 14px 16px 12px;
  }
  .ph-safety-line { margin: 0; font-size: 1rem; }
  .ph-safety-line b { font-size: 1.2rem; color: var(--accent-text); }
  .ph-safety-bar { height: 8px; margin: 10px 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
  .ph-safety-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--line-cool, #9fb4c9), var(--line-warm, #e2a063)); transition: width 500ms ease; }
  .ph-safety.met .ph-safety-line { color: var(--accent-text); font-weight: 700; }
  .ph-safety-meta { margin: 0; color: var(--muted); font-size: 0.8rem; }
  .ph-swipe-hint { margin: 8px 0 0; color: var(--muted); font-size: 0.76rem; text-align: center; }

  /* rows with swipe actions */
  .ph-list { display: grid; gap: 6px; }
  .ph-row { position: relative; overflow: hidden; border-radius: 14px; touch-action: pan-y; }
  .ph-row-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 0.86rem;
    font-weight: 800;
    color: #fff;
    background: var(--line-strong);
  }
  .ph-row.swipe-done .ph-row-bg { background: color-mix(in srgb, var(--accent) 80%, #6f8f6a); }
  .ph-row.swipe-later .ph-row-bg { background: color-mix(in srgb, #e2a063 85%, var(--ink)); }
  .ph-row .ph-bg-done, .ph-row .ph-bg-later { opacity: 0.55; transition: opacity 120ms ease, transform 120ms ease; }
  .ph-row.swipe-done .ph-bg-later, .ph-row.swipe-later .ph-bg-done { opacity: 0; }
  .ph-row.armed .ph-bg-done, .ph-row.armed .ph-bg-later { opacity: 1; transform: scale(1.06); }
  .ph-row-main {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--event-color, var(--accent)) 7%, var(--surface-strong));
    box-shadow: inset 3px 0 0 var(--event-color, var(--accent));
    padding: 8px 12px;
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .ph-check {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 2px solid color-mix(in srgb, var(--event-color, var(--accent)) 55%, var(--line-strong));
    border-radius: 999px;
    background: var(--surface-strong);
    color: #fff;
    font-weight: 900;
    font-size: 0.8rem;
    padding: 0;
  }
  .ph-row.done .ph-check { background: var(--event-color, var(--accent)); border-color: transparent; }
  .ph-row.done .ph-row-title { color: var(--muted); text-decoration: line-through; }
  .ph-row-text { min-width: 0; flex: 1; }
  .ph-row-title { margin: 0; overflow: hidden; font-size: 0.96rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
  .ph-row-meta { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; color: var(--muted); font-size: 0.78rem; }
  .ph-row-meta i { width: 7px; height: 7px; border-radius: 99px; background: var(--event-color, var(--accent)); flex-shrink: 0; }
  .ph-fold { justify-self: start; border: 0; border-radius: 999px; background: var(--surface-muted); padding: 6px 14px; color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 700; }

  .ph-late { display: grid; gap: 10px; background: color-mix(in srgb, #e2a063 8%, var(--surface-strong)); }
  .ph-late p { margin: 0; font-size: 0.92rem; }
  .ph-late-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .ph-late-actions button, .ph-wait-chips button, .ph-add-here {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
  }
  .ph-late-actions button:first-child { background: var(--accent); border-color: transparent; color: var(--accent-ink); }

  .ph-wait-list { display: grid; gap: 4px; }
  .ph-wait { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
  .ph-wait:first-child { border-top: 0; }
  .ph-wait-text { min-width: 0; flex: 1; }
  .ph-wait-text p { margin: 0; overflow: hidden; font-size: 0.92rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
  .ph-wait-text span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.76rem; }
  .ph-wait-text i { width: 7px; height: 7px; border-radius: 99px; background: var(--event-color); }
  .ph-wait-chips { display: flex; gap: 6px; flex-shrink: 0; }
  .ph-wait-chips button { min-height: 34px; padding: 0 11px; font-size: 0.8rem; }
  .ph-wait-chips button:active { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }

  .ph-note textarea { width: 100%; min-height: 84px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 10px 12px; color: var(--ink); font: inherit; font-size: 0.92rem; line-height: 1.6; resize: vertical; }
  .ph-note-saved { color: var(--muted); font-size: 0.76rem; }

  /* 日历 */
  .ph-strip { display: grid; grid-template-columns: 26px 1fr 26px; align-items: center; gap: 4px; touch-action: pan-y; }
  .ph-week-nav { height: 64px; border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; padding: 0; }
  .ph-pills { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .ph-pill {
    display: grid;
    justify-items: center;
    gap: 2px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    padding: 6px 0 7px;
    color: var(--ink);
    font: inherit;
  }
  .ph-pill span { color: var(--muted); font-size: 0.72rem; }
  .ph-pill b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 99px; font-size: 1.02rem; }
  .ph-pill.today b { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent-text); }
  .ph-pill.selected { background: color-mix(in srgb, var(--accent) 14%, var(--surface-strong)); }
  .ph-pill.selected b { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
  .ph-pill em { display: flex; gap: 3px; height: 6px; }
  .ph-pill em i { width: 5px; height: 5px; border-radius: 99px; }
  .ph-pill em i.all-done { background: var(--line-strong); }
  .ph-pill.drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; }
  .ph-month-toggle { justify-self: center; border: 0; border-radius: 999px; background: var(--surface-muted); padding: 5px 14px; color: var(--muted); font: inherit; font-size: 0.8rem; font-weight: 700; }
  .ph-month { border-radius: 18px; background: var(--surface-strong); padding: 6px 4px; }
  .ph-day-budget { border-radius: 999px; padding: 2px 9px; font-size: 0.74rem; font-weight: 700; }
  .ph-day-budget.ok { background: color-mix(in srgb, #7fa67a 16%, transparent); color: #4f7a4b; }
  .ph-day-budget.under { background: color-mix(in srgb, #e2a063 18%, transparent); color: #9a5f2a; }
  .ph-add-here { width: 100%; margin-top: 10px; border-style: dashed; color: var(--accent-text); }

  /* 我的 */
  .ph-me-card { display: flex; align-items: center; gap: 14px; padding: 6px 2px; }
  .ph-me-avatar { flex-shrink: 0; }
  .ph-me-who h2 { margin: 0; font-size: 1.25rem; }
  .ph-me-who p { margin: 2px 0 0; color: var(--muted); font-size: 0.84rem; }
  .ph-me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ph-me-stats div { display: grid; justify-items: center; gap: 2px; border-radius: 16px; background: var(--surface-strong); border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); padding: 12px 4px; }
  .ph-me-stats b { font: 600 1.35rem "Songti SC", serif; color: var(--accent-text); }
  .ph-me-stats span { color: var(--muted); font-size: 0.76rem; }
  .ph-me-group { overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 18px; background: var(--surface-strong); }
  .ph-me-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; border: 0; border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent); background: transparent; padding: 8px 14px; color: var(--ink); font: inherit; text-align: left; }
  .ph-me-row:first-child { border-top: 0; }
  .ph-me-row:active { background: var(--surface-muted); }
  .ph-me-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, var(--surface-muted)); font-size: 1rem; }
  .ph-me-text { display: grid; flex: 1; min-width: 0; }
  .ph-me-text b { font-size: 0.96rem; font-weight: 650; }
  .ph-me-text small { color: var(--muted); font-size: 0.76rem; }
  .ph-me-chev { color: var(--muted); font-size: 1.3rem; }
  body[data-view="me"] .topbar, body[data-view="today"] .topbar { display: none; }
  body[data-view="me"] .main-view, body[data-view="today"] .main-view { padding-top: calc(14px + env(safe-area-inset-top)); }
}
@media (max-width: 760px) {
  /* phone tour: when the target sits at the top, the card moves above the tab bar */
  .tour-card.at-bottom {
    top: auto !important;
    bottom: calc(82px + env(safe-area-inset-bottom)) !important;
  }
}

/* ======================================================================
   手机版 v5：精简 + 子页面不弹窗 (phone.js) — Claude, 2026-09-30
   ====================================================================== */
@media (max-width: 760px) {
  /* every phone page brings its own head; the desktop top bar and the pool sheet are gone */
  body .topbar { display: none !important; }
  body .detail-panel, body .tray-backdrop { display: none !important; }
  body.wb-open { overflow: hidden; }

  .ph-head { display: grid; gap: 2px; margin: 4px 0 12px; }
  .ph-back { justify-self: start; color: var(--accent-text); font-size: 0.9rem; font-weight: 700; text-decoration: none; padding: 4px 0; }
  .ph-head h2 { margin: 0; font: 600 1.35rem/1.3 "Songti SC", "Noto Serif SC", serif; }
  .ph-sub { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.6; }
  .ph-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 99px; background: var(--event-color, var(--accent)); vertical-align: 1px; }

  /* 今天 */
  p.ph-hello { margin: 2px 0 0; color: var(--muted); font-size: 0.86rem; }
  .ph-note-open { justify-self: center; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.88rem; padding: 6px 12px; }
  .ph-install-card {
    display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px;
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 16px;
    background: var(--surface-strong); padding: 10px 8px 10px 14px;
  }
  .ph-install-card > span { font-size: 1.3rem; }
  .ph-install-card p { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
  .ph-install-card p b { display: block; color: var(--ink); font-size: 0.92rem; }
  .ph-install-go { border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.84rem; font-weight: 700; padding: 7px 12px; text-decoration: none; }
  .ph-install-x { width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; }

  /* 日历 */
  .ph-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 2px 0; }
  .ph-cal-head h2 { margin: 0; font: 600 1.3rem/1.3 "Songti SC", "Noto Serif SC", serif; }
  .ph-today-btn { border: 1px solid var(--line); border-radius: 999px; background: var(--surface-strong); color: var(--ink); font: inherit; font-size: 0.84rem; font-weight: 700; padding: 6px 14px; }

  /* 计划 */
  .ph-proj header h3 { display: flex; align-items: center; }
  .ph-proj-pct { color: var(--accent-text); font-weight: 700; font-variant-numeric: tabular-nums; }
  .ph-proj-bar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
  .ph-proj-bar i { display: block; height: 100%; border-radius: 99px; background: var(--event-color, var(--accent)); }
  .ph-proj-dl { margin: 8px 0 10px; color: var(--muted); font-size: 0.82rem; }
  .ph-proj-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ph-proj-stats div { display: grid; gap: 2px; border-radius: 12px; background: color-mix(in srgb, var(--surface-muted) 70%, transparent); padding: 8px 10px; }
  .ph-proj-stats b { font-size: 1rem; font-variant-numeric: tabular-nums; }
  .ph-proj-stats span { color: var(--muted); font-size: 0.74rem; }
  .ph-proj-health { margin: 10px 0 4px; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
  .ph-proj-edit { border: 0; background: transparent; color: var(--accent-text); font: inherit; font-size: 0.86rem; font-weight: 700; padding: 4px 0; }
  .ph-add-project { min-height: 48px; border: 1.5px dashed var(--line-strong, var(--line)); border-radius: 16px; background: transparent; color: var(--ink); font: inherit; font-weight: 700; }

  /* 设置 / 账号 / 帮助 as a page */
  #main-view > .menu-output { padding: 0; border: 0; background: transparent; box-shadow: none; }
  #main-view .settings-layout { display: grid; gap: 12px; height: auto; }
  #main-view .settings-layout > .settings-page { height: auto; overflow: visible; padding: 0; }
  #main-view .menu-output[data-phone="solo"] .settings-nav { display: none; }
  #main-view .menu-output[data-phone="settings"] .settings-nav [data-page="account"],
  #main-view .menu-output[data-phone="settings"] .settings-nav [data-page="help"] { display: none; }
  #main-view .settings-nav { gap: 6px; padding: 0; border: 0; background: transparent; }
  #main-view .settings-nav button { border-radius: 999px; padding: 7px 14px; }
  .set-link-button { display: inline-flex; align-items: center; text-decoration: none; padding: 8px 16px; border-radius: 999px; }

  /* 放到手机桌面 */
  .ph-install-why p { margin: 0 0 6px; font-size: 0.9rem; line-height: 1.65; }
  .ph-install-os { display: grid; grid-template-columns: 1fr 1fr; }
  .ph-steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
  .ph-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: 0.94rem; line-height: 1.6; }
  .ph-steps .n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 0.8rem; font-weight: 700; }
  .ph-steps small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.8rem; line-height: 1.55; }
  .ph-steps .ico { width: 22px; height: 22px; margin: 0 2px; vertical-align: -5px; fill: none; stroke: #2f7cf6; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .ph-steps .ico circle { fill: currentColor; stroke: none; }
  .ph-install-cta { display: block !important; }
  .ph-install-cta button { width: 100%; min-height: 46px; border-radius: 14px; }

  /* ＋ 新建: 更多 */
  .quick-more { border-top: 1px solid var(--line); padding-top: 8px; }
  .quick-more summary { color: var(--muted); font-size: 0.88rem; cursor: pointer; padding: 4px 0; }
  .quick-more > .project-meta-grid { margin-top: 8px; }

  /* 统计: three charts on a phone (numbers, trend, where the time went) */
  .stats-dash .dash-heat, .stats-dash .dash-rhythm, .stats-dash .dash-projects { display: none !important; }

  /* 回响之书: one page on a stage */
  .wbp-stage { position: relative; width: var(--W); height: var(--H); margin: 0 auto; touch-action: none; overflow: visible; }
  .wbp-page { position: absolute !important; inset: 0; width: var(--W); height: var(--H); border-radius: 6px; box-shadow: 0 22px 44px -22px rgba(70, 50, 30, 0.45); will-change: transform; }
  .wbp-page::after { display: none; }
  .wb-phone .wb-nav button:disabled { opacity: 0.35; }
}
@media (max-width: 760px) {
  a.ph-link { text-decoration: none; }
  .ph-day > header { flex-wrap: wrap; row-gap: 6px; }
  .ph-day > header h3 { white-space: nowrap; }
  #main-view .feedback-mail { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
  #main-view .feedback-address { min-width: 0; overflow-wrap: anywhere; }
  #main-view #copy-feedback { white-space: nowrap; }
  #main-view .feedback-write { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .wbp-stage .wbp-page { left: 0 !important; top: 0 !important; right: auto !important; margin: 0 !important; }
  .wb-phone .wb-progress { white-space: nowrap; letter-spacing: 0.04em; }
}
@media (max-width: 760px) {
  .quick-add-form > .project-meta-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 安排到哪天: quick picks + our own month calendar (no native blue wheel) */
.day-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mini-cal { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.mini-cal header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mini-cal header b { font-size: 0.95rem; color: var(--ink); }
.mini-cal header button { width: 36px; height: 36px; border: 0; border-radius: 99px; background: transparent; color: var(--ink); font-size: 1.3rem; }
.mini-cal header button:disabled { opacity: 0.25; }
.mini-cal-week, .mini-cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.mini-cal-week span { color: var(--muted); font-size: 0.72rem; padding: 2px 0 4px; }
.mini-cal-days > i { display: block; }
.mini-cal-days button {
  position: relative; display: grid; place-items: center; height: 42px; margin: 1px;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink);
  font: inherit; font-size: 0.95rem; font-variant-numeric: tabular-nums;
}
.mini-cal-days button em { position: absolute; bottom: 3px; left: 0; right: 0; color: var(--accent); font-size: 0.55rem; font-style: normal; letter-spacing: -1px; line-height: 1; }
.mini-cal-days button.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 700; }
.mini-cal-days button:disabled { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.mini-cal-days button:not(:disabled):active { background: var(--accent); color: var(--accent-ink, #fff); }
.mini-cal-days button.current { background: color-mix(in srgb, var(--accent) 18%, transparent); }

@media (max-width: 760px) {
  /* one tap placed it: the row answers at once, then slides away */
  .ph-placed { color: var(--accent-text); font-size: 0.88rem; font-weight: 700; white-space: nowrap; animation: ph-pop 240ms ease; }
  .ph-wait.placed { animation: ph-leave 480ms ease forwards; overflow: hidden; }
  @keyframes ph-pop { from { transform: scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes ph-leave {
    0%, 55% { max-height: 80px; opacity: 1; background: color-mix(in srgb, var(--accent) 10%, transparent); }
    100% { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }
  }
  .ph-row.just-added .ph-row-main { animation: ph-flash 1400ms ease; }
  @keyframes ph-flash { 0%, 40% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 2px transparent; } }

  /* 计划: a ring instead of the old SVG donut */
  .ph-ring {
    position: relative; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 99px;
    background: conic-gradient(var(--event-color, var(--accent)) calc(var(--p) * 1%), color-mix(in srgb, var(--line) 75%, transparent) 0);
  }
  .ph-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 99px; background: var(--surface-strong); }
  .ph-ring b { position: relative; font-size: 0.86rem; font-variant-numeric: tabular-nums; line-height: 1; }
  .ph-ring small { font-size: 0.62rem; font-weight: 600; }
  .ph-proj > header { align-items: center; }
}
@media (max-width: 760px) {
  /* the undo toast: full sentence, above the tab bar */
  body #undo-toast { left: 12px !important; right: 12px !important; width: auto !important; max-width: none !important; transform: none !important; bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
  body #undo-message { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.45; }
}
.dev-error-note {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; z-index: 9999;
  border: 0; border-radius: 12px; background: #b3261e; color: #fff; padding: 10px 12px;
  font: 600 0.8rem/1.45 -apple-system, sans-serif; text-align: left; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
@media (max-width: 760px) {
  /* 回响之书 on a phone: no full-screen blur (heavy for iPhone GPUs) */
  .wb-view.wb-phone { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (max-width: 760px) {
  /* choosing a day inline, under the row */
  .ph-pick {
    margin: 4px 0 8px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 16px;
    background: var(--surface-strong); padding: 12px 10px 8px; animation: ph-open 180ms ease;
  }
  .ph-pick.closing { animation: ph-close 160ms ease forwards; }
  @keyframes ph-open { from { opacity: 0; transform: translateY(-6px); } }
  @keyframes ph-close { to { opacity: 0; transform: translateY(-6px); } }
  .ph-pick .mini-cal { margin-top: 10px; }
  .ph-pick-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
  .ph-pick-foot button { min-height: 36px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: 0.86rem; padding: 0 16px; }
  .ph-wait.picking [data-when="pick"], .ph-row.picking .ph-row-main { box-shadow: 0 0 0 2px var(--accent); }
  .day-chip { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); padding: 6px 0; display: grid; gap: 1px; font: inherit; }
  .day-chip b { font-size: 0.9rem; }
  .day-chip span { color: var(--muted); font-size: 0.72rem; }
}
@media (max-width: 760px) {
  /* 新建 / 编辑 on a phone: a whole page (no dimmed app behind, no floating card) */
  #course-editor { padding: 0 !important; background: var(--bg) !important; backdrop-filter: none !important; z-index: 60; }
  #course-editor .course-editor-sheet {
    width: 100% !important; max-width: none !important; height: 100% !important; max-height: none !important;
    border-radius: 0 !important; box-shadow: none !important; background: var(--bg) !important;
    padding: calc(8px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto; animation: ph-page-in 200ms ease;
  }
  @keyframes ph-page-in { from { opacity: 0; transform: translateY(12px); } }
  #course-editor .day-sheet-head { position: sticky; top: calc(-8px - env(safe-area-inset-top)); z-index: 2; background: var(--bg); padding: 8px 0 10px; margin-bottom: 6px; }
  #course-editor .editor-module { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; }
  #course-editor .form-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 4px; }
  #course-editor .form-actions button { flex: 1; min-height: 46px; }
}
/* 回响之书 · 手机：平面书页（不用电脑版的 3D 规则） */
.wbp-page { position: absolute; left: 0; top: 0; width: var(--W); height: var(--H); overflow: hidden; border-radius: 4px 8px 8px 4px; box-shadow: 0 22px 44px -22px rgba(70, 50, 30, 0.45), 0 1px 0 rgba(120, 95, 65, 0.1); transform: translateX(0); backface-visibility: visible; -webkit-backface-visibility: visible; }
.wbp-page .wb-page-host { position: absolute; inset: 0; overflow: hidden; }
.wbp-cover { background: none; }
.wbp-empty { display: grid; align-content: center; justify-items: center; gap: 10px; height: 100%; padding: 0 12%; text-align: center; color: var(--wb-ink); }
.wbp-empty-kicker { margin: 0; color: var(--wb-muted); font-size: 0.72rem; letter-spacing: 0.3em; }
.wbp-empty h3 { margin: 0; font: 500 1.35rem/1.4 "Songti SC", "Noto Serif SC", serif; letter-spacing: 0.12em; }
.wbp-empty p { margin: 0; color: var(--wb-muted); font-size: 0.86rem; line-height: 1.9; }
@media (max-width: 760px) {
  /* App feel: a short page does not scroll, and nothing rubber-bands past the edges. */
  html, body { overscroll-behavior: none; }
  body { padding-bottom: 0 !important; box-sizing: border-box; }
  body .app-shell { min-height: 100vh; min-height: 100dvh; }
}
.update-bar {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; z-index: 9000; transform: translateX(-50%);
  border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); padding: 10px 18px;
  font: 700 0.86rem/1 inherit; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22); animation: ph-open 220ms ease;
}
@media (max-width: 760px) {
  .ph-version { justify-self: center; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.74rem; padding: 10px; }
}
@media (max-width: 760px) {
  /* No zoom: iPhone zooms into any field under 16px; and no double-tap zoom anywhere. */
  body input, body select, body textarea { font-size: 16px !important; }
  html, body { touch-action: manipulation; }
  /* Tab bar: clear of the iPhone home bar (viewport-fit=cover now reports its height). */
  body .mobile-tabbar { padding: 6px 6px calc(8px + max(env(safe-area-inset-bottom), 12px)) !important; }
  body .main-view, body #calendar-grid { padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important; }
  body #undo-toast { bottom: calc(92px + env(safe-area-inset-bottom)) !important; }
  body .tour-card.at-bottom { bottom: calc(92px + env(safe-area-inset-bottom)) !important; }
  /* Top: under a home-screen status bar the page starts below it. */
  body .main-view, body #calendar-grid { padding-top: max(14px, calc(6px + env(safe-area-inset-top))); }
}
@media (max-width: 760px) {
  /* 动态安全线 (今天) */
  .ph-safety { display: grid; gap: 14px; padding: 16px 16px 14px; border-radius: 20px; }
  .ph-safety > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .ph-sl-kicker { margin: 0 0 2px; color: var(--muted); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.08em; }
  .ph-safety h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
  .ph-safety h3 b { font: 700 1.45rem/1.1 "Songti SC", "Noto Serif SC", serif; color: var(--accent-text); margin: 0 2px; }
  .ph-safety.met h3 { color: var(--accent-text); }
  .ph-sl-pill { flex: none; border-radius: 999px; background: color-mix(in srgb, var(--line-warm, #e2a063) 20%, transparent); color: color-mix(in srgb, #a86a2c 85%, var(--ink)); font-size: 0.78rem; font-weight: 700; padding: 5px 10px; }
  .ph-sl-scale { position: relative; height: 44px; margin: 0 8px; }
  .ph-sl-track { position: absolute; left: 0; right: 0; top: 10px; height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--line) 75%, transparent); overflow: hidden; }
  .ph-sl-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--line-cool, #9fb4c9), var(--line-warm, #e2a063)); }
  .ph-sl-knob { position: absolute; top: 6px; width: 18px; height: 18px; margin-left: -9px; border-radius: 99px; background: var(--surface-strong); box-shadow: 0 0 0 3px var(--line-warm, #e2a063), 0 2px 6px rgba(0, 0, 0, 0.18); }
  .ph-sl-mark { position: absolute; top: 2px; width: 0; height: 26px; margin-left: -1px; }
  .ph-sl-mark.line { border-left: 2.5px solid color-mix(in srgb, #a86a2c 80%, var(--ink)); }
  .ph-sl-mark.line::before { content: ""; position: absolute; top: -5px; left: -6px; border: 5px solid transparent; border-top-color: color-mix(in srgb, #a86a2c 80%, var(--ink)); }
  .ph-sl-mark.planned { border-left: 2px dashed var(--line-cool, #8fa3b5); }
  .ph-sl-ticks { position: absolute; left: 0; right: 0; top: 30px; height: 14px; }
  .ph-sl-ticks span { position: absolute; transform: translateX(-50%); color: var(--muted); font-size: 0.68rem; font-variant-numeric: tabular-nums; }
  .ph-sl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ph-sl-stats div { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; border-radius: 12px; background: color-mix(in srgb, var(--surface-muted) 70%, transparent); padding: 8px 10px; }
  .ph-sl-stats b { font-size: 0.98rem; font-variant-numeric: tabular-nums; }
  .ph-sl-stats span { grid-column: 1 / -1; color: var(--muted); font-size: 0.72rem; }
  .ph-sl-stats i { width: 10px; height: 10px; border-radius: 3px; }
  .ph-sl-stats .k-done { background: linear-gradient(90deg, var(--line-cool, #9fb4c9), var(--line-warm, #e2a063)); }
  .ph-sl-stats .k-line { width: 3px; height: 14px; border-radius: 0; background: color-mix(in srgb, #a86a2c 80%, var(--ink)); justify-self: center; }
  .ph-sl-stats .k-plan { width: 0; height: 14px; border-radius: 0; border-left: 2px dashed var(--line-cool, #8fa3b5); justify-self: center; }
  .ph-sl-projects { display: grid; gap: 10px; margin: 0; padding: 10px 0 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); list-style: none; }
  .ph-sl-projects li { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; column-gap: 8px; row-gap: 3px; font-size: 0.88rem; }
  .ph-sl-projects .ph-dot { margin: 0; }
  .ph-sl-projects b { font-weight: 700; white-space: nowrap; }
  .ph-sl-mini { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--line) 75%, transparent); overflow: hidden; }
  .ph-sl-mini i { display: block; height: 100%; border-radius: 99px; background: var(--event-color); }
  .ph-sl-projects em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink); font-size: 0.82rem; }
  .ph-sl-projects small { grid-column: 2 / -1; color: var(--muted); font-size: 0.74rem; }
}
/* 回响之书 · 手机：翻页（绕书脊转，和电脑一样的翻开方式） */
.wbp-stage { perspective: 1600px; perspective-origin: 30% 50%; }
.wbp-page { transform-origin: 0 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.wbp-page::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(90deg, rgba(60, 40, 20, 0.55), rgba(60, 40, 20, 0.05) 70%); opacity: var(--shade, 0); }
.wbp-page:not(.turning)::before { opacity: 0; }
.wbp-page.is-current:not(.turning) { box-shadow: 0 22px 44px -22px rgba(70, 50, 30, 0.45), -2px 0 0 #eadfcd, -4px 0 0 #f7f0e3; }
@media (max-width: 760px) {
  .ph-sl-projects li { grid-template-columns: 10px minmax(0, 4.5em) 1fr auto; }
  .ph-sl-projects b { overflow: hidden; text-overflow: ellipsis; }
}
.wbp-stage { perspective: 2600px; perspective-origin: 0% 50%; }
@media (max-width: 760px) {
  /* the desktop thread (moon · safety tick · sun) inside the phone card */
  .ph-sl-thread .safety-line { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
  .ph-sl-thread .sl-caption { display: none; }
  .ph-sl-thread .sl-thread { touch-action: pan-y; margin: 18px 4px 22px; }
}
/* 放到桌面教程（电脑 Windows / Mac，手机 iPhone / 安卓） */
.install-guide { display: grid; gap: 12px; }
.install-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.install-wechat { margin: 0; border-radius: 10px; background: color-mix(in srgb, #e2a063 14%, transparent); padding: 8px 10px; font-size: 0.84rem; }
.install-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.install-list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: 0.94rem; line-height: 1.6; }
.install-list .n { display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; border-radius: 99px; background: var(--accent); color: var(--accent-ink, #fff); font-size: 0.78rem; font-weight: 700; }
.install-list .ico { width: 20px; height: 20px; margin: 0 2px; vertical-align: -5px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--accent-text); }
.install-list .ico circle { fill: currentColor; stroke: none; }
.ph-install-now { min-height: 46px; border-radius: 14px; }
@media (max-width: 760px) {
  /* 设置 as a phone list: title (with a small hint under it) on the left, the control on the right */
  #main-view .desktop-only-row { display: none !important; }
  #main-view .set-group { display: grid; gap: 0; padding: 14px 16px 6px; }
  #main-view .set-group > h4 { margin: 0 0 6px; color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; }
  #main-view .set-group > .set-hint { margin: 0 0 6px; font-size: 0.8rem; line-height: 1.5; }
  #main-view .set-row { display: flex !important; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }
  #main-view .set-group > h4 + .set-row, #main-view .set-group > .set-hint + .set-row { border-top: 0; }
  #main-view .set-row > span { display: grid; gap: 2px; min-width: 0; font-size: 0.95rem; line-height: 1.35; }
  #main-view .set-row > span small { color: var(--muted); font-size: 0.76rem; }
  #main-view .set-row select { flex: none; width: auto; min-width: 92px; max-width: 46%; height: 38px; border-radius: 10px; padding: 0 30px 0 12px; }
  #main-view .set-row.sub > span { display: flex; align-items: center; gap: 8px; padding-left: 4px; }
  #main-view .set-row.sub .set-dot { flex: none; margin: 0; }
  #main-view .capacity-week { display: grid !important; grid-template-columns: 1fr !important; gap: 0 !important; }
  #main-view .capacity-day { display: flex !important; align-items: center; justify-content: space-between; min-height: 48px; border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent); font-size: 0.95rem; }
  #main-view .capacity-day:first-child { border-top: 0; }
  #main-view .capacity-day .duration-stepper { width: 150px; flex: none; }
}

/* ===== 手机：我的页不上下滑（整页放得下，矮屏幕上行高按屏高压缩） ===== */
@media (max-width: 760px) {
  body:has(.ph-me) { overflow: hidden; overscroll-behavior: none; }
  .ph-me { gap: 10px; align-content: start; height: calc(100dvh - 118px - env(safe-area-inset-bottom, 0px)); overflow: hidden; }
  .ph-me .ph-me-row { min-height: clamp(40px, 6.6dvh, 58px); padding-top: 4px; padding-bottom: 4px; }
  .ph-me .ph-me-stats div { padding: clamp(6px, 1.4dvh, 12px) 4px; }
  .ph-me .ph-me-card { padding: 2px; }
}

/* ===== 手机：新建 → 更多，全部竖着排（时长、重复、颜色、备注不再挤到右边） ===== */
@media (max-width: 760px) {
  .quick-more > .project-meta-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 10px; }
  .quick-more > .project-meta-grid > * { grid-column: 1 / -1; min-width: 0; }
  .quick-more .time-plan { width: 100%; }
  .quick-more .time-plan .segmented { width: 100%; }
  .quick-more .time-plan .segmented button { flex: 1; }
  .quick-more .check-label { min-height: 44px; }
}
/* ===== 手机：饼图更精致 ===== */
.dash-donut .donut-track { stroke: color-mix(in srgb, var(--line) 55%, transparent); }
@media (max-width: 760px) {
  .ph-ring { width: 46px; height: 46px; background: conic-gradient(from 0deg, color-mix(in srgb, var(--event-color, var(--accent)) 92%, #fff) calc(var(--p) * 1%), color-mix(in srgb, var(--line) 55%, transparent) 0); }
  .ph-ring::before { inset: 4px; }
}
/* 手机：内容短的页面，下面不露出渐变底色 */
@media (max-width: 760px) {
  html { min-height: 100dvh; }
  body { min-height: 100dvh; }
  .app-shell { min-height: 100dvh; }
}
@media (max-width: 760px) { .calendar-panel { min-height: 100dvh; } }
/* 手机安全线：不碰它的时候是静止的，碰了才动 */
@media (max-width: 760px) {
  .ph-sl-thread .sun-rays, .ph-sl-thread .sun-halo, .ph-sl-thread .sl-star { animation: none !important; }
  .ph-sl-thread .sl-thread { margin: 10px 4px 12px; }
}
.install-note { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.6; }

/* 回响之书：读到最后一页，合上回到封面 */
.wb-stage { transition: opacity 420ms ease, transform 420ms ease; }
.wb-stage.wb-finish { opacity: 0; transform: scale(0.96); }
/* 手机上书变窄了，书页里的字放大一点（电脑不变） */
@media (max-width: 760px) {
  .wb-page-in { font-size: calc(var(--W) / 26); }
}

/* 手机：返回键只放一个箭头；「我的」顶部卡片就是账号入口 */
@media (max-width: 760px) {
  .ph-back { display: inline-grid; place-items: center; width: 36px; height: 36px; margin: 0 0 2px -6px; padding: 0; border-radius: 99px; color: var(--accent-text); }
  .ph-back:active { background: var(--accent-faint); }
  .ph-back svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .ph-me-card { position: relative; cursor: pointer; padding-right: 44px; border-radius: 18px; }
  .ph-me-card .ph-me-who { flex: 1; min-width: 0; }
  .ph-me-card .ph-me-who p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ph-me-login { flex: none; border-radius: 99px; background: var(--accent); color: var(--accent-ink, #fff); padding: 7px 14px; font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
  .ph-me-card > .ph-me-chev { flex: none; color: var(--muted); font-size: 1.4rem; }
  .ph-me-cam { position: absolute; top: 0; right: 0; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 99px; background: var(--surface-muted); color: var(--muted); padding: 0; }
  .ph-me-cam svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .ph-me-cam:active { background: var(--accent-faint); }
}
@media (max-width: 760px) { .ph-me .ph-me-card { padding: 2px 44px 2px 2px; } }
/* 手机：项目进度环——圆头细环 */
@media (max-width: 760px) {
  .ph-ring { background: none !important; width: 46px; height: 46px; }
  .ph-ring::before { display: none !important; }
  .ph-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
  .ph-ring circle { fill: none; stroke-width: 4.5; }
  .ph-ring .trk { stroke: color-mix(in srgb, var(--line) 60%, transparent); }
  .ph-ring .val { stroke: var(--event-color, var(--accent)); stroke-linecap: round; }
}
@media (max-width: 760px) { .ph-me { grid-template-columns: minmax(0, 1fr); } .ph-me > * { min-width: 0; } }

/* ===== 第三轮：键盘不挡按钮、我的页、书合上动作 ===== */
@media (max-width: 760px) {
  /* 新建/编辑页跟着「可见区域」走：键盘弹出时按钮在键盘上面 */
  #course-editor { top: var(--vvt, 0px) !important; bottom: auto !important; height: var(--vvh, 100%) !important; }
  #course-editor .course-editor-sheet { padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important; }
  #course-editor .form-actions { padding-bottom: 6px; }

  /* 我的：撑满一屏，行更大一点；底部不再留一大片空白 */
  .ph-me { gap: clamp(12px, 2.2dvh, 20px); }
  .ph-me .ph-me-row { min-height: clamp(54px, 8.6dvh, 80px); }
  .ph-me .ph-me-stats div { padding: clamp(10px, 2.2dvh, 22px) 4px; }
  .ph-me .ph-me-card { padding: clamp(2px, 1dvh, 10px) 2px; }
  .ph-me-card { padding-right: 2px; }
  .ph-me-cam { display: none; }
  .ph-me-avatar { position: relative; }
  .ph-me-edit { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid var(--bg); border-radius: 99px; background: var(--accent); color: var(--accent-ink, #fff); padding: 0; }
  .ph-me-edit svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
}
/* 回响之书合上：先让字静静淡去，再让封面翻过来合上 */
.wb-page-host { transition: opacity 260ms ease; }
.wb-book.wb-fold .wb-page-host { opacity: 0; }
.wb-stage.wb-finish { opacity: 1; transform: none; }
@media (max-width: 760px) { .ph-ring { width: 54px; height: 54px; } .ph-ring b { font-size: 0.8rem; } }

/* ===== 登录页 v3：新 logo + 粒子 ===== */
.gate-canvas-wrap { width: min(500px, 100%, 52vh); aspect-ratio: 1 / 1; position: relative; }
.gate-canvas { position: absolute; left: -20%; top: -20%; width: 140%; height: 140%; pointer-events: none; }
@media (max-width: 860px) { .gate-canvas-wrap { width: min(270px, 64vw); margin: 0 auto; } }
.gate-art { position: relative; }
.gate-name { margin-top: 0; }
.dash-donut .donut-seg { pointer-events: none; }
.dash-donut svg { cursor: default; }
.ph-ring2 { display: grid; place-items: center; width: 62px; height: 62px; }
.ph-ring2 .project-donut { display: block; }
.ph-ring2 .donut-text { font-size: 15px; }
.ph-ring2 .donut-unit { font-size: 9px; }

/* 新 logo 是方形的：欢迎页里小一点，圆角，不再是横幅 */
.welcome-card .welcome-logo { width: min(168px, 52%); margin: -2px auto 8px; border-radius: 30px; box-shadow: 0 18px 40px -22px rgba(150, 100, 40, 0.55); }

/* ===== 手机：导出页 ===== */
@media (max-width: 760px) {
  #main-view .book-card { display: grid !important; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 4px 16px; padding: 16px; border-radius: 22px; background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 10%, var(--surface-strong)), var(--surface-strong) 62%); }
  #main-view .book-card .wb-mini-cover { --W: 92px; }
  #main-view .book-card-body { min-width: 0; display: grid; gap: 6px; }
  #main-view .book-card-body h3 { margin: 0; font: 600 1.15rem "Songti SC", "Noto Serif SC", serif; letter-spacing: 0.06em; }
  #main-view .book-card-body > p:not(.book-count) { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #main-view .book-periods { display: flex; gap: 6px; flex-wrap: wrap; }
  #main-view .book-periods button { min-height: 30px; padding: 0 12px; border-radius: 99px; font-size: 0.82rem; }
  #main-view .book-count { margin: 0; font-size: 0.78rem; color: var(--muted); }
  #main-view .book-actions .primary-action { min-height: 42px; padding: 0 20px; border-radius: 14px; }

  #main-view .export-layout { gap: 14px; }
  #main-view .export-options { gap: 12px; }
  #main-view .export-step { padding: 14px 14px 16px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 20px; background: var(--surface-strong); }
  #main-view .export-step h3 { margin: 0 0 10px; font-size: 0.86rem; color: var(--muted); letter-spacing: 0.06em; }
  #main-view .export-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #main-view .export-choices button { min-height: 46px; border-radius: 14px; font-size: 0.95rem; white-space: nowrap; }
  #main-view .export-formats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #main-view .export-formats button { padding: 12px 12px; border-radius: 14px; }
  #main-view .export-formats strong { font-size: 0.95rem; }
  #main-view .export-preview { padding: 14px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 20px; background: var(--surface-strong); }
  #main-view .export-download { width: 100%; min-height: 52px; border-radius: 16px; }
}

/* ===== 手机：新建 —— 日期、时长做成一点就选的小胶囊 ===== */
@media (max-width: 760px) {
  .ph-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .ph-chips-label { width: 100%; color: var(--muted); font-size: 0.82rem; font-weight: 600; }
  .ph-chip { min-height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface-strong); color: var(--ink); font: inherit; font-size: 0.95rem; font-weight: 600; }
  .ph-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
  #course-editor .quick-add-form input[name="title"] { min-height: 52px; font-size: 1.05rem; }
  #course-editor .form-actions .primary-action { flex: 1.6; }
}

/* ===== 手机：新建 —— 日期、时长做成一点就选的小胶囊 ===== */
@media (max-width: 760px) {
  .ph-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .ph-chips-label { width: 100%; color: var(--muted); font-size: 0.82rem; font-weight: 600; }
  .ph-chip { min-height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface-strong); color: var(--ink); font: inherit; font-size: 0.95rem; font-weight: 600; }
  .ph-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
  #course-editor .quick-add-form .time-plan .field-title small { display: none; }
  #course-editor .quick-add-form input[name="title"] { min-height: 52px; font-size: 1.05rem; }
  #course-editor .form-actions .primary-action { flex: 1.6; }
}

/* 手机新建：「添加」在顶部（×旁边），底部没有按钮，键盘弹出时页面不再跳 */
@media (max-width: 760px) {
  #course-editor .quick-add-form.ph-header-save .form-actions { display: none; }
  #course-editor .day-sheet-head { align-items: center; gap: 10px; }
  #course-editor .ph-head-save { flex: none; margin-left: auto; min-height: 40px; padding: 0 20px; border: 0; border-radius: 99px; background: var(--accent); color: var(--accent-ink, #fff); font: inherit; font-weight: 700; font-size: 1rem; box-shadow: 0 10px 20px -12px var(--accent); }
  #course-editor .ph-head-save:active { transform: scale(0.97); }
  #course-editor { top: 0 !important; height: var(--vvh, 100%) !important; }
}
/* 圆环的发光（drop-shadow）不能被 svg 边界裁成方框：全部完成、打勾时右边那个方框就是这么来的 */
.tv2-ring, .tv2-ring svg, .progress-ring, .progress-ring svg, .today-progress, .today-progress svg { overflow: visible; }
.tv2-ring.done .tp-value, .tv2-ring .tp-value { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--sun, #f0a55e) 50%, transparent)); }
/* 书合上时：封面（closed 状态的页）不参与淡出，避免最后闪一下 */
.wb-book.closed .wb-page-host { opacity: 1 !important; transition: none; }
/* 饼图入场：整体淡入，不再用遮罩扫一圈（扫的时候最后一段的圆头会先冒在 12 点，出现一小段绿色断层） */
.dash-donut .donut-reveal { animation: none; stroke-dashoffset: 0; }
.dash-donut svg > g[mask] { animation: de-donut-in 820ms cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-box: view-box; transform-origin: center; }
@keyframes de-donut-in { from { opacity: 0; transform: rotate(-80deg) scale(0.9); } 40% { opacity: 1; } }
.wb-book.wb-fold .wb-sheet-face.back .wb-page-in { opacity: 0; }

/* 侧栏底部：显示模式按钮 + 弹出菜单（头像和名字仍是进设置） */
.sidebar-footer { position: relative; display: flex; align-items: center; gap: 4px; }
.sidebar-footer .profile-chip { flex: 1; min-width: 0; }
.mode-button { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; }
.mode-button:hover, .mode-button[aria-expanded="true"] { background: var(--surface-muted); color: var(--ink); }
.mode-menu { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 30; width: 176px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-strong); box-shadow: 0 18px 40px -18px rgba(50, 35, 20, 0.45); animation: de-rise 160ms ease both; }
.mode-menu p { margin: 2px 8px 6px; color: var(--muted); font-size: 0.74rem; letter-spacing: 0.06em; }
.mode-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer; }
.mode-menu button:hover { background: var(--surface-muted); }
.mode-menu button[aria-checked="true"] { color: var(--accent-text); font-weight: 700; }
.mode-menu button svg { flex: none; color: var(--muted); }
.mode-menu button i { margin-left: auto; font-style: normal; }
