/* ---------- 基础 ---------- */
:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --line: #e6e4dd;
  --line-strong: #d3d0c6;
  --ink: #191817;
  --ink-2: #5f5c55;
  --ink-3: #96928a;
  --accent: #14614a;
  --accent-soft: #e9f2ed;
  --amber: #b8792c;
  --rose: #a8452f;
  --r: 10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  padding-bottom: 0;
}

h1, h2 { margin: 0; font-weight: 600; }

button { font: inherit; }

kbd {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 11px/16px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-3);
  text-align: center;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 28px;
  background: rgba(246, 246, 243, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 9px; }

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.brand h1 { font-size: 14.5px; letter-spacing: 0.01em; }

.tag {
  font: 10.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 3px 5px;
}

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

.topdate {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-right: 6px;
  white-space: nowrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); }
.btn:active { transform: translateY(0.5px); }

.mini {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}

.mini:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }

/* ---------- 布局 ---------- */
.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 28px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.col-main, .col-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px 9px;
}

.panel-hd h2 {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--ink-3);
}

.panel-ft {
  padding: 8px 16px 11px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.hint { font-size: 11.5px; color: var(--ink-3); }

.empty {
  margin: 0;
  padding: 18px 16px 22px;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.7;
}

/* ---------- 今日任务 ---------- */
.ratio {
  font: 12.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-3);
}

.ratio b { color: var(--ink); font-weight: 600; }

.task-list { list-style: none; margin: 0; padding: 0; }

.task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  transition: background 0.12s;
  outline: none;
}

.task:first-child { border-top: 1px solid var(--line); }
.task:hover { background: var(--surface-2); }
.task:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); }

.box {
  flex: none;
  width: 19px;
  height: 19px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s;
}

.box svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset 0.22s ease 0.04s;
}

.task.done .box { background: var(--accent); border-color: var(--accent); }
.task.done .box svg { stroke-dashoffset: 0; }

.t-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }

.t-title {
  font-size: 13.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s;
}

.task.done .t-title {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

.t-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.cat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: none;
}

.spark { margin-left: auto; display: flex; gap: 3px; flex: none; margin-right: 2px; }

.spark i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #eceae3;
}

.spark i.na { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.spark i.on { background: var(--accent); }

/* ---------- 指标卡 ---------- */
.stat-panel { padding-bottom: 0; }

.stat-top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 16px 14px;
}

.ring {
  --p: 0;
  flex: none;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), #eceae3 0);
  transition: background 0.35s ease;
}

