/* ---------- Page header ---------- */
/* 常驻页头：滚动时标题与本页主操作一直可见。实底 + 底部 20px 淡出，内容从下面穿过是「化开」而不是被切一刀；
   分界不用发丝线或阴影（会被判成重投影）。左右反向出血，铺满滚动口的整幅宽度 */
.page-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: flex-end; gap: var(--s-4); flex-wrap: wrap;
  margin: 0 calc(var(--view-pad-x) * -1);
  padding: var(--s-4) var(--view-pad-x) var(--s-5);
  background: linear-gradient(var(--slab) calc(100% - 20px), transparent);
}
.page-title { font-size: var(--fs-32); font-weight: 600; letter-spacing: var(--ls-display); line-height: 1.1; }
.page-sub { color: var(--ink-3); margin-top: var(--s-1h); font-size: var(--fs-14); }
.page-sub .dot-sep { margin: 0 var(--s-1h); color: var(--ink-4); }
.page-sub > svg { display: inline-block; vertical-align: -1px; margin-right: var(--s-1); }
.page-actions { margin-left: auto; display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }

.eyebrow {
  font-size: var(--fs-13); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-3);
  display: flex; align-items: center; gap: var(--s-2);
}
.eyebrow .ic { color: var(--ink-4); }
/* 小标题读作一句段首说明，末尾一段发丝线当格线 */
.eyebrow::after { content: ""; flex: none; width: 22px; height: 1px; background: var(--line-strong); }
.section { margin-top: var(--s-7); }
.section-head { display: flex; align-items: center; gap: var(--s-2h); margin-bottom: var(--s-3); }
.section-head .link { margin-left: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 var(--s-3h); border-radius: var(--r-sm);
  font-size: var(--fs-13); font-weight: 500; white-space: nowrap;
  border: 1px solid transparent; background: var(--bg-sunk); color: var(--ink);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), color var(--t-fast);
}
.btn:hover { border-color: transparent; background: color-mix(in srgb, var(--bg-sunk) 86%, var(--ink)); }
.btn:active { transform: scale(.98); }
.btn .ic { color: var(--ink-3); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary .ic { color: var(--on-primary-muted); }
/* 主按钮：平涂墨底，悬停只抬起 1px，按下回落 */
.btn-primary:hover { background: var(--primary-ink); border-color: var(--primary-ink); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-sunk); border-color: transparent; color: var(--ink); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.btn-soft .ic { color: var(--primary); }
.btn-soft:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary-line)); border-color: transparent; }
.btn-danger { color: var(--urgent); }
.btn-danger .ic { color: var(--urgent); }
.btn-sm { height: 28px; padding: 0 var(--s-2h); font-size: var(--fs-12); border-radius: var(--r-control-sm); }
.btn-lg { height: 44px; padding: 0 var(--s-5); font-size: var(--fs-14); border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link { color: var(--primary-ink); font-size: var(--fs-13); font-weight: 500; display: inline-flex; align-items: center; gap: var(--s-1); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--card-shadow); }
.card-pad { padding: var(--s-5); }
.card-title { font-size: var(--fs-15); font-weight: 600; letter-spacing: var(--ls-display); }
.card-hover { transition: var(--rise); }
.card-hover:hover { box-shadow: var(--card-shadow-hover); transform: var(--lift); border-color: var(--line-strong); }
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }
.small { font-size: var(--fs-12); }
.divider { height: 1px; background: var(--line); margin: var(--s-4) 0; border: 0; }

/* Paper surface — the one warm background used for written memories and reflections */
.home-moment, .m-tile.is-text, .mem-card.cat-daily .mem-body, .wr-note, .paper-card { background: var(--warm-paper); }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: var(--s-fine-2); height: 22px; padding: 0 var(--s-2);
  border-radius: var(--r-pill); font-size: var(--fs-12); font-weight: 500;
  background: var(--bg-sunk); color: var(--ink-2); white-space: nowrap;
}
.chip-area { background: var(--area-soft); color: color-mix(in srgb, var(--area) 60%, var(--ink)); }
.chip-area::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--area); }
.chip-important { background: var(--orange-soft); color: color-mix(in srgb, var(--orange) 70%, var(--ink)); }
.chip-urgent { background: var(--urgent-soft); color: var(--urgent); }
.chip-done { background: var(--done-soft); color: var(--done); }
.chip-tag { background: transparent; color: var(--ink-3); padding: 0 var(--s-0h); height: auto; font-weight: 400; }
.chip-btn { cursor: pointer; border: 1px solid var(--line); background: var(--card); height: 28px; padding: 0 var(--s-3); font-size: var(--fs-13); color: var(--ink-2); transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.chip-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.chip-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 500; }

.mood-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- Segmented ---------- */
.seg { display: inline-flex; padding: 3px; background: var(--bg-sunk); border-radius: 11px; gap: 0; }
.seg button { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; color: color-mix(in srgb, var(--ink-2) 55%, var(--ink-3)); font-weight: 500; display: inline-flex; align-items: center; gap: var(--s-1h); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* ---------- Progress ---------- */
/* 进度一律用完成绿；领域色只负责「这是哪件事」，不再兼任进度色 */
.bar { height: 6px; border-radius: var(--r-pill); background: var(--bg-sunk); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--progress); transition: width var(--t-bar) var(--ease); }
.bar.thin { height: 4px; }

/* 子任务完成占比：绿条按子任务数量分格，后面跟 2/5 这样的分数 */
.sub-prog { display: inline-flex; align-items: center; gap: var(--s-1h); flex: none; }
.sub-prog .sp-track { width: 40px; height: 4px; border-radius: var(--r-pill); background: var(--bg-sunk); overflow: hidden; }
.sub-prog .sp-track b { display: block; height: 100%; border-radius: inherit; background: var(--progress); transition: width var(--t-bar) var(--ease); }
.sub-prog .mono { font-size: var(--fs-11); color: var(--ink-3); }

/* Stacked ratio bar — how a whole splits across areas or moods */
.mood-split, .area-split { display: flex; height: 12px; gap: var(--s-fine-1); border-radius: var(--r-pill); overflow: hidden; }
.mood-split i, .area-split i { display: block; min-width: var(--s-1); }
.mood-split { margin-top: var(--s-3h); }
.area-split { margin-top: var(--s-1h); }
.area-split i { background: var(--area); }

