/* C 柔彩 Bento：一桌子大小不一的软色块，颜色告诉你这块是什么状态。
   结构：令牌 → 页面骨架 → 桌面与模块 → 待拍板整页 → 模块库 → 反馈与动效 → 手机 → 降级。
   规则：颜色只表示状态（五个），不表示分类，也不做装饰；主按钮是中性的墨色药丸，把颜色全部让给状态；
   色块不描边、不投影，只靠色差分层，阴影只在「拾起」时出现；签名装置只有「换色漫开」（signature.js）。 */

:root {
  --bg: #F4F3EF;
  --bg-2: #ECEAE4;
  --ink: #1F1E1B;
  --ink-2: #4E4C46;
  --ink-3: #6B6860;
  --line: rgba(40, 36, 28, .10);
  --pocket: rgba(255, 253, 247, .52);
  --pocket-2: rgba(255, 253, 247, .78);
  --btn: #1F1E1B;
  --btn-hover: #34322D;
  --on-btn: #F6F4EF;
  --scrim: rgba(30, 28, 22, .24);
  --toast-bg: #1F1E1B;
  --toast-fg: #F4F3EF;
  /* 五个状态：底色／同色相深字／小圆点 */
  --wait-bg: #F7E0C9;  --wait-ink: #6E3A10;  --wait-dot: #E3843A;
  --late-bg: #ECEACC;  --late-ink: #4F4A0C;  --late-dot: #C49A12;
  --today-bg: #DAE7F3; --today-ink: #1B456B; --today-dot: #3C7FC0;
  --done-bg: #D4EADB;  --done-ink: #1A5133;  --done-dot: #389A60;
  --quiet-bg: #E7E5DF; --quiet-ink: #3F3D38; --quiet-dot: #9B978D;
  --sh-lift: 0 2px 6px rgba(30, 28, 20, .08), 0 24px 48px -16px rgba(30, 28, 20, .30);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --num: "SF Pro Rounded", ui-rounded, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  --r-card: 26px;
  --r-in: 14px;
  --ease-smooth: linear(0, 0.04, 0.134, 0.254, 0.381, 0.502, 0.61, 0.704, 0.781, 0.843, 0.892, 0.929, 0.956, 0.976, 0.989, 0.998, 1.003, 1.006, 1.007, 1.008, 1.007, 1.006, 1.006, 1.005, 1);
  --ease-snappy: linear(0, 0.035, 0.116, 0.218, 0.325, 0.428, 0.522, 0.605, 0.677, 0.737, 0.788, 0.83, 0.864, 0.892, 0.914, 0.932, 0.947, 0.958, 0.967, 0.974, 0.98, 0.984, 0.988, 0.991, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #121311;
  --bg-2: #1A1B18;
  --ink: #EFEDE7;
  --ink-2: #C3C0B7;
  --ink-3: #9E9B92;
  --line: rgba(240, 236, 226, .09);
  --pocket: rgba(255, 252, 240, .055);
  --pocket-2: rgba(255, 252, 240, .09);
  --btn: #EFEDE7;
  --btn-hover: #FFFFFF;
  --on-btn: #161714;
  --scrim: rgba(0, 0, 0, .55);
  --toast-bg: #EFEDE7;
  --toast-fg: #161714;
  --wait-bg: #3A2A1C;  --wait-ink: #F5CBA2;  --wait-dot: #E89A55;
  --late-bg: #33321D;  --late-ink: #E3DC93;  --late-dot: #CDA92A;
  --today-bg: #1A2836; --today-ink: #ADCFEF; --today-dot: #5D9BD8;
  --done-bg: #172A1F;  --done-ink: #A5DBB9;  --done-dot: #4DB079;
  --quiet-bg: #21221F; --quiet-ink: #D6D3CB; --quiet-dot: #8F8C83;
  --sh-lift: 0 2px 6px rgba(0, 0, 0, .4), 0 26px 50px -16px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* 状态 → 底色与字色。所有色块都走这一处 */
[data-state="wait"], .draft[data-st="pending"], .draft[data-hold] { --t-bg: var(--wait-bg); --t-ink: var(--wait-ink); --t-dot: var(--wait-dot); }
[data-state="late"] { --t-bg: var(--late-bg); --t-ink: var(--late-ink); --t-dot: var(--late-dot); }
[data-state="today"] { --t-bg: var(--today-bg); --t-ink: var(--today-ink); --t-dot: var(--today-dot); }
[data-state="done"], .draft:not([data-st="pending"]):not([data-hold]) { --t-bg: var(--done-bg); --t-ink: var(--done-ink); --t-dot: var(--done-dot); }
[data-state="quiet"] { --t-bg: var(--quiet-bg); --t-ink: var(--quiet-ink); --t-dot: var(--quiet-dot); }
[data-tone="wait"] { background: var(--wait-bg) !important; }
[data-tone="done"] { background: var(--done-bg) !important; }
[data-tone="late"] { background: var(--late-bg) !important; }
[data-tone="today"] { background: var(--today-bg) !important; }
[data-tone="quiet"] { background: var(--quiet-bg) !important; }

/* ---------- 骨架 ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
mark { background: var(--pocket-2); color: inherit; border-radius: 4px; padding: 0 3px; }
.p-aside mark { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

.sample {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 14px; height: 34px; padding: 0 20px; font-size: 12px; color: var(--ink-3);
  background: var(--bg); border-bottom: 1px dashed var(--line); white-space: nowrap; overflow-x: auto; scrollbar-width: none;
}
.sample-n { color: var(--ink-2); font-weight: 600; }
.sample-seg { display: inline-flex; gap: 2px; }
.sample-seg button, .sample-reset { padding: 3px 10px; border-radius: 999px; color: var(--ink-3); }
.sample-seg button[aria-current="page"], .sample-seg button[aria-pressed="true"] { background: var(--bg-2); color: var(--ink); }
.sample-reset { margin-left: auto; }

.top {
  position: sticky; top: 34px; z-index: 20; display: flex; align-items: center; gap: 16px; height: 64px;
  padding: 0 max(32px, calc((100vw - 1272px) / 2 + 32px));
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.brand-mark { width: 24px; height: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.brand-mark::before, .brand-mark::after { content: ""; border-radius: 6px; }
.brand-mark::before { background: var(--ink); border-radius: 7px 3px 3px 7px; }
.brand-mark::after { background: var(--ink-3); border-radius: 3px 7px 7px 3px; }
.top-date { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ib { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 999px; color: var(--ink-2); transition: background-color .3s var(--ease-snappy), color .3s; }
.ib:hover { background: var(--bg-2); color: var(--ink); }
.ib .i-moon, [data-theme="dark"] .ib .i-sun { display: none; }
[data-theme="dark"] .ib .i-moon { display: block; }
.top-wait { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 16px; border-radius: 999px; background: var(--wait-bg); color: var(--wait-ink); font-size: 13.5px; font-weight: 600; transition: transform .3s var(--ease-snappy), background-color .4s ease, color .4s ease; }
.top-wait:active { transform: scale(.97); }
.top-wait[data-n="0"] { background: var(--bg-2); color: var(--ink-2); font-weight: 500; }
.count { min-width: 22px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--wait-dot); color: #1F1E1B; font: 700 12px/1 var(--num); }
.me { width: 34px; height: 34px; margin-left: 6px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--bg-2); color: var(--ink); font-weight: 600; font-size: 14px; }

/* ---------- 桌面 ---------- */
.desk { max-width: 1272px; margin: 0 auto; padding: 0 32px 72px; }
.hello { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 500px); grid-template-areas: "l ask" "lg lg"; gap: 18px 48px; align-items: end; padding: 30px 0 22px; }
.hello-l { grid-area: l; }
.ask { grid-area: ask; }
.legend { grid-area: lg; }
.hello-d { margin: 0 0 6px; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.hello-h { margin: 0; font-size: 36px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
.hello-s { margin: 10px 0 0; color: var(--ink-2); font-size: 15px; }
.hello-s a { color: var(--wait-ink); background: var(--wait-bg); border-radius: 999px; padding: 2px 10px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.ask { display: flex; align-items: center; gap: 4px; height: 52px; padding: 0 7px 0 8px; border-radius: 999px; background: var(--bg-2); transition: background-color .3s, box-shadow .3s var(--ease-snappy); }
.ask:focus-within { box-shadow: 0 0 0 2px var(--ink); }
.ask-b { width: 38px; height: 38px; display: grid; place-items: center; color: var(--ink-3); border-radius: 999px; }
.ask-b:hover { color: var(--ink); background: var(--pocket-2); }
.ask-i { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 14.5px; }
.ask-i::placeholder { color: var(--ink-3); }
.ask-go { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; background: var(--btn); color: var(--on-btn); transition: transform .3s var(--ease-snappy), background-color .3s; }
.ask-go:hover { background: var(--btn-hover); }
.ask-go:active { transform: scale(.92); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-3); font-size: 12px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend li::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--t-bg); box-shadow: inset 0 0 0 1px var(--line); }
.legend li[data-st="wait"] { --t-bg: var(--wait-bg); }
.legend li[data-st="late"] { --t-bg: var(--late-bg); }
.legend li[data-st="today"] { --t-bg: var(--today-bg); }
.legend li[data-st="done"] { --t-bg: var(--done-bg); }
.legend li[data-st="quiet"] { --t-bg: var(--quiet-bg); }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 172px; gap: 14px; grid-auto-flow: dense; }
.tile {
  position: relative; order: var(--o); min-width: 0; padding: 18px 20px 18px; border-radius: var(--r-card); background: var(--t-bg); color: var(--t-ink);
  cursor: pointer; overflow: hidden; touch-action: manipulation; user-select: none; isolation: isolate;
  transition: scale .42s var(--ease-smooth), background-color .4s ease, color .4s ease;
}
.tile[data-w="2"] { grid-column: span 2; }
.tile[data-h="2"] { grid-row: span 2; }
.tile:hover { scale: 1.012; }
.tile:active:not(.is-lift) { scale: .985; }
.tile-in { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; min-height: 0; }
.tile-flood, .flood { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; pointer-events: none; display: none; }
.tile-flood.is-on, .flood.is-on { display: block; }
.tile-flood i, .flood i { position: absolute; border-radius: 50%; transform: scale(0); }
.tile.is-lift { z-index: 30; cursor: grabbing; box-shadow: var(--sh-lift); transform: translate(var(--dx, 0), var(--dy, 0)); scale: 1.04; transition: box-shadow .3s var(--ease-snappy), scale .3s var(--ease-snappy), background-color .4s; }
.tile.is-drop { transition: transform .46s var(--ease-smooth), scale .3s var(--ease-snappy), box-shadow .3s; }
.tile.is-target { box-shadow: 0 0 0 2px var(--ink); }
.is-dragging, .is-dragging * { cursor: grabbing !important; }
.tile-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--line); }
.tile-add:hover { color: var(--ink); background: var(--bg-2); }
.tile-add .ic { width: 22px; height: 22px; margin-bottom: 4px; }
.tile-add span { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.tile-add em { font-style: normal; font-size: 12px; }

.t-head { display: flex; align-items: center; gap: 8px; height: 24px; margin-bottom: 10px; flex: none; }
.t-ic { width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 8px; background: var(--pocket); }
.t-ic .ic { width: 15px; height: 15px; }
.t-name { margin: 0; font-size: 15px; font-weight: 650; white-space: nowrap; }
.t-meta { margin-left: auto; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; opacity: .82; }
.kick { font-size: 12px; font-weight: 500; opacity: .82; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -.03em; }
.num.xl { font-size: 52px; line-height: .95; }
.num.lg { font-size: 34px; line-height: 1; }
.hero-t { font-size: 15.5px; font-weight: 650; line-height: 1.32; }
.hero-t.lg { font-size: 21px; letter-spacing: -.01em; }
.sub { font-size: 12.5px; line-height: 1.45; opacity: .86; }
.t-hero { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.t-hero > :first-child { margin-top: auto; }
.t-more { margin: auto 0 0; padding-top: 6px; font-size: 12px; font-weight: 500; opacity: .82; }
.t-fill { flex: 1; min-height: 0; position: relative; }
.t-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); gap: 20px; align-items: end; }
.t-next { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.t-next.row { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; }
.t-next.row .avs { margin-left: auto; }
.t-foot span { white-space: nowrap; }
.t-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; font-weight: 500; }

