/* D 清透玻璃 · 壁纸取色
   一句话：桌面是一张柔和的光，模块是搁在上面的小玻璃；颜色从壁纸里来。
   唯一签名装置：壁纸取色（换壁纸时新壁纸从按钮处展开，强调色随展开的波前流过每块模块）。
   取色得到的颜色写进下面这组注册过的变量，由 app.js 计算；其余令牌都由它们派生。 */

@property --acc { syntax: '<color>'; inherits: true; initial-value: #2C7A72; }
@property --on-acc { syntax: '<color>'; inherits: true; initial-value: #FFFFFF; }
@property --ink { syntax: '<color>'; inherits: true; initial-value: #18211F; }
@property --ink2 { syntax: '<color>'; inherits: true; initial-value: #45524F; }
@property --ink3 { syntax: '<color>'; inherits: true; initial-value: #5C6966; }
@property --shade { syntax: '<color>'; inherits: true; initial-value: #3C5F5A; }
@property --glow { syntax: '<color>'; inherits: true; initial-value: #EAF6F3; }
@property --wr { syntax: '<length>'; inherits: false; initial-value: 0px; }

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-num: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", sans-serif;

  /* 圆角：模块 24，面板 32，内衬 16，控件全药丸 */
  --r-tile: 24px; --r-sheet: 32px; --r-plate: 16px; --r-chip: 10px;
  /* 间距 4 进制 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;

  /* 动效：一条弹簧（ζ≈.78，过冲约 2%）＋一条缓出；不用 ease 族 */
  --spring: linear(0, 0.0384, 0.1311, 0.2511, 0.3797, 0.5045, 0.618, 0.7163, 0.7981, 0.8638, 0.9146, 0.9525, 0.9797, 0.9981, 1.0098, 1.0164, 1.0194, 1.0199, 1.0187, 1.0167, 1.0142, 1.0117, 1.0092, 1.0071, 1.0052, 1.0036, 1.0024, 1.0015, 1);
  --t-spring: 560ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 160ms;
  --t-tint: 760ms;

  /* 材质：亮色 regular 玻璃（不是 clear）。白 .50 ＋ 模糊 28 ＋ 饱和 1.6，背后的壁纸只透出颜色、不透出形状 */
  --glass: rgb(255 255 255 / .44);
  --glass-thick: rgb(255 255 255 / .66);
  --glass-hi: rgb(255 255 255 / .78);
  --glass-rim: rgb(255 255 255 / .46);
  --glass-sheen: linear-gradient(180deg, rgb(255 255 255 / .22), rgb(255 255 255 / 0) 42%);
  --blur: blur(28px) saturate(1.6);
  --blur-thick: blur(44px) saturate(1.5);
  --fill: rgb(255 255 255 / .44);
  --fill-hover: rgb(255 255 255 / .62);
  --line: color-mix(in oklab, var(--ink) 11%, transparent);
  --acc-soft: color-mix(in oklab, var(--acc) 14%, transparent);
  --acc-line: color-mix(in oklab, var(--acc) 42%, transparent);
  --tile-shadow: 0 1px 2px color-mix(in oklab, var(--shade) 10%, transparent), 0 18px 40px -22px color-mix(in oklab, var(--shade) 55%, transparent);
  --lift-shadow: 0 2px 6px color-mix(in oklab, var(--shade) 14%, transparent), 0 34px 64px -24px color-mix(in oklab, var(--shade) 70%, transparent);

  /* 语义色不随壁纸变：逾期琥珀、完成绿（Lab 里压到与墨同一可读档） */
  --warn: #A3530A;
  --ok: #1E7A4F;
  --warn-soft: rgb(222 140 50 / .16);
  --ok-soft: rgb(40 160 100 / .14);
  --scrim: rgb(30 44 44 / .08);
  color-scheme: light;
}

:root[data-theme="dark"] {
  /* 暗色：烟色玻璃，比壁纸更暗一档，白字落在上面 */
  --glass: rgb(12 16 20 / .48);
  --glass-thick: rgb(12 16 20 / .62);
  --glass-hi: rgb(255 255 255 / .16);
  --glass-rim: rgb(255 255 255 / .09);
  --glass-sheen: linear-gradient(180deg, rgb(255 255 255 / .06), rgb(255 255 255 / 0) 40%);
  --blur: blur(28px) saturate(1.5);
  --blur-thick: blur(44px) saturate(1.4);
  --fill: rgb(255 255 255 / .06);
  --fill-hover: rgb(255 255 255 / .10);
  --line: rgb(255 255 255 / .09);
  --acc-soft: color-mix(in oklab, var(--acc) 18%, transparent);
  --tile-shadow: 0 1px 2px rgb(0 0 0 / .25), 0 20px 44px -24px rgb(0 0 0 / .7);
  --lift-shadow: 0 2px 8px rgb(0 0 0 / .3), 0 40px 70px -26px rgb(0 0 0 / .85);
  --warn: #F2B169;
  --ok: #7FD3A6;
  --warn-soft: rgb(242 177 105 / .16);
  --ok-soft: rgb(127 211 166 / .14);
  --scrim: rgb(0 0 0 / .32);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; background: #DDE6E3; }
:root[data-theme="dark"] { background: #0C1214; }
body {
  margin: 0; min-height: 100%;
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg.i { width: 1em; height: 1em; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
mark { background: color-mix(in oklab, var(--acc) 20%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; white-space: nowrap; }
mark.w { background: var(--warn-soft); color: var(--warn); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* 取色跟随：这些元素在壁纸切换时按波前延迟各自过渡 */
.tint {
  transition: --acc var(--t-tint) var(--ease-out) var(--d, 0ms), --on-acc var(--t-tint) var(--ease-out) var(--d, 0ms),
    --ink var(--t-tint) var(--ease-out) var(--d, 0ms), --ink2 var(--t-tint) var(--ease-out) var(--d, 0ms),
    --ink3 var(--t-tint) var(--ease-out) var(--d, 0ms), --shade var(--t-tint) var(--ease-out) var(--d, 0ms),
    --glow var(--t-tint) var(--ease-out) var(--d, 0ms);
  color: var(--ink);
}
.no-tint .tint, .no-tint .tint * { transition: none !important; }

/* ---------- 壁纸 ---------- */
.wallpaper { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--wp-base, #E6EEEC); }
.wp-layer { position: absolute; inset: -4%; }
.wp-layer.revealing { -webkit-mask-image: radial-gradient(circle at var(--ox) var(--oy), #000 calc(var(--wr) - 160px), transparent var(--wr)); mask-image: radial-gradient(circle at var(--ox) var(--oy), #000 calc(var(--wr) - 160px), transparent var(--wr)); }
.wp-layer::after {
  /* 细颗粒：压掉大面积渐变的色带，并给玻璃一点「有东西可折射」的细节 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .22; mix-blend-mode: soft-light;
}

/* ---------- 布局 ---------- */
.app { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 28px 40px 32px; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s6); }
.hello .date { margin: 0; font-size: 13px; font-weight: 500; color: var(--ink2); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.hello h1 { margin: 2px 0 0; font-size: 30px; line-height: 40px; font-weight: 600; letter-spacing: -.01em; }
.hello .brief { margin: 4px 0 0; font-size: 15px; color: var(--ink2); }
.top-actions { display: flex; align-items: center; gap: var(--s2); padding-top: 6px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; font-size: 20px;
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-rim), var(--tile-shadow);
  color: var(--ink); transition: transform var(--t-fast) var(--ease-out), background var(--t-fast);
}
.icon-btn:hover { background: var(--glass-thick); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.plain { background: var(--fill); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.icon-btn.plain:hover { background: var(--fill-hover); }
.wp-dots { display: flex; }
.wp-dots i { width: 12px; height: 12px; border-radius: 50%; margin-left: -4px; box-shadow: 0 0 0 1.5px var(--glass-hi), inset 0 0 0 1px color-mix(in oklab, var(--ink) 16%, transparent); transition: background var(--t-tint) var(--ease-out); }
.wp-dots i:first-child { margin-left: 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center;
  background: var(--acc); color: var(--on-acc); font-weight: 600; font-size: 15px; margin-left: var(--s1);
}

/* 输入条：功能层玻璃，比模块厚一档 */
.ask {
  margin-top: var(--s5); max-width: 760px; height: 52px; display: flex; align-items: center; gap: var(--s1); padding: 0 6px;
  border-radius: 999px; background: var(--glass-thick); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-rim), var(--tile-shadow);
  transition: box-shadow var(--t-fast);
}
.ask:focus-within { box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--acc-line), 0 0 0 4px var(--acc-soft), var(--tile-shadow); }
.ask input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 15px; padding: 0 var(--s2); }
.ask input::placeholder { color: var(--ink3); }
.ask button { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; font-size: 20px; color: var(--ink2); transition: background var(--t-fast), transform var(--t-fast); }
.ask button:hover { background: var(--fill); }
.ask .ask-send { background: var(--acc); color: var(--on-acc); font-size: 18px; }
.ask .ask-send:hover { background: color-mix(in oklab, var(--acc) 88%, black); }
.ask button:active { transform: scale(.92); }

/* ---------- 桌面网格：4 列，行高 150 ---------- */
.grid {
  margin-top: var(--s6);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 150px; gap: 18px;
}

/* ---------- 模块：regular 玻璃 ---------- */
.tile {
  position: relative; border-radius: var(--r-tile); padding: 18px 20px; overflow: hidden;
  background: var(--glass-sheen), var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-rim), var(--tile-shadow);
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.tile.is-lift {
  z-index: 5; cursor: grabbing;
  background: var(--glass-sheen), color-mix(in oklab, var(--glass) 80%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--acc-line), var(--lift-shadow);
}
.tile.is-target { box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 2px var(--acc-line), var(--tile-shadow); }
.tile.can-open { cursor: pointer; }

.t-head { display: flex; align-items: center; gap: 8px; height: 20px; font-size: 13px; font-weight: 600; color: var(--ink2); flex: none; }
.t-head .ico { font-size: 17px; color: var(--acc); }
.t-head > span:nth-child(2) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-head .meta { margin-left: auto; font-weight: 500; font-size: 12px; color: var(--ink3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-head .more { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--acc); }
.t-head .more svg { font-size: 14px; }

.hero { display: flex; align-items: baseline; gap: 6px; }
.big { font-family: var(--font-num); font-size: 44px; line-height: 1; font-weight: 300; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.unit { font-size: 14px; font-weight: 500; color: var(--ink2); }
.sub { font-size: 13px; color: var(--ink2); line-height: 1.45; }
.sub b { color: var(--ink); font-weight: 600; }
.warn { color: var(--warn); }
.ok { color: var(--ok); }

/* 今日 2×2 */
.today-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); }
.today-hero .sub { margin-top: 6px; }
.today-sum { display: flex; gap: var(--s4); font-size: 12px; color: var(--ink3); padding-bottom: 2px; }
.today-sum b { display: block; font-family: var(--font-num); font-size: 20px; font-weight: 500; color: var(--ink); line-height: 1.1; }
.dayline { position: relative; height: 26px; border-radius: 9px; background: var(--fill); flex: none; }
.dayline .blk { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; background: color-mix(in oklab, var(--acc) 30%, transparent); }
.dayline .blk.focus { background: color-mix(in oklab, var(--acc) 8%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--acc) 55%, transparent); }
.dayline .now { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--ink); }
.dayline .now::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.dayline .hr { position: absolute; bottom: -17px; font-size: 10.5px; color: var(--ink3); transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.agenda { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.agenda li { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: var(--s3); height: 25px; font-size: 13px; }
.agenda .tm { font-variant-numeric: tabular-nums; color: var(--ink3); font-size: 12.5px; }
.agenda .tt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.agenda .tt small { color: var(--ink3); font-size: 12px; margin-left: 6px; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tag.acc { background: var(--acc-soft); color: color-mix(in oklab, var(--acc) 76%, var(--ink)); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.mute { background: var(--fill); color: var(--ink2); }

/* 待拍板 2×1 */
.ap-tile { display: grid; grid-template-columns: 92px 1fr; gap: var(--s4); align-items: center; flex: 1; min-height: 0; }
.ap-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ap-rows li { display: flex; align-items: center; gap: var(--s2); height: 26px; padding: 0 10px; border-radius: 9px; background: var(--fill); font-size: 13px; min-width: 0; }
.ap-rows li .ico { font-size: 15px; color: var(--acc); flex: none; }
.ap-rows li span.t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-rows li .w { color: var(--ink3); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }

/* 待办 1×2 */
.todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.todo li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); overflow: hidden; }
.todo li:first-child { border-top: 0; padding-top: 2px; }
.todo .ck { width: 20px; height: 20px; border-radius: 50%; margin-top: 1px; box-shadow: inset 0 0 0 1.6px color-mix(in oklab, var(--ink) 34%, transparent); display: grid; place-items: center; color: var(--on-acc); transition: background var(--t-fast), box-shadow var(--t-fast); }
.todo .ck svg { font-size: 13px; stroke-width: 2.4; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset 280ms var(--ease-out) 60ms; }
.todo .ck:hover { box-shadow: inset 0 0 0 1.6px var(--acc); }
.todo .tx { font-size: 13.5px; line-height: 1.4; color: var(--ink); min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color var(--t-fast); }
.todo .mt { font-size: 12px; color: var(--ink3); margin-top: 2px; }
.todo li.is-done .ck { background: var(--acc); box-shadow: none; }
.todo li.is-done .ck svg { stroke-dashoffset: 0; }
.todo li.is-done .tx { color: var(--ink3); text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--ink3) 70%, transparent); }
.add-row { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink3); padding-top: 4px; }
.add-row svg { font-size: 16px; }

/* 随手记 1×2 */
.note-main { font-size: 16px; line-height: 1.5; font-weight: 500; color: var(--ink); }
.note-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--ink3); }
.notes-more { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.notes-more li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 最近文件 2×1 */
.files { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.file { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; min-width: 0; height: 38px; }
.ext { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--fill); color: var(--acc); box-shadow: inset 0 0 0 1px var(--line); }
.file .nm { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .fm { font-size: 11.5px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 项目 2×1 */
.projects { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); flex: 1; }
.proj .pn { font-size: 15px; font-weight: 600; }
.proj .ps { font-size: 12px; color: var(--ink3); }
.segs { display: flex; gap: 4px; margin: 10px 0 6px; }
.segs i { flex: 1; height: 6px; border-radius: 3px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); }
.segs i.on { background: var(--acc); box-shadow: none; }
.segs i.late { background: var(--warn); box-shadow: none; }
.segs i.todo { background: color-mix(in oklab, var(--acc) 22%, transparent); box-shadow: none; }
.proj .pst { font-size: 12px; color: var(--ink2); }

/* 通用预览（模块库里用） */
.pv-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pv-rows li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; min-width: 0; }
.pv-rows li:first-child { border-top: 0; }
.pv-rows li span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-rows li span:last-child { color: var(--ink3); font-size: 12px; white-space: nowrap; }
.empty { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink3); padding: 10px 12px; border-radius: 12px; box-shadow: inset 0 0 0 1.2px var(--line); border: 0; }

/* ---------- 按钮 ---------- */
.btn {
  height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--fill); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-out), color var(--t-fast);
}
.btn:hover { background: var(--fill-hover); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--acc); color: var(--on-acc); box-shadow: 0 6px 16px -8px color-mix(in oklab, var(--acc) 80%, transparent); }
.btn.primary:hover { background: color-mix(in oklab, var(--acc) 88%, black); }
.btn.ghost { background: none; box-shadow: none; color: var(--ink2); }
.btn.ghost:hover { background: var(--fill); }
.btn[aria-busy="true"] { color: transparent; pointer-events: none; position: relative; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--on-acc); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---------- 壁纸选择 ---------- */
.wp-pop {
  position: fixed; z-index: 30; top: 76px; right: max(40px, calc((100vw - 1280px) / 2 + 40px)); width: 344px; padding: 16px;
  border-radius: 24px; background: var(--glass-thick); backdrop-filter: var(--blur-thick); -webkit-backdrop-filter: var(--blur-thick);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-rim), var(--lift-shadow);
  transform-origin: top right;
}
.wp-pop.is-in { animation: pop-in var(--t-spring) var(--spring) both; }
.wp-pop-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.wp-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wp-opt { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.wp-thumb { position: relative; height: 92px; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.wp-thumb > div { position: absolute; inset: 0; }
.wp-opt[aria-pressed="true"] .wp-thumb { box-shadow: 0 0 0 2px var(--glass-hi), 0 0 0 4px var(--acc); }
.wp-opt .nm { font-size: 13px; font-weight: 600; }
.wp-sw { display: flex; gap: 4px; }
.wp-sw i { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08); }
.wp-sw code { font: 500 11px/14px ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink3); margin-left: 2px; }
.wp-pop-note { margin: 12px 0 0; font-size: 12px; color: var(--ink3); line-height: 1.5; }

/* ---------- 模块库：底部滑出 ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); }
.scrim.is-in { animation: fade-in 240ms var(--ease-out) both; }
.library {
  position: fixed; z-index: 41; left: 50%; bottom: 16px; width: min(1120px, calc(100vw - 32px)); height: min(720px, calc(100dvh - 56px));
  translate: -50% 0; border-radius: var(--r-sheet); display: flex; flex-direction: column;
  background: var(--glass-thick); backdrop-filter: var(--blur-thick); -webkit-backdrop-filter: var(--blur-thick);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-rim), var(--lift-shadow);
}
.library.is-in { animation: sheet-up var(--t-spring) var(--spring) both; }
.library.is-out { animation: sheet-down 260ms var(--ease-out) both; }
.lib-grab { width: 40px; height: 5px; border-radius: 3px; background: color-mix(in oklab, var(--ink) 18%, transparent); margin: 10px auto 0; flex: none; }
.lib-head { display: flex; align-items: center; gap: var(--s4); padding: 12px 28px 18px; flex: none; }
.lib-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.lib-sub { margin: 2px 0 0; font-size: 13px; color: var(--ink3); }
.lib-search { margin-left: auto; display: flex; align-items: center; gap: 8px; height: 40px; width: 280px; padding: 0 14px; border-radius: 999px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink3); font-size: 18px; }
.lib-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; color: var(--ink); }
.lib-search input::placeholder { color: var(--ink3); }
.lib-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 540px; gap: var(--s6); padding: 0 28px 28px; }
.lib-folders { overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-content: start; padding: 4px; margin: -4px; }
.folder { display: flex; flex-direction: column; gap: 8px; }
.folder-box { padding: 12px; border-radius: 24px; background: var(--fill); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.folder-name { font-size: 13px; font-weight: 600; color: var(--ink2); padding-left: 6px; }
.folder-name span { color: var(--ink3); font-weight: 500; margin-left: 4px; }
.mod {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px;
  height: 84px; padding: 10px 12px; border-radius: 16px; text-align: left;
  background: var(--fill);
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast);
}
.mod:hover { transform: translateY(-2px); background: var(--fill-hover); }
.mod:active { transform: scale(.97); }
.mod .ico { font-size: 22px; color: var(--acc); }
.mod .nm { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.mod .on-desk { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 2px var(--glass-hi); }
.mod[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--acc); }
.mod.is-hidden { opacity: .25; }

.lib-detail { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: auto; padding: 20px; border-radius: 24px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); }
.ld-name { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; }
.ld-name .ico { font-size: 24px; color: var(--acc); }
.ld-desc { margin: 0; font-size: 13.5px; color: var(--ink2); line-height: 1.55; }
.sizes { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); align-self: flex-start; }
.sizes button { height: 30px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink2); font-variant-numeric: tabular-nums; transition: background var(--t-fast), color var(--t-fast); }
.sizes button[aria-pressed="true"] { background: var(--glass-thick); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
:root[data-theme="dark"] .sizes button[aria-pressed="true"] { background: rgb(255 255 255 / .14); }
.ld-stage { position: relative; flex: 1; display: grid; place-items: center; padding: 18px; border-radius: 18px; min-height: 196px; overflow: hidden; }
.ld-stage .stage-bg { position: absolute; inset: 0; }
.ld-stage .tile { position: relative; width: var(--pw); height: var(--ph); }
.ld-actions { display: flex; gap: var(--s2); margin-top: auto; }
.ld-actions .btn { flex: 1; height: 42px; }

/* ---------- 展开整页：待拍板 ---------- */
.page { position: fixed; inset: 16px; z-index: 45; border-radius: var(--r-sheet); overflow: hidden;
  background: var(--glass-thick); backdrop-filter: var(--blur-thick); -webkit-backdrop-filter: var(--blur-thick);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-rim), var(--lift-shadow); }
.page-inner { height: 100%; overflow: auto; padding: 24px 40px 40px; max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: var(--s4); }
.page-title { flex: 1; min-width: 0; }
.page-title h2 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.page-title .count { line-height: 1; display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--acc); color: var(--on-acc); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.page-title .count.bump { animation: bump 420ms var(--spring); }
.page-title p { margin: 2px 0 0; color: var(--ink2); font-size: 14px; }
.page-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; margin-top: 28px; align-items: start; }
.ap-list { display: flex; flex-direction: column; gap: 14px; }
.ap {
  border-radius: 22px; padding: 20px 22px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line);
  display: flex; flex-direction: column; gap: 12px; overflow: hidden;
}
.ap-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink3); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; background: var(--acc-soft); color: color-mix(in oklab, var(--acc) 76%, var(--ink)); font-weight: 600; font-size: 12px; }
.chip svg { font-size: 14px; }
.ap h3 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; }
.ap-fields { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; }
.ap-fields div { display: flex; gap: 8px; font-size: 13.5px; }
.ap-fields dt { color: var(--ink3); }
.ap-fields dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.basis { margin: 0; padding: 10px 14px; border-radius: 14px; background: color-mix(in oklab, var(--glow) 55%, transparent); font-size: 13.5px; line-height: 1.6; color: var(--ink2); }
:root[data-theme="dark"] .basis { background: rgb(255 255 255 / .05); }
.basis b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.ap-actions { display: flex; gap: var(--s2); }
.ap-done { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.ap-done .okc { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--acc); color: var(--on-acc); font-size: 15px; flex: none; }
.ap-done .okc svg { stroke-width: 2.6; }
.ap-done .okc.pop { animation: pop var(--t-spring) var(--spring) both; }
.ap-done .w { color: var(--ink3); font-size: 13px; }
.ap-done .btn { margin-left: auto; height: 30px; font-size: 13px; }
.ap.is-done { padding-top: 14px; padding-bottom: 14px; }
.ap.is-gone { opacity: .55; }