/* ---------- Task check ---------- */
.check {
  position: relative; width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 1.6px solid var(--ink-4); display: grid; place-items: center;
  color: transparent; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.check:hover { border-color: var(--done); color: color-mix(in srgb, var(--done) 50%, transparent); }
.check.is-done { background: var(--accent); border-color: var(--accent); color: var(--on-primary, #fff); }
.check.prio-3 { border-color: var(--orange); }
.check.is-done.prio-3 { border-color: var(--done); }
.check.is-progress { border-color: var(--primary); }
.check.is-progress::after { content: ""; position: absolute; inset: var(--s-fine-1); border-radius: 50%; background: conic-gradient(var(--primary) 0 50%, transparent 0); }
.check .ic { width: 12px; height: 12px; stroke-width: 2.4; }

.echo-ring {
  position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; border: 1.5px solid var(--done); pointer-events: none;
  animation: echo var(--t-echo) var(--ease-soft) forwards;
}
.echo-ring.r2 { animation-delay: 140ms; }
.echo-ring.r3 { animation-delay: 280ms; }
@keyframes echo { from { transform: scale(1); opacity: .7; } to { transform: scale(3.2); opacity: 0; } }

/* ---------- Task row ---------- */
/* 表单式分区：勾选和时间是左侧的定位栏，标题独占一行，其余参数一格一件事排在下面。
   格子之间用发丝线分段，标签压到最弱一档、值才是要读的东西。 */
.task-row {
  display: flex; align-items: flex-start; gap: var(--s-4); padding: var(--s-3h) var(--s-4); border-radius: var(--r-md);
  transition: background var(--t-fast);
  position: relative;
}
.task-row:hover { background: var(--bg-sunk); }
.task-row .t-main { flex: 1; min-width: 0; cursor: pointer; }
.task-row .t-title { font-size: var(--fs-15); line-height: 20px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-row.is-done .t-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.task-row .t-time { flex: none; width: 46px; margin-top: 1px; font-family: var(--font-mono); font-size: var(--fs-13); line-height: 20px; color: var(--ink-3); }
.task-row .check { margin-top: 2px; }
.task-row .t-actions { display: flex; gap: var(--s-0h); opacity: 0; transition: opacity var(--t-fast); }
.task-row:hover .t-actions, .task-row:focus-within .t-actions { opacity: 1; }

.t-fields { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s-2) 0; margin-top: var(--s-2h); }
.t-field { display: flex; flex-direction: column; gap: var(--s-0h); min-width: 0; max-width: 46%; padding: 0 var(--s-4); border-left: 1px solid var(--line); }
.t-field:first-child { padding-left: 0; border-left: 0; }
.t-field:last-child { padding-right: 0; }
.t-field > i { font-style: normal; font-size: var(--fs-11); line-height: 14px; color: var(--ink-4); letter-spacing: var(--ls-display); }
.t-field > b { font-weight: 500; font-size: var(--fs-13); line-height: 20px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-field > b.is-upnext { color: var(--primary-ink); }
.t-field > .chip { align-self: flex-start; }
.t-field > .sub-prog { margin-top: 3px; }

/* 右侧紧凑元信息：领域、日期、时间、时长；只在该属性存在时才渲染，不占空位 */
.task-row .t-meta { display: flex; align-items: center; gap: var(--s-2h); flex: none; flex-wrap: wrap; justify-content: flex-end; max-width: 46%; margin-left: var(--s-2); }
.task-row .t-meta-item { font-family: var(--font-mono); font-size: var(--fs-12); line-height: 20px; color: var(--ink-3); white-space: nowrap; }
.task-row .t-meta-item.is-over { color: var(--urgent); }
/* 标题下的小字：项目 · 子任务，哪个有就写哪个 */
.task-row .t-sub { display: flex; align-items: center; gap: var(--s-2h); margin-top: 2px; font-size: var(--fs-12); line-height: 18px; color: var(--ink-3); }
.task-row .t-sub-proj { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .t-sub-sep { font-style: normal; color: var(--ink-4); opacity: .7; }
.task-row .t-sub .sub-prog { margin-top: 0; }

/* ---------- Controls that appear on hover ---------- */
.inbox-actions, .mo-edit, .mem-pin, .ltl-top .icon-btn, .sub-row .icon-btn { opacity: 0; }
.inbox-actions, .mo-edit, .mem-pin { transition: opacity var(--t-fast); }
.done-list li:hover .icon-btn, .inbox-row:hover .inbox-actions, .inbox-row:focus-within .inbox-actions,
.moment:hover .mo-edit, .mo-edit:focus-visible, .mem-card:hover .mem-pin, .mem-pin:focus-visible,
.mem-pin[aria-pressed="true"], .ltl-item:hover .ltl-top .icon-btn, .ltl-top .icon-btn:focus-visible,
.sub-row:hover .icon-btn, .sub-row .icon-btn:focus-visible { opacity: 1; }

/* ---------- Trailing element pushed to the right edge of its row ---------- */
.tl-hint, .inbox-nudge .ic:last-child, .tg-head .btn, .mo-edit, .ltl-top .icon-btn, .ai-head .icon-btn { margin-left: auto; }

/* ---------- Meta rows: date, area and counts beside a title ---------- */
.hm-meta, .mo-meta, .mm-meta, .ai-plan-where, .bcard-meta { display: flex; align-items: center; }
.hm-meta, .mo-meta, .ai-plan-where, .bcard-meta { color: var(--ink-3); }
.hm-meta, .mo-meta, .ai-plan-where { font-size: var(--fs-12); }

/* ---------- Stat numbers ---------- */
.stage-n, .pm-stats b, .bud-total b, .stat-num { font-weight: 500; }

/* ---------- Single-line text that must not wrap ---------- */
.ai-plan-title, .sl-title, .cc-t, .chain-v, .pc-next li span:nth-child(2),
.ai-list li span:nth-child(2), .wr-list button, .wr-next button { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-t, .chain-v, .wr-list button, .wr-next button { min-width: 0; }
.wr-list button, .wr-next button { text-align: left; }

/* ---------- Completed work reads as struck-through ---------- */
.any-chip.is-done > span[data-action], .cal-chip.is-done .cc-t, .sd-list li.is-done button:last-child,
.board-card.is-done .bcard-title, .sub-row:has(.check.is-done) .input { color: var(--ink-3); text-decoration: line-through; }
.tl-block.is-done .tl-title, .plan-item.is-done .plan-title, .focus-card.is-done .fc-title {
  color: color-mix(in srgb, var(--ink-2) 55%, var(--ink-3)); text-decoration: line-through; text-decoration-color: var(--ink-4);
}

/* ---------- Cover image inside a fixed frame ---------- */
.mem-photo img, .wr-photos img, .cm-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Cards that lift when hovered ---------- */
.bottle-return:hover, .board-card:hover, .rail-link:hover,
.mem-moment:hover, .bottle-back:hover, .ai-mem:hover { box-shadow: var(--shadow-1); }

/* ---------- Icon-and-label rows ---------- */
.hm-stats > div, .pm-ms li, .mood-legend li { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-13); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-1h); }
.field > label, .label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 14px; border-radius: var(--r-field);
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { height: auto; min-height: 84px; padding: var(--s-2h) var(--s-3); resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input-bare { border: 0; background: transparent; padding: 0; height: auto; box-shadow: none !important; }
.title-input { font-size: var(--fs-20); font-weight: 600; letter-spacing: var(--ls-heading); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.row { display: flex; align-items: center; gap: var(--s-2); }
.row-wrap { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.stack { display: flex; flex-direction: column; gap: var(--s-3); }
.stack-lg { display: flex; flex-direction: column; gap: var(--s-4h); }

.radio-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.radio-chip input { position: absolute; opacity: 0; pointer-events: none; }
.radio-chip span {
  display: inline-flex; align-items: center; gap: var(--s-1h); height: 32px; padding: 0 var(--s-3); border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-size: var(--fs-13); cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.radio-chip input:checked + span { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.radio-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--line-strong); transition: background var(--t-fast); pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--on-knob); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform var(--t-med) var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layer: modal / drawer / menu ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 60; animation: fade-in var(--t-hover) var(--ease) both; }
.modal {
  position: fixed; left: 50%; top: 50%; z-index: 61; width: min(560px, calc(100vw - var(--s-8))); max-height: calc(100vh - var(--s-12));
  transform: translate(-50%, -50%); display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-2); border: 1px solid var(--line);
  animation: modal-in var(--t-modal) var(--ease) both;
}
.modal.wide { width: min(760px, calc(100vw - var(--s-8))); }
.modal.paper { background: var(--warm-paper); }
.modal-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-5) var(--s-5h) 0; }
.modal-title { font-size: var(--fs-17); font-weight: 600; letter-spacing: var(--ls-display); }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: var(--s-4h) var(--s-5h); overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3h) var(--s-5h) var(--s-5); }
.modal-foot .spacer { flex: 1; }

/* ---------- 领域管理 ---------- */
.am-item + .am-item { margin-top: var(--s-3h); }
.am-item { display: flex; flex-direction: column; gap: var(--s-2h); }
.am-row { display: grid; grid-template-columns: 34px 1fr auto auto auto; align-items: center; gap: var(--s-2h); }
.am-color { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-xs); background: none; }
.am-count { min-width: 40px; text-align: right; }
.am-move { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2h); margin-left: 44px; padding: var(--s-2h) var(--s-3); border-radius: var(--r-sm); background: var(--bg-sunk); }
.am-move .select { width: auto; }
.am-add { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: var(--s-2h); margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.ed-area { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--s-2h); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }

.drawer {
  position: fixed; top: var(--s-2h); right: var(--s-2h); bottom: var(--s-2h); z-index: 61; width: min(480px, calc(100vw - var(--s-5)));
  display: flex; flex-direction: column; background: var(--card); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); border: 1px solid var(--line);
  animation: drawer-in var(--t-drawer) var(--ease) both;
}
@keyframes drawer-in { from { opacity: 0; transform: translateX(var(--s-6)); } }

/* 关闭也要有过程（js/ui.js 给 .layer-item 挂 is-closing，动画跑完才摘节点）：
   进场和退场共用一条路径，退场更快、pointer-events 先关掉，避免半路上再点一次。 */
.layer-item.is-closing { pointer-events: none; }
.layer-item.is-closing .scrim { animation: fade-out var(--t-pop) var(--ease) both; }
.layer-item.is-closing .modal { animation: modal-out var(--t-pop) var(--ease) both; }
.layer-item.is-closing .drawer { animation: drawer-out var(--t-pop) var(--ease) both; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
@keyframes drawer-out { to { opacity: 0; transform: translateX(var(--s-6)); } }

.menu {
  position: fixed; z-index: 70; min-width: 200px; padding: var(--s-1h);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  animation: menu-in var(--t-snap) var(--ease) both;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(calc(var(--s-1h) * -1)); } }
.menu-item {
  display: flex; align-items: center; gap: var(--s-2h); width: 100%; height: 34px; padding: 0 var(--s-2h); border-radius: 9px;
  font-size: var(--fs-13); color: var(--ink); text-align: left;
}
.menu-item .ic { color: var(--ink-3); }
.menu-item:hover, .menu-item:focus-visible { background: var(--bg-sunk); outline: none; }
.menu-item.danger { color: var(--urgent); }
.menu-item.danger .ic { color: var(--urgent); }
.menu-item kbd { margin-left: auto; }
.menu-sep { height: 1px; background: var(--line); margin: var(--s-fine-2) var(--s-1); }
.menu-label { font-size: var(--fs-11); color: var(--ink-3); padding: var(--s-1h) var(--s-2h) var(--s-1); letter-spacing: var(--ls-caps); text-transform: uppercase; font-weight: 600; }

/* 账户菜单：头像是真图，下面只放真能走到的入口 */
.menu.account-menu { width: 258px; }
.account-menu .menu-item { height: 36px; }
.menu-profile { padding: var(--s-1h) var(--s-2h) var(--s-2); }
.account-menu-head { display: flex; align-items: center; gap: var(--s-2h); min-width: 0; }
.account-menu-avatar { width: 38px; height: 38px; font-size: var(--fs-14); }
.account-menu-meta { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.account-menu-meta b { font-size: var(--fs-13); font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-meta span { font-size: var(--fs-11); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: var(--s-7); transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: var(--s-2); align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2h) var(--s-3) var(--s-2h) var(--s-4); min-height: 44px;
  background: var(--toast-bg); color: var(--toast-ink); border-radius: var(--r-md); box-shadow: var(--shadow-2);
  font-size: var(--fs-13); animation: toast-in var(--t-modal) var(--ease) both;
}
.toast .btn { height: 28px; background: var(--toast-btn); border-color: transparent; color: inherit; }
.toast .btn:hover { background: var(--toast-btn-hover); }
.toast.out { animation: toast-out var(--t-pop) var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(var(--s-2)); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(var(--s-1h)); } }
@media (max-width: 760px) { .toasts { bottom: calc(86px + env(safe-area-inset-bottom)); width: calc(100vw - var(--s-8)); } }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: var(--s-9) var(--s-5); color: var(--ink-3); }
.empty-title { color: var(--ink); font-weight: 500; margin-bottom: var(--s-1); }
.empty .btn { margin-top: var(--s-3h); }

/* ---------- Stat ---------- */
.stat-num { font-family: var(--font-mono); font-size: var(--fs-24); letter-spacing: var(--ls-num); color: var(--ink); line-height: 1.1; }
.stat-label { font-size: var(--fs-12); color: var(--ink-3); margin-top: var(--s-1); }

/* ---------- Lifecycle ---------- */
.lifecycle { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: var(--s-1) 0 var(--s-0h); }
.lc-step { display: flex; flex-direction: column; align-items: center; gap: var(--s-1h); flex: 1; min-width: 50px; position: relative; font-size: var(--fs-11); color: var(--ink-4); }
.lc-step::before { content: ""; position: absolute; top: 5px; left: -50%; right: 50%; height: 1.5px; background: var(--line); }
.lc-step:first-child::before { display: none; }
.lc-step i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--card); position: relative; z-index: 1; }
.lc-step.done { color: var(--ink-3); }
.lc-step.done::before { background: var(--done); }
.lc-step.done i { background: var(--done); border-color: var(--done); }
.lc-step.current { color: var(--primary-ink); font-weight: 600; }
.lc-step.current::before { background: var(--done); }
.lc-step.current i { border-color: var(--primary); box-shadow: 0 0 0 var(--s-1) var(--primary-soft); }

/* ---------- Palette ---------- */
.palette { top: 14vh; transform: translateX(-50%); width: min(620px, calc(100vw - var(--s-8))); animation: menu-in var(--t-hover) var(--ease) both; }
.palette-input { display: flex; align-items: center; gap: var(--s-2h); padding: var(--s-3h) var(--s-4h); border-bottom: 1px solid var(--line); }
.palette-input input { flex: 1; border: 0; background: transparent; font-size: var(--fs-17); outline: none; }
.palette-list { max-height: 52vh; overflow-y: auto; padding: var(--s-2); }
.palette-item { display: flex; align-items: center; gap: var(--s-3); width: 100%; padding: var(--s-fine-4) var(--s-3); border-radius: var(--r-sm); text-align: left; }
.palette-item[aria-selected="true"] { background: var(--bg-sunk); }
.palette-item .ic { color: var(--ink-3); }
.palette-item .p-kind { margin-left: auto; font-size: var(--fs-12); color: var(--ink-3); }
.palette-empty { padding: var(--s-7); text-align: center; color: var(--ink-3); }