/* 小标签：口袋底＋状态圆点，字沿用所在色块的深字，避免同色叠同色 */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--pocket-2); color: inherit; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--quiet-dot); }
.chip[data-st="late"]::before { background: var(--late-dot); }
.chip[data-st="today"]::before { background: var(--today-dot); }
.chip[data-st="done"]::before { background: var(--done-dot); }
.chip[data-st="wait"]::before { background: var(--wait-dot); }

/* 时间轴（竖）：今天这块是「天」色，日程是口袋，只有等你定的专注块用杏色 */
.tl { position: absolute; inset: 6px 0 2px 0; }
.tl-h { position: absolute; left: 0; right: 0; top: calc(var(--t) * 100%); border-top: 1px solid color-mix(in srgb, var(--t-ink) 14%, transparent); }
.tl-h span { position: absolute; left: 0; top: -8px; width: 20px; text-align: right; font: 600 11px/1 var(--num); opacity: .8; }
.tl-ev {
  position: absolute; left: 30px; right: 0; top: calc(var(--a) * 100% + 1.5px); height: calc((var(--b) - var(--a)) * 100% - 3px);
  display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 9px; overflow: hidden; font-size: 12px; line-height: 1.2; background: var(--pocket-2); min-height: 18px;
}
.tl-ev b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tl-ev span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-variant-numeric: tabular-nums; flex: none; max-width: 45%; opacity: .8; }
.tl-ev em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 650; white-space: nowrap; }
.tl-ev[data-ev="pending"] { background: var(--wait-bg); color: var(--wait-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--wait-dot) 55%, transparent); }
.tl-ev[data-ev="pending"] span { display: none; }
.tl-ev[data-ev="pending"] em::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--wait-dot); }
.tl-now { position: absolute; left: 26px; right: 0; top: calc(var(--t) * 100%); border-top: 2px solid var(--t-ink); }
.tl-now i { position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--t-ink); }
.tl-now span { position: absolute; right: 0; top: -19px; font: 700 11px/1 var(--num); }
.tl-compact .tl-ev span { display: none; }

