:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #fafbfd;
  --ink: #1b2130;
  --ink-soft: #3c4358;
  --muted: #727a90;
  --muted-light: #9aa1b3;
  --line: #e7eaf1;
  --line-strong: #d9dee9;
  --accent: #5146e5;
  --accent-deep: #4238c9;
  --accent-soft: #eeecfd;
  --green: #0d9f6e;
  --green-soft: #e7f7f0;
  --amber: #d97706;
  --amber-soft: #fef3e2;
  --red: #e0454b;
  --red-soft: #fdeeee;
  --blue: #3b82f6;
  --blue-soft: #eaf2fe;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 31, 54, 0.04), 0 14px 30px -22px rgba(23, 31, 54, 0.22);
  --shadow-pop: 0 24px 70px -20px rgba(23, 31, 54, 0.32);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(112, 96, 255, 0.09), transparent 62%),
    radial-gradient(900px 460px at 100% 0%, rgba(80, 165, 255, 0.07), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

.app {
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
  padding: 30px 0 80px;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(231, 234, 241, 0.9);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-inner {
  width: min(1180px, calc(100% - 56px));
  margin: 0 auto;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #675cf0, #4a3fd2);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 8px 18px -8px rgba(81, 70, 229, 0.85);
}

.brand-text strong { display: block; font-size: 16px; letter-spacing: 0.02em; }
.brand-text small { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: 0.08em; margin-top: 1px; }

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  padding: 7px 16px;
  border-radius: 8px;
  transition: background 0.16s ease, color 0.16s ease;
}

.tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.75); }
.tab.active { color: var(--accent); background: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(23, 31, 54, 0.08); }

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.today-chip { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, #f4a261, #e76f51);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line);
}