/* ---------- Photos ---------- */
.photos { display: grid; gap: var(--s-1h); border-radius: var(--r-md); overflow: hidden; }
.photos.n1 { grid-template-columns: 1fr; max-width: 420px; }
.photos.n2 { grid-template-columns: 1fr 1fr; max-width: 520px; }
.photos.n3, .photos.n4 { grid-template-columns: repeat(3, 1fr); max-width: 560px; }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-sunk); cursor: zoom-in; }
.photos.n1 img { aspect-ratio: 16 / 10; }

.lightbox { position: fixed; inset: 0; z-index: 90; background: var(--scrim-lightbox); display: grid; place-items: center; padding: var(--s-8); animation: fade-in var(--t-pop) both; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-md); box-shadow: var(--shadow-2); }

@media (max-width: 760px) {
  .page-title { font-size: var(--fs-26); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92vh; border-radius: var(--r-md) var(--r-md) 0 0; animation: sheet-in var(--t-sheet) var(--ease-sheet) both; }
  .modal { top: auto; bottom: 0; left: 0; width: 100%; transform: none; border-radius: var(--r-md) var(--r-md) 0 0; max-height: 92vh; animation: sheet-in var(--t-sheet) var(--ease-sheet) both; }
  /* 命令面板贴在屏幕上方，走自己的淡入，别跟着抽屉从屏幕下沿升起 */
  .palette { top: var(--s-2h); bottom: auto; left: 50%; transform: translateX(-50%); border-radius: var(--r-md); animation: palette-in var(--t-hover) var(--ease) both; }
  .task-row .t-actions { opacity: 1; }
  /* 退场走同一条路径，只是更快（见 js/ui.js 的 is-closing） */
  .layer-item.is-closing .modal:not(.palette),
  .layer-item.is-closing .drawer { animation: sheet-out var(--t-sheet-out) var(--ease-sheet-out) both; }
  .layer-item.is-closing .palette { animation: palette-out var(--t-pop) var(--ease) both; }
}
/* 底部抽屉：整块从屏幕下沿升起（与长按快建的 mqa-up 同一条曲线、同一个时长） */
@keyframes sheet-in { from { transform: translateY(105%); } }
@keyframes sheet-out { to { transform: translateY(105%); } }
@keyframes palette-in { from { opacity: 0; transform: translateX(-50%) translateY(calc(var(--s-1h) * -1)); } }
@keyframes palette-out { to { opacity: 0; transform: translateX(-50%) translateY(calc(var(--s-1h) * -1)); } }

/* ---------- 启动引导页 + 登录门：浅空、果冻精灵、玻璃卡 ----------
   引导页是第一屏：天空渐变 + 双叶标 + 圆润精灵 + 三层柔浪，点一下进登录门。
   登录门桌面端对开：左栏品牌海报，右栏纯表单；≤960px 收成单栏，
   精灵坐在玻璃卡右上角，两只手搭在卡片边沿。颜色全走 tokens.css 的 --auth-*。 */
html.lg-lock { overflow: hidden; }
.lg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* 波浪渐变的色标跟主题走（CSS 变量换成属性值在部分内核里不稳，这里直接给色标上色） */
.le-stop-mint-a { stop-color: var(--auth-wave-mint-a); }
.le-stop-mint-b { stop-color: var(--auth-wave-mint-b); }
.le-stop-mint-c { stop-color: var(--auth-wave-mint-c); }
.le-stop-mid-a { stop-color: var(--auth-wave-mid-a); }
.le-stop-mid-b { stop-color: var(--auth-wave-mid-b); }
.le-stop-mid-c { stop-color: var(--auth-wave-mid-c); }
.le-stop-front-a { stop-color: var(--auth-wave-front-a); }
.le-stop-front-b { stop-color: var(--auth-wave-front-b); }
.le-stop-front-c { stop-color: var(--auth-wave-front-c); }

/* 果冻精灵的身体：两档主题都当「发亮的浅绿物体」画，色标在 tokens.css 基础块里 */
.le-stop-jelly-hi { stop-color: var(--auth-jelly-hi); }
.le-stop-jelly-loft { stop-color: var(--auth-jelly-loft); }
.le-stop-jelly-soft { stop-color: var(--auth-jelly-soft); }
.le-stop-jelly-mid { stop-color: var(--auth-jelly-mid); }
.le-stop-jelly-body { stop-color: var(--auth-jelly-body); }
.le-stop-jelly-deep { stop-color: var(--auth-jelly-deep); }

/* 小精灵落在登录卡上的投影：SVG 的 flood-color 只能由 CSS 上色，别写回十六进制 */
#leMascotShadow feDropShadow { flood-color: var(--auth-jelly-shadow); }

/* 精灵：悬浮、眨眼、水珠漂移 */
.lg-float { animation: lg-float 4.5s ease-in-out infinite; transform-origin: center bottom; }
.lg-blink { transform-box: fill-box; transform-origin: center; animation: lg-blink 5.8s infinite; }
.lg-pupils { transition: transform 300ms var(--ease); }

@keyframes lg-float {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-6px) scale(1.014, .99); }
}
@keyframes lg-blink {
  0%, 94%, 98%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(.08); }
}
@keyframes lg-bubble-left {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-4px, -9px) scale(1.03); }
}
@keyframes lg-bubble-right {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5px, -8px) scale(.98); }
}
@keyframes lg-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-btn-b) 18%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--auth-btn-b) 8%, transparent); }
}
@keyframes fade-out { to { opacity: 0; } }
@keyframes lg-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes lg-field-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- 启动引导页 ---------- */
.start-guide {
  position: fixed; inset: 0; z-index: 89;
  overflow: hidden; cursor: pointer;
  background: linear-gradient(180deg, var(--auth-sky-a) 0%, var(--auth-sky-b) 52%, var(--auth-sky-c) 100%);
  animation: fade-in var(--t-page) var(--ease) both;
  -webkit-tap-highlight-color: transparent;
}
.start-guide.is-out { animation: fade-out 240ms var(--ease) both; pointer-events: none; }

.sg-orb {
  position: absolute; left: -70px; top: -46px;
  width: clamp(220px, 42vw, 330px); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 62% 58%, var(--auth-orb), transparent 68%);
  opacity: .8; pointer-events: none;
}
.sg-halo {
  position: absolute; left: 50%; top: 64%;
  width: min(680px, 110vw); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--auth-glow), transparent 62%);
  opacity: .5; filter: blur(34px); pointer-events: none;
}