.tlh { min-width: 0; }
.tlh-track { position: relative; height: 40px; border-radius: 12px; background: var(--pocket); }
.tlh-ev { position: absolute; top: 7px; bottom: 7px; left: calc(var(--a) * 100% + 1px); width: calc((var(--b) - var(--a)) * 100% - 2px); border-radius: 6px; background: var(--t-ink); opacity: .55; }
.tlh-ev[data-ev="pending"] { background: var(--wait-dot); opacity: 1; }
.tlh-now { position: absolute; top: -3px; bottom: -3px; left: calc(var(--t) * 100%); width: 2px; border-radius: 1px; background: var(--t-ink); }
.tlh-ticks { position: relative; height: 16px; margin-top: 5px; }
.tlh-ticks span { position: absolute; left: calc(var(--t) * 100%); transform: translateX(-50%); font: 600 10.5px/1 var(--num); opacity: .8; }
.tlh-ticks span:first-child { transform: none; }
.tlh-ticks span:last-child { transform: translateX(-100%); }

/* 待拍板行 */
.ap-list { list-style: none; margin: 0; padding: 0; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.ap-row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "tg t w" "why why why"; align-items: center; gap: 2px 10px; padding: 8px 12px; border-radius: 12px; background: var(--pocket); }
.ap-tg { grid-area: tg; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; white-space: nowrap; opacity: .82; }
.ap-tg .ic { width: 13px; height: 13px; }
.ap-t { grid-area: t; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-w { grid-area: w; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 500; }
.ap-why { grid-area: why; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .82; }
.ap-row .mini-stamp { display: none; }
[data-state="wait"] .ap-row:not([data-st="pending"]) { background: var(--done-bg); color: var(--done-ink); }
.ap-narrow .ap-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tg" "t"; }
.mini-stamps { display: none; }

/* 待办 */
.td-list { list-style: none; margin: 0; padding: 0; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.td-list.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.td { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; }
.ck { flex: none; width: 20px; height: 20px; margin-top: 0; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.6px currentColor; opacity: .7; transition: background-color .3s var(--ease-snappy), opacity .3s; }
.ck:hover { opacity: 1; }
.ck .ic { width: 13px; height: 13px; stroke-width: 2.4; opacity: 0; color: var(--done-bg); }
.td[data-done="true"] .ck { background: var(--done-dot); box-shadow: none; opacity: 1; }
.td[data-done="true"] .ck .ic { opacity: 1; color: #F6F4EF; }
.td[data-done="true"] .td-t { opacity: .55; text-decoration: line-through; }
.td-b { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.td-t { font-size: 13.5px; line-height: 1.4; font-weight: 550; }
.td-m { display: flex; align-items: center; gap: 8px; min-width: 0; }
.src { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .8; }

/* 随手记 */
.nt-wrap { flex: 1; min-height: 0; display: flex; }
.nt { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.nt blockquote { text-wrap: pretty; margin: 0; font-size: 13.5px; line-height: 1.55; font-weight: 550; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nt-big { flex: 1; }
.nt-big blockquote { flex: 1; font-size: 18px; line-height: 1.4; font-weight: 650; letter-spacing: -.01em; -webkit-line-clamp: 3; }
.nt figcaption { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; font-weight: 500; }
.tag { padding: 1px 8px; border-radius: 999px; background: var(--pocket-2); }
.nt .at { margin-left: auto; font-variant-numeric: tabular-nums; opacity: .8; }
.nt-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 10px; min-height: 0; }
.nt-grid .nt { padding: 10px 12px; border-radius: var(--r-in); background: var(--pocket); }
.nt-grid[data-n="4"] { grid-template-rows: 1fr 1fr; flex: 1; }
.nt-grid[data-n="4"] .nt blockquote { -webkit-line-clamp: 3; }
.nt-grid .nt figcaption { margin-top: auto; padding-top: 6px; }

/* 文件 */
.fbadge { flex: none; display: inline-grid; place-items: center; width: 44px; height: 22px; border-radius: 7px; font: 700 11px/1 var(--sans); letter-spacing: .05em; background: var(--pocket-2); }
.t-hero .fbadge { width: 48px; height: 58px; align-content: end; padding-bottom: 9px; border-radius: 9px 16px 9px 9px; margin-bottom: 6px; font-size: 11px; }
.fname { word-break: break-all; }
.f-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.f-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; height: 30px; }
.f-n { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-at { font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: .8; }
.f-sum { margin: auto 0 0; padding: 10px 12px; border-radius: var(--r-in); background: var(--pocket); font-size: 12.5px; line-height: 1.55; }
.f-sum b { font-weight: 650; }

/* 会议、联系人 */
.avs { display: inline-flex; }
.av { width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--pocket-2); font-size: 11px; font-weight: 650; font-style: normal; box-shadow: 0 0 0 2px var(--t-bg, var(--bg)); flex: none; }
.avs .av + .av { margin-left: -6px; }
.av.sm { width: 20px; height: 20px; font-size: 11px; }
.av.lg { width: 46px; height: 46px; font-size: 18px; margin-bottom: 6px; }
.carry { list-style: none; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.carry li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--pocket); font-size: 13px; font-weight: 550; }
.carry li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carry em { font-style: normal; font-size: 12px; font-weight: 500; opacity: .8; }
.last { margin-top: auto; padding: 10px 12px; border-radius: var(--r-in); background: var(--pocket); }
.last p { margin: 3px 0 0; font-size: 12.5px; }
.ct { list-style: none; margin: 0; padding: 0; }
.ct.cols2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.ct li { display: flex; align-items: center; gap: 10px; padding: 5px 0; min-width: 0; }
.ct li > span { display: flex; flex-direction: column; min-width: 0; }
.ct b { font-size: 13px; font-weight: 650; }
.ct em { font-style: normal; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .82; }

/* 项目 */
.seg-bar { display: flex; gap: 4px; height: 8px; margin: 8px 0 6px; }
.seg-bar i { flex: 1; border-radius: 4px; background: var(--quiet-dot); }
.seg-bar i[data-st="today"] { background: var(--today-dot); }
.seg-bar i[data-st="late"] { background: var(--late-dot); }
.seg-bar i[data-st="done"] { background: var(--done-dot); }
.steps { list-style: none; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.steps .chip { height: 20px; }
.steps li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 2px 3px 2px 10px; border-radius: 10px; background: var(--pocket); font-size: 12.5px; font-weight: 550; }
.steps li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(150px, 38%) minmax(0, 1fr); gap: 20px; align-items: center; }
.pj-h { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pj-v { flex: none; display: block; padding-bottom: 12px; }

/* 收件箱 */
.shot { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--r-in); background: var(--pocket); min-width: 0; }
.shot-h { font-size: 11px; font-weight: 600; opacity: .8; }
.shot-m { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; line-height: 1.5; font-weight: 500; }
.shot-m > span { text-wrap: pretty; padding: 5px 10px; border-radius: 4px 12px 12px 12px; background: var(--pocket-2); }
.ib-wrap { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 0; }
.tile[data-h="1"] .ib-wrap .shot { padding: 8px 10px; gap: 4px; }
.ib-wrap .shot-m > span { text-wrap: pretty; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ib-r { margin: 0; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; }
.ib-r .ic { width: 14px; height: 14px; }
.p-aside .shot { background: var(--bg-2); color: var(--ink); }
.shot-lg { padding: 12px; }
.shot-lg .shot-m { font-size: 13px; }

/* 本周、文档、表格 */
.wk { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.wk-d { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 12px; min-width: 0; background: var(--pocket); }
.wk-d[data-today="true"] { background: var(--today-bg); color: var(--today-ink); }
.wk-n { font-size: 11px; font-weight: 500; display: flex; align-items: baseline; justify-content: space-between; }
.wk-n b { font: 650 17px/1 var(--num); }
.wk-e { font-size: 11px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-dots { display: flex; gap: 3px; margin-top: auto; }
.wk-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; }
.dc { display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.dc-p { margin: 8px 0 0; padding: 7px 10px; border-radius: 10px; background: var(--pocket); font-size: 12.5px; }
.dc-p .src { margin-left: 6px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.tb { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tb th { text-align: left; font-weight: 600; font-size: 11.5px; padding: 0 0 6px; opacity: .8; }
.tb td { padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--t-ink) 12%, transparent); }
.tb td:last-child, .tb th:last-child { text-align: right; }

/* ---------- 待拍板整页 ---------- */
.page-in { max-width: 1200px; margin: 0 auto; padding: 22px 32px 88px; }
.back { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 14px 0 8px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.back:hover { color: var(--ink); }
.back .ic { width: 16px; height: 16px; }
.p-head { margin: 22px 0 28px; }
.p-head .kick { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--wait-bg); color: var(--wait-ink); font-size: 13px; font-weight: 650; opacity: 1; }
.p-head .kick .ic { width: 15px; height: 15px; }
.p-h { margin: 12px 0 0; font-size: 34px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.p-s { margin: 10px 0 0; max-width: 640px; color: var(--ink-2); font-size: 15px; }
.p-grid { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 24px; align-items: start; }
.drafts { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.draft { position: relative; border-radius: var(--r-card); background: var(--t-bg); color: var(--t-ink); isolation: isolate; overflow: hidden; transition: color .35s ease; }
.d-in { position: relative; z-index: 1; padding: 22px 26px 20px; }
.d-top { display: flex; align-items: center; gap: 10px; }
.d-tg { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 8px; border-radius: 999px; background: var(--pocket-2); font-size: 12px; font-weight: 650; }
.d-tg .ic { width: 14px; height: 14px; }
.d-verb { font-size: 12.5px; font-weight: 500; opacity: .82; }
.d-st { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--pocket-2); font-size: 12.5px; font-weight: 650; }
.d-st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--t-dot); }
.d-title { margin: 14px 0 14px; font-size: 21px; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
.d-kv { display: grid; gap: 8px; margin: 0; }
.d-kv > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
.d-kv dt { font-size: 12.5px; line-height: 1.7; font-weight: 500; opacity: .8; }
.d-kv dd { text-wrap: pretty; margin: 0; font-size: 13.5px; line-height: 1.7; }
.d-kv > div:first-child dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.d-act { display: flex; align-items: center; gap: 8px; margin-top: 18px; min-height: 40px; }
.d-done { display: none; margin: 0; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; }
.d-done .ic { width: 18px; height: 18px; stroke-width: 2.2; padding: 2px; border-radius: 50%; background: var(--done-dot); color: #F6F4EF; }
.d-link { margin-left: 10px; font-weight: 600; font-size: 13px; text-underline-offset: 3px; }
.draft:not([data-st="pending"]) .btn { display: none; }
.draft[data-st="sent"] .d-done { display: inline-flex; }
.draft[data-st="confirmed"] .d-act::before { content: "正在写入…"; font-size: 13px; font-weight: 500; opacity: .8; }
.draft[data-kind="local"][data-st="confirmed"] .d-act::before { content: "正在改…"; }
.stamp-slot { display: none; }

.p-aside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 116px; }
.panel { padding: 18px 20px 20px; border-radius: var(--r-card); background: var(--bg-2); }
.panel-h { margin: 0 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 15px; font-weight: 650; }
.panel-h span { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.panel-tl { position: relative; height: 360px; --t-ink: var(--ink-2); }
.panel .tl-ev:not([data-ev="pending"]) { background: var(--bg); color: var(--ink); }
.panel .tl-ev[data-k="focus"]:not([data-ev="pending"]) { background: var(--done-bg); color: var(--done-ink); }
.hist { margin-top: 40px; }
.hist .panel-h { justify-content: flex-start; }
.h-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.h-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 96px minmax(120px, auto); gap: 16px; align-items: center; padding: 13px 18px; border-radius: 16px; background: var(--quiet-bg); color: var(--quiet-ink); font-size: 13.5px; }
.h-at { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; }
.h-t { font-weight: 550; }
.h-t em { margin-left: 8px; font-style: normal; font-size: 12px; font-weight: 400; opacity: .8; }
.h-tg { font-size: 12px; }
.h-r { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.h-r::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--quiet-dot); flex: none; }
.h-row[data-res="ok"] .h-r::before { background: var(--done-dot); }
.h-row .mini-stamp { display: none; }

/* 按钮：墨色药丸，把颜色让给状态 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 20px; border-radius: 999px; font-size: 14px; font-weight: 650; position: relative; transition: background-color .3s var(--ease-snappy), transform .3s var(--ease-snappy), color .3s; }
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--btn); color: var(--on-btn); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-ghost { background: var(--pocket-2); }
.btn-ghost:hover { background: var(--pocket); }
.btn-text { padding: 0 14px; opacity: .85; }
.btn-text:hover { opacity: 1; background: var(--pocket); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn[aria-busy="true"] { color: transparent; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--on-btn); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn:disabled:not([aria-busy]) { opacity: .45; }
@keyframes spin { to { transform: rotate(1turn); } }

/* ---------- 模块库 ---------- */
.lib { position: fixed; inset: 34px 0 0 0; z-index: 50; }
.scrim { position: absolute; inset: 0; background: var(--scrim); }
.lib-panel { position: absolute; top: 10px; right: 10px; bottom: 10px; width: min(580px, calc(100% - 20px)); display: flex; flex-direction: column; background: var(--bg); border-radius: 30px; box-shadow: 0 30px 80px -24px rgba(20, 18, 10, .45); overflow: hidden; }
.lib-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 22px 6px 28px; }
.lib-head h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.lib-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 12.5px; }
.lib-head .ib { background: var(--bg-2); }
.lib-search { display: flex; align-items: center; gap: 8px; height: 44px; margin: 12px 28px 4px; padding: 0 14px; border-radius: 999px; background: var(--bg-2); color: var(--ink-3); }
.lib-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font-size: 14px; }
.lib-search input::placeholder { color: var(--ink-3); }
.lib-body { flex: 1; overflow: auto; padding: 0 28px 48px; overscroll-behavior: contain; }
.lib-g h3 { margin: 26px 0 12px; display: flex; align-items: baseline; gap: 10px; font-size: 15px; font-weight: 700; }
.lib-g h3 span { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.lib-card { padding: 14px; border-radius: 28px; background: var(--bg-2); margin-bottom: 12px; }
.lib-stage { position: relative; }
.lib-frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: grid; }
.lib-frame .tile { cursor: default; pointer-events: none; }
.lib-info { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: 12px; padding: 0 6px 4px; }
.lib-t { min-width: 0; }
.lib-t b { font-size: 15px; font-weight: 700; }
.lib-t span { display: block; margin-top: 3px; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.lib-ctl { display: flex; align-items: center; gap: 10px; flex: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg); }
.seg button { height: 26px; padding: 0 11px; border-radius: 999px; color: var(--ink-3); font-size: 12.5px; font-weight: 500; transition: background-color .3s var(--ease-snappy), color .3s; }
.seg button[aria-checked="true"] { background: var(--btn); color: var(--on-btn); font-weight: 650; }
.lib-on { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 13px; font-weight: 650; }
.lib-on .ic { width: 15px; height: 15px; stroke-width: 2.2; }

/* ---------- 反馈 ---------- */
.morph { position: fixed; z-index: 40; pointer-events: none; background: var(--t-bg, var(--bg-2)); border-radius: var(--r-card); }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 70; max-width: min(520px, calc(100vw - 32px)); padding: 11px 18px; border-radius: 999px;
  background: var(--toast-bg); color: var(--toast-fg); font-size: 13.5px; font-weight: 500; box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .4);
  translate: -50% 12px; scale: .96; opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity .26s var(--ease-snappy), translate .42s var(--ease-smooth), scale .42s var(--ease-smooth), visibility 0s .42s;
}
.toast.is-in { opacity: 1; translate: -50% 0; scale: 1; visibility: visible; transition: opacity .26s var(--ease-snappy), translate .42s var(--ease-smooth), scale .42s var(--ease-smooth); }
.toast.is-in.is-out { opacity: 0; translate: -50% 6px; }
.tabbar { display: none; }

