:root {
  --paper: #EFE6D2;
  --paper-2: #E6DAC0;
  --paper-3: #DBCEAC;
  --card: #F5EEDD;
  --ink: #2F2519;
  --ink-soft: #5A4A38;
  --ink-faint: #8A7A63;
  --brown: #6B4A2F;
  --brown-deep: #3A2E22;
  --red: #A8443A;
  --olive: #7B8B6F;
  --navy: #2E4057;
  --mustard: #B08D3F;
  --faded-blue: #5E7C8B;
  --line: rgba(58, 46, 34, 0.22);
  --line-soft: rgba(58, 46, 34, 0.12);
  --shadow: 0 1px 0 rgba(58, 46, 34, 0.14), 0 6px 18px -12px rgba(58, 46, 34, 0.5);
  --serif: Georgia, 'Times New Roman', 'Songti SC', 'Noto Serif SC', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

a { color: var(--red); }

/* ---------- boot ---------- */
.boot { display: grid; place-items: center; min-height: 100vh; }
.boot-inner { text-align: center; color: var(--ink-faint); }
.boot-mark {
  font-family: var(--serif);
  font-size: 44px;
  color: var(--brown);
  border: 2px solid var(--line);
  width: 84px; height: 84px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 14px;
}
.boot-text { font-size: 13px; letter-spacing: 0.08em; }

/* ---------- auth ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 32px 20px 48px;
  max-width: 980px;
  margin: 0 auto;
  align-content: center;
}
@media (min-width: 860px) {
  .auth-wrap { grid-template-columns: 1.05fr 1fr; align-items: center; gap: 44px; }
}

.poster { text-align: center; }
@media (min-width: 860px) { .poster { text-align: left; } }

.poster-eyebrow {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.poster-title {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--brown-deep);
  margin-bottom: 6px;
}
.poster-sub {
  font-size: 14px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--mustard);
  margin-bottom: 18px;
}
.poster-rule {
  height: 2px;
  background: var(--brown-deep);
  opacity: 0.65;
  margin: 0 auto 18px;
  max-width: 260px;
}
@media (min-width: 860px) { .poster-rule { margin-left: 0; } }
.poster-line {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 2;
  color: var(--ink-soft);
  margin: 0 0 20px;
}
.stamp {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: 3px;
  padding: 5px 12px;
  transform: rotate(-2.5deg);
  opacity: 0.85;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.auth-card { max-width: 440px; width: 100%; margin: 0 auto; }
@media (min-width: 860px) { .auth-card { margin: 0; } }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 18px;
}
.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-faint);
  padding: 8px 12px;
  cursor: pointer;
  margin-bottom: -1px;
}
.tab.on { color: var(--brown-deep); border-bottom-color: var(--red); }

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px 12px;
}
.field input:focus {
  outline: none;
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(107, 74, 47, 0.12);
}

.btn {
  appearance: none;
  display: block;
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary {
  background: var(--brown-deep);
  color: var(--paper);
  border-color: var(--brown-deep);
}
.btn.ghost { background: transparent; }
.btn.link {
  background: none;
  border: 0;
  color: var(--faded-blue);
  font-size: 13px;
  padding: 8px 0 0;
  width: auto;
  text-decoration: underline;
}
.btn.small { width: auto; display: inline-block; padding: 7px 14px; font-size: 13px; }

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--ink-faint);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.alert {
  border-left: 3px solid var(--red);
  background: rgba(168, 68, 58, 0.08);
  color: #7d3229;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 2px;
  margin-bottom: 16px;
}
.alert.ok {
  border-left-color: var(--olive);
  background: rgba(123, 139, 111, 0.14);
  color: #4c5a42;
}
.hint { font-size: 12.5px; color: var(--ink-faint); margin: 14px 0 0; line-height: 1.7; }

/* ---------- shell ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: var(--brown-deep);
  color: var(--paper);
  border-bottom: 3px double rgba(239, 230, 210, 0.35);
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand-mark {
  font-family: var(--serif);
  font-size: 17px;
  width: 30px; height: 30px;
  border: 1.5px solid rgba(239, 230, 210, 0.55);
  border-radius: 50%;
  display: grid; place-items: center;
}
.brand-text {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.1em;
}

.nav { display: none; gap: 2px; flex: 1; }
@media (min-width: 900px) { .nav { display: flex; } }

.navitem {
  position: relative;
  font-size: 13.5px;
  letter-spacing: 0.05em;
  color: rgba(239, 230, 210, 0.68);
  text-decoration: none;
  padding: 8px 11px;
  border-radius: 3px;
}
.navitem:hover { color: var(--paper); background: rgba(239, 230, 210, 0.09); }
.navitem.on {
  color: var(--paper);
  background: rgba(176, 141, 63, 0.22);
  box-shadow: inset 0 -2px 0 var(--mustard);
}

.dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mustard);
  display: none;
}
.dot.on { display: block; }

.who {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(239, 230, 210, 0.8);
  flex: none;
}
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--paper-3);
  color: var(--brown-deep);
  display: grid; place-items: center;
  font-size: 15px;
}
.who-name { display: none; }
@media (min-width: 620px) { .who-name { display: inline; } }

.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 18px 96px;
}
@media (min-width: 900px) { .main { padding-bottom: 56px; } }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 900px) { .tabbar { display: none; } }
.tabbar a {
  position: relative;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  text-decoration: none;
  padding: 10px 2px;
}
.tabbar a.on { color: var(--red); font-weight: 500; }
.tabbar .dot { top: 6px; right: 50%; margin-right: -16px; }

/* ---------- page content ---------- */
.page-head { margin-bottom: 22px; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.page-title { font-size: 27px; color: var(--brown-deep); }
.page-sub { font-size: 13.5px; color: var(--ink-soft); margin-top: 8px; }

.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid.two { grid-template-columns: 1fr 1fr; } }

.section-title {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--brown-deep);
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 14.5px; }
.row-meta { font-size: 12px; color: var(--ink-faint); }

.badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}
.badge.stage { border-color: var(--mustard); color: #7a5f24; background: rgba(176, 141, 63, 0.13); }

.code-chip {
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: 0.28em;
  color: var(--brown-deep);
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed var(--brown);
  border-radius: 3px;
  padding: 10px 14px;
  display: inline-block;
}

.cat-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 8px;
  background: rgba(255, 255, 255, 0.45);
}
.cat-dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }

.stub { text-align: center; padding: 48px 22px; }
.stub-icon {
  font-family: var(--serif);
  font-size: 34px;
  color: var(--paper-3);
  border: 1.5px dashed var(--line);
  width: 74px; height: 74px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 18px;
}
.stub h2 { font-size: 19px; color: var(--brown-deep); margin-bottom: 8px; }
.stub p { font-size: 13.5px; color: var(--ink-soft); max-width: 460px; margin: 0 auto 16px; }

.notice-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  background: rgba(94, 124, 139, 0.1);
  border: 1px solid rgba(94, 124, 139, 0.28);
  border-radius: 3px;
  padding: 11px 13px;
  margin-bottom: 18px;
}

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-faint); }
.right { text-align: right; }
.mt { margin-top: 18px; }

/* ================= 阶段 2-5 · 通用块 ================= */

.loadbar {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--mustard), transparent);
  animation: slide 1.1s linear infinite;
  margin-bottom: 10px;
}
@keyframes slide {
  0% { transform: translateX(-40%); }
  100% { transform: translateX(40%); }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--brown-deep);
  color: var(--paper);
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 3px;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.6);
  max-width: 88vw;
  text-align: center;
}
@media (min-width: 900px) { .toast { bottom: 26px; } }

.alert.bad {
  border-left-color: var(--red);
  background: rgba(168, 68, 58, 0.13);
  color: #7d3229;
  font-weight: 500;
}
.badtext { color: var(--red); }
.hint b { color: var(--brown-deep); }

