/* Pane 网页版（/app/）的样式（设计，2026-11-29）。
 * 定稿原型 prototype/web-sync.html；风格照账号中心（site/assets/site.css 的玻璃和光斑背景，字体 Segoe UI / 苹方）。
 * 令牌来自 ../assets/tokens.css。宽屏左侧导航 + 内容，窄屏（< 720）底部标签栏，可加到主屏幕。
 * 安全策略：页面里不写 <style>、不写 style="…"；动态的颜色（标签色点）走 .tc1～.tc6 类，颜色条目的色块由脚本经 CSSOM 设置。 */

:root {
  --font-ui: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --bg-base: #eef0f6; --orb-opacity: 0.55; --grain: 0.05;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
:root[data-theme="dark"] { --bg-base: #0d1020; --orb-opacity: 0.32; --grain: 0.07; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg-base: #0d1020; --orb-opacity: 0.32; --grain: 0.07; } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-3) 45%, transparent) transparent; }
body { height: 100vh; height: 100dvh; overflow: hidden; font-family: var(--font-ui); font-size: var(--text-md); line-height: 1.6; color: var(--text-1);
  background: var(--bg-base); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg.i { width: 16px; height: 16px; flex: none; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

.root { position: relative; z-index: 1; height: 100%; }

/* ---------- 背景光斑（同官网，慢慢漂移） ---------- */
.wall { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--bg-base); pointer-events: none; }
.wall i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: var(--orb-opacity); will-change: transform; animation: orb 46s var(--ease-smooth) infinite alternate; }
.wall i:nth-child(1) { width: 62vmax; height: 62vmax; left: -18vmax; top: -24vmax; background: radial-gradient(circle at 40% 40%, #7f97e0, transparent 68%); }
.wall i:nth-child(2) { width: 52vmax; height: 52vmax; right: -16vmax; top: -10vmax; background: radial-gradient(circle, #c98aa6, transparent 66%); animation-duration: 58s; animation-delay: -12s; }
.wall i:nth-child(3) { width: 58vmax; height: 58vmax; left: 18vmax; bottom: -34vmax; background: radial-gradient(circle, #6fc2b8, transparent 64%); animation-duration: 64s; animation-delay: -30s; }
.wall i:nth-child(4) { width: 34vmax; height: 34vmax; right: 8vmax; bottom: 6vmax; background: radial-gradient(circle, #e7b57a, transparent 66%); animation-duration: 52s; animation-delay: -20s; opacity: calc(var(--orb-opacity) * 0.7); }
.wall::after { content: ""; position: absolute; inset: 0; opacity: var(--grain);
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes orb { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(6vmax, 4vmax, 0) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .wall i { animation: none; } }

/* ---------- 玻璃 ---------- */
.glass { position: relative; border-radius: var(--radius-panel);
  background-color: color-mix(in srgb, var(--luminosity) calc(var(--glass-lum-opacity) * 100%), transparent);
  background-image: linear-gradient(color-mix(in srgb, var(--tint) calc(var(--glass-tint-opacity) * 100%), transparent), color-mix(in srgb, var(--tint) calc(var(--glass-tint-opacity) * 100%), transparent));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation)); backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  box-shadow: inset 0 1px 0 var(--edge-light), 0 0 0 1px var(--edge-outer), 0 8px 32px rgb(var(--shadow-color) / calc(0.10 * var(--glass-shadow))); }

/* 标签色点：1～6 是 --tag-N，没有颜色是第三级文字色 */
.tc0 { --dot: var(--text-3); } .tc1 { --dot: var(--tag-1); } .tc2 { --dot: var(--tag-2); }
.tc3 { --dot: var(--tag-3); } .tc4 { --dot: var(--tag-4); } .tc5 { --dot: var(--tag-5); } .tc6 { --dot: var(--tag-6); }
.dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--text-3)); }

/* ---------- 按钮、键帽、分段 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-sm); padding: 0 12px; border: 0; border-radius: var(--radius-control);
  font-size: var(--text-sm); background: var(--fill-control); box-shadow: inset 0 0 0 1px var(--stroke); color: var(--text-1); white-space: nowrap; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-smooth), color var(--dur-fast), transform var(--dur-fast) var(--ease-smooth), opacity var(--dur-fast); }
.btn:hover { background: var(--fill-hover); }
.btn:active { transform: scale(var(--press-scale-button)); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: none; font-weight: 600; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn.primary.danger { background: var(--danger); color: #fff; }
.btn.md { height: var(--control-md); }
.btn.lg { height: var(--control-lg); font-size: var(--text-md); }
.btn:disabled, .btn[aria-busy="true"] { opacity: 0.45; cursor: default; pointer-events: none; }
.btn.ghost { background: none; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--fill-hover); color: var(--text-1); }
.btn.icon { width: var(--control-sm); padding: 0; }
.btn.icon:active { transform: scale(var(--press-scale-icon)); }
.btn.icon.on { color: var(--accent); background: var(--fill-selected); }
.kbd { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 5px; font-size: 11px; line-height: 18px; text-align: center; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--stroke); font-family: var(--font-ui); }
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--fill-control); box-shadow: inset 0 0 0 1px var(--stroke); }
.seg button { height: var(--control-xs); padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-size: var(--text-sm); color: var(--text-2); }
.seg button:hover { color: var(--text-1); }
.seg button[aria-pressed="true"] { background: var(--fill-selected); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--stroke); font-weight: 600; }
a.link, button.link { padding: 0; border: 0; background: none; color: var(--accent); text-decoration: none; font-size: var(--text-sm); }
a.link:hover, button.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 外框：宽屏左侧导航 + 内容 ---------- */
.shell { position: relative; z-index: 1; height: 100%; display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 16px; padding: 16px; max-width: 1440px; margin: 0 auto; }
.side { display: flex; flex-direction: column; min-height: 0; padding: 12px; }
.brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 12px; font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand small { font-size: var(--text-xs); font-weight: 600; color: var(--accent); padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.side nav { display: grid; gap: 2px; }
.side nav a, .side nav button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: var(--radius-item); background: none;
  text-decoration: none; font-size: var(--text-sm); color: var(--text-2); text-align: left; transition: background var(--dur-fast), color var(--dur-fast); }
.side nav a:hover, .side nav button:hover { background: var(--fill-hover); color: var(--text-1); }
.side nav [aria-current="true"] { background: var(--fill-selected); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--stroke); }
.side nav .n { margin-left: auto; font-size: var(--text-xs); color: var(--text-3); }
.side nav .ext { width: 12px; height: 12px; margin-left: auto; color: var(--text-3); }
.side .grow { flex: 1; }
.status { display: flex; align-items: center; gap: 6px; padding: 6px 10px 4px; font-size: var(--text-xs); color: var(--text-3); }
.status i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent); }
.status.syncing i { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); animation: pulse 1.2s var(--ease-smooth) infinite; }
.status.off i { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 18%, transparent); }
.status.err i { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
@keyframes pulse { 50% { opacity: 0.35; } }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--stroke); }
.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #7f97e0, var(--accent)); color: #fff; font-weight: 600; overflow: hidden; }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }
.me .who { flex: 1; min-width: 0; font-size: var(--text-xs); color: var(--text-3); line-height: 1.4; }
.me .who b { display: block; font-size: var(--text-sm); color: var(--text-1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .dev { display: flex; align-items: center; gap: 4px; max-width: 100%; padding: 0; border: 0; background: none; color: inherit; font-size: inherit; text-align: left; }
.me .dev span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .dev svg { width: 11px; height: 11px; }
.me .dev:hover { color: var(--text-1); }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.main > .glass { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
.head h1 { margin: 0; font-family: var(--font-display); font-size: var(--text-title); font-weight: 650; }
.head .sp { flex: 1; }
.search { position: relative; width: 260px; }
.search > svg { position: absolute; left: 10px; top: 50%; translate: 0 -50%; width: 14px; height: 14px; color: var(--text-3); pointer-events: none; }
.search input { width: 100%; height: var(--control-md); padding: 0 30px 0 30px; border: 0; border-radius: var(--radius-control); outline: none; background: var(--fill-control);
  box-shadow: inset 0 0 0 1px var(--stroke); font-size: var(--text-sm); }
.search input::placeholder { color: var(--text-3); }
.search input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.search input::-webkit-search-cancel-button { display: none; }
.search .x { position: absolute; right: 4px; top: 50%; translate: 0 -50%; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-3); }
.search .x:hover { color: var(--text-1); background: var(--fill-hover); }
.search .x svg { width: 13px; height: 13px; }

/* 只读（没有订阅）、离线横条 */
.banner { display: flex; align-items: center; gap: 10px; margin: 0 18px 10px; padding: 8px 10px 8px 12px; border-radius: 12px; font-size: var(--text-sm);
  background: color-mix(in srgb, var(--warning) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 32%, transparent); }
.banner > svg { color: var(--warning); }
.banner span { flex: 1; min-width: 0; }

/* ---------- 发到电脑 ---------- */
.compose { margin: 0 18px 10px; padding: 10px; border-radius: 14px; background: var(--fill-control); box-shadow: inset 0 0 0 1px var(--stroke); transition: box-shadow var(--dur-fast); }
.compose:focus-within { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--stroke)); }
.compose.drag { box-shadow: inset 0 0 0 1.5px var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--fill-control)); }
.compose textarea { display: block; width: 100%; min-height: 44px; max-height: 120px; padding: 4px 6px; border: 0; outline: none; resize: none; background: none; font-size: var(--text-md); line-height: 1.6; field-sizing: content; }
.compose textarea::placeholder { color: var(--text-3); }
.compose .bar { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.compose .bar .hint { flex: 1; font-size: var(--text-xs); color: var(--text-3); }
.compose .att { display: flex; align-items: center; gap: 8px; margin: 2px 6px 6px; font-size: var(--text-sm); color: var(--text-2); }
.compose .att img { width: 56px; height: 40px; flex: none; object-fit: cover; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--stroke); }
.compose .att span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose.busy { opacity: 0.7; pointer-events: none; }

