:root {
  --paper: #f6f1e7;
  --paper-2: #fffdf8;
  --card: #fffdf9;
  --ink: #24201b;
  --ink-2: #57504a;
  --muted: #8f877b;
  --line: #e6ddcd;
  --line-soft: #efe8da;
  --accent: #a53f2b;
  --accent-deep: #8c3222;
  --accent-soft: #f6e4dc;
  --jade: #3f6b64;
  --jade-soft: #e5efec;
  --gold: #a8854f;
  --gold-soft: #f4ebd9;
  --danger: #b03a2e;
  --shadow: 0 1px 2px rgba(60, 45, 30, .05), 0 12px 32px -18px rgba(60, 45, 30, .35);
  --radius: 16px;
  --radius-sm: 10px;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(165, 63, 43, .06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(63, 107, 100, .07), transparent 55%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .02em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
.hidden { display: none !important; }
::selection { background: var(--accent-soft); }

/* ---------- 登录 ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 30px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.seal {
  width: 58px; height: 58px;
  margin: 0 auto 18px;
  border-radius: 12px;
  background: var(--accent);
  color: #fdf8ef;
  font-family: var(--serif);
  font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.seal.small { width: 38px; height: 38px; font-size: 21px; margin: 0; border-radius: 10px; }
.login-card h1 { font-size: 30px; letter-spacing: .18em; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-hint { font-size: 11.5px; color: var(--muted); margin-top: 16px; line-height: 1.5; }

.field { display: block; text-align: left; margin-bottom: 16px; }
.field > span {
  display: block;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: .03em;
}

input[type="text"], input[type="password"], input[type="date"], input[type="number"],
input[type="url"], textarea, select {
  width: 100%;
  background: #fffcf5;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(165, 63, 43, .1);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: #b3aa9b; }

/* ---------- 布局 ---------- */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 248, .72);
  backdrop-filter: blur(10px);
  padding: 26px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand-name { font-family: var(--serif); font-size: 19px; letter-spacing: .2em; line-height: 1.2; }
.brand-sub { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background .16s, color .16s;
  position: relative;
}
.nav a .ic { width: 16px; text-align: center; opacity: .8; font-size: 15px; }
.nav a:hover { background: rgba(165, 63, 43, .06); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.nav a.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 2px; background: var(--accent);
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-tip { font-size: 11px; color: var(--muted); line-height: 1.5; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }
.link-btn { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 4px 6px; text-align: left; }
.link-btn:hover { color: var(--accent); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 30px;
  background: rgba(246, 241, 231, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.crumb { font-family: var(--serif); font-size: 17px; letter-spacing: .04em; }
.crumb span { color: var(--muted); font-family: var(--sans); font-size: 12px; margin-left: 8px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 0 4px rgba(63,107,100,.12); }
.sync-dot.warn { background: var(--gold); box-shadow: 0 0 0 4px rgba(168,133,79,.14); }

.view { padding: 26px 30px 80px; max-width: 1180px; width: 100%; margin: 0 auto; }
.tabbar { display: none; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: all .16s;
  white-space: nowrap;
}
.btn:hover { border-color: #d6c9b3; background: #fff; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fdf7ee; }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn.jade { background: var(--jade); border-color: var(--jade); color: #f4fbf8; }
.btn.jade:hover { background: #335a54; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn.lg { padding: 11px 20px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.danger { color: var(--danger); border-color: #e8cfc9; }
.btn.danger:hover { background: #fbeeea; border-color: #d9afa5; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ink-2); padding: 4px; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head h2 { font-size: 25px; letter-spacing: .03em; }
.page-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pad { padding: 20px; }

.grid { display: grid; gap: 14px; }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.section-title { font-size: 14px; font-family: var(--sans); font-weight: 600; letter-spacing: .04em; color: var(--ink-2); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.section-title .count { color: var(--muted); font-weight: 400; font-size: 12px; }

.stat { padding: 16px 18px; }
.stat .k { font-size: 11.5px; color: var(--muted); letter-spacing: .05em; }
.stat .v { font-family: var(--serif); font-size: 27px; line-height: 1.3; margin-top: 2px; }
.stat .v small { font-size: 12px; color: var(--muted); font-family: var(--sans); margin-left: 3px; }

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty .big { font-family: var(--serif); font-size: 30px; color: #cbbfa9; margin-bottom: 8px; }

/* ---------- 项目 ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.project-card { padding: 18px; position: relative; overflow: hidden; cursor: pointer; transition: transform .16s, box-shadow .16s; }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -22px rgba(60,45,30,.45); }
.project-card .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.project-card h3 { font-size: 18px; margin-bottom: 4px; }
.project-card .desc { color: var(--muted); font-size: 12px; height: 38px; overflow: hidden; }
.project-card .meta { display: flex; gap: 14px; margin-top: 14px; font-size: 11.5px; color: var(--ink-2); flex-wrap: wrap; }
.project-card .meta b { font-family: var(--serif); font-size: 15px; color: var(--ink); font-weight: 600; margin-right: 2px; }
.project-card .foot { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--muted); }
.mini-dots { display: flex; gap: 4px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dot.draft { background: var(--gold); }
.dot.ready { background: var(--jade); }
.dot.published { background: var(--accent); }

/* ---------- 日历 ---------- */
.cal-wrap { padding: 18px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.cal-title { font-family: var(--serif); font-size: 19px; letter-spacing: .05em; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.cal-grid-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-grid-head div { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  min-height: 92px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 6px;
  background: #fffdf8;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex; flex-direction: column; gap: 3px;
  overflow: hidden;
}
.cal-cell:hover { border-color: #d8c9b1; background: #fff; }
.cal-cell.other { background: transparent; border-color: transparent; color: #c9c0b1; cursor: default; }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell .d { font-size: 12px; color: var(--ink-2); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.cal-cell.today .d { color: var(--accent); }
.cal-cell .d .n { font-weight: 400; color: var(--muted); font-size: 10px; }
.cal-cell .ld { font-size: 10px; color: var(--muted); line-height: 1.2; margin-top: -1px; letter-spacing: .02em; }
.cal-cell .ld.term { color: var(--accent); font-weight: 600; }
.cal-chip {
  font-size: 10.5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.5;
}
.cal-chip.done { background: var(--jade-soft); color: var(--jade); }
.cal-chip.more { background: transparent; color: var(--muted); padding-left: 2px; }

/* ---------- 计划 / 作品列表 ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #fffdf8;
  transition: border-color .15s;
}
.row-item:hover { border-color: #dccfb9; }
.row-item .date-badge {
  flex: 0 0 auto;
  width: 46px; text-align: center;
  border-right: 1px solid var(--line-soft);
  padding-right: 10px;
}
.row-item .date-badge b { display: block; font-family: var(--serif); font-size: 17px; line-height: 1.2; }
.row-item .date-badge span { font-size: 10px; color: var(--muted); }
.row-item .body { flex: 1; min-width: 0; }
.row-item .t { font-size: 14px; font-weight: 600; }
.row-item .t .dy { color: var(--muted); font-weight: 400; font-size: 11.5px; margin-left: 6px; }
.row-item .sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .fb-text { font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.row-item .acts { display: flex; gap: 6px; flex: 0 0 auto; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; padding: 2px 8px; border-radius: 20px;
  background: var(--gold-soft); color: #8a6a35; white-space: nowrap;
}
.pill.jade { background: var(--jade-soft); color: var(--jade); }
.pill.accent { background: var(--accent-soft); color: var(--accent-deep); }
.pill.muted { background: #f0ebe0; color: var(--muted); }

/* ---------- 看板 ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.kanban-col { background: rgba(255,255,255,.4); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px; min-height: 160px; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.kanban-head .n { font-size: 11px; color: var(--muted); font-weight: 400; }
.work-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 11px; padding: 13px; margin-bottom: 9px;
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.work-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.work-card h4 { font-size: 15px; margin-bottom: 3px; }
.work-card .poem { font-size: 11.5px; color: var(--muted); }
.work-card .kv { display: flex; gap: 10px; margin-top: 9px; font-size: 11px; color: var(--ink-2); }
.work-card .kv b { font-family: var(--serif); font-size: 14px; color: var(--ink); }
.work-card .flag { margin-top: 9px; font-size: 10.5px; color: var(--danger); display: flex; gap: 4px; align-items: center; }

/* ---------- 详情 ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.poem-box { padding: 22px; background: linear-gradient(180deg, #fffdf8, #fbf7ee); }
.poem-box .pt { font-family: var(--serif); font-size: 25px; letter-spacing: .08em; }
.poem-box .pa { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.ai-hint { margin: -6px 0 14px; padding: 9px 12px; border-radius: 9px; font-size: 12.5px; line-height: 1.75; background: rgba(160, 130, 90, .08); color: var(--ink-2); }
.ai-hint .btn { margin-left: 8px; }
.ai-hint.ok { background: rgba(58, 118, 88, .1); color: #2f6b4f; }
.ai-hint.ai { background: rgba(160, 130, 90, .12); color: var(--ink); }
.ai-hint.loading { background: rgba(160, 130, 90, .07); color: var(--muted); }
.ai-hint.warn { background: rgba(165, 63, 43, .09); color: #a53f2b; }
.lib-results { display: none; margin: -4px 0 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fffdf8; }
.lib-results.open { display: block; }
.lib-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 12px; background: none; border: 0; border-top: 1px solid var(--line-soft); font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.lib-item:first-child { border-top: 0; }
.lib-item:hover { background: rgba(160, 130, 90, .08); }
.lib-item b { font-family: var(--serif); font-weight: 600; letter-spacing: .04em; }
.lib-item span { color: var(--muted); font-size: 12px; }
.lib-empty { padding: 10px 12px; color: var(--muted); font-size: 12.5px; }
.poem-lines { font-family: var(--serif); font-size: 16.5px; line-height: 2.1; white-space: pre-wrap; margin: 18px 0; padding: 16px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.poem-note h5 { font-size: 12px; color: var(--accent); letter-spacing: .08em; margin: 14px 0 5px; font-family: var(--sans); font-weight: 600; }
.poem-note p { font-size: 13px; color: var(--ink-2); line-height: 1.85; }

.form-card { padding: 20px; }
.form-card h3 { font-size: 16px; margin-bottom: 14px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 11.5px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 3px 9px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; }
.chip button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.chip button:hover { color: var(--danger); }

.progress-steps { display: flex; align-items: center; gap: 0; margin: 4px 0 18px; }
.step { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.step .num { width: 20px; height: 20px; border-radius: 50%; background: #eee6d8; color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 10.5px; }
.step.on .num { background: var(--accent); color: #fff; }
.step.on { color: var(--accent-deep); font-weight: 600; }
.step-line { flex: 1; height: 1px; background: var(--line); margin: 0 10px; }

.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.metric { text-align: center; padding: 10px 4px; background: var(--paper); border-radius: 9px; }
.metric b { display: block; font-family: var(--serif); font-size: 18px; }
.metric span { font-size: 10.5px; color: var(--muted); }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 48px; margin-top: 12px; }
.bars i { flex: 1; background: var(--accent-soft); border-radius: 2px 2px 0 0; min-height: 3px; }

/* ---------- 复盘 ---------- */
.report { padding: 22px; }
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.report h3 { font-size: 17px; }
.report .date { font-size: 11.5px; color: var(--muted); }
.report .summary { font-size: 13.5px; line-height: 1.9; padding: 12px 14px; background: var(--paper); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.report-block { margin-top: 14px; }
.report-block h5 { font-size: 12px; color: var(--jade); letter-spacing: .06em; margin-bottom: 6px; font-family: var(--sans); }
.report-block ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.85; }
.report-block.issue h5 { color: var(--accent); }
.report-block.idea h5 { color: var(--gold); }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.switch input { width: auto; }
.kv-list { font-size: 12px; color: var(--muted); line-height: 1.9; }
.kv-list b { color: var(--ink-2); font-weight: 500; }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(38, 30, 22, .38);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade .16s ease;
}
.modal {
  width: 100%; max-width: 560px;
  max-height: 88vh; overflow: auto;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 30px 80px -30px rgba(30, 20, 10, .55);
  animation: pop .18s ease;
}
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 18px 22px; }
.modal-foot { padding: 0 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.close-x { background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99) } to { opacity: 1; transform: none } }

.gen-preview { display: flex; flex-direction: column; gap: 7px; max-height: 46vh; overflow: auto; }
.gen-row { display: flex; gap: 10px; padding: 9px 11px; border: 1px solid var(--line-soft); border-radius: 9px; font-size: 12px; align-items: center; }
.gen-row .gdate { flex: 0 0 74px; color: var(--muted); font-size: 11px; }
.gen-row .gmain { flex: 1; min-width: 0; }
.gen-row .gmain b { font-size: 13px; }
.gen-row .gmain span { color: var(--muted); margin-left: 5px; font-size: 11px; }
.gen-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: #2c2620; color: #f7f1e5;
  padding: 10px 18px; border-radius: 24px;
  font-size: 12.5px; z-index: 200;
  opacity: 0; pointer-events: none;
  transition: all .22s;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.loading { padding: 60px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 12px 16px; }
  .view { padding: 18px 15px 92px; }
  .tabbar {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: rgba(255, 253, 248, .94);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 5px 0; font-size: 10.5px; color: var(--muted); border-radius: 9px;
  }
  .tabbar a .ic { font-size: 17px; line-height: 1; }
  .tabbar a.active { color: var(--accent); font-weight: 600; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-2, .settings-grid, .detail-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .kanban-col { min-height: 0; }
  .cal-cell { min-height: 62px; padding: 4px; border-radius: 8px; }
  .cal-cell .d { font-size: 11px; }
  .cal-cell .ld { font-size: 9px; }
  .cal-chip { font-size: 9px; padding: 1px 3px; border-radius: 3px; }
  .cal-grid, .cal-grid-head { gap: 4px; }
  .page-head h2 { font-size: 21px; }
  .row-item { flex-wrap: wrap; }
  .row-item .body { flex: 1 1 calc(100% - 60px); }
  .row-item .acts { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { max-width: none; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .form-row { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(5, 1fr); }
  .topbar .btn.ghost { padding: 6px 9px; font-size: 11.5px; }
  .poem-lines { font-size: 15.5px; }
}
@media (max-width: 420px) {
  .grid.cols-4, .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .cal-cell { min-height: 54px; }
  .cal-chip { display: none; }
  .cal-cell.has .d::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
}