.sg-brand {
  position: absolute; left: 50%; top: clamp(96px, 23vh, 210px);
  z-index: 3;
  display: flex; flex-direction: column; align-items: center;
  transform: translateX(-50%);
  text-align: center;
  animation: sg-brand-in 720ms var(--ease-soft) both;
}
@keyframes sg-brand-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.sg-wordmark {
  margin: 18px 0 0; color: var(--auth-ink);
  font-size: clamp(34px, 5vw, 46px); font-weight: 700;
  letter-spacing: -.035em; line-height: 1;
}
.sg-tagline {
  margin: 16px 0 0; color: var(--auth-ink-3);
  font-size: 14px; letter-spacing: .38em; white-space: nowrap;
}

.sg-mascot {
  position: absolute; left: 50%; bottom: clamp(40px, 8vh, 96px);
  width: clamp(280px, 30vw, 460px);
  transform: translateX(-50%);
  z-index: 1;
  animation: sg-mascot-in 800ms var(--ease-soft) 60ms both;
}
@keyframes sg-mascot-in { from { opacity: 0; transform: translate(-50%, 18px) scale(.98); } }
.sg-jelly { display: block; width: 100%; height: auto; overflow: visible; }
.sg-pupils { transition: transform 240ms ease-out; }

.sg-waves {
  position: absolute; inset: auto 0 0;
  height: min(34vh, 340px);
  z-index: 2; pointer-events: none;
  animation: sg-waves-in 800ms var(--ease-soft) 120ms both;
}
@keyframes sg-waves-in { from { opacity: 0; transform: translateY(20px); } }
.sg-waves svg { display: block; width: 100%; height: 100%; }

.sg-bubble {
  position: absolute; z-index: 2; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, var(--card) 0%, var(--auth-jelly-loft) 42%, var(--auth-jelly-deep) 78%, var(--auth-jelly-soft) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
  pointer-events: none;
}
.sg-bubble-a { left: 15%; top: 55%; width: clamp(20px, 3vw, 30px); aspect-ratio: 1; animation: lg-bubble-left 5.2s ease-in-out infinite; }
.sg-bubble-b { right: 15%; top: 40%; width: clamp(30px, 4vw, 46px); aspect-ratio: 1; animation: lg-bubble-right 4.8s ease-in-out infinite; }

.sg-hint {
  position: absolute; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--auth-brand-line);
  background: var(--auth-glass);
  color: var(--auth-link);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: sg-fade-in 700ms var(--ease) 320ms both;
}
@keyframes sg-fade-in { from { opacity: 0; } }

.sg-bars {
  position: absolute; left: 50%; bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 4; display: flex; align-items: center; gap: 8px;
  animation: sg-fade-in 700ms var(--ease) 380ms both;
}
.sg-bars i { width: 21px; height: 4.5px; border-radius: 999px; background: color-mix(in srgb, var(--auth-ink) 12%, transparent); }
.sg-bars i:first-child { background: linear-gradient(90deg, var(--brand-leaf-front), color-mix(in srgb, var(--brand-leaf-front) 38%, var(--card))); }

.sg-home {
  position: absolute; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  width: 115px; height: 4.5px; border-radius: 999px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--auth-ink) 14%, transparent);
  z-index: 4; display: none;
}

/* ---------- 登录门骨架 ---------- */
.login-gate {
  position: fixed; inset: 0; z-index: 88;
  overflow-x: hidden; overflow-y: auto;
  background: var(--auth-paper);
  animation: fade-in var(--t-page) var(--ease) both;
}
.login-gate.is-out { animation: fade-out 200ms var(--ease) both; pointer-events: none; }
.login-gate-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100svh;
}

/* 双叶标：形状只有一份（js/icons.js 的 leafMark 出 SVG，assets/logo.svg 与 make-icons 同几何）。
   这里只管尺寸与颜色，所以三档是等比的正方形，不再各自硬写叶片 px。
   配色走 --brand-leaf-*：后叶是主题对比色，前叶是固定自然绿。 */
.lg-mark { display: block; flex: 0 0 auto; width: 58px; height: 58px; }
.lg-mark svg { display: block; width: 100%; height: 100%; }
.lg-mark-a { fill: var(--accent); }
.lg-mark-b { fill: var(--progress, #7E9C87); fill-opacity: .9; }
.lg-mark-v { fill: none; stroke: var(--bg); stroke-width: 1.6; stroke-linecap: round; opacity: .75; }
.lg-mark-sm { width: 40px; height: 40px; }
.lg-mark-lg { width: 72px; height: 72px; }
.lg-lockup-name { color: var(--auth-ink); font-size: 23px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.lg-lockup-name span { color: var(--auth-link); font-weight: 500; font-style: italic; letter-spacing: -.02em; }

/* ---------- 左栏品牌区：浅暖白 + 双叶标 + 一屏日程节奏 ---------- */
.lg-brand {
  position: relative; overflow: hidden;
  background: linear-gradient(155deg, var(--auth-brand-surface) 0%, var(--auth-brand-surface-2) 100%);
}
.lg-brand::before {
  content: ""; position: absolute; right: -16%; top: -20%;
  width: min(620px, 64%); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--auth-accent-soft), transparent 68%);
  pointer-events: none;
}
.lg-brand-inner {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  min-height: 100%;
  padding: clamp(36px, 5vw, 72px) clamp(40px, 6vw, 104px) clamp(28px, 4vh, 44px);
}
.lg-brand-top { display: inline-flex; align-items: center; gap: 14px; animation: lg-brand-in 620ms var(--ease-soft) both; }
.lg-brand-name { color: var(--ink); font-size: 21px; font-weight: 650; letter-spacing: -.025em; line-height: 1; }

.lg-brand-copy { margin-top: clamp(44px, 8vh, 96px); animation: lg-brand-in 680ms var(--ease-soft) 80ms both; }
.lg-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 18px; color: var(--auth-accent);
  font-size: 12px; font-weight: 600; letter-spacing: .16em;
}
.lg-eyebrow i { width: 14px; height: 1px; background: currentColor; opacity: .7; }
.lg-brand-title {
  margin: 0; color: var(--ink);
  font-size: clamp(34px, 3.1vw, 50px); font-weight: 650;
  line-height: 1.24; letter-spacing: -.035em;
}
.lg-brand-title span { color: var(--auth-accent); }
.lg-brand-lead { margin: 20px 0 0; max-width: 26em; color: var(--ink-3); font-size: var(--fs-15); line-height: 1.75; }