.field textarea,
.selectbox {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 11px;
  resize: vertical;
}
.selectbox { padding: 8px 10px; font-size: 14px; }
.selectbox.small { font-size: 12.5px; padding: 5px 6px; width: 100%; }
.field textarea:focus, .selectbox:focus {
  outline: none;
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(107, 74, 47, 0.12);
}

.inlinefield { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-faint); }
.inlinefield .selectbox { width: auto; }
.stackform .field:last-of-type { margin-bottom: 12px; }

.xbtn {
  appearance: none;
  background: none;
  border: 0;
  font-size: 15px;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 2px;
}
.xbtn:hover { color: var(--red); background: rgba(168, 68, 58, 0.09); }

.grip { color: var(--paper-3); font-size: 12px; cursor: grab; letter-spacing: -1px; }
body.dnd-active .grip { cursor: grabbing; }

/* 分段选择 */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.4);
}
.seg-item {
  appearance: none;
  background: none;
  border: 0;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 5px 10px;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
}
.seg-item:hover { background: rgba(107, 74, 47, 0.08); }
.seg-item.on { background: var(--brown-deep); color: var(--paper); }

/* 涂色笔 */
.brush-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.brush {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px 4px 6px;
  cursor: pointer;
}
.brush i { width: 13px; height: 13px; border-radius: 3px; display: block; }
.brush.on { border-color: var(--brown-deep); box-shadow: 0 0 0 2px rgba(58, 46, 34, 0.16); background: rgba(255, 255, 255, 0.85); }
.brush.eraser { padding: 4px 11px; color: var(--ink-soft); }
.brush.eraser.on { background: var(--brown-deep); color: var(--paper); }

/* 待办池 */
.pools { display: grid; gap: 12px; }
.pools-grid { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 900px) { .pools-grid { grid-template-columns: repeat(3, 1fr); } }
.pool-h {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
}
.pool-e { font-size: 13px; }
.pool-n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.pool-body { min-height: 22px; }
.pool-empty { font-size: 12px; color: var(--ink-faint); padding: 6px 2px; border: 1px dashed var(--line-soft); border-radius: 3px; text-align: center; }
.tasklist { min-height: 40px; display: grid; gap: 4px; }

.mini-task {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 5px 7px;
  cursor: grab;
  user-select: none;
}
.mini-task:hover { border-color: var(--brown); }
.mini-bar { width: 3px; height: 14px; background: var(--mustard); border-radius: 2px; flex: none; }
.mini-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-e { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.mini-task.picked { border-color: var(--red); background: rgba(168, 68, 58, 0.1); }
.mini-task.sched { opacity: 0.5; }
.mini-task.sched .mini-bar { background: var(--faded-blue); }

/* 日视图布局 */
.daylayout { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 979px) { .daymain { order: -1; } }
@media (min-width: 980px) {
  .daylayout { flex-direction: row; align-items: flex-start; gap: 18px; }
  .daytools { width: 296px; flex: none; position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto; }
  .daymain { flex: 1; min-width: 0; }
}

.daybar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.daybar-nav { display: flex; align-items: center; gap: 6px; }
.daybar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.daybar-date { font-family: var(--serif); font-size: 16px; color: var(--brown-deep); margin-left: 6px; }
.dateinput {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 8px;
}

.daystats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.statcard {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 7px 11px;
}
.statcard-who { color: var(--brown-deep); }
.statcard-n { font-family: var(--mono); font-size: 12px; }
.statcard-f { color: var(--olive); }

/* 时间轴 */
.tlhead { display: flex; gap: 8px; margin-bottom: 4px; }
.tlhead-hour { width: 44px; flex: none; }
.tlhead-cols { flex: 1; display: flex; gap: 8px; padding: 0 8px; }
.tlhead-col {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 2px solid var(--line);
  padding-bottom: 4px;
}

.tl {
  max-height: 62vh;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.32);
  display: flex;
  overscroll-behavior: contain;
}
.tl-hours { width: 44px; flex: none; border-right: 1px solid var(--line-soft); }
.tl-hourlabel { height: 48px; position: relative; }
.tl-hourlabel span {
  position: absolute;
  top: 1px;
  right: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-faint);
}
.tl-cols { flex: 1; display: flex; gap: 8px; padding: 0 8px; min-width: 0; }
.tl-col { flex: 1; min-width: 0; }
.tl-track { position: relative; }
.hour { height: 48px; display: grid; grid-template-rows: repeat(4, 1fr); border-top: 1px solid var(--line); }
.cell {
  appearance: none;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-top: 1px dashed var(--line-soft);
  background: transparent;
  cursor: crosshair;
}
.hour .cell:first-child { border-top: 0; }
.cell:hover { background: rgba(176, 141, 63, 0.16); }
.cell.hl { background: rgba(176, 141, 63, 0.42); }