/* ---------- 筛选 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 0; border-radius: 13px; background: transparent; box-shadow: inset 0 0 0 1px var(--stroke);
  font-size: var(--text-xs); color: var(--text-2); white-space: nowrap; transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast); }
.chip:hover { color: var(--text-1); background: var(--fill-hover); }
.chip[aria-pressed="true"] { color: var(--text-1); background: var(--fill-selected); box-shadow: inset 0 0 0 1px var(--accent); }
.chip svg { width: 12px; height: 12px; }
.chip-sep { flex: none; width: 1px; margin: 4px 2px; background: var(--stroke); }

/* ---------- 剪贴板列表 ---------- */
.list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 12px; scrollbar-width: thin; overscroll-behavior: contain; }
.label { padding: 8px 10px 4px; font-size: var(--text-xs); color: var(--text-3); }
.empty-list { padding: 40px 16px; text-align: center; font-size: var(--text-sm); color: var(--text-3); }
.empty-list svg { display: block; width: 28px; height: 28px; margin: 0 auto 8px; opacity: 0.6; }
.more-row { padding: 10px; text-align: center; font-size: var(--text-xs); color: var(--text-3); }
.item { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 2px 10px; align-items: start; padding: 9px 10px; border-radius: var(--radius-item); cursor: default;
  transition: background var(--dur-fast); }