.lg-brand-art { position: relative; flex: 1; min-height: 236px; margin-top: clamp(28px, 5vh, 56px); }
.lg-leaf { position: absolute; border-radius: 62% 38% 54% 46%; pointer-events: none; }
.lg-leaf-a {
  right: 1%; top: 2%; width: clamp(160px, 17vw, 240px); aspect-ratio: .8;
  background: linear-gradient(150deg, var(--auth-accent-soft), transparent 78%);
  border: 1px solid var(--auth-accent-line);
  transform: rotate(18deg);
}
.lg-leaf-b {
  left: 3%; bottom: 1%; width: clamp(110px, 12vw, 168px); aspect-ratio: .82;
  background: linear-gradient(160deg, var(--lavender-soft), transparent 80%);
  border: 1px solid var(--auth-brand-hair);
  transform: rotate(-14deg);
}
.lg-day-card {
  position: absolute; left: 50%; top: 50%;
  width: min(352px, 92%);
  padding: 18px 20px 10px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--auth-brand-hair); border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--auth-brand-shadow);
}
.lg-day-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 12px;
  color: var(--ink); font-size: var(--fs-13); font-weight: 600;
}
.lg-day-head span:last-child { color: var(--ink-4); font-size: var(--fs-micro); font-weight: 500; letter-spacing: .08em; }
.lg-day-list { list-style: none; margin: 0; padding: 0; }
.lg-day-list li {
  display: grid; grid-template-columns: 52px 8px minmax(0, 1fr); align-items: center; gap: 10px;
  min-height: 44px; border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: var(--fs-13);
}
.lg-day-list time { color: var(--ink-4); font-family: var(--font-mono); font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.lg-dot { width: 7px; height: 7px; border-radius: 50%; }
.lg-dot-work { background: var(--area-work); }
.lg-dot-study { background: var(--area-study); }
.lg-dot-life { background: var(--area-life); }

.lg-brand-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: clamp(18px, 4vh, 36px);
  color: var(--ink-3); font-size: var(--fs-caption); letter-spacing: .01em;
}
@keyframes lg-brand-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- 右栏表单 ---------- */
.lg-form-side {
  position: relative; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px clamp(32px, 5vw, 64px);
  background: var(--auth-paper);
}
.lg-mobile-head { display: none; }
.lg-card-wrap { position: relative; width: 100%; max-width: 396px; }
.lg-mascot-card { display: none; }
.lg-mascot { pointer-events: none; }
.lg-mascot svg { display: block; width: 100%; height: auto; overflow: visible; }
.lg-card { animation: lg-rise 640ms var(--ease-soft) 60ms both; }

.lg-head { margin-bottom: 24px; }
.lg-badge {
  display: inline-flex; align-items: center; gap: 7px;
  margin-bottom: 14px; padding: 5px 11px;
  border: 1px solid var(--auth-brand-line); border-radius: 999px;
  background: var(--auth-brand-soft);
  color: var(--auth-link);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
}
.lg-badge[hidden] { display: none; }
.lg-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--auth-btn-b); animation: lg-pulse 2.6s ease-in-out infinite; }
.lg-form-title {
  margin: 0; color: var(--auth-ink);
  font-size: var(--fs-30); font-weight: 700;
  letter-spacing: -.03em; line-height: 1.2;
}
.lg-subtitle { margin: 8px 0 0; color: var(--auth-ink-3); font-size: var(--fs-14); line-height: 1.6; }

.lg-alert {
  display: block; margin: 0 0 14px; padding: 10px 14px;
  border-radius: 12px;
  background: var(--auth-urgent-bg);
  color: var(--auth-urgent);
  font-size: var(--fs-13); line-height: 1.55;
}
.lg-alert[hidden] { display: none; }

/* 登录 ⇄ 注册 ⇄ 找回：外层高度过渡，字段错峰淡入 */
.lg-holder {
  position: relative; overflow: hidden;
  transition: height var(--t-page) var(--ease);
}
.lg-form { display: flex; flex-direction: column; gap: 14px; }
.lg-form[hidden] { display: none; }
.lg-field { display: flex; flex-direction: column; gap: 6px; }
.lg-form:not([hidden]) .lg-field { animation: lg-field-in 420ms var(--ease-soft) both; }
.lg-field:nth-child(2) { animation-delay: 40ms; }
.lg-field:nth-child(3) { animation-delay: 80ms; }
.lg-field:nth-child(4) { animation-delay: 120ms; }

.lg-field-box {
  position: relative; display: flex; align-items: center;
  height: 54px;
  border: 1.5px solid var(--auth-field-line);
  border-radius: 16px;
  background: var(--auth-field-bg);
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.lg-field-box:focus-within {
  border-color: var(--auth-brand);
  background: var(--auth-field-bg-focus);
  box-shadow: 0 0 0 4px var(--auth-focus-ring);
}
.lg-field.is-bad .lg-field-box { border-color: var(--auth-urgent); }
.lg-field.is-bad .lg-field-box:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-urgent) 12%, transparent); }

.lg-field-icon {
  position: absolute; left: 16px; top: 50%;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  transform: translateY(-50%);
  color: var(--auth-ink-4); pointer-events: none;
  transition: color var(--t-fast);
}
.lg-field-box:focus-within .lg-field-icon { color: var(--auth-brand); }
.lg-ico {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.login-gate .input {
  width: 100%; height: 100%; min-width: 0;
  padding: 0 48px 0 46px;
  border: 0; border-radius: inherit;
  background: transparent; color: var(--auth-ink-2);
  font-size: var(--fs-15); letter-spacing: .01em;
}
.login-gate .input::placeholder { color: var(--auth-ink-3); }
.login-gate .input:focus { outline: none; background: transparent; border: 0; box-shadow: none; }
.login-gate .input:-webkit-autofill {
  -webkit-text-fill-color: var(--auth-ink-2);
  -webkit-box-shadow: 0 0 0 1000px var(--auth-field-bg-focus) inset;
  caret-color: var(--auth-ink-2);
}

.lg-reveal {
  position: absolute; right: 9px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: var(--auth-ink-3); border-radius: 10px;
  transition: color var(--t-fast), background var(--t-fast);
}
.lg-reveal:hover { color: var(--auth-brand); background: color-mix(in srgb, var(--auth-brand) 8%, transparent); }
.lg-reveal[aria-pressed="true"] { opacity: .55; }
.lg-eye {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.lg-error { margin: 0 2px; font-size: var(--fs-caption); line-height: 1.45; color: var(--auth-urgent); }
.lg-error[hidden] { display: none; }
.lg-field.shake { animation: lg-shake 220ms var(--ease); }
@keyframes lg-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  85% { transform: translateX(-1px); }
}

.lg-submit {
  position: relative;
  width: 100%; height: 54px; margin-top: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 16px;
  background: linear-gradient(95deg, var(--auth-btn-a) 0%, var(--auth-btn-b) 55%, var(--auth-btn-c) 100%);
  color: var(--auth-btn-fg);
  font-size: var(--fs-15); font-weight: 600; letter-spacing: .02em;
  box-shadow: 0 12px 26px -6px color-mix(in srgb, var(--auth-btn-a) 44%, transparent);
  transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-hover);
}
.lg-submit:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 16px 32px -6px color-mix(in srgb, var(--auth-btn-a) 56%, transparent);
  filter: saturate(1.06);
}
.lg-submit:active { transform: translateY(.5px); }
.lg-submit:disabled { opacity: .72; transform: none; filter: none; }
.lg-submit .lg-arrow {
  position: absolute; right: 20px; top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: .95;
  transition: opacity var(--t-fast);
}
.lg-submit.is-busy .lg-arrow { opacity: 0; }
.lg-spinner {
  display: inline-block; width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, currentColor 32%, transparent);
  border-top-color: currentColor;
  animation: spin .8s linear infinite;
}
.lg-spinner[hidden] { display: none; }