.ring-in {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.ring-in b {
  font: 600 20px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: -0.02em;
}

.ring-in span { font-size: 11px; color: var(--ink-3); }

.stat-copy { min-width: 0; }
.stat-label { font-size: 11.5px; letter-spacing: 0.09em; color: var(--ink-3); }
.stat-note { margin-top: 5px; font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.stat-note.warn { color: var(--rose); }
.stat-note.good { color: var(--accent); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.stat-cell {
  padding: 11px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 1px solid var(--line);
}

.stat-cell:first-child { border-left: none; }
.stat-cell .k { font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }
.stat-cell b {
  font: 600 15px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
}

/* ---------- 热力图 ---------- */
.hm {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  grid-template-columns: repeat(12, 1fr);
  gap: 9px 13px;
  padding: 2px 16px 14px;
}

.hm i { display: block; aspect-ratio: 1; border-radius: 3px; }

.legend { display: flex; gap: 3px; align-items: center; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: block; }

/* 色阶 */
.l0 { background: #eeede6; }
.l1 { background: #dbe8e1; }
.l2 { background: #b2d3c2; }
.l3 { background: #7ab59c; }
.l4 { background: #3d8b6b; }
.l5 { background: #14614a; }
.hm i.-1 { background: #faf9f5; box-shadow: inset 0 0 0 1px #f0eee8; }

/* ---------- 需要盯住 ---------- */
.watch { list-style: none; margin: 0; padding: 0 0 4px; }

.watch li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

.watch li .w-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch li .w-num {
  margin-left: auto;
  flex: none;
  font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--rose);
}

.watch li.ok { color: var(--ink-3); }
.watch li.ok .w-num { color: var(--accent); }

/* ---------- 月历 ---------- */
.cal-nav { display: flex; gap: 2px; }

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0 16px 5px;
  font-size: 10.5px;
  color: var(--ink-3);
  text-align: center;
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0 16px 16px;
}

.cal .d {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: var(--surface);
}

.cal .d.lv-1 { background: #fcfbf8; border-color: #f2f0e9; }
.cal .d.lv0 { background: #f8f7f2; border-color: #eeece5; }
.cal .d.lv0 .n { color: #a9a49a; }
.cal .d.lv1 { background: #faeeea; border-color: #f2e0d9; }
.cal .d.lv1 .n { color: #a0604c; }
.cal .d.lv2 { background: #eaf2ed; border-color: #dfeae3; }
.cal .d.lv3 { background: #d6e7df; border-color: #c9ded4; }
.cal .d.lv4 { background: #b8d7c8; border-color: #a9cbb9; }
.cal .d.lv5 { background: #92c2ad; border-color: #82b6a0; }
.cal .d.lv3 .n, .cal .d.lv4 .n, .cal .d.lv5 .n { color: #2c4f42; }

.cal .d .n { font-size: 10.5px; color: var(--ink-3); line-height: 1.1; }



.cal .d.blank { border-color: transparent; background: transparent; }

.cal .d.today { border-color: var(--ink); }

/* ---------- 页脚 ---------- */
.foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 6px 28px 34px;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.7;
}

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(25, 24, 23, 0.26);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 40;
}

.drawer-mask.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 94vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 41;
  display: flex;
  flex-direction: column;
}

.drawer.open { transform: none; }

.drawer-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-hd h2 { font-size: 14px; }

.drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px 20px; }

.drawer-tip {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.mlist { display: flex; flex-direction: column; gap: 8px; }

.mrow {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
}

.mrow-top { display: flex; align-items: center; gap: 8px; }

.mtitle {
  flex: 1;
  min-width: 0;
  border: 1px solid #f1efe9;
  background: var(--surface-2);
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  padding: 4px 7px;
  border-radius: 5px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.mtitle:hover { border-color: var(--line); }
.mtitle:focus { background: var(--surface); border-color: var(--accent); }

.mdel {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  width: 24px;
  height: 24px;
  border-radius: 5px;
  cursor: pointer;
  flex: none;
  font-size: 12px;
}

.mdel:hover { color: var(--rose); border-color: var(--line); background: #fdf5f3; }

.mctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-left: 2px; }

.sel {
  appearance: none;
  border: 1px solid var(--line);
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2396938a' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 8px 5px;
  color: var(--ink-2);
  font: inherit;
  font-size: 11.5px;
  padding: 3px 20px 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  outline: none;
}

.sel:hover { border-color: var(--line-strong); color: var(--ink); }
.sel:focus { border-color: var(--accent); }

.days { display: flex; gap: 3px; }

.days button {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 10.5px;
  border-radius: 5px;
  cursor: pointer;
  padding: 0;
}

.days button.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.add-btn {
  width: 100%;
  margin-top: 12px;
  padding: 9px;
  border-style: dashed;
  color: var(--ink-2);
}

.drawer-ft {
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 4px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topdate { display: none; }
  .brand h1 { font-size: 13.5px; }
  .foot { padding: 4px 14px 30px; }
  .cal .d { min-height: 40px; padding: 4px 4px; }
  .stat-top { gap: 14px; }
}

@media (max-width: 560px) {
  .btn { padding: 5px 8px; font-size: 12px; }
  .topbar-right { gap: 5px; }
  .spark { display: none; }
  .ring { width: 84px; height: 84px; }
  .ring-in { width: 66px; height: 66px; }
  .ring-in b { font-size: 17px; }
}
