/* ============================================================
   助理台 · 黑白极简 / 圆润线条
   ============================================================ */

:root {
  --paper: #ffffff;
  --wash: #f4f4f1;
  --wash-2: #ecece8;
  --ink: #111110;
  --ink-2: #3b3b38;
  --muted: #8c8c85;
  --line: #e5e5df;
  --line-strong: #d2d2cb;
  --radius: 26px;
  --radius-sm: 16px;
  --gutter: clamp(16px, 2.2vw, 64px);
  --shadow: 0 1px 2px rgba(17, 17, 16, .04), 0 18px 44px -34px rgba(17, 17, 16, .55);
  --ease: cubic-bezier(.22, .72, .28, 1);
  --font: "Inter", "Noto Sans SC", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Noto Sans SC", "SFMono-Regular", Consolas, "Cascadia Mono", "PingFang SC", "Microsoft YaHei", monospace;
}

[data-theme="dark"] {
  --paper: #0c0c0b;
  --wash: #141413;
  --wash-2: #1d1d1b;
  --ink: #f3f3ef;
  --ink-2: #cfcfc8;
  --muted: #7d7d76;
  --line: #232321;
  --line-strong: #35352f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 22px 50px -34px rgba(0, 0, 0, .95);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(110% 52% at 50% -18%, var(--wash) 0%, transparent 62%);
}

::selection { background: var(--ink); color: var(--paper); }

h1, h2, h3 { margin: 0; letter-spacing: -.02em; font-weight: 600; }
h1, h2, h3, h4, h5, h6, button, input, select, textarea { font-family: var(--font); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter) 56px;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
  margin: 0 calc(var(--gutter) * -1) 12px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
}

.brand { display: flex; align-items: baseline; gap: 10px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transform: translateY(4px);
  color: var(--ink);
}

.brand-name { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }

.brand-sub {
  font-size: 9.5px;
  letter-spacing: .22em;
  color: var(--muted);
  font-weight: 500;
  transform: translateY(-1px);
}

.topbar-side { display: flex; align-items: center; gap: 10px; }

.today-chip {
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color .25s var(--ease), transform .25s var(--ease), background-color .25s var(--ease);
}

.icon-btn:hover { border-color: var(--line-strong); background: var(--wash); transform: rotate(-12deg); }
.icon-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.i-moon { display: none; }
[data-theme="dark"] .i-moon { display: block; }
[data-theme="dark"] .i-sun { display: none; }

/* ---------- HERO ---------- */

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  padding: 30px 34px;
  background: var(--wash);
  border-radius: 30px;
  margin-bottom: 20px;
}

.hero-text { min-width: 0; }

.eyebrow {
  font-size: 10px;
  letter-spacing: .28em;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 500;
}

.hero .eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.hero .eyebrow::before {
  content: "";
  flex: none;
  width: 22px;
  height: 1px;
  border-radius: 2px;
  background: var(--ink);
}

.hero h1 {
  font-size: clamp(32px, 3.1vw, 54px);
  line-height: 1.08;
  letter-spacing: -.038em;
  font-weight: 600;
}

.hero h1 .name { color: var(--muted); font-weight: 400; }

.hero-sum {
  margin-top: 14px;
  max-width: 76ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  text-wrap: pretty;
}

.hero-sum b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hero-date {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding-left: 24px;
  border-left: 1px solid var(--line-strong);
}

.hero-day {
  font-size: clamp(48px, 4.2vw, 92px);
  line-height: .78;
  font-weight: 300;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}

.hero-date-meta {
  display: grid;
  gap: 4px;
  padding-bottom: 2px;
}

.hero-date-meta b {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: .01em;
}

.hero-date-meta em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .05em;
}

/* ---------- 指标卡 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  padding: 20px 22px 18px;
  box-shadow: var(--shadow);
  transition: border-color .28s var(--ease), transform .28s var(--ease);
}

.stat:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .02em;
  margin-bottom: 10px;
}

.stat-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat-value {
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.045em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.stat-value small {
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 400;
}

.stat-foot {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stat-foot em {
  font-style: normal;
  color: var(--ink);
}

/* 圆环 */

.ring { flex: none; overflow: visible; }
.ring-track { stroke: var(--wash-2); }
.ring-fill {
  stroke: var(--ink);
  transition: stroke-dashoffset 1.05s var(--ease);
}

/* 迷你柱状 */

.spark { display: flex; align-items: flex-end; gap: 4px; height: 32px; }
.spark i {
  width: 6px;
  border-radius: 3px;
  background: var(--wash-2);
  display: block;
  transition: height .8s var(--ease), background-color .3s var(--ease);
}
.spark i.on { background: var(--ink); }

/* ---------- 网格 ---------- */

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.col { display: grid; gap: 20px; min-width: 0; align-content: start; }

/* 宽屏以外的两列模式下，资料库与时间线并排铺满整行 */
.col-c {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 24px 26px 22px;
  box-shadow: var(--shadow);
  transition: border-color .28s var(--ease);
  min-width: 0;
}

.card:hover { border-color: var(--line-strong); }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 18px;
}

.card-heading { min-width: 0; }

.card-head h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.015em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-sub {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ghost-count {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 筛选 chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-left: auto; }

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12px;
  cursor: pointer;
  transition: all .22s var(--ease);
  white-space: nowrap;
}