.ap-side { position: sticky; top: 0; border-radius: 22px; padding: 18px 20px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); }
.side-title { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.dayview { position: relative; height: 432px; margin-left: 44px; }
.dayview .hl { position: absolute; left: -44px; right: 0; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.dayview .hl span { position: absolute; top: -9px; left: 0; width: 36px; }
.dayview .ev { position: absolute; left: 4px; right: 0; border-radius: 10px; padding: 4px 10px; font-size: 12.5px; line-height: 1.35; overflow: hidden;
  background: color-mix(in oklab, var(--acc) 22%, transparent); color: var(--ink); box-shadow: inset 3px 0 0 var(--acc); transition: background 400ms var(--ease-out), box-shadow 400ms var(--ease-out); }
.dayview .ev small { display: block; color: var(--ink2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.dayview .ev.ghost { background: color-mix(in oklab, var(--acc) 6%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--acc) 50%, transparent); color: var(--ink2); }
.dayview .ev.ghost::after { content: "待拍板"; position: absolute; right: 8px; top: 5px; font-size: 11px; font-weight: 600; color: var(--acc); }
.dayview .ev.solid { animation: settle var(--t-spring) var(--spring); }
.dayview .ev.gone { opacity: 0; transition: opacity 300ms; }
.dayview .nowl { position: absolute; left: -6px; right: 0; height: 2px; background: var(--ink); border-radius: 2px; }
.dayview .nowl::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: 28px; translate: -50% 0; display: none; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 8px 0 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--glass-thick); backdrop-filter: var(--blur-thick); -webkit-backdrop-filter: var(--blur-thick);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-rim), var(--lift-shadow);
}
.toast.is-in { display: flex; animation: toast-in var(--t-spring) var(--spring) both; }
.toast.is-out { display: flex; animation: toast-out 220ms var(--ease-out) both; }
.toast .btn { height: 32px; font-size: 13px; }
.toast .tk { color: var(--acc); font-size: 18px; }