/* 卡片入场：从 .94 长到原大，40ms 错峰，最多 8 个 */
.grid.is-entering .tile { animation: enter .56s var(--ease-smooth) backwards; animation-delay: calc(min(var(--i), 8) * 40ms + 60ms); }
.hello { animation: enter-up .52s var(--ease-smooth) backwards; }
@keyframes enter { from { opacity: 0; transform: scale(.94); } }
@keyframes enter-up { from { opacity: 0; transform: translateY(8px); } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; animation-timing-function: ease; }

/* ---------- 中屏 ---------- */
@media (max-width: 1100px) {
  .hello { grid-template-columns: 1fr; grid-template-areas: "l" "ask" "lg"; }
  .ask { max-width: 640px; }
  .p-grid { grid-template-columns: 1fr; }
  .p-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; }
}

/* ---------- 手机 ---------- */
@media (max-width: 640px) {
  :root { --r-card: 22px; }
  .sample { padding: 0 12px; gap: 8px; font-size: 11.5px; }
  .sample-n { display: none; }
  .top { height: 56px; padding: 0 16px; gap: 10px; }
  .top-date { font-size: 12.5px; }
  .hide-m { display: none !important; }
  .desk { padding: 0 14px 104px; }
  .hello { padding: 16px 2px 16px; gap: 12px; }
  .hello-d { display: none; }
  .hello-h { font-size: 28px; }
  .hello-s { font-size: 14px; margin-top: 6px; line-height: 1.7; }
  .ask { height: 50px; }
  .legend { gap: 6px 12px; font-size: 11.5px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 152px; gap: 10px; }
  .tile { order: var(--mo); padding: 14px 15px 15px; }
  .tile-add { order: 99; }
  .t-name { font-size: 14px; }
  .num.xl { font-size: 42px; }
  .num.lg { font-size: 28px; }
  .hero-t { font-size: 14px; }
  .nt-big blockquote { font-size: 15px; }
  .t-split { grid-template-columns: minmax(96px, 36%) minmax(0, 1fr); gap: 14px; }
  .pj { grid-template-columns: 1fr; gap: 6px; }
  .pj .steps { display: none; }
  .tile[data-w="2"][data-h="1"] .carry { display: none; }
  .tile[data-id="meeting"][data-w="2"][data-h="1"] .t-split { grid-template-columns: 1fr; }
  .ap-row { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "tg t"; padding: 7px 10px; }
  .ap-row .ap-w { display: none; }
  .tile[data-w="1"] .t-foot .av:nth-child(n + 3) { display: none; }
  .ib-wrap .shot-h { display: none; }
  .ib-wrap .shot-m > span { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tile[data-h="2"] .td-list .td:nth-child(n + 4) { display: none; }
  .page-in { padding: 14px 14px 104px; }
  .p-h { font-size: 26px; }
  .p-s { font-size: 14px; }
  .p-aside { display: flex; }
  .d-in { padding: 18px 18px 16px; }
  .d-title { font-size: 18px; margin: 12px 0; }
  .d-kv > div { grid-template-columns: 1fr; gap: 0; }
  .d-kv dt { font-size: 12px; line-height: 1.5; }
  .d-act { flex-wrap: wrap; }
  .d-done { flex-wrap: wrap; }
  .h-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t t" "at r"; gap: 4px 12px; padding: 12px 14px; }
  .h-row .h-t { grid-area: t; }
  .h-row .h-at { grid-area: at; }
  .h-row .h-r { grid-area: r; }
  .h-row .h-tg { display: none; }
  .lib-panel { top: 5vh; right: 0; bottom: 0; width: 100%; border-radius: 28px 28px 0 0; }
  .lib-head { padding: 24px 18px 4px 20px; }
  .lib-head::before { content: ""; position: absolute; left: 50%; top: 8px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line); }
  .lib-search { margin: 10px 20px 4px; }
  .lib-body { padding: 0 16px 40px; }
  .lib-info { flex-direction: column; align-items: stretch; }
  .lib-ctl { justify-content: space-between; }
  .toast { bottom: 92px; }
  .tabbar {
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 25; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center;
    height: 64px; border-radius: 999px; background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px -12px rgba(20, 18, 10, .3);
  }
  .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-3); font-size: 11px; font-weight: 500; }
  .tabbar button .ic { width: 22px; height: 22px; }
  .tabbar button[aria-current="page"] { color: var(--ink); font-weight: 650; }
  .tabbar .count { position: absolute; top: -4px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
  .tabbar .tab-add { justify-self: center; width: 48px; height: 48px; border-radius: 999px; display: grid; place-items: center; background: var(--btn); color: var(--on-btn); }
}

/* ---------- 降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .12s !important; }
  .btn[aria-busy="true"]::after { animation: none; }
  .tile:hover, .tile:active:not(.is-lift), .tile.is-lift { scale: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .top, .tabbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