.chip:hover { border-color: var(--line-strong); color: var(--ink); }

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- 待办 ---------- */

.todo-list { display: grid; }

.todo {
  display: flex;
  gap: 14px;
  padding: 13px 2px;
  border-bottom: 1px dashed var(--line);
  align-items: flex-start;
}

.todo:last-child { border-bottom: 0; padding-bottom: 2px; }

.tick {
  flex: none;
  width: 21px;
  height: 21px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: transparent;
  transition: all .22s var(--ease);
}

.tick svg { width: 11px; height: 11px; }

.todo:hover .tick { border-color: var(--ink); }

.is-done .tick { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.todo-main { min-width: 0; flex: 1; }

.todo-text {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.is-done .todo-text { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: var(--line-strong); }

.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1;
  padding: 4.5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.pill-project { color: var(--ink-2); }
.pill-due.today { border-color: var(--ink); color: var(--ink); }
.pill-due.overdue { border-style: dashed; border-color: var(--ink-2); color: var(--ink); }
.pill-prio { letter-spacing: .06em; }
.pill-prio.high { border-color: var(--ink-2); color: var(--ink); }

/* ---------- 项目 ---------- */

.proj-list { display: grid; gap: 16px; }

.proj {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px 15px;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}

.proj:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--wash) 55%, transparent); }

.proj-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.proj-top h3 { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  flex: none;
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .55;
}

.status.active { color: var(--ink); border-color: var(--line-strong); }
.status.active::before { background: var(--ink); opacity: 1; }
.status.paused { border-style: dashed; }
.status.done { background: var(--wash-2); color: var(--muted); border-color: transparent; }

.proj-sum {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.proj-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--wash-2);
  overflow: hidden;
}

.proj-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
  width: 0;
  transition: width 1.1s var(--ease);
}

.proj-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.proj-log {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--ink-2);
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.proj-log time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }

/* ---------- 图表 ---------- */

.chart-wrap { position: relative; margin-top: 2px; }

.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }

.chart-area { fill: url(#areaGrad); opacity: 0; transition: opacity .8s var(--ease) .15s; }
.chart-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--len, 1400);
  stroke-dashoffset: var(--len, 1400);
  transition: stroke-dashoffset 1.25s var(--ease);
}
.chart-base { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 6; stroke-linecap: round; }
.chart-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.chart-dot.now { fill: var(--ink); }
.chart-label { fill: var(--muted); font-size: 9.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-hit { fill: transparent; cursor: default; }

.chart-tip {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -122%);
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.45;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s var(--ease);
  font-variant-numeric: tabular-nums;
}

.chart-tip.on { opacity: 1; }

.act-total {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.act-total b { color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: -.02em; }

/* ---------- 资料库 ---------- */

.lib-cats { display: grid; gap: 11px; }

.cat-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 22px;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}

.cat-name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cat-track { height: 6px; border-radius: 999px; background: var(--wash-2); overflow: hidden; }

.cat-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
  width: 0;
  transition: width .9s var(--ease);
}

.cat-count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.lib-recent {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 9px;
}

.lib-recent li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  min-width: 0;
}

.lib-recent li time { color: var(--muted); font-size: 11px; flex: none; font-variant-numeric: tabular-nums; }

.lib-recent li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lib-empty { font-size: 12.5px; color: var(--muted); }

/* ---------- 时间线 ---------- */

.timeline {
  padding-left: 18px;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 16px;
}

.timeline li { position: relative; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink);
}

.tl-date {
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 3px;
}

.tl-title { font-size: 13px; color: var(--ink); line-height: 1.5; }

.tl-preview {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* ---------- 空状态 ---------- */

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 26px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.empty code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--wash);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--ink-2);
}

/* ---------- 页脚 ---------- */

.foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  font-size: 11.5px;
  color: var(--muted);
}

.foot code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  background: var(--wash);
  border-radius: 6px;
  padding: 2px 6px;
  margin-right: 4px;
}

.foot-meta { font-variant-numeric: tabular-nums; }

/* ---------- 出场动画 ---------- */

.reveal { opacity: 0; transform: translateY(12px); }
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}

/* ---------- 响应式 ---------- */

/* 宽屏：三栏瀑布，铺满整屏 */

@media (min-width: 1400px) {
  .grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.04fr) minmax(0, .96fr); }
  .col-c { grid-column: auto; grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 22px 24px;
    border-radius: 24px;
    margin-bottom: 16px;
  }
  .hero-date {
    border-left: 0;
    padding-left: 0;
    gap: 12px;
  }
  .hero-day { font-size: 38px; }
  .hero-date-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-bottom: 0;
  }
  .col-c { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px 18px 18px; border-radius: 22px; }
  .chips { justify-content: flex-start; }
  .card-head { flex-direction: column; gap: 12px; }
  .card-head .chips { width: 100%; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 16px 16px 14px; }
  .stat-label { font-size: 11px; margin-bottom: 8px; }
  .stat-value { font-size: 28px; }
  .stat-main .ring { width: 44px; height: 44px; }
  .stat-foot { font-size: 10.5px; margin-top: 10px; }
  .spark { height: 26px; gap: 3px; }
  .spark i { width: 5px; }
  .brand-sub { display: none; }
  .today-chip { display: none; }
  .hero h1 { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  body::before, .topbar { display: none; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
}