.item:hover { background: var(--fill-hover); }
.item.sel { background: var(--fill-selected); box-shadow: inset 0 0 0 1px var(--stroke); }
.item .k { grid-row: span 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--fill-control); box-shadow: inset 0 0 0 1px var(--stroke); color: var(--text-2); }
.item .k svg { width: 15px; height: 15px; }
.item .k.swatch { box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12); }
.item .t { min-width: 0; font-size: var(--text-md); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; overflow-wrap: anywhere; white-space: pre-line; }
.item .t.mono { font-family: var(--font-mono); font-size: 13px; white-space: pre; display: block; max-height: 3em; text-overflow: ellipsis; }
.item .t.link { color: var(--accent); }
.item .m { grid-column: 2; display: flex; align-items: center; gap: 4px; min-width: 0; font-size: var(--text-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; }
.item .m svg { width: 11px; height: 11px; }
.item .m .tg { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; }
.item .m .tg .dot { width: 6px; height: 6px; }
.item .m .open { margin-left: 6px; color: var(--accent); text-decoration: none; }
.item .m .open:hover { text-decoration: underline; }
.item .ops { grid-row: span 2; display: flex; gap: 2px; opacity: 0; transition: opacity var(--dur-fast); }
.item:hover .ops, .item.sel .ops, .item:focus-within .ops { opacity: 1; }
.item .pin { position: absolute; right: 12px; top: 10px; width: 12px; height: 12px; color: var(--text-3); }
.item:hover .pin, .item.sel .pin, .item:focus-within .pin { display: none; }
.item .more { display: none; }
.thumb-btn { display: block; padding: 0; border: 0; background: none; border-radius: 8px; cursor: zoom-in; }
.item .thumb { display: block; width: 200px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--stroke); background: var(--fill-control); }
.item .sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--text-xs); color: var(--warning); }
.item .sub svg { width: 12px; height: 12px; }
.item.flash { animation: flash 900ms var(--ease-smooth); }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 16%, transparent); } }
.foot { display: flex; align-items: center; gap: 14px; padding: 8px 18px; border-top: 1px solid var(--stroke); font-size: var(--text-xs); color: var(--text-3); }
.foot .sp { flex: 1; }
.foot .kbd { margin-right: 4px; }

