:root {
  --seed-bg: #f6f7f9;
  --seed-surface: #ffffff;
  --seed-ink: #14181f;
  --seed-muted: #6b7280;
  --seed-line: #e6e8ee;
  --seed-accent: #2f6df6;

  --accent: var(--seed-accent);
  --accent-ink: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --font: "Microsoft YaHei UI", "PingFang SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hour: 64px;
  --gutter: 58px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--seed-bg);
  color: var(--seed-ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 14px; font-weight: 650; letter-spacing: -0.005em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
}

/* ---------------- 侧栏 ---------------- */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 14px 16px;
  background: var(--seed-surface);
  border-right: 1px solid var(--seed-line);
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 650;
}

.brand-name { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--seed-muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  color: #3f4652;
  text-align: left;
  font-size: 13px;
}

.nav-item:hover { background: #f3f5f9; }

.nav-item.is-active {
  background: color-mix(in srgb, var(--accent) 9%, white);
  color: var(--accent);
  font-weight: 600;
}

.nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c9ced9;
}
.nav-item.is-active .nav-dot { background: var(--accent); }

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 6px 0;
  border-top: 1px solid var(--seed-line);
}

/* ---------------- 通用按钮 ---------------- */

.primary-btn {
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 550;
}
.primary-btn:hover { filter: brightness(0.95); }