.lg-options {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px;
  color: var(--auth-ink-3); font-size: var(--fs-13);
}
.lg-remember { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.lg-remember input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.lg-check {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border: 1.5px solid var(--auth-field-line); border-radius: 5px;
  background: var(--auth-field-bg);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.lg-remember input:checked + .lg-check { border-color: var(--auth-brand); background: var(--auth-brand); }
.lg-remember input:checked + .lg-check::after {
  content: "";
  width: 8px; height: 4px;
  border-left: 2px solid var(--auth-check);
  border-bottom: 2px solid var(--auth-check);
  transform: rotate(-45deg) translate(1px, -1px);
}
.lg-remember input:focus-visible + .lg-check { outline: 2px solid var(--auth-brand); outline-offset: 3px; }

.lg-link {
  padding: 4px 0; border-radius: 6px;
  color: var(--auth-link); font-size: var(--fs-13); font-weight: 500;
  transition: color var(--t-fast);
}
.lg-link:hover { text-decoration: underline; }

.lg-divider {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 14px; margin: 18px 0 14px;
}
.lg-divider span { height: 1px; background: var(--auth-hair); }
.lg-divider em { color: var(--auth-ink-4); font-style: normal; font-size: var(--fs-12); }

.lg-secondary {
  width: 100%; height: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid var(--auth-line); border-radius: 16px;
  background: transparent;
  color: var(--auth-ink-2);
  font-size: var(--fs-14); font-weight: 600; letter-spacing: .02em;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.lg-secondary:hover { border-color: var(--auth-brand-line); background: var(--auth-brand-soft); }
.lg-secondary:active { transform: translateY(1px); }
.lg-secondary-icon { flex: 0 0 auto; width: 18px; height: 18px; display: grid; place-items: center; color: var(--auth-brand); }
.lg-secondary-icon .lg-ico { width: 18px; height: 18px; }

.lg-links { display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.lg-note { margin: 2px 0 0; color: var(--auth-ink-3); font-size: var(--fs-12); line-height: 1.65; }
.lg-note[hidden] { display: none; }

.lg-skip {
  display: block; margin: 24px auto 0; padding: 6px 8px;
  border-radius: 8px;
  color: var(--auth-ink-3); font-size: var(--fs-13); letter-spacing: .02em;
  transition: color var(--t-fast);
}
.lg-skip:hover { color: var(--auth-ink-2); }
.lg-skip[hidden] { display: none; }
.lg-skip-glyph { margin-right: 4px; opacity: .75; }

.lg-submit:focus-visible,
.lg-secondary:focus-visible,
.lg-link:focus-visible,
.lg-reveal:focus-visible,
.lg-skip:focus-visible { outline: 2px solid var(--auth-brand); outline-offset: 3px; }

/* ---------- ≥961px：品牌区 + 无卡片登录面板 ---------- */
@media (min-width: 961px) {
  /* 墨 + 自然绿的令牌现在在 tokens.css 基础块里，桌面这里只压平背景，不再重复映射一遍 */
  .login-gate { background: var(--card); }
  .login-gate-inner { grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr); }
  .lg-brand { min-height: 100svh; }
  .lg-brand-inner { min-height: 100svh; }
  .lg-form-side {
    min-height: 100svh;
    justify-content: center;
    padding: clamp(40px, 5vh, 64px) clamp(32px, 4.4vw, 80px);
    border-left: 1px solid var(--line);
    background: var(--card);
  }
  .lg-card-wrap { max-width: 372px; }
  .lg-head { margin-bottom: 28px; }
  .lg-badge { display: none; }
  .lg-form-title { font-size: clamp(26px, 2vw, 32px); font-weight: 650; letter-spacing: -.025em; }
  .lg-subtitle { margin-top: 8px; font-size: var(--fs-14); }
  .lg-form { gap: 14px; }
  .lg-field-box { height: 48px; border-width: 1px; border-radius: var(--r-sm); }
  .lg-field-box:focus-within { box-shadow: 0 0 0 3px var(--auth-focus-ring); }
  .lg-field-icon { left: 15px; }
  .login-gate .input { padding: 0 46px 0 45px; font-size: var(--fs-14); }
  .lg-reveal { right: 7px; }
  .lg-submit {
    height: 48px; margin-top: 4px;
    border-radius: var(--r-md);
    background: var(--auth-accent);
    font-size: var(--fs-14); letter-spacing: .01em;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--auth-accent) 22%, transparent);
  }
  .lg-submit:hover {
    transform: none; filter: none;
    background: var(--auth-accent-strong);
    box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--auth-accent) 60%, transparent);
  }
  .lg-submit:active { transform: translateY(1px); }
  .lg-submit .lg-arrow { right: 18px; width: 18px; height: 18px; }
  .lg-options { margin-top: 2px; }
  .lg-divider { display: none; }
  .lg-secondary {
    height: auto; margin-top: 2px; padding: 8px 0;
    border: 0; background: none;
    color: var(--auth-link);
    font-size: var(--fs-13); font-weight: 500; letter-spacing: .01em;
  }
  .lg-secondary:hover { background: none; color: var(--auth-accent-strong); text-decoration: underline; }
  .lg-secondary:active { transform: none; }
  .lg-secondary-icon { display: none; }
  .lg-skip { margin-top: 26px; font-size: var(--fs-12); color: var(--ink-3); }
  .lg-skip:hover { color: var(--ink); }
}

/* 768 高左右的桌面：压缩品牌区，让表单完整可见 */
@media (min-width: 961px) and (max-height: 800px) {
  .lg-brand-inner { padding-top: 40px; padding-bottom: 28px; }
  .lg-brand-copy { margin-top: 40px; }
  .lg-brand-title { font-size: clamp(32px, 2.8vw, 42px); }
  .lg-brand-lead { margin-top: 16px; font-size: var(--fs-14); }
  .lg-brand-art { min-height: 200px; margin-top: 24px; }
  .lg-day-list li { min-height: 40px; }
  .lg-brand-foot { margin-top: 18px; }
  .lg-form-side { padding-top: 30px; padding-bottom: 30px; }
  .lg-head { margin-bottom: 22px; }
  .lg-form { gap: 12px; }
}

/* 精灵的眼睛跟着表单焦点：邮箱往下看，密码往上（害羞） */
.login-gate[data-focus="email"] .lg-mascot-card .lg-pupils { transform: translate(-5px, 4px); }
.login-gate[data-focus="password"] .lg-mascot-card .lg-pupils { transform: translate(0, -6px); }