/* 剪贴板条目原地编辑（同电脑原型） */
.item.editing { background: var(--fill-selected); box-shadow: inset 0 0 0 1px var(--stroke); }
.item .edit { grid-column: 2 / -1; }
.item .edit textarea, .page-edit textarea { width: 100%; min-height: 72px; max-height: 240px; padding: 8px 10px; border: 0; border-radius: var(--radius-control); outline: none; resize: vertical;
  background: var(--fill-control); box-shadow: inset 0 0 0 1.5px var(--accent); font-size: var(--text-md); line-height: 1.6; }
.item .edit .row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.item .edit .row .note, .page-edit .note { flex: 1; font-size: var(--text-xs); color: var(--text-3); }
.item .edit .row .note.warn, .page-edit .note.warn { color: var(--warning); }

/* ---------- 备忘录：列表 + 编辑 ---------- */
.memo { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr); border-top: 1px solid var(--stroke); }
.memo .mlist { min-height: 0; overflow-y: auto; padding: 8px; border-right: 1px solid var(--stroke); scrollbar-width: thin; overscroll-behavior: contain; }
.note-row { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-item); background: none; text-align: left; cursor: default; transition: background var(--dur-fast); }
.note-row:hover { background: var(--fill-hover); }
.note-row.sel { background: var(--fill-selected); box-shadow: inset 0 0 0 1px var(--stroke); }
.note-row .r1 { display: flex; align-items: center; gap: 8px; }
.note-row .tt { flex: 1; min-width: 0; font-size: var(--text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-row .tt.untitled { color: var(--text-3); font-weight: 500; }
.note-row .r1 svg { width: 12px; height: 12px; color: var(--text-3); }
.note-row .w { font-size: var(--text-xs); color: var(--text-3); white-space: nowrap; }
.note-row .p { font-size: var(--text-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-row .p .from { color: var(--warning); }
.note-row .p .tg { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; }
.note-row .p .tg .dot { width: 6px; height: 6px; }
.memo .ed { min-width: 0; min-height: 0; display: grid; grid-template-rows: 44px minmax(0, 1fr); }
.memo .ed.blank { display: grid; place-items: center; grid-template-rows: none; font-size: var(--text-sm); color: var(--text-3); }
.memo .ebar { display: flex; align-items: center; gap: 4px; padding: 0 12px 0 20px; min-width: 0; }
.memo .ebar .mt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; }
.memo .ebar .back { display: none; padding: 0 8px 0 2px; }
.memo .ebar .back svg { rotate: 180deg; }
.tagc { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--stroke); font-size: 11px; color: var(--text-2); }
.tagc .dot { width: 6px; height: 6px; }
.fromc { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11px; color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.fromc svg { width: 11px; height: 11px; }
.memo .ed-body { min-height: 0; display: flex; flex-direction: column; }
.memo .etags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 8px; }
.memo .etags:empty { display: none; }
.memo .ed-body > textarea, .memo .ed-body > .md { flex: 1; min-height: 0; }
.memo textarea { width: 100%; height: 100%; padding: 4px 20px 20px; border: 0; outline: none; resize: none; background: none; font-size: var(--text-md); line-height: 1.75; }
.memo textarea::placeholder { color: var(--text-3); }
.memo textarea[readonly] { cursor: default; }
.memo .md { overflow-y: auto; padding: 4px 20px 20px; line-height: 1.75; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { margin: 4px 0 6px; font-size: var(--text-lg); } .md h2, .md h3 { font-size: var(--text-md); }
.md p { margin: 0 0 8px; } .md ul { margin: 0 0 8px; padding-left: 20px; }
.md li.task { list-style: none; margin-left: -20px; } .md li.task input { margin: 0 6px 0 0; accent-color: var(--accent); vertical-align: -2px; }
.md code { font-family: var(--font-mono); font-size: 13px; padding: 0 4px; border-radius: 4px; background: var(--fill-control); }

/* ---------- 账号页（窄屏底部「账号」） ---------- */
.acct { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 24px; }
.acct .card { margin-bottom: 14px; padding: 4px 0; border-radius: 16px; background: var(--fill-control); box-shadow: inset 0 0 0 1px var(--stroke); }
.acct .who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.acct .who b { display: block; font-size: var(--text-md); }
.acct .who small { display: block; font-size: var(--text-xs); color: var(--text-3); }
.acct .row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 14px; border: 0; border-top: 1px solid var(--stroke); background: none; text-align: left; text-decoration: none; font-size: var(--text-md); }
.acct .card > .row:first-child { border-top: 0; }
.acct .row > svg { color: var(--text-2); }
.acct .row span { flex: 1; min-width: 0; }
.acct .row em { font-style: normal; font-size: var(--text-sm); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.acct .row .status { flex: none; width: 16px; padding: 0; justify-content: center; }
.acct .row .chev { width: 14px; height: 14px; color: var(--text-3); }
.acct .row.danger, .acct .row.danger > svg { color: var(--danger); }
.acct .row:active { background: var(--fill-hover); }
.acct .ver { padding: 4px 14px; font-size: var(--text-xs); color: var(--text-3); line-height: 1.6; }

/* ---------- 登录、解锁、没有订阅、设备上限：居中卡片 ---------- */
.center { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; padding: calc(20px + var(--safe-t)) 20px calc(20px + var(--safe-b)); overflow-y: auto; }
.auth { width: 100%; max-width: 380px; padding: 28px 28px 22px; border-radius: 24px; animation: auth-in 520ms var(--ease-spring) backwards; }
@keyframes auth-in { from { opacity: 0; transform: translateY(10px) scale(0.985); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .auth { animation: none; } }
.auth .hd { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 18px; text-align: center; }
.auth .hd img { width: 44px; height: 44px; border-radius: 12px; }
.auth .hd h1 { margin: 6px 0 0; font-family: var(--font-display); font-size: var(--text-title); font-weight: 650; line-height: 1.3; }
.auth .hd p { margin: 0; font-size: var(--text-sm); color: var(--text-2); overflow-wrap: anywhere; }
.fld { display: grid; gap: 4px; margin-bottom: 10px; font-size: var(--text-sm); color: var(--text-2); }
.fld input { width: 100%; height: var(--control-md); padding: 0 10px; border: 0; border-radius: var(--radius-control); outline: none; background: var(--fill-control); box-shadow: inset 0 0 0 1px var(--stroke); font-size: var(--text-md); color: var(--text-1); }
.fld input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.fld input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 60%, transparent); }
.fld small { font-size: var(--text-xs); color: var(--text-3); line-height: 1.5; }
.pw { position: relative; }
.pw input { padding-right: 36px; }
.pw .eye { position: absolute; right: 2px; top: 2px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); display: grid; place-items: center; }
.pw .eye:hover { color: var(--text-1); background: var(--fill-hover); }
.pw .eye svg { width: 15px; height: 15px; }
.turnstile { min-height: 65px; margin: 4px 0 12px; display: flex; justify-content: center; }
.turnstile:empty { display: none; }
.err { margin: -2px 0 10px; font-size: var(--text-sm); color: var(--danger); line-height: 1.5; }
.err:empty { display: none; }
.auth .btn.lg { width: 100%; }
.auth .links { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.auth .links.center-one { justify-content: center; }
.auth .safe { display: flex; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; font-size: var(--text-xs); line-height: 1.6; color: var(--text-2); background: var(--fill-control); }
.auth .safe svg { width: 14px; height: 14px; color: var(--accent); margin-top: 2px; }
.empty { text-align: center; }
.empty .ic { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--fill-control); box-shadow: inset 0 0 0 1px var(--stroke); color: var(--text-2); }
.empty .ic svg { width: 22px; height: 22px; }
.empty h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.4; }
.empty p { margin: 0 0 16px; font-size: var(--text-sm); color: var(--text-2); }
.loading { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; font-size: var(--text-sm); color: var(--text-3); }
.loading > div { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.loading img { width: 40px; height: 40px; border-radius: 11px; animation: breathe 1.6s var(--ease-smooth) infinite; }
@keyframes breathe { 50% { opacity: 0.55; transform: scale(0.96); } }
/* 设备上限：列出设备选一台移除 */
.devs { display: grid; gap: 6px; margin: 0 0 12px; }
.devs .dv { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--fill-control); box-shadow: inset 0 0 0 1px var(--stroke); }
.devs .dv > svg { color: var(--text-2); }
.devs .dv span { flex: 1; min-width: 0; font-size: var(--text-sm); line-height: 1.4; }
.devs .dv span small { display: block; font-size: var(--text-xs); color: var(--text-3); }
.devs .dv b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 浮层：菜单、底部操作表、对话框、标签管理、看大图、窄屏编辑页 ---------- */
.menu { position: fixed; z-index: 45; width: 232px; max-height: min(420px, calc(100dvh - 24px)); overflow-y: auto; padding: 6px; border-radius: 14px; animation: pop var(--dur-normal) var(--ease-spring) backwards; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(var(--enter-scale)); } }
.menu.on-scrim { z-index: 61; }
.menu h4 { margin: 6px 8px 4px; font-size: var(--text-xs); color: var(--text-3); font-weight: 600; }
.menu button.opt { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: none; font-size: var(--text-sm); text-align: left; }
.menu button.opt:hover, .menu button.opt.hl { background: var(--fill-hover); }
.menu button.opt .dot { width: 8px; height: 8px; }
.menu button.opt .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu button.opt .ck { width: 14px; height: 14px; color: var(--accent); }
.menu button.opt.new { color: var(--accent); } .menu button.opt.new svg { width: 13px; height: 13px; }
.menu button.opt .from { font-size: 11px; color: var(--text-3); }
.menu button.opt.danger { color: var(--danger); }
.menu button.opt > svg { width: 15px; height: 15px; color: var(--text-2); }
.menu button.opt.danger > svg { color: var(--danger); }
.menu p { margin: 6px 8px 4px; font-size: var(--text-xs); color: var(--text-3); line-height: 1.5; }
.menu .tin { display: flex; align-items: center; gap: 6px; height: 30px; margin: 2px 2px 4px; padding: 0 8px; border-radius: 8px; background: var(--fill-control); box-shadow: inset 0 0 0 1px var(--stroke); }
.menu .tin svg { width: 13px; height: 13px; color: var(--text-3); }
.menu .tin input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: var(--text-sm); }
.menu .sep { height: 1px; margin: 4px 6px; background: var(--stroke); }
.menu .sheet-hd { display: none; }