.ghost-btn {
  border: 1px solid var(--seed-line);
  background: var(--seed-surface);
  color: #3f4652;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
}
.ghost-btn:hover { background: #f5f7fa; }
.ghost-btn.small { padding: 4px 9px; font-size: 12px; }
.ghost-btn.danger { color: #b42318; }
.ghost-btn.danger:hover { background: #fef3f2; border-color: #fbd5d2; }

.icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--seed-line);
  background: var(--seed-surface);
  border-radius: var(--radius-sm);
  color: #3f4652;
  font-size: 15px;
  padding: 0;
}
.icon-btn:hover { background: #f5f7fa; }

/* ---------------- 主区 ---------------- */

.main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: var(--seed-surface);
  border-bottom: 1px solid var(--seed-line);
  flex-wrap: wrap;
}

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

.date-nav input[type="date"] {
  border: 1px solid var(--seed-line);
  border-radius: var(--radius-sm);
  background: var(--seed-surface);
  padding: 5px 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.progress { display: flex; align-items: center; gap: 8px; color: var(--seed-muted); font-size: 12px; }
.progress .bar {
  width: 92px;
  height: 5px;
  border-radius: 999px;
  background: #edf0f5;
  overflow: hidden;
}
.progress .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: inherit;
  transition: width 240ms ease;
}
#progress-text { font-variant-numeric: tabular-nums; min-width: 44px; }

.view { display: none; min-height: 0; flex: 1; overflow: auto; padding: 20px 22px 28px; }
.view.is-active { display: block; }

.subtle { color: var(--seed-muted); font-size: 12px; }

.card {
  background: var(--seed-surface);
  border: 1px solid var(--seed-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
}
.card-head.compact { align-items: center; padding: 14px 16px 8px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 14px;
  color: var(--seed-muted);
  font-size: 12px;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.swatch.course { background: #64748b; }
.swatch.basic { background: #2f9e66; }
.swatch.task { background: var(--accent); }
.swatch.done { background: #cbd5e1; }
.swatch.sleep { background: #9aa7bb; }
.swatch.nap { background: #dfae4a; }
.swatch.travel { background: #7aa2c9; }

/* ---------------- 课表 ---------------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 308px;
  gap: 18px;
  align-items: start;
}

.timetable-card { min-width: 0; }

.tt-scroll {
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 14px 16px 6px;
}

.tt-canvas {
  position: relative;
  height: calc(var(--hour) * 18);
  min-width: 0;
}

.tt-hours {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--gutter);
  pointer-events: none;
}

.tt-hour-label {
  position: absolute;
  left: 0;
  width: 44px;
  text-align: right;
  transform: translateY(-7px);
  font-size: 11px;
  color: #9aa2b1;
  font-variant-numeric: tabular-nums;
}

.tt-grid {
  position: absolute;
  inset: 0 0 0 var(--gutter);
  background-image:
    linear-gradient(to bottom, #eef0f5 1px, transparent 1px),
    linear-gradient(to bottom, #f7f8fb 1px, transparent 1px);
  background-size: 100% var(--hour), 100% calc(var(--hour) / 2);
  border-top: 1px solid #eef0f5;
}

.tt-blocks { position: absolute; inset: 0 0 0 var(--gutter); }

.tt-block {
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, white);
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, white);
  border-radius: 7px;
  padding: 5px 8px;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: #1f2937;
  min-width: 0;
}
.tt-block:hover { background: color-mix(in srgb, var(--accent) 14%, white); }
.tt-block.is-course {
  border-color: #d6dbe4;
  border-left-color: #64748b;
  background: #f5f7fa;
}
.tt-block.is-course:hover { background: #eef2f7; }
.tt-block.is-done {
  border-color: #e5e8ee;
  border-left-color: #cbd5e1;
  background: #f8f9fb;
  color: #98a1af;
  text-decoration: line-through;
}
.tt-block.is-sleep {
  pointer-events: none;
  border: 1px dashed #d9dee8;
  border-left: 3px solid #b8c3d3;
  background: repeating-linear-gradient(135deg, #f8f9fc, #f8f9fc 9px, #f2f4f8 9px, #f2f4f8 18px);
  color: #8a93a3;
}
.tt-block.is-sleep .tt-name { color: #7b8494; font-weight: 550; }
.tt-block.is-nap {
  pointer-events: none;
  border: 1px solid #f0dfb8;
  border-left: 3px solid #dfae4a;
  background: #fff8e8;
  color: #8a6a1d;
  gap: 0;
  padding: 2px 7px;
}
.tt-block.is-nap .tt-time { font-size: 9px; color: #a58a4a; }
.tt-block.is-nap .tt-name { font-size: 11px; color: #8a6a1d; }
.tt-block.is-travel {
  pointer-events: none;
  border: 1px dashed #b9cde0;
  border-left: 3px solid #7aa2c9;
  background: repeating-linear-gradient(135deg, #f4f9fd, #f4f9fd 6px, #eaf3fa 6px, #eaf3fa 12px);
  color: #4a6f91;
  gap: 0;
  padding: 2px 7px;
}
.tt-block.is-travel .tt-time { font-size: 9px; color: #7c98b3; }
.tt-block.is-travel .tt-name { font-size: 11px; color: #4a6f91; }
.tt-block.is-basic {
  background: #eef9f3;
  border-color: #c7e8d6;
  border-left-color: #2f9e66;
  color: #1f6b47;
}
.tt-block.is-basic:hover { background: #e2f5eb; }
.tt-block.is-basic .tt-time { font-size: 9px; color: #4b8a68; }
.tt-block.is-basic .tt-name { font-size: 11px; color: #1f6b47; font-weight: 550; }
.tt-block .tt-time {
  font-size: 10px;
  color: #7a8394;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.tt-block .tt-name {
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tt-block .tt-loc {
  font-size: 10px;
  line-height: 1.3;
  color: #8a93a3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tt-block.tight { padding: 2px 7px; }
.tt-block.tight .tt-time { display: none; }
.tt-block.tight .tt-name { -webkit-line-clamp: 1; }

.tt-now {
  position: absolute;
  left: calc(var(--gutter) - 3px);
  right: 0;
  height: 1px;
  background: #e5484d;
  z-index: 3;
  pointer-events: none;
}
.tt-now span {
  position: absolute;
  left: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e5484d;
}

.tt-empty {
  position: absolute;
  inset: 29% 0 auto var(--gutter);
  text-align: center;
  color: var(--seed-muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* ---------------- 右栏 ---------------- */

.rail { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.counter {
  font-size: 12px;
  color: var(--seed-muted);
  font-variant-numeric: tabular-nums;
  background: #f3f5f9;
  border-radius: 999px;
  padding: 1px 9px;
}

/* ---------------- 起床签到 ---------------- */

.wake-btn:disabled { cursor: default; opacity: 1; }
.wake-btn.is-checked { color: #1f7a4d; border-color: #bfe3cf; background: #f1fbf5; }
.wake-btn.is-late { color: #a15c00; border-color: #f0d6a8; background: #fff9ee; }
.wake-btn.is-lazy { color: #b42318; border-color: #fbd5d2; background: #fef3f2; }
.wake-btn.is-waiting { color: #8a93a3; }

.wake-body { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 14px; }
.wake-today { font-size: 13px; color: #3f4652; }
.wake-check { width: 100%; }
.wake-check:disabled { cursor: default; opacity: 1; filter: none; }
.wake-check.is-checked { background: #e8f7ef; color: #1f7a4d; border: 1px solid #bfe3cf; }
.wake-check.is-lazy { background: #fef3f2; color: #b42318; border: 1px solid #fbd5d2; }
.wake-note { margin: 0; font-size: 11px; line-height: 1.55; color: var(--seed-muted); }

.wake-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wake-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 2px;
  border-radius: 6px;
  background: #f7f8fb;
}
.wake-day.is-today {
  background: color-mix(in srgb, var(--accent) 8%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, white);
}
.wake-day-label { font-size: 10px; color: var(--seed-muted); }
.wake-dot { width: 8px; height: 8px; border-radius: 50%; background: #d6dbe4; }
.wake-day-time {
  font-size: 9px;
  color: var(--seed-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wake-day.is-done .wake-dot { background: #2f9e66; }
.wake-day.is-late .wake-dot { background: #d98a14; }
.wake-day.is-late .wake-day-time { color: #a15c00; }
.wake-day.is-lazy .wake-dot { background: #d9534f; }
.wake-day.is-lazy .wake-day-time { color: #b42318; }
.wake-day.is-pending .wake-dot { background: #fff; box-shadow: inset 0 0 0 1px var(--accent); }
.wake-day.is-before .wake-dot,
.wake-day.is-future .wake-dot,
.wake-day.is-before-start .wake-dot { background: #e5e8ee; }

.wake-week-stats { margin-top: 14px; }
.wake-week-stats .wake-day { padding: 9px 2px; }
.wake-week-stats .wake-dot { width: 10px; height: 10px; }
.wake-week-stats .wake-day-time { font-size: 10px; }

.task-list { display: flex; flex-direction: column; padding: 0 8px 10px; }

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.task-item:hover { background: #f8fafc; border-color: var(--seed-line); }

.task-check {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid #c3cad6;
  border-radius: 5px;
  margin-top: 2px;
  flex: none;
  display: grid;
  place-items: center;
  background: #fff;
}
.task-check:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.task-check:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.task-main { min-width: 0; flex: 1; }
.task-title { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.task-item.is-done .task-title { color: #98a1af; text-decoration: line-through; }
.task-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
  font-size: 11px;
  color: var(--seed-muted);
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
.pill {
  border-radius: 4px;
  padding: 0 5px;
  background: #f1f4f8;
  font-size: 10px;
}
.pill.high { background: #fef0ee; color: #b42318; }
.pill.course { background: #eef2f7; color: #475569; }
.pill.weekly { background: #eef7f1; color: #227a4b; }
.pill.unscheduled { background: #fff7e6; color: #a15c00; }
.task-loc {
  color: #8a93a3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 190px;
}

.empty-note {
  padding: 6px 16px 16px;
  color: var(--seed-muted);
  font-size: 12px;
  line-height: 1.6;
}

.unscheduled { display: flex; flex-direction: column; gap: 4px; padding: 0 10px 10px; }
.unscheduled button {
  text-align: left;
  border: 1px dashed #dfe3ea;
  background: #fbfcfe;
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-size: 12px;
}
.unscheduled button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- 习惯 ---------------- */

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.inline-form { display: flex; gap: 8px; }
.inline-form input {
  border: 1px solid var(--seed-line);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  background: var(--seed-surface);
  min-width: 200px;
}

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

.habit-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.habit-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.habit-name { font-size: 14px; font-weight: 600; }
.habit-streak { font-size: 12px; color: var(--seed-muted); font-variant-numeric: tabular-nums; }
.habit-heat { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; }
.heat-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: #eff1f6;
}
.heat-cell.l1 { background: color-mix(in srgb, var(--accent) 25%, white); }
.heat-cell.l2 { background: color-mix(in srgb, var(--accent) 55%, white); }
.heat-cell.l3 { background: var(--accent); }
.habit-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.habit-today { font-size: 12px; color: var(--seed-muted); font-variant-numeric: tabular-nums; }

/* ---------------- 统计 ---------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.stat-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.stat-big {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}
.stat-sub { font-size: 12px; color: var(--seed-muted); }

.week-bars { display: flex; align-items: flex-end; gap: 8px; height: 86px; margin-top: 14px; }
.week-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.week-bar i {
  display: block;
  width: 100%;
  background: color-mix(in srgb, var(--accent) 22%, white);
  border-radius: 4px 4px 2px 2px;
  min-height: 3px;
}
.week-bar i.full { background: var(--accent); }
.week-bar span { font-size: 10px; color: var(--seed-muted); }

.time-split { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.time-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.time-row .track { flex: 1; height: 6px; border-radius: 999px; background: #f0f2f6; overflow: hidden; }
.time-row .track i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.time-row .val { width: 52px; text-align: right; color: var(--seed-muted); font-variant-numeric: tabular-nums; }

.habit-mini { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.habit-mini-row { display: flex; justify-content: space-between; font-size: 12px; color: #3f4652; }
.habit-mini-row em { font-style: normal; color: var(--seed-muted); font-variant-numeric: tabular-nums; }

/* ---------------- 设置 ---------------- */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}

.settings-card { padding: 16px 18px; }
.settings-card h2 { margin-bottom: 6px; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid #f0f2f6;
}
.settings-card .row:first-of-type { border-top: 0; }
.row-title { font-size: 13px; font-weight: 550; }
.row-sub { font-size: 11px; color: var(--seed-muted); line-height: 1.6; margin-top: 2px; max-width: 320px; }

.switch {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #d8dde6;
  background: #e9edf3;
  padding: 2px;
  flex: none;
  transition: background 160ms ease;
}
.switch i {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
  transition: transform 160ms ease;
}
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"] i { transform: translateX(18px); }

.size-control { display: flex; gap: 6px; }
.accent-row { display: flex; gap: 8px; }
.accent-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  outline: 1px solid #e2e6ee;
  padding: 0;
}
.accent-dot[data-accent="blue"] { background: #2f6df6; }
.accent-dot[data-accent="purple"] { background: #7a5af8; }
.accent-dot[data-accent="green"] { background: #1f9d74; }
.accent-dot[data-accent="orange"] { background: #d97706; }
.accent-dot.is-active { outline: 2px solid var(--seed-ink); outline-offset: 1px; }

/* ---------------- 弹窗 ---------------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.34);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
}
.modal[hidden] { display: none; }

.modal-panel {
  width: min(520px, 100%);
  background: var(--seed-surface);
  border-radius: 14px;
  border: 1px solid var(--seed-line);
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.18);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
}
.modal-body { padding: 6px 18px 4px; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 11px; color: var(--seed-muted); }
.field input, .field select {
  border: 1px solid var(--seed-line);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  background: var(--seed-surface);
  min-width: 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.field-row[hidden] { display: none; }
.sync-form { display: grid; gap: 10px; margin: 10px 0 6px; }
.sync-actions { align-items: flex-start; }
.sync-state { min-width: 0; }
.sync-btns { display: flex; gap: 8px; flex-shrink: 0; }
#sync-status { max-width: 360px; word-break: break-word; white-space: pre-line; line-height: 1.6; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
.modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px 18px;
}
.modal-foot .spacer { flex: 1; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #14181f;
  color: #f6f7f9;
  border-radius: 9px;
  padding: 9px 14px;
  font-size: 12px;
  max-width: 360px;
  z-index: 80;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.24);
}
.toast[hidden] { display: none; }

/* ---------------- 作业计时与统计 ---------------- */

.task-actions { flex: none; display: flex; align-items: center; }

.hw-btn {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.hw-btn.start {
  background: color-mix(in srgb, var(--accent) 10%, white);
  border-color: color-mix(in srgb, var(--accent) 30%, white);
  color: var(--accent);
}
.hw-btn.end { background: var(--accent); color: #fff; }
.hw-btn:hover { filter: brightness(0.96); }
.hw-btn:disabled { opacity: 0.55; cursor: default; }

.hw-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #b42318;
  font-variant-numeric: tabular-nums;
}
.hw-timer i,
.hw-running-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e5484d;
  animation: hw-pulse 1.2s ease-in-out infinite;
}
@keyframes hw-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.pill.subject { background: #eef2f7; color: #475569; }
.pill.nature { background: #f3efff; color: #6d4aff; }
.pill.done { background: #eef7f1; color: #227a4b; }
.pill.archived { background: #eef2f7; color: #475569; }
.pill.expired { background: #f4f5f7; color: #8a93a3; }

.field-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.hw-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.hw-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 12px;
  border-right: 1px solid #f0f2f6;
  min-width: 0;
}
.hw-stat:nth-child(4) { border-right: 0; }
.hw-num {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.hw-stat-label { font-size: 11px; color: var(--seed-muted); }
.hw-summary-note {
  grid-column: 1 / -1;
  border-top: 1px solid #f0f2f6;
  padding-top: 10px;
  font-size: 12px;
  color: var(--seed-muted);
  font-variant-numeric: tabular-nums;
}

.hw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}
.hw-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.hw-card.wide { grid-column: 1 / -1; }
.hw-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hw-note { font-size: 11px; color: var(--seed-muted); line-height: 1.6; }
.hw-empty-line { font-size: 12px; color: var(--seed-muted); padding: 6px 0; }

.hw-chart { display: flex; flex-direction: column; gap: 9px; }
.hw-bar-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 76px;
  gap: 9px;
  align-items: center;
  font-size: 12px;
}
.hw-bar-label {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
}
.hw-bar-label em { font-style: normal; font-size: 10px; color: var(--seed-muted); }
.hw-bar-track { height: 8px; border-radius: 999px; background: #f0f2f6; overflow: hidden; }
.hw-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 200ms ease;
}
.hw-bar-track i.muted { background: #c9ced9; }
.hw-bar-val {
  text-align: right;
  font-size: 11px;
  line-height: 1.3;
  color: var(--seed-muted);
  font-variant-numeric: tabular-nums;
}

#hw-running:empty { display: none; }
.hw-running {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border-color: color-mix(in srgb, var(--accent) 30%, white);
  background: color-mix(in srgb, var(--accent) 4%, white);
}
.hw-running-dot { flex: none; width: 8px; height: 8px; }
.hw-running-main { flex: 1; min-width: 0; }
.hw-running-title {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hw-running-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
  font-size: 11px;
  color: var(--seed-muted);
}
.hw-running-clock {
  flex: none;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.hw-running-actions { display: flex; gap: 6px; flex: none; }

.hw-conclusion {
  font-size: 12px;
  line-height: 1.7;
  color: #3f4652;
  background: #f8fafc;
  border: 1px solid var(--seed-line);
  border-radius: 8px;
  padding: 10px 12px;
}
.hw-eff-bars { display: flex; flex-direction: column; gap: 7px; }
.hw-eff-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 200px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.hw-eff-row.is-muted { color: #9aa2b1; }
.hw-eff-track { height: 7px; border-radius: 999px; background: #f0f2f6; overflow: hidden; }
.hw-eff-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 200ms ease;
}
.hw-eff-val {
  text-align: right;
  font-size: 11px;
  color: var(--seed-muted);
  font-variant-numeric: tabular-nums;
}

.hw-archive { display: flex; flex-direction: column; gap: 10px; }
.hw-subject-group {
  border: 1px solid var(--seed-line);
  border-radius: 9px;
  overflow: hidden;
  background: #fdfefe;
}
.hw-subject-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: #f7f9fc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.hw-subject-summary::-webkit-details-marker { display: none; }
.hw-subject-summary span::before {
  content: "▸ ";
  color: var(--seed-muted);
  font-weight: 400;
}
.hw-subject-group[open] .hw-subject-summary span::before { content: "▾ "; }
.hw-subject-summary em {
  font-style: normal;
  font-weight: 500;
  color: var(--seed-muted);
  font-variant-numeric: tabular-nums;
}
.hw-nature-group { padding: 6px 12px 8px; }
.hw-nature-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 6px;
  margin-bottom: 2px;
  border-bottom: 1px dashed #eef0f5;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}
.hw-nature-title em {
  font-style: normal;
  font-weight: 400;
  color: var(--seed-muted);
  font-variant-numeric: tabular-nums;
}
.hw-archive-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #f5f6f9;
  cursor: pointer;
}
.hw-archive-item:hover { background: #f8fafc; }
.hw-archive-item:last-child { border-bottom: 0; }
.hw-archive-main { flex: 1; min-width: 0; }
.hw-archive-title { font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.hw-archive-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
  font-size: 10px;
  color: var(--seed-muted);
  font-variant-numeric: tabular-nums;
}
.hw-archive-time {
  flex: none;
  padding: 2px 7px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 8%, white);
  color: var(--accent);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------------- 基本任务 ---------------- */

.basic-rail { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }
.basic-mini {
  border: 1px solid #eef1f5;
  border-radius: 8px;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #fff;
}
.basic-mini.is-running { border-color: #bfe3cf; background: #f4fbf7; }
.basic-mini.is-met { background: #f7faf8; }
.basic-mini-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.basic-mini-name { font-weight: 600; }
.basic-mini-value {
  color: var(--seed-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.basic-mini-value.is-met { color: #1f7a4d; font-weight: 600; }
.basic-mini-track { height: 5px; border-radius: 999px; background: #eef1f5; overflow: hidden; }
.basic-mini-track i {
  display: block;
  height: 100%;
  width: 0;
  background: #2f9e66;
  border-radius: inherit;
  transition: width 240ms ease;
}
.basic-mini-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--seed-muted);
  font-size: 10px;
}

.basic-btn {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.basic-btn.start { background: #eaf7f0; border-color: #bfe3cf; color: #1f7a4d; }
.basic-btn.end { background: #1f7a4d; color: #fff; }
.basic-btn:hover { filter: brightness(0.97); }
.basic-btn:disabled { opacity: 0.45; cursor: default; filter: none; }

.basic-week-badge {
  background: #eef9f3;
  color: #1f6b47;
  border: 1px solid #c7e8d6;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  align-self: flex-start;
}

.basic-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 18px;
  background: var(--seed-surface);
  border: 1px solid var(--seed-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.basic-stat { border-right: 1px solid #f0f2f6; padding-right: 12px; min-width: 0; }
.basic-stat:last-child { border-right: 0; }
.basic-stat-num {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.basic-stat-label { font-size: 11px; color: var(--seed-muted); }

.basic-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.basic-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.basic-card.is-running { border-color: #bfe3cf; box-shadow: 0 0 0 1px #d7f0e1; }
.basic-card.is-met { background: linear-gradient(180deg, #fbfefc, #fff); }
.basic-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.basic-card-title h2 { font-size: 15px; }
.basic-target { font-size: 11px; color: var(--seed-muted); margin-top: 2px; }
.basic-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #5b6472;
  white-space: nowrap;
}
.basic-badge.is-running { background: #fef0ee; color: #b42318; }
.basic-badge.is-met { background: #e8f7ef; color: #1f7a4d; }
.basic-badge.is-progress { background: #fff7e6; color: #a15c00; }

.basic-progress-row { display: flex; align-items: center; gap: 10px; }
.basic-track { flex: 1; height: 7px; border-radius: 999px; background: #eef1f5; overflow: hidden; }
.basic-track i {
  display: block;
  height: 100%;
  width: 0;
  background: #2f9e66;
  border-radius: inherit;
  transition: width 240ms ease;
}
.basic-track i.is-met { background: #1f7a4d; }
.basic-total {
  font-size: 11px;
  color: var(--seed-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.basic-total.is-met { color: #1f7a4d; font-weight: 600; }

.basic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11px;
  color: var(--seed-muted);
}
.basic-week-pill { background: #f4f5f7; border-radius: 999px; padding: 2px 7px; }
.basic-week-pill.is-ok { background: #e8f7ef; color: #1f7a4d; font-weight: 600; }
.basic-live { display: inline-flex; align-items: center; gap: 5px; color: #b42318; font-variant-numeric: tabular-nums; }
.basic-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e5484d;
  animation: hw-pulse 1.2s ease-in-out infinite;
}
.basic-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.basic-actions .basic-btn { padding: 5px 12px; }
.basic-hint { font-size: 10px; color: var(--seed-muted); }

.basic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}
.basic-panel {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.basic-panel.wide { grid-column: 1 / -1; }

.basic-week-table { display: flex; flex-direction: column; gap: 12px; }
.basic-week-row { display: flex; flex-direction: column; gap: 5px; }
.basic-week-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.basic-week-score { font-size: 11px; color: var(--seed-muted); }
.basic-week-score.is-ok { color: #1f7a4d; font-weight: 600; }
.basic-week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.basic-week-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 2px;
  border-radius: 6px;
  background: #f7f8fa;
  font-size: 10px;
  color: #8a93a3;
}
.basic-week-cell.is-met { background: #e8f7ef; color: #1f7a4d; }
.basic-week-cell.is-today { box-shadow: inset 0 0 0 1px #c7e8d6; }
.basic-week-min { font-variant-numeric: tabular-nums; }

.basic-preference { display: flex; flex-direction: column; gap: 14px; }
.basic-pref-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; margin-bottom: 5px; }
.basic-pref-head span { color: var(--seed-muted); text-align: right; }
.basic-pref-bars { display: flex; flex-direction: column; gap: 4px; }
.basic-pref-line {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 108px;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  color: var(--seed-muted);
}
.basic-pref-track { height: 6px; background: #f0f2f6; border-radius: 999px; overflow: hidden; }
.basic-pref-track i { display: block; height: 100%; width: 0; background: #7aa2c9; border-radius: inherit; }
.basic-pref-val { text-align: right; font-variant-numeric: tabular-nums; }

.basic-matrix { display: flex; flex-direction: column; gap: 5px; }
.basic-matrix-row {
  display: grid;
  grid-template-columns: 92px repeat(7, minmax(0, 1fr));
  gap: 4px;
  align-items: center;
}
.basic-matrix-row.is-head { font-size: 10px; color: var(--seed-muted); }
.basic-matrix-name { font-size: 11px; color: #3f4652; }
.basic-matrix-day { text-align: center; font-size: 10px; }
.basic-matrix-day.is-today { color: var(--accent); font-weight: 600; }
.basic-matrix-cell {
  text-align: center;
  padding: 6px 2px;
  background: #f7f8fa;
  border-radius: 5px;
  font-size: 10px;
  color: #8a93a3;
  font-variant-numeric: tabular-nums;
}
.basic-matrix-cell.is-some { background: #eef7f1; color: #227a4b; }
.basic-matrix-cell.is-half { background: #d9f0e3; color: #1f6b47; }
.basic-matrix-cell.is-met { background: #2f9e66; color: #fff; font-weight: 600; }
.basic-matrix-cell.is-today { box-shadow: inset 0 0 0 1px #9fd3b8; }

.rest-row { margin-top: 10px; }
.rest-save { display: flex; align-items: flex-end; }
.rest-save .ghost-btn { width: 100%; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1180px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .rail { flex-direction: row; flex-wrap: wrap; }
  .rail > .card { flex: 1 1 300px; }
  .tt-scroll { max-height: 60vh; }
}

@media (max-width: 880px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--seed-line);
    overflow-x: auto;
  }
  .brand-sub, .sidebar-foot { display: none; }
  .nav { flex-direction: row; gap: 4px; }
  .view { padding: 14px; }
  .topbar { padding: 10px 14px; }
  .rail { flex-direction: column; }
  .hw-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hw-stat:nth-child(2n) { border-right: 0; }
  .hw-running { flex-wrap: wrap; }
  .hw-running-actions { margin-left: auto; }
  .hw-bar-row { grid-template-columns: 88px minmax(0, 1fr) 70px; }
  .hw-eff-row { grid-template-columns: 100px minmax(0, 1fr); }
  .hw-eff-val { grid-column: 1 / -1; text-align: left; padding-left: 110px; }
  .basic-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .basic-stat:nth-child(2n) { border-right: 0; }
  .basic-matrix-row { grid-template-columns: 70px repeat(7, minmax(0, 1fr)); }
  .basic-pref-line { grid-template-columns: 30px minmax(0, 1fr) 92px; }
}

/* ---------------- 云同步 ---------------- */

.cloud-mobile-card { display: none; }
.is-cloud .desktop-only { display: none !important; }
.is-cloud .cloud-mobile-card { display: block; }

.cloud-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  flex: 1 1 320px;
}
.cloud-url-row input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--seed-line);
  border-radius: var(--radius-sm);
  background: var(--seed-surface);
  padding: 7px 10px;
  font-size: 12px;
  color: var(--seed-muted);
}

.cloud-help {
  margin-top: 12px;
  border-top: 1px solid var(--seed-line);
  padding-top: 10px;
  font-size: 12px;
  color: var(--seed-muted);
}
.cloud-help summary { cursor: pointer; color: var(--accent); font-weight: 550; }
.cloud-help ol { margin: 8px 0 6px; padding-left: 20px; line-height: 1.8; }
.cloud-help code {
  background: #f3f5f9;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
}

.cloud-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--seed-line);
  background: #f7f8fa;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--seed-muted);
  white-space: nowrap;
}

.cloud-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 24, 34, 0.42);
  backdrop-filter: blur(6px);
}
.cloud-gate[hidden] { display: none; }
body.cloud-gate-open { overflow: hidden; }

.cloud-gate-panel {
  width: min(380px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--seed-surface);
  border: 1px solid var(--seed-line);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.24);
  padding: 22px;
}
.cloud-gate-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.cloud-gate-brand h1 { font-size: 18px; }
.cloud-gate-brand p { font-size: 11px; color: var(--seed-muted); margin-top: 2px; }
.cloud-gate-panel .field { margin-bottom: 12px; }
.cloud-gate-panel .field input {
  border: 1px solid var(--seed-line);
  border-radius: var(--radius-sm);
  background: var(--seed-surface);
  padding: 10px 12px;
  font-size: 15px;
}
.cloud-gate-actions { display: flex; gap: 10px; margin-top: 4px; }
.cloud-gate-actions .primary-btn,
.cloud-gate-actions .ghost-btn { flex: 1; padding: 10px 14px; font-size: 14px; }
.cloud-gate-status {
  margin-top: 12px;
  font-size: 12px;
  color: var(--seed-muted);
  min-height: 18px;
  white-space: pre-wrap;
  word-break: break-word;
}
.cloud-gate-advanced {
  margin-top: 14px;
  border-top: 1px solid var(--seed-line);
  padding-top: 12px;
  font-size: 12px;
  color: var(--seed-muted);
}
.cloud-gate-advanced summary { cursor: pointer; color: var(--accent); font-weight: 550; margin-bottom: 10px; }
.cloud-gate-advanced .field { margin-top: 10px; }

@media (max-width: 720px) {
  body { font-size: 15px; }
  .app {
    display: block;
    height: 100dvh;
    min-height: 0;
  }
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--seed-line);
    border-bottom: 0;
    overflow: visible;
    box-shadow: 0 -6px 20px rgba(16, 24, 40, 0.06);
  }
  .sidebar .brand, .sidebar .sidebar-foot { display: none; }
  .nav {
    flex-direction: row;
    flex: 1;
    gap: 0;
    justify-content: space-around;
  }
  .nav-item {
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 7px 2px 5px;
    font-size: 10px;
    border-radius: 10px;
    white-space: nowrap;
  }
  .nav-dot { display: none; }
  .main {
    height: 100dvh;
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
    overflow: hidden;
  }
  .topbar {
    padding: 8px 12px;
    gap: 8px;
  }
  .top-actions { gap: 6px; }
  .top-actions .progress { order: 4; flex: 1 1 100%; }
  .top-actions .progress .bar { flex: 1; width: auto; }
  .top-actions .ghost-btn, .top-actions .primary-btn { padding: 6px 10px; font-size: 12px; }
  .view { padding: 12px; }
  .workspace, .settings-grid, .stats-grid, .habit-grid, .hw-grid, .basic-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { gap: 12px; }
  .settings-card { padding: 14px; }
  .cloud-mobile-card { display: block; }
  .desktop-only { display: none !important; }
  .cloud-gate-panel { padding: 18px; }
  .sync-actions { flex-direction: column; align-items: stretch; }
  .sync-btns { flex-wrap: wrap; }
  .sync-btns .ghost-btn, .sync-btns .primary-btn { flex: 1 1 120px; }
  .tt-scroll { max-height: 64dvh; }
  .card-head { padding: 14px 14px 10px; }
}