/* ---------- 窄屏：单栏 + 精灵坐在玻璃卡上 ---------- */
@media (max-width: 960px) {
  .login-gate {
    background: linear-gradient(180deg, var(--auth-mobile-a) 0%, var(--auth-mobile-b) 48%, var(--auth-mobile-c) 100%);
  }
  /* 手机上的精灵要够大、坐得够高，眼睛才不会被前景浪盖住 */
  .sg-mascot { width: min(92vw, 430px); bottom: 11vh; }
  .login-gate-inner { grid-template-columns: 1fr; }
  .lg-brand { display: none; }
  .lg-form-side {
    min-height: 100svh;
    justify-content: flex-end;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
    background: transparent;
  }
  .lg-mobile-head {
    display: flex; align-items: center; gap: 11px;
    align-self: flex-start; margin: 4px 4px auto;
  }
  .lg-mobile-head .lg-lockup-name { font-size: 24px; }
  .lg-tagline { margin: 6px 0 0; color: var(--auth-ink-3); font-size: 11px; letter-spacing: .22em; white-space: nowrap; }
  .lg-card-wrap { margin-top: 56px; max-width: 440px; }
  /* 找回密码表单短，卡片悬在半空比贴底更稳 */
  .login-gate[data-form="forgot"] .lg-card-wrap { margin-bottom: auto; }
  .lg-mascot-card { display: block; position: absolute; right: 12px; top: -58px; width: 146px; z-index: 3; }
  .lg-card {
    position: relative; z-index: 2;
    padding: 30px 22px 22px;
    border: 1px solid var(--auth-glass-line);
    border-radius: 30px;
    background: var(--auth-glass);
    box-shadow: var(--auth-card-shadow);
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  }
  .lg-head { padding-right: 104px; margin-bottom: 22px; }
  .lg-badge { margin-bottom: 12px; }
  .lg-form-title { font-size: var(--fs-26); }
  .lg-subtitle { font-size: 13.5px; }
  .lg-alert { margin-bottom: 12px; }
  .login-gate .input { font-size: 16px; }
  .lg-submit { height: 52px; margin-top: 6px; }
  .lg-secondary { height: 50px; }
  .lg-skip { margin-top: 16px; }
}

@media (max-width: 960px) and (max-height: 680px) {
  .lg-form-side { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .lg-card-wrap { margin-top: 48px; }
  .lg-mascot-card { width: 124px; top: -50px; right: 8px; }
  .lg-card { padding: 24px 20px 18px; border-radius: 26px; }
  .lg-head { padding-right: 88px; margin-bottom: 16px; }
  .lg-badge { display: none; }
  .lg-form-title { font-size: var(--fs-24); }
  .lg-subtitle { font-size: var(--fs-13); }
  .lg-form { gap: 10px; }
  .lg-field-box { height: 48px; border-radius: 14px; }
  .lg-submit { height: 46px; border-radius: 14px; }
  .lg-options { margin-top: 2px; }
  .lg-divider { margin: 12px 0 10px; }
  .lg-secondary { height: 44px; border-radius: 14px; }
  .lg-skip { margin-top: 12px; }
}

/* 320×568 这类小屏：再收一档，让「暂不登录」不用滚动也看得见 */
@media (max-width: 960px) and (max-height: 600px) {
  .lg-form-side { padding: calc(10px + env(safe-area-inset-top, 0px)) 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .lg-mobile-head .lg-lockup-name { font-size: 21px; }
  .lg-mobile-head .lg-tagline { font-size: 10.5px; }
  .lg-card-wrap { margin-top: 44px; }
  .lg-card { padding: 22px 18px 16px; }
  .lg-head { margin-bottom: 14px; }
  .lg-form { gap: 8px; }
  .lg-field-box { height: 46px; }
  .lg-submit { height: 44px; }
  .lg-options { margin-top: 0; }
  .lg-divider { margin: 10px 0 8px; }
  .lg-secondary { height: 42px; }
  .lg-skip { margin-top: 8px; }
}

/* 启动页在矮屏上收一点，别让标题和精灵打架 */
@media (max-height: 680px) {
  .sg-brand { top: 58px; gap: 0; }
  .sg-wordmark { margin-top: 10px; font-size: 32px; }
  .sg-tagline { margin-top: 8px; font-size: 12.5px; letter-spacing: .3em; }
  .sg-mascot { width: min(80vw, 360px); bottom: 5vh; }
  .sg-waves { height: min(42vh, 320px); }
  .sg-hint { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .sg-bars { bottom: calc(42px + env(safe-area-inset-bottom, 0px)); }
}

/* 桌面端的启动页底部不放手机 Home 条；提示胶囊也压低一点 */
@media (min-width: 961px) {
  .sg-hint { bottom: 62px; }
  .sg-bars { bottom: 36px; }
  .sg-mascot { bottom: clamp(40px, 8vh, 96px); }
}

/* 矮桌面（768 高）由上面的 max-height 断点统一压缩 */

@media (prefers-reduced-motion: reduce) {
  .lg-float, .lg-blink,
  .sg-bubble-a, .sg-bubble-b, .lg-badge i { animation: none; }
  .sg-brand, .sg-mascot, .sg-waves, .sg-hint, .sg-bars, .lg-card, .lg-brand-top, .lg-brand-copy { animation: none; }
  .lg-pupils, .sg-pupils { transition: none; }
  .lg-holder { transition: none; }
  .lg-form:not([hidden]) .lg-field { animation: none; }
  .lg-field.shake { animation: none; }
  .start-guide, .login-gate, .login-gate.is-out, .start-guide.is-out { animation-duration: 1ms; }
}

/* =========================================================
   极简创建 · 图标属性行（任务/习惯/项目共用，弹窗内）
   只露标题输入框；属性点图标弹菜单单独设置，值回显在图标下。
   ========================================================= */
.qt-attrs { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 2px; }
.qt-attr {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 58px; padding: 9px 12px 7px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2);
  font: inherit; cursor: pointer;
  transition: transform .3s var(--spring, ease), border-color .18s, background .18s;
}
.qt-attr svg { color: var(--ink-2); }
.qt-attr:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--bg-sunk); color: var(--ink); }
.qt-attr:active { transform: scale(.94); }
.qt-attr-v { font-size: 12px; color: var(--ink-3); max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   登录门 · 定稿原型 le-auth 全采（58/42 场景 + 白表单面板）
   ========================================================= */
.login-gate-inner { grid-template-columns: 58fr 42fr; }
.lg-brand {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 15%, var(--bg)) 0%, var(--bg) 72%);
}
.lg-brand::before { display: none; }
.lg-scene-cn { font-size: 12px; font-weight: 400; color: var(--ink-3); letter-spacing: .3em; margin-left: 2px; }
.lg-brand-title { font-size: clamp(30px, 2.6vw, 36px); font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.lg-brand-title span { color: var(--accent); }
.lg-brand-lead { margin-top: 12px; max-width: 380px; color: var(--ink-3); font-size: 13px; line-height: 1.7; }
.lg-scene-orb { position: absolute; border-radius: 50%; filter: blur(48px); opacity: .32; pointer-events: none; }
.lg-scene-orb-a { width: 260px; height: 260px; right: -60px; top: 8%; background: var(--accent); animation: lg-orb 22s ease-in-out infinite alternate; }
.lg-scene-orb-b { width: 200px; height: 200px; left: -40px; bottom: 10%; background: var(--progress); animation: lg-orb 18s ease-in-out infinite alternate-reverse; }
@keyframes lg-orb { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-30px, 24px, 0) scale(1.12); } }
.lg-scene-trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lg-scene-trail path { fill: none; stroke: var(--accent); stroke-opacity: .3; stroke-width: 1.2; stroke-dasharray: 6 10; animation: lg-trail 40s linear infinite; }
@keyframes lg-trail { to { stroke-dashoffset: -640; } }
.lg-brand-foot { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-4); font-size: 12px; }
.lg-form-side { background: var(--card); }
.lg-card { border: 0; box-shadow: none; background: transparent; padding: 0; }
.lg-card-wrap { max-width: 400px; margin: 0 auto; width: 100%; }
.lg-form-title { font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.lg-submit { height: 44px; border-radius: 12px; }
.lg-field-box { border-radius: 12px; }