/* ---------- 样张控制（非产品界面） ---------- */
.sample { position: fixed; z-index: 70; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 14px;
  background: rgb(20 22 24 / .86); color: #F2F4F5; font-size: 12px; box-shadow: 0 8px 24px rgb(0 0 0 / .25); }
.sample-toggle { height: 28px; padding: 0 10px; border-radius: 9px; font-weight: 600; color: #F2F4F5; background: rgb(255 255 255 / .1); }
.sample-body { display: flex; gap: 8px; }
.seg { display: flex; padding: 2px; border-radius: 9px; background: rgb(255 255 255 / .08); }
.seg button { height: 26px; padding: 0 9px; border-radius: 7px; color: #C9CED1; font-weight: 500; }
.seg button[aria-pressed="true"] { background: #F2F4F5; color: #141618; }

/* ---------- 动效 ---------- */
.tile.enter { animation: rise 620ms var(--spring) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms); }
.collapse { animation: collapse 380ms var(--ease-out) forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.92) translateY(-6px); } }
@keyframes sheet-up { from { transform: translateY(105%); } }
@keyframes sheet-down { to { transform: translateY(105%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes pop { from { transform: scale(.4); } }
@keyframes bump { 40% { transform: scale(1.18); } }
@keyframes settle { from { transform: scale(.96); } }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes collapse { to { opacity: 0; transform: translateX(10px); } }

/* ---------- 手机 ---------- */
@media (max-width: 720px) {
  .app { padding: 18px 16px 96px; }
  .hello h1 { font-size: 26px; line-height: 34px; }
  .hello .brief { font-size: 14px; }
  .top-actions { padding-top: 0; }
  .top-actions .avatar { display: none; }
  .ask { margin-top: var(--s4); height: 50px; }
  .grid { margin-top: var(--s4); grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; gap: 12px; grid-auto-flow: row dense; }
  .grid .tile { grid-column: auto / span 1 !important; grid-row: auto / span 1 !important; }
  .grid .tile[data-w="2"] { grid-column: auto / span 2 !important; }
  .grid .tile[data-h="2"] { grid-row: auto / span 2 !important; }
  .tile { padding: 16px; border-radius: 22px; }
  .big { font-size: 38px; }
  .today-sum { display: none; }
  .ap-tile { grid-template-columns: 64px 1fr; gap: var(--s3); }
  .tile:not([data-w="2"]) .t-head .meta { display: none; }
  .files { grid-template-columns: 1fr; }
  .files .file:nth-child(n + 3) { display: none; }
  .projects { gap: var(--s4); }
  .wp-pop { top: 64px; right: 16px; left: 16px; width: auto; }
  .library { bottom: 0; width: 100vw; height: calc(100dvh - 40px); border-radius: 28px 28px 0 0; }
  .lib-head { flex-wrap: wrap; padding: 10px 20px 14px; }
  .lib-search { order: 3; width: 100%; margin-left: 0; }
  .lib-head .icon-btn { margin-left: auto; }
  .lib-body { display: flex; flex-direction: column-reverse; justify-content: flex-end; overflow: auto; padding: 0 20px 24px; gap: 18px; }
  .lib-folders { grid-template-columns: 1fr; overflow: visible; gap: 14px; }
  .folder-box { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px; border-radius: 20px; }
  .mod { height: 76px; padding: 9px 10px; border-radius: 14px; }
  .ld-stage { flex: none; }
  .todo li:nth-child(n + 4), .tile[data-id="todos"] .add-row { display: none; }
  .lib-detail { overflow: visible; flex: none; padding: 16px; }
  .ld-stage { padding: 10px; }
  .page { inset: 0; border-radius: 0; }
  .page-inner { padding: 16px 16px 32px; }
  .page-head { flex-wrap: wrap; }
  .page-head #apAll { order: 3; width: 100%; }
  .page-title h2 { font-size: 24px; }
  .page-body { grid-template-columns: 1fr; margin-top: 18px; }
  .ap-side { display: none; }
  .ap { padding: 16px; }
  .ap-actions .btn { flex: 1; padding: 0 10px; }
  .sample { right: 8px; bottom: 8px; left: auto; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100vw - 16px); }
  .sample:not(.is-open) .sample-body { display: none; }
  .sample-body { flex-wrap: wrap; justify-content: flex-end; }
}
@media (min-width: 721px) {
  .sample-toggle { display: none; }
}

/* ---------- 降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 120ms !important; transition-delay: 0ms !important; }
  .btn[aria-busy="true"]::after { animation: none; border-right-color: var(--on-acc); border-bottom-color: transparent; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: color-mix(in oklab, var(--glow) 92%, white); --glass-thick: color-mix(in oklab, var(--glow) 96%, white); }
  :root[data-theme="dark"] { --glass: #1A2124; --glass-thick: #1D2528; }
  .tile, .ask, .icon-btn, .library, .page, .toast, .wp-pop { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}