.tl-blocks { position: absolute; inset: 0; pointer-events: none; }
.blk {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 2px;
  background: var(--c);
  border: 1px solid rgba(58, 46, 34, 0.34);
  pointer-events: auto;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.blk:hover { filter: brightness(1.06); }
.blk-txt {
  display: block;
  font-size: 10px;
  line-height: 1.3;
  padding: 1px 5px;
  color: #FBF6E9;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blk.lt .blk-txt { color: #33291C; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); }
.blk.compact .blk-txt { font-size: 9px; padding: 0 4px; }
.blk-ico { font-style: normal; opacity: 0.9; margin-right: 3px; }
.blk-ck { font-style: normal; margin-right: 3px; }
.blk-txt em { font-style: normal; opacity: 0.82; }
.blk.done { opacity: 0.78; }
.blk.done .blk-txt { text-decoration: line-through; }
body.dnd-active .blk { pointer-events: none; }

.nowline { position: absolute; left: -4px; right: -4px; height: 2px; background: var(--red); opacity: 0.62; pointer-events: none; }
.nowline::before { content: ''; position: absolute; left: 0; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* ================= 任务页 ================= */

.quickrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.quickrow input[name="title"] {
  flex: 1;
  min-width: 180px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 11px;
}
.quickrow input[name="title"]:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 3px rgba(107, 74, 47, 0.12); }

.taskrow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 7px 9px;
  cursor: grab;
}
.taskrow:hover { border-color: var(--brown); }
.taskrow.sched { background: rgba(94, 124, 139, 0.1); }
.taskrow.drop-before { box-shadow: inset 0 3px 0 var(--red); }
.taskrow-t { flex: 1; min-width: 0; cursor: text; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taskrow-note { font-size: 11.5px; color: var(--ink-faint); max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taskrow-who { font-size: 11px; color: var(--ink-faint); white-space: nowrap; }
.tickbtn {
  appearance: none;
  background: none;
  border: 0;
  font-size: 15px;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0 3px;
}
.tickbtn:hover { color: var(--olive); }
.estchip {
  appearance: none;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 2px 8px;
  cursor: pointer;
}
.estchip:hover { border-color: var(--brown); }

/* ================= 统计 / 完成页 ================= */

.statsrow { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.statbig {
  flex: 1;
  min-width: 130px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.statbig-n { font-family: var(--serif); font-size: 21px; color: var(--brown-deep); line-height: 1.2; }
.statbig-l { font-size: 11.5px; color: var(--ink-faint); }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-day { position: relative; margin-bottom: 18px; }
.tl-dot { position: absolute; left: -19px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--mustard); border: 1.5px solid var(--paper); }
.tl-dayhead { font-family: var(--serif); font-size: 14.5px; color: var(--brown-deep); margin-bottom: 6px; }
.tl-dayn { font-family: var(--sans); font-size: 11.5px; color: var(--ink-faint); margin-left: 8px; }
.tl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--line-soft);
  padding: 6px 0;
}
.tl-item-who { font-size: 14px; }
.tl-item-t { flex: 1; min-width: 0; }

.spark { display: flex; align-items: flex-end; gap: 4px; height: 110px; padding-top: 6px; }
.spark-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.spark-bar { width: 100%; background: var(--paper-3); border: 1px solid var(--line); border-radius: 2px 2px 0 0; min-height: 2px; }
.spark-bar.cur { background: var(--mustard); border-color: var(--brown); }
.spark-n { font-family: var(--mono); font-size: 9.5px; color: var(--ink-faint); margin-top: 3px; }

/* ================= 周网格（周视图 / 规划页共用） ================= */

.weekwrap { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1000px) {
  .weekwrap { flex-direction: row; align-items: flex-start; }
  .weekcard { flex: 1; min-width: 0; }
  .weekpool { width: 268px; flex: none; }
}

.wk { display: flex; gap: 8px; }
.wk-hours { width: 30px; flex: none; padding-top: 32px; }
.wk-hourstrack { position: relative; height: 300px; }
.wk-hours span { position: absolute; right: 3px; transform: translateY(-50%); font-family: var(--mono); font-size: 9px; color: var(--ink-faint); }
.wk-days { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; min-width: 0; }
.wk-day { min-width: 0; }
.wk-dayhead { height: 32px; text-align: center; display: flex; align-items: center; justify-content: center; }
.wk-dayhead a { text-decoration: none; color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.wk-wd { font-size: 10px; letter-spacing: 0.06em; color: var(--ink-faint); }
.wk-dn { font-family: var(--serif); font-size: 15px; }
.wk-day.today .wk-wd, .wk-day.today .wk-dn { color: var(--red); }
.wk-day.today .wk-dayhead a { border-bottom: 2px solid var(--red); padding-bottom: 1px; }
.wk-lanes { display: flex; gap: 3px; }
.wk-lane {
  flex: 1;
  min-width: 0;
  position: relative;
  height: 300px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
}
.wk-lane.hot { border-color: var(--red); background: rgba(168, 68, 58, 0.1); }
.wk-blk { position: absolute; left: 1px; right: 1px; border-radius: 1px; }
.wk-now { position: absolute; left: -2px; right: -2px; height: 2px; background: var(--red); opacity: 0.6; }
.wk-dayfoot { text-align: center; font-family: var(--mono); font-size: 10px; color: var(--ink-faint); padding: 5px 0; }
.wk-shared { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--red); margin-left: 4px; vertical-align: middle; }

.legend { display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: 11.5px; color: var(--ink-soft); }
.legend-i { display: inline-flex; align-items: center; gap: 5px; }
.legend-i i { width: 11px; height: 11px; border-radius: 2px; display: block; }
.legend-i .lg-dot { border-radius: 50%; border: 1px solid var(--line); }
.legend-i .lg-ring { background: transparent; border: 2px solid var(--red); }

/* ================= 规划页 ================= */

.planlayout { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1220px) {
  .planlayout { flex-direction: row; align-items: flex-start; }
  .planpools { width: 252px; flex: none; }
  .planweek { flex: 1; min-width: 420px; }
  .plancap { width: 292px; flex: none; }
}
.cap-row { padding: 9px 0; border-bottom: 1px dashed var(--line-soft); }
.cap-row:last-of-type { border-bottom: 0; }
.cap-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; }
.cap-head b { font-family: var(--mono); font-size: 13.5px; color: var(--brown-deep); }
.cap-sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.cap-row.big .cap-head { font-size: 14px; }
.capbar { height: 8px; border-radius: 999px; background: rgba(58, 46, 34, 0.1); overflow: hidden; margin: 6px 0 3px; }
.capbar i { display: block; height: 100%; background: var(--brown); }
.capbar.warn i { background: var(--red); }

/* ================= 月视图 ================= */

.mn { display: grid; gap: 5px; }
.mn-head, .mn-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.mn-wd { text-align: center; font-size: 11px; letter-spacing: 0.08em; color: var(--ink-faint); padding-bottom: 3px; }
.mn-cell {
  position: relative;
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 6px 7px 15px;
  min-height: 66px;
  background: rgba(255, 255, 255, 0.4);
}
.mn-cell:hover { border-color: var(--brown); }
.mn-cell.out { opacity: 0.4; }
.mn-cell.today { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.mn-cell.lv1 { background: rgba(176, 141, 63, 0.12); }
.mn-cell.lv2 { background: rgba(176, 141, 63, 0.22); }
.mn-cell.lv3 { background: rgba(107, 74, 47, 0.24); }
.mn-cell.lv4 { background: rgba(107, 74, 47, 0.36); }
.mn-cell.lv3, .mn-cell.lv4 { color: #FBF6E9; }
.mn-cell.lv3 .mn-h, .mn-cell.lv4 .mn-h, .mn-cell.lv3 .mn-d, .mn-cell.lv4 .mn-d { color: rgba(251, 246, 233, 0.85); }
.mn-d { font-family: var(--serif); font-size: 14px; }
.mn-h { position: absolute; top: 7px; right: 7px; font-family: var(--mono); font-size: 9.5px; color: var(--ink-faint); }
.mn-bar {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  background: rgba(58, 46, 34, 0.07);
}
.mn-bar i { display: block; height: 100%; }

.catbar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.catbar i { display: block; height: 100%; }
.catrows { display: grid; gap: 2px; margin-top: 10px; }
.catrow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 0; border-bottom: 1px dashed var(--line-soft); }
.catrow-n { flex: 1; min-width: 0; }
.catrow-v { font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); }
.catrow-p { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); width: 42px; text-align: right; }