/* ---------- buttons ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  color: #fff;
  background: linear-gradient(145deg, #6257ee, #4b40d8);
  box-shadow: 0 8px 18px -10px rgba(81, 70, 229, 0.85);
}
.btn-primary:hover { box-shadow: 0 12px 24px -10px rgba(81, 70, 229, 0.9); transform: translateY(-1px); }

.btn-ghost { color: var(--ink-soft); border-color: var(--line); background: #fff; }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-soft); }

.btn-soft { color: var(--accent); background: var(--accent-soft); }
.btn-soft:hover { background: #e6e3fc; }

.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }

.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-light);
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-soft); color: var(--ink); border-color: var(--line); }
.icon-btn.danger:hover { color: var(--red); background: var(--red-soft); }

/* ---------- shared surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.card-head h2 { font-size: 15.5px; font-weight: 650; letter-spacing: 0.01em; }
.card-hint { margin-left: auto; color: var(--muted-light); font-size: 11.5px; }

.eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted-light);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.spacer { flex: 1; }

.bar {
  height: 6px;
  border-radius: 99px;
  background: #eef0f6;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #6f63f2, #9b8cff);
  transition: width 0.4s ease;
}
.bar.done span { background: linear-gradient(90deg, #12b07b, #4ed3a4); }

.pct { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- page heads ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin: 8px 0 24px;
}
.page-head h1 { font-size: 29px; font-weight: 700; letter-spacing: -0.02em; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.head-actions { margin-left: auto; display: flex; gap: 10px; }

.hero {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin: 10px 0 26px;
}
.hero h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; }
.hero .wave { font-size: 24px; }
.hero-sub { color: var(--muted); font-size: 13.5px; margin-top: 7px; }
.hero-sub b { color: var(--accent); font-weight: 650; }
.hero-actions { margin-left: auto; display: flex; gap: 10px; }

/* ---------- overview ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 19px;
  box-shadow: var(--shadow);
}

.stat-top { display: flex; align-items: center; gap: 8px; }
.stat-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.tone-indigo { color: var(--accent); background: var(--accent-soft); }
.tone-green { color: var(--green); background: var(--green-soft); }
.tone-amber { color: var(--amber); background: var(--amber-soft); }
.tone-red { color: var(--red); background: var(--red-soft); }
.tone-blue { color: var(--blue); background: var(--blue-soft); }

.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--muted-light); letter-spacing: 0; margin-left: 3px; }
.stat-foot { color: var(--muted-light); font-size: 11.5px; margin-top: 3px; }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.stack { display: flex; flex-direction: column; gap: 18px; }

.focus-list { display: flex; flex-direction: column; }
.focus-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px dashed var(--line);
}
.focus-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.focus-row:first-child { padding-top: 0; }

.check {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.check:hover { border-color: var(--accent); }
.check.done { border-color: var(--green); background: var(--green); }
.check.done::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2.5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}

.focus-main { min-width: 0; flex: 1; }
.focus-title { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 550; }
.focus-title .strike { text-decoration: line-through; color: var(--muted-light); }
.focus-meta { display: flex; align-items: center; gap: 7px; margin-top: 2px; color: var(--muted-light); font-size: 11.5px; }
.focus-meta .overdue { color: var(--red); }
.mini-bar { width: 86px; display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.mini-bar .bar { flex: 1; height: 4px; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 14px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}
.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  background: var(--accent);
  box-shadow: 0 0 0 3px #fff;
}
.tl-dot.st-done { background: var(--green); }
.tl-dot.st-blocked { background: var(--red); }
.tl-body { min-width: 0; flex: 1; }
.tl-text { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tl-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; color: var(--muted-light); font-size: 11px; }
.tag-soft {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 99px;
  background: #f2f3f8;
  color: var(--muted);
  font-size: 10.5px;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-mini + .plan-mini { margin-top: 16px; }
.plan-mini-top { display: flex; align-items: baseline; gap: 8px; }
.plan-mini-top strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-mini-top .pct { margin-left: auto; color: var(--accent); font-weight: 600; }
.plan-mini .bar { margin-top: 8px; height: 5px; }
.plan-mini-foot { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted-light); font-size: 11px; }

.dist { display: flex; flex-direction: column; gap: 12px; }
.dist-row { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.dist-row .dot { width: 7px; height: 7px; border-radius: 50%; }
.dist-label { width: 48px; color: var(--muted); flex-shrink: 0; }
.dist-track { flex: 1; height: 6px; border-radius: 99px; background: #f0f1f7; overflow: hidden; }
.dist-track i { display: block; height: 100%; border-radius: 99px; }
.dist-track i.fill-doing { background: linear-gradient(90deg, #6f63f2, #a99dff); }
.dist-track i.fill-blocked { background: linear-gradient(90deg, #e0454b, #f28f93); }
.dist-track i.fill-todo { background: linear-gradient(90deg, #9aa1b3, #c2c7d3); }
.dist-track i.fill-done { background: linear-gradient(90deg, #0d9f6e, #55cfa2); }
.dist-count { width: 18px; text-align: right; color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.st-todo { background: #a2a8b8; }
.dot.st-doing { background: var(--accent); }
.dot.st-blocked { background: var(--red); }
.dot.st-done { background: var(--green); }
.focus-meta .soon { color: var(--amber); }

/* ---------- tasks ---------- */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 99px;
  padding: 6px 13px;
  font-size: 12px;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .chip-count { opacity: 0.6; margin-left: 4px; font-variant-numeric: tabular-nums; }

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 11px;
  width: 230px;
  color: var(--muted-light);
}
.search:focus-within { border-color: #b9b2f5; box-shadow: 0 0 0 3px rgba(81, 70, 229, 0.08); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 12.5px; color: var(--ink); }

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

.task-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.task-card:hover { transform: translateY(-2px); border-color: #dfe2ec; box-shadow: 0 1px 2px rgba(23,31,54,.04), 0 18px 34px -22px rgba(23, 31, 54, 0.3); }
.task-card.is-done { background: #fcfdfd; }
.task-card.is-done .task-title { color: var(--muted); }

.task-head { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }

.prio {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 6px;
}
.p0 { color: var(--red); background: var(--red-soft); }
.p1 { color: var(--amber); background: var(--amber-soft); }
.p2 { color: var(--blue); background: var(--blue-soft); }
.p3 { color: var(--muted); background: #f1f2f6; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 500;
  padding: 2.5px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.st-todo { color: #7a8194; background: #f1f2f6; }
.st-doing { color: var(--accent); background: var(--accent-soft); }
.st-blocked { color: var(--red); background: var(--red-soft); }
.st-done { color: var(--green); background: var(--green-soft); }

.task-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; }
.task-desc {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 6px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; min-height: 20px; }
.tag {
  font-size: 10.5px;
  color: #6a6f85;
  background: #f4f5f9;
  border-radius: 6px;
  padding: 2px 7px;
}

.task-progress { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.task-progress .bar { flex: 1; }
.task-progress .pct { width: 34px; text-align: right; }

.task-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.due { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.due.overdue { color: var(--red); }
.due.soon { color: var(--amber); }

.status-select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  border: 0;
  border-radius: 7px;
  padding: 4px 18px 4px 8px;
  font-size: 11px;
  outline: 0;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(60, 67, 88, 0.45) 50%),
    linear-gradient(135deg, rgba(60, 67, 88, 0.45) 50%, transparent 50%);
  background-position: calc(100% - 9px) 52%, calc(100% - 5px) 52%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.status-select.st-todo { background-color: #f1f2f6; color: #7a8194; }
.status-select.st-doing { background-color: var(--accent-soft); color: var(--accent); }
.status-select.st-blocked { background-color: var(--red-soft); color: var(--red); }
.status-select.st-done { background-color: var(--green-soft); color: var(--green); }

/* ---------- plans ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 21px;
  box-shadow: var(--shadow);
}
.plan-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.tag-plan {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 6px;
}
.plan-period { font-size: 11px; color: var(--muted-light); font-variant-numeric: tabular-nums; }
.plan-card h3 { font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; }
.plan-goal { color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.6; }
.plan-progress-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.plan-progress-row .bar { flex: 1; height: 7px; }
.plan-progress-row b { font-size: 12px; color: var(--accent); font-variant-numeric: tabular-nums; }

.linked-tasks { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.linked-tasks li { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 2px 0; }
.linked-tasks .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.lt-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.lt-title.done { color: var(--muted-light); text-decoration: line-through; }
.lt-pct { margin-left: auto; color: var(--muted-light); font-size: 11px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.lt-empty { color: var(--muted-light); font-size: 12px; padding: 4px 0; }

.plan-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted-light); font-size: 11.5px; }

/* ---------- updates ---------- */
.update-layout { max-width: 880px; margin: 0 auto; }

.composer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 26px;
  cursor: text;
  transition: border-color 0.15s;
}
.composer:hover { border-color: #c8c2f7; }
.composer-fake { flex: 1; color: var(--muted-light); font-size: 13px; }
.composer .btn { flex-shrink: 0; }

.day-group + .day-group { margin-top: 22px; }
.day-title { font-size: 12.5px; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.day-title small { font-weight: 400; color: var(--muted-light); font-size: 11px; }

.update-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.update-item {
  display: flex;
  gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px dashed var(--line);
}
.update-item:last-child { border-bottom: 0; }

.avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, #7f74ff, #5146e5);
}
.update-body { min-width: 0; flex: 1; }
.update-top { display: flex; align-items: center; gap: 8px; }
.update-ref { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.update-ref .ref-kind { font-weight: 500; color: var(--muted-light); font-size: 11px; margin-right: 3px; }
.update-time { margin-left: auto; font-size: 10.5px; color: var(--muted-light); white-space: nowrap; flex-shrink: 0; }
.update-text { font-size: 13px; color: var(--ink-soft); margin-top: 6px; line-height: 1.65; }
.update-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.delta {
  font-size: 10.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}
.delta .arrow { opacity: 0.55; margin: 0 2px; }

/* ---------- summaries ---------- */
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.summary-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.period-pill {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.summary-date { font-size: 10.5px; color: var(--muted-light); }
.summary-card h3 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.summary-sections { display: flex; flex-direction: column; gap: 13px; margin-top: 15px; }
.summary-section h4 {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--muted-light);
  margin-bottom: 4px;
}
.summary-section p { font-size: 12.5px; color: var(--ink-soft); white-space: pre-line; line-height: 1.7; }
.summary-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted-light); font-size: 11px; }

/* ---------- empty state ---------- */
.empty {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  grid-column: 1 / -1;
}
.empty-icon { font-size: 26px; color: var(--muted-light); margin-bottom: 8px; }
.empty p { font-size: 13px; }
.empty .btn { margin-top: 14px; }

/* ---------- modal ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(23, 27, 43, 0.42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  animation: fade-in 0.16s ease;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  animation: pop-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal.wide { width: min(660px, 100%); }
.modal.slim { width: min(420px, 100%); }

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 24px 0;
}
.modal-head h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.modal-head .eyebrow { margin-bottom: 3px; }
.modal-head .icon-btn { margin-left: auto; flex-shrink: 0; }

.modal-form { padding: 18px 24px 0; }
.modal-body { padding: 16px 24px 0; }
.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 22px;
  margin-top: 4px;
}
.modal-foot .spacer { flex: 1; }
.modal .field { margin-bottom: 14px; }
.modal-foot .btn { padding: 9px 18px; }

.field label { display: block; font-size: 11.5px; font-weight: 550; color: var(--muted); margin-bottom: 5px; }
.field label .req { color: var(--red); margin-left: 2px; }

input[type="text"], input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: #b9b2f5;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(81, 70, 229, 0.09);
}
textarea { resize: vertical; min-height: 74px; line-height: 1.6; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8a90a3 50%), linear-gradient(135deg, #8a90a3 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  background: transparent;
  padding: 0;
  border: 0;
}
.range-row output { font-size: 12px; font-weight: 650; color: var(--accent); width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

.task-picker {
  max-height: 172px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 9px;
  padding: 6px;
}
.task-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  cursor: pointer;
}
.task-pick:hover { background: #fff; }
.task-pick input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; flex-shrink: 0; }
.task-pick .task-pick-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-pick .task-pick-status { font-size: 10.5px; color: var(--muted-light); flex-shrink: 0; }

.hint {
  font-size: 11.5px;
  color: var(--muted);
  background: #f7f7fb;
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 14px;
  line-height: 1.55;
}
.hint strong { color: var(--accent); font-weight: 600; }
.hint-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.hint-row .hint { margin-bottom: 0; flex: 1; }

.confirm-text { color: var(--ink-soft); font-size: 13.5px; line-height: 1.7; }
.confirm-text b { color: var(--ink); }

.danger-btn { color: #fff; background: linear-gradient(145deg, #e85b5f, #d53a40); box-shadow: 0 8px 18px -10px rgba(224, 69, 75, 0.8); }
.danger-btn:hover { transform: translateY(-1px); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 16px);
  z-index: 100;
  background: #1f2536;
  color: #fff;
  font-size: 12.5px;
  padding: 9px 16px;
  border-radius: 10px;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .plan-grid, .summary-grid, .task-grid { grid-template-columns: 1fr; }
  .brand-text small { display: none; }
  .today-chip { display: none; }
}

@media (max-width: 760px) {
  .topbar-inner { gap: 12px; height: auto; padding: 12px 0; flex-wrap: wrap; }
  .app { width: calc(100% - 32px); padding-top: 20px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .tab { flex: 1; }
  .topbar-actions { gap: 8px; }
  .hero, .page-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .hero-actions, .head-actions { margin-left: 0; width: 100%; }
  .hero-actions .btn, .head-actions .btn { flex: 1; justify-content: center; }
  .toolbar { flex-wrap: wrap; }
  .search { margin-left: 0; width: 100%; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .update-item { padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- priority overview ---------- */
.priority-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.8fr);
  gap: 18px;
  align-items: start;
}
.priority-main, .priority-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.spotlight {
  position: relative;
  overflow: hidden;
  padding: 24px 26px 22px;
  border: 1px solid #ddd8fb;
  border-radius: 18px;
  background: linear-gradient(150deg, #ffffff 0%, #fbfaff 55%, #f2effe 100%);
  box-shadow: 0 1px 2px rgba(23, 31, 54, 0.04), 0 20px 45px -32px rgba(81, 70, 229, 0.5);
}
.spotlight::before {
  content: "";
  position: absolute;
  top: -130px;
  right: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(109, 95, 255, 0.2), transparent);
  pointer-events: none;
}
.spotlight > * { position: relative; }

.spotlight-head { display: flex; align-items: center; gap: 10px; }
.spot-rank {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.spot-kicker { font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; color: var(--muted-light); }
.spot-title {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin-top: 14px;
}
.spot-desc { color: var(--muted); font-size: 13px; line-height: 1.65; margin-top: 6px; max-width: 620px; }
.spot-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.reason {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: #f2f3f8;
  color: var(--muted);
  white-space: nowrap;
}
.reason.warn { background: var(--amber-soft); color: var(--amber); }
.reason.danger { background: var(--red-soft); color: var(--red); }
.reason.plan { background: var(--accent-soft); color: var(--accent); }

.spot-progress { margin-top: 18px; }
.spot-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted-light);
  margin-bottom: 7px;
}
.spot-progress-label b { font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; }
.spot-progress .bar { height: 8px; }
.spot-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(81, 70, 229, 0.12);
}
.spot-owner { font-size: 11.5px; color: var(--muted-light); }

.queue-card { padding: 0; overflow: hidden; }
.queue-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.queue-head h2 { font-size: 15.5px; font-weight: 650; letter-spacing: 0.01em; }
.queue-hint { font-size: 11px; color: var(--muted-light); margin-top: 2px; }
.queue-list { display: flex; flex-direction: column; }
.queue-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 22px;
  border-bottom: 1px dashed var(--line);
  transition: background 0.15s ease;
}
.queue-row:last-child { border-bottom: 0; }
.queue-row:hover { background: #fafbfe; }
.queue-rank {
  width: 24px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-light);
  font-variant-numeric: tabular-nums;
}
.queue-main { flex: 1; min-width: 0; }
.queue-title { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; }
.queue-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-title .prio, .queue-title .status-pill { flex-shrink: 0; }
.queue-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted-light);
  flex-wrap: wrap;
}
.queue-sub .overdue { color: var(--red); }
.queue-sub .soon { color: var(--amber); }
.queue-plan {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.queue-progress { width: 118px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.queue-progress .bar { flex: 1; height: 4px; }
.queue-progress .pct { width: 32px; text-align: right; }
.queue-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.queue-actions .check { width: 18px; height: 18px; }
.queue-actions .check::after { left: 5px; top: 2px; width: 4px; height: 8px; }
.queue-actions .icon-btn.add { font-size: 13px; color: var(--muted-light); }
.queue-actions .icon-btn.add:hover { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.queue-empty { padding: 22px; color: var(--muted-light); font-size: 12.5px; text-align: center; }

.side-card { padding: 20px; }
.side-card .card-head { margin-bottom: 12px; }
.side-card .card-head h2 { font-size: 14px; }
.card-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  padding: 2px 4px;
  margin-left: auto;
}
.card-link:hover { text-decoration: underline; }
.side-empty { color: var(--muted-light); font-size: 12px; padding: 6px 0; }

.done-list { display: flex; flex-direction: column; }
.done-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.done-row:last-child { border-bottom: 0; padding-bottom: 0; }
.done-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.done-main { min-width: 0; flex: 1; }
.done-title {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.done-meta { font-size: 10.5px; color: var(--muted-light); margin-top: 1px; }

.priority-empty { margin-top: 18px; }

@media (max-width: 1020px) {
  .priority-layout { grid-template-columns: 1fr; }
  .priority-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 760px) {
  .priority-side { grid-template-columns: 1fr; }
  .spotlight { padding: 20px; }
  .spot-title { font-size: 21px; }
  .spot-rank { font-size: 26px; }
  .queue-head { padding: 16px; }
  .queue-row { padding: 13px 16px; gap: 9px; }
  .queue-rank { width: 18px; }
  .queue-progress { display: none; }
}

/* ---------- 登录与账号 ---------- */
[hidden] { display: none !important; }

.user-box { display: inline-flex; align-items: center; gap: 8px; }
.user-name {
  font-size: 12.5px;
  color: var(--ink-soft);
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar.has-image { background-size: cover; background-position: center; background-repeat: no-repeat; }

body.is-locked .app { display: none; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-pop);
  text-align: center;
}

.brand-mark-lg {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  font-size: 22px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  color: #fff;
  background: linear-gradient(145deg, #6257ee, #4b40d8);
  box-shadow: 0 12px 26px -14px rgba(81, 70, 229, 0.9);
}

.login-card h1 { font-size: 21px; margin: 0 0 10px; letter-spacing: -0.01em; }
.login-sub { color: var(--muted); font-size: 13px; line-height: 1.75; margin: 0 0 22px; }
.login-sub strong { color: var(--ink-soft); font-weight: 600; }

.login-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: left;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-size: 13.5px;
  text-decoration: none;
}

.login-foot { color: var(--muted-light); font-size: 11.5px; line-height: 1.75; margin: 18px 0 0; }

@media (max-width: 680px) {
  .user-name { display: none; }
  .today-chip { display: none; }
  .login-card { padding: 30px 22px 24px; }
}