.scrim { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); background: rgb(0 0 0 / 0.22); animation: fade var(--dur-normal) var(--ease-smooth) backwards; }
.scrim.clear { background: transparent; }
@keyframes fade { from { opacity: 0; } }
.dialog { width: 100%; max-width: 380px; padding: 20px; border-radius: 20px; animation: pop var(--dur-normal) var(--ease-spring) backwards; }
.dialog h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.4; overflow-wrap: anywhere; }
.dialog p { margin: 0 0 14px; font-size: var(--text-sm); color: var(--text-2); }
.dialog .fld { margin-bottom: 4px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.tagman { width: 100%; max-width: 460px; max-height: 100%; display: flex; flex-direction: column; padding: 16px; border-radius: 20px; animation: pop var(--dur-normal) var(--ease-spring) backwards; }
.tagman .hd { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tagman .hd h2 { flex: 1; margin: 0; font-family: var(--font-display); font-size: var(--text-lg); }
.tagman .rows { min-height: 0; overflow-y: auto; }
.tagman .tr { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px; border-bottom: 1px solid var(--stroke); }
.tagman .tr:last-child { border-bottom: 0; }
.tagman .tr input { flex: 1; min-width: 0; height: 28px; padding: 0 8px; border: 0; border-radius: 7px; outline: none; background: none; font-size: var(--text-sm); }
.tagman .tr input:hover { background: var(--fill-hover); }
.tagman .tr input:focus { background: var(--fill-control); box-shadow: inset 0 0 0 1.5px var(--accent); }
.tagman .tr .cnt { width: 32px; text-align: right; font-size: var(--text-xs); color: var(--text-3); }
.tagman .none-row { padding: 20px 4px; text-align: center; font-size: var(--text-sm); color: var(--text-3); }
.sw { display: flex; gap: 4px; flex: none; }
.sw button { width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; background: var(--dot); opacity: 0.35; transition: opacity var(--dur-fast), transform var(--dur-fast) var(--ease-smooth); }
.sw button:hover { opacity: 0.7; }
.sw button:active { transform: scale(var(--press-scale-swatch)); }
.sw button.none { background: none; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.sw button[aria-pressed="true"] { opacity: 1; outline: 2px solid var(--accent); outline-offset: 1px; }
.tagman .ft { margin-top: 10px; font-size: var(--text-xs); color: var(--text-3); line-height: 1.6; }
.tagman .add { display: flex; gap: 6px; margin-top: 10px; }
.tagman .add input { flex: 1; min-width: 0; height: var(--control-sm); padding: 0 8px; border: 0; border-radius: var(--radius-control); outline: none; background: var(--fill-control); box-shadow: inset 0 0 0 1px var(--stroke); font-size: var(--text-sm); }
.tagman .add input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }

.viewer { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: rgb(8 10 20 / 0.82); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); color: #fff; animation: fade var(--dur-normal) var(--ease-smooth) backwards; }
.viewer .vbar { display: flex; align-items: center; gap: 6px; padding: calc(10px + var(--safe-t)) 12px 10px; }
.viewer .vbar .mt { flex: 1; min-width: 0; font-size: var(--text-sm); color: rgb(255 255 255 / 0.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer .btn { color: #fff; background: rgb(255 255 255 / 0.12); box-shadow: none; }
.viewer .btn:hover { background: rgb(255 255 255 / 0.2); }
.viewer .stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 8px 16px calc(16px + var(--safe-b)); }
.viewer .stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgb(0 0 0 / 0.4); }
.viewer .stage img.low { filter: blur(1.5px); }
.viewer .vnote { display: inline-flex; align-items: center; gap: 6px; align-self: center; margin: 0 16px calc(16px + var(--safe-b)); padding: 6px 12px; border-radius: 999px; font-size: var(--text-sm); background: rgb(255 255 255 / 0.12); }
.viewer .vnote svg { width: 14px; height: 14px; }
.viewer .vnote.warn svg { color: var(--warning); }

.page-edit { position: fixed; inset: 0; z-index: 65; display: flex; flex-direction: column; background: var(--bg-base); animation: slide var(--dur-slow) var(--ease-smooth) backwards; }
.page-edit > .wall { position: absolute; }
.page-edit .pbar { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-t)) 12px 10px; }
.page-edit .pbar h2 { flex: 1; margin: 0; text-align: center; font-size: var(--text-lg); font-weight: 650; }
.page-edit .pbody { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 4px 16px calc(16px + var(--safe-b)); }
.page-edit textarea { flex: 1; max-height: none; resize: none; }
.page-edit .pbody .note { flex: none; padding: 0 2px; line-height: 1.5; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

/* 提示条 */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 80; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; max-width: calc(100vw - 32px); padding: 6px 8px 6px 14px; border-radius: 18px; translate: -50% 0;
  font-size: var(--text-sm); font-weight: 600; animation: tin 300ms var(--ease-spring) backwards; }
.toast.out { animation: tout 200ms var(--ease-smooth) both; }
.toast > svg { width: 14px; height: 14px; color: var(--success); }
.toast.warn > svg { color: var(--warning); }
.toast.bad > svg { color: var(--danger); }
.toast span { padding-right: 6px; }
.toast .btn { height: 24px; padding: 0 10px; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
@keyframes tout { to { opacity: 0; transform: translateY(6px); } }

/* 底部标签栏（窄屏才有） */
.tabbar { display: none; }

/* ---------- 窄屏（手机、加到主屏幕） ---------- */
@media (max-width: 719px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 0 var(--safe-r) 0 var(--safe-l); gap: 0; }
  .side { display: none; }
  .main > .glass { border-radius: 0; box-shadow: none; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .head { padding: calc(18px + var(--safe-t)) 16px 8px; flex-wrap: wrap; }
  .head h1 { font-size: 28px; font-weight: 700; }
  .head .search { order: 3; width: 100%; }
  .head .search input { height: 38px; font-size: var(--text-md); }
  .head .status { padding: 0; }
  .banner { margin: 0 16px 10px; }
  .compose { margin: 0 16px 10px; }
  .compose .bar .hint { display: none; }
  .compose .bar .sp { flex: 1; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .list { padding: 0 8px calc(96px + var(--safe-b)); }
  .item { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .item .ops { display: none; }
  .item .more { display: inline-flex; grid-row: span 2; align-self: center; }
  .item .pin { display: none; }
  .item .m .pin-s { display: inline; }
  .item .thumb { width: 100%; max-width: 240px; }
  .item.editing { display: none; }
  .foot { display: none; }
  .memo { grid-template-columns: minmax(0, 1fr); border-top: 0; }
  .memo .mlist { border-right: 0; padding: 0 8px calc(96px + var(--safe-b)); }
  .memo.editing .mlist { display: none; }
  .memo:not(.editing) .note-row.sel { background: none; box-shadow: none; }
  .memo:not(.editing) .ed { display: none; }
  .memo .ebar { padding: 0 8px 0 4px; }
  .memo .ebar .back { display: inline-flex; }
  .memo .ed { padding-bottom: var(--safe-b); }
  #v-notes.note-open .head .search, #v-notes.note-open .chips, #v-notes.note-open [data-banner] { display: none; }
  .memo .ebar .mt .fromc { display: none; }
  .acct { padding-bottom: calc(96px + var(--safe-b)); }
  .tabbar { position: fixed; left: calc(16px + var(--safe-l)); right: calc(16px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); z-index: 30; height: 58px; display: flex; padding: 4px; border-radius: 29px; }
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 0; border-radius: 25px; background: none; font-size: 10.5px; font-weight: 600; color: var(--text-2);
    transition: background var(--dur-fast), color var(--dur-fast); }
  .tabbar button svg { width: 20px; height: 20px; }
  .tabbar button[aria-current="true"] { color: var(--accent); background: var(--fill-selected); }
  .toast { bottom: calc(86px + var(--safe-b)); }
  .toast.no-tabbar { bottom: calc(24px + var(--safe-b)); }
  /* 菜单在窄屏改成底部操作表 */
  .menu { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + var(--safe-b)); width: auto; max-height: 70dvh; padding: 8px; border-radius: 22px; animation: rise var(--dur-slow) var(--ease-spring) backwards; }
  .menu .sheet-hd { display: block; margin: 2px 8px 6px; font-size: var(--text-sm); font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .menu button.opt { height: 44px; font-size: var(--text-md); }
  .menu .tin { height: 38px; }
  .menu .tin input { font-size: var(--text-md); }
  .scrim.sheet { place-items: end stretch; padding: 8px 8px calc(8px + var(--safe-b)); }
  .scrim.sheet > .tagman, .scrim.sheet > .dialog { max-width: none; border-radius: 22px; animation: rise var(--dur-slow) var(--ease-spring) backwards; }
  .tagman .tr { min-height: 48px; flex-wrap: wrap; padding: 6px 4px; }
  .tagman .tr .sw { order: 3; width: 100%; padding-left: 4px; gap: 8px; }
  .sw button { width: 22px; height: 22px; }
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 720px) {
  .item .m .pin-s, .head .status { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .menu, .dialog, .tagman, .toast, .scrim, .page-edit, .viewer { animation: none; }
}