/* ================= 备忘 ================= */

.memogrid { display: grid; gap: 14px; }
@media (min-width: 760px) { .memogrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) { .memogrid { grid-template-columns: repeat(3, 1fr); } }
.memocard { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.memocard-head { display: flex; align-items: flex-start; gap: 8px; }
.memocard-t { flex: 1; font-family: var(--serif); font-size: 15.5px; color: var(--brown-deep); }
.memocard-c { font-size: 13px; color: var(--ink-soft); white-space: pre-wrap; word-break: break-word; flex: 1; }
.memocard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.memocard-actions { display: inline-flex; gap: 6px; align-items: center; }
.linkbadge { cursor: pointer; border-color: var(--olive); color: #4c5a42; background: rgba(123, 139, 111, 0.14); }

/* ================= 大学页 ================= */

.unilayout { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1000px) { .unilayout { flex-direction: row; align-items: flex-start; } }
.unicourses { width: auto; }
@media (min-width: 1000px) { .unicourses { width: 300px; flex: none; } .uniweek { flex: 1; min-width: 0; } }
.courselist { display: grid; gap: 3px; }
.courserow { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); }
.courserow.off { opacity: 0.45; }
.courserow-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.courserow-m { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.wheelbox { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.wheelslot {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--brown-deep);
  text-align: center;
  border: 1px dashed var(--brown);
  border-radius: 3px;
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.5);
}
.wheelslot.spin { animation: stampin 0.22s ease; }
@keyframes stampin {
  0% { transform: scale(0.86) rotate(-2deg); opacity: 0.4; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.weeknav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.unipicks { display: grid; gap: 6px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 900px) { .unipicks { display: flex; overflow-x: auto; } .uniday { min-width: 118px; } }
.uniday { min-width: 0; border: 1px solid var(--line-soft); border-radius: 3px; background: rgba(255, 255, 255, 0.4); padding: 7px 6px; }
.uniday.today { border-color: var(--red); }
.uniday-head { font-size: 11px; color: var(--ink-faint); text-align: center; padding-bottom: 5px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.uniday-head b { font-family: var(--serif); font-size: 14px; color: var(--ink); margin-left: 3px; }
.uniday-body { display: grid; gap: 4px; }
.unipick { display: flex; align-items: center; gap: 4px; font-size: 12px; background: var(--paper-2); border-radius: 2px; padding: 3px 5px; }
.unipick-i { font-family: var(--mono); font-size: 9.5px; color: var(--ink-faint); }
.unipick-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uniday-go { width: 100%; font-size: 11.5px; padding: 4px 6px; margin-top: 3px; }
.unifoot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* ================= 年视图 · 公路地图 ================= */

.roadwrap { overflow-x: auto; }
.road { width: 100%; min-width: 620px; height: auto; display: block; border: 1px solid var(--line); border-radius: 3px; }
.stn { transition: transform 0.15s ease; }
.ms { display: flex; align-items: flex-end; gap: 6px; height: 108px; }
.ms-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.ms-bar { width: 100%; background: var(--navy); opacity: 0.72; border-radius: 2px 2px 0 0; min-height: 2px; }
.ms-l { font-family: var(--mono); font-size: 9.5px; color: var(--ink-faint); margin-top: 3px; }

.stampgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stampcard {
  border: 1.5px dashed var(--line);
  border-radius: 3px;
  padding: 12px 12px 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.32);
}
.stampcard.got { border-style: solid; border-color: var(--red); background: rgba(168, 68, 58, 0.07); }
.stampmark { font-size: 22px; color: var(--paper-3); line-height: 1; margin-bottom: 6px; }
.stampcard.got .stampmark { color: var(--red); }
.stampname { font-family: var(--serif); font-size: 14.5px; color: var(--brown-deep); }
.stampdesc { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; line-height: 1.5; }
.stampdate { font-family: var(--mono); font-size: 10px; color: var(--red); margin-top: 5px; }

/* ================= 设置页 · 分类管理 / 变更 ================= */

.catlist { display: grid; gap: 2px; }
.catmanage { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); }
.catmanage-i { font-size: 14px; width: 16px; text-align: center; }
.catmanage-n { flex: 1; min-width: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.swatch {
  width: 30px; height: 30px;
  border-radius: 4px;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(58, 46, 34, 0.25);
  cursor: pointer;
  padding: 0;
}
.swatch.on { border-color: var(--brown-deep); }
.swatch.native { border: 1px solid var(--line); background: none; padding: 2px; cursor: pointer; }
.icons { display: flex; flex-wrap: wrap; gap: 6px; }
.iconpick {
  appearance: none;
  width: 34px; height: 34px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}
.iconpick.on { border-color: var(--brown-deep); background: var(--brown-deep); color: var(--paper); }
.filebtn { cursor: pointer; }
.changelog { display: grid; gap: 1px; }
.changerow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); }
.changerow-s { flex: 1; min-width: 0; color: var(--ink-soft); }
.changerow-t { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }

/* ================= 弹层 ================= */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(35, 28, 20, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 700px) { .sheet-backdrop { align-items: center; padding: 24px; } }
.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  box-shadow: 0 -10px 40px -12px rgba(0, 0, 0, 0.5);
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 700px) { .sheet { border-radius: 6px; padding-bottom: 20px; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-title { font-family: var(--serif); font-size: 18px; color: var(--brown-deep); }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.sheet-actions .btn { flex: 1; }
.checkrow { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); margin-top: 14px; cursor: pointer; }
.checkrow input { width: 16px; height: 16px; accent-color: var(--brown); }

/* ================= 响应式收敛 ================= */

@media (max-width: 700px) {
  .page-title { font-size: 23px; }
  .statbig { min-width: 108px; padding: 10px 12px; }
  .statbig-n { font-size: 18px; }
  .tl { max-height: 56vh; }
  .tlhead-col { font-size: 11px; }
  .mn-cell { min-height: 52px; padding: 4px 5px 13px; }
  .mn-h { display: none; }
  .main { padding: 18px 12px 96px; }
  .daytools { position: static; max-height: none; }
  .road { min-width: 520px; }
}

