/* ============================================================
   剪切板 · 样式
   ============================================================ */
:root {
  --bg: #f1f3fa;
  --bg2: #e9edf8;
  --surface: #ffffff;
  --surface2: #f7f8fc;
  --surface3: #eef1f9;
  --text: #0f1526;
  --muted: #6b7488;
  --faint: #98a1b3;
  --line: #e2e6f0;
  --line2: #d5dbe9;
  --accent: #4f6ef7;
  --accent2: #6f88ff;
  --accentSoft: #e9edff;
  --onAccent: #ffffff;
  --danger: #e5484d;
  --dangerSoft: #fdecec;
  --ok: #12b76a;
  --warn: #f79009;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 30px rgba(16, 24, 40, .06);
  --shadowLg: 0 24px 60px rgba(16, 24, 40, .18);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --maxw: 860px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070b14;
    --bg2: #0b1220;
    --surface: #101827;
    --surface2: #0d1422;
    --surface3: #162034;
    --text: #e8ecf7;
    --muted: #94a0b8;
    --faint: #6b7793;
    --line: #1e293e;
    --line2: #2a3a56;
    --accent: #7c93ff;
    --accent2: #98a9ff;
    --accentSoft: #1a2440;
    --onAccent: #08101f;
    --danger: #ff6369;
    --dangerSoft: #2c1519;
    --ok: #34d399;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    --shadowLg: 0 24px 60px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 12% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, color-mix(in srgb, #22d3ee 7%, transparent), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); text-decoration: none; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 2px;
}

/* ---------- 启动 ---------- */
.boot {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--bg);
  transition: opacity .25s ease;
}
.boot.hide { opacity: 0; pointer-events: none; }
.bootLogo {
  width: 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent2));
  color: var(--onAccent);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 35%, transparent);
  animation: pulse 1.6s ease-in-out infinite;
}
.bootLogo .ic { width: 32px; height: 32px; stroke-width: 1.6; }
.bootText { color: var(--muted); font-size: 13px; letter-spacing: .04em; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* ---------- 登录 ---------- */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.loginCard {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px 28px 26px;
  box-shadow: var(--shadowLg);
  text-align: center;
}
.loginLogo {
  width: 58px; height: 58px; margin: 0 auto 18px;
  border-radius: 17px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent2));
  color: var(--onAccent);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 35%, transparent);
}
.loginLogo .ic { width: 30px; height: 30px; }
.loginCard h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: .04em; }
.loginHint { margin: 0 0 26px; color: var(--muted); font-size: 13.5px; }
.loginCard form { display: flex; flex-direction: column; gap: 12px; }
.loginFoot { margin: 22px 0 0; color: var(--faint); font-size: 12px; line-height: 1.6; }

.field {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
  background: var(--surface);
}
.field .ic { color: var(--faint); }
.field input {
  flex: 1; min-width: 0; height: 48px;
  background: none; border: 0; outline: none; font-size: 15px;
}
.field input::placeholder { color: var(--faint); }
.field > span { color: var(--muted); font-size: 13px; white-space: nowrap; }

.formErr { min-height: 18px; margin: 2px 0 0; color: var(--danger); font-size: 13px; }

/* ---------- 按钮 ---------- */
.btnPrimary, .btnGhost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px;
  border-radius: 11px; font-size: 14px; font-weight: 500;
  white-space: nowrap; transition: transform .12s, background .15s, box-shadow .15s, border-color .15s;
}
.btnPrimary {
  background: linear-gradient(140deg, var(--accent), var(--accent2));
  color: var(--onAccent);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btnPrimary:hover { filter: brightness(1.05); }
.btnPrimary:active { transform: scale(.97); }
.btnPrimary:disabled { opacity: .6; cursor: default; transform: none; }
.btnGhost {
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--text);
}
.btnGhost:hover { background: var(--surface3); border-color: var(--line2); }
.btnGhost:active { transform: scale(.97); }
.btnGhost.danger { color: var(--danger); }
.btnGhost.danger:hover { background: var(--dangerSoft); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.btnBlock { width: 100%; height: 46px; font-size: 15px; margin-top: 2px; }

.iconBtn {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  color: var(--muted);
  transition: background .15s, color .15s, transform .12s;
}
.iconBtn:hover { background: var(--surface3); color: var(--text); }
.iconBtn:active { transform: scale(.94); }
.iconBtn.on { background: var(--accentSoft); color: var(--accent); }

/* ---------- 主框架 ---------- */
.app { max-width: var(--maxw); margin: 0 auto; padding-bottom: calc(96px + var(--safe-b)); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brandLogo {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent2));
  color: var(--onAccent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent);
}
.brandLogo .ic { width: 17px; height: 17px; stroke-width: 1.9; }
.brandName { font-size: 16.5px; font-weight: 650; letter-spacing: .06em; }
.connDot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
  transition: background .2s, box-shadow .2s;
}
.connDot.offline { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.connDot.slow { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); }
.topActions { display: flex; gap: 2px; }
.topTitle { font-size: 16px; font-weight: 600; }
.topRight { width: 38px; }

.tabs {
  display: flex; gap: 4px;
  padding: 2px 16px 8px;
  position: sticky; top: 62px; z-index: 19;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  color: var(--muted); font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.tab:hover { background: var(--surface3); color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--surface3); color: var(--muted);
  font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.tab.active .badge { background: var(--accentSoft); color: var(--accent); }

.page { padding: 4px 16px 24px; }

/* ---------- 输入区 ---------- */
.composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  transition: border-color .18s, box-shadow .18s;
}
.composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent), var(--shadow);
}
.composer textarea {
  display: block; width: 100%;
  min-height: 48px; max-height: 46vh;
  padding: 6px 4px;
  border: 0; outline: none; resize: none;
  background: none;
  font-size: 15px; line-height: 1.55;
}
.composer textarea::placeholder { color: var(--faint); }
.composerRow {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 8px; padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.composerActions { display: flex; gap: 8px; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface2); border: 1px solid var(--line);
  border-radius: 10px;
}
.seg button {
  padding: 5px 11px; border-radius: 7px;
  font-size: 12.5px; color: var(--muted);
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); font-weight: 500; }

/* ---------- 搜索 ---------- */
.searchWrap {
  position: relative;
  display: flex; align-items: center;
  margin: 14px 0 10px;
}
.searchIcon {
  position: absolute; left: 13px;
  color: var(--faint); pointer-events: none;
  width: 18px; height: 18px;
}
.searchWrap input {
  width: 100%; height: 42px;
  padding: 0 40px 0 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  outline: none;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.searchWrap input:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}
.searchWrap input::-webkit-search-cancel-button { display: none; }
.clearSearch {
  position: absolute; right: 8px;
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; color: var(--faint);
}
.clearSearch:hover { background: var(--surface3); color: var(--text); }
.clearSearch .ic { width: 15px; height: 15px; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted); font-size: 12.5px;
  transition: all .15s;
}
.chip:hover { border-color: var(--line2); color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--onAccent); font-weight: 500; }

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 6px;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover { border-color: var(--line2); }
.card.pinned { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card.pinned::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--accent), var(--accent2));
}
.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accentSoft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.cardMain { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; }
.kind {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  flex: none; margin-top: 1px;
}
.kind .ic { width: 18px; height: 18px; }
.kind[data-kind="text"] { background: #e8efff; color: #3b66f5; }
.kind[data-kind="link"] { background: #e3f6f6; color: #0e9f9f; }
.kind[data-kind="code"] { background: #f1eafe; color: #8b5cf6; }
.kind[data-kind="table"] { background: #fff2dc; color: #d97706; }
@media (prefers-color-scheme: dark) {
  .kind[data-kind="text"] { background: #18233f; color: #8fa7ff; }
  .kind[data-kind="link"] { background: #102b2e; color: #4fd1c5; }
  .kind[data-kind="code"] { background: #241b3d; color: #b794ff; }
  .kind[data-kind="table"] { background: #2e2210; color: #fbbf24; }
}

.cardText { flex: 1; min-width: 0; }
.cardTitle {
  font-size: 14.5px; font-weight: 600; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cardPreview {
  margin-top: 2px;
  color: var(--muted); font-size: 13px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.cardPreview.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace; font-size: 12.5px; }
.cardMeta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px;
  margin-top: 6px; color: var(--faint); font-size: 11.5px;
}
.cardMeta .tag { color: var(--accent); }
.cardMeta .dotSep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); opacity: .6; }

.check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line2);
  flex: none; margin-top: 5px;
  display: grid; place-items: center;
  color: transparent;
  transition: all .15s;
}
.check .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.card.selected .check { background: var(--accent); border-color: var(--accent); color: var(--onAccent); }

.cardTools {
  display: flex; justify-content: flex-end; gap: 2px;
  margin: 4px -2px 0 0;
}
.toolBtn {
  width: 32px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--faint);
  transition: background .15s, color .15s;
}
.toolBtn .ic { width: 16px; height: 16px; }
.toolBtn:hover { background: var(--surface3); color: var(--text); }
.toolBtn.danger:hover { background: var(--dangerSoft); color: var(--danger); }
.toolBtn.active { color: var(--accent); }

/* 表格预览 */
.miniTable { margin-top: 7px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.miniTable table { width: 100%; border-collapse: collapse; font-size: 12px; }
.miniTable th, .miniTable td {
  padding: 5px 9px; text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px;
}
.miniTable th { background: var(--surface2); font-weight: 600; color: var(--muted); font-size: 11.5px; }
.miniTable tr:last-child td { border-bottom: 0; }
.miniTable .more { color: var(--faint); font-size: 11px; padding: 4px 9px; background: var(--surface2); }

/* 空状态 */
.empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 56px 16px; color: var(--faint); text-align: center;
}
.emptyIcon { width: 44px; height: 44px; stroke-width: 1.3; opacity: .6; margin-bottom: 12px; }
.empty p { margin: 0; font-size: 13.5px; }

/* ---------- 批量条 ---------- */
.bulkbar {
  position: fixed; left: 50%; bottom: calc(16px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 40;
  width: min(calc(100% - 28px), 640px);
  display: flex; align-items: center; justify-content: flex-start; gap: 6px;
  padding: 10px 12px 10px 16px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--line2);
  border-radius: 15px;
  box-shadow: var(--shadowLg);
  animation: rise .2s ease;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }
.bulkCount { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; margin-right: auto; }
.bulkAll {
  font-size: 12.5px; color: var(--accent);
  padding: 6px 8px; border-radius: 8px;
}
.bulkAll:hover { background: var(--accentSoft); }
.bulkActions { display: flex; gap: 4px; }
.bulkActions button {
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--surface2); border: 1px solid var(--line);
  color: var(--text);
}
.bulkActions button .ic { width: 17px; height: 17px; }
.bulkActions button:hover { background: var(--surface3); }
.bulkActions button.danger { color: var(--danger); }
.bulkActions button.danger:hover { background: var(--dangerSoft); }

/* ---------- 设置 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  overflow-y: auto;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.overlay > .topbar { position: sticky; }
.settingsPage { max-width: 720px; margin: 0 auto; padding-bottom: calc(40px + var(--safe-b)); }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 14px; font-size: 14px; font-weight: 600;
  letter-spacing: .02em;
}
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack .field { background: var(--surface2); }
.stack .field > span { min-width: 64px; }
.stack .field input { height: 44px; }

.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  flex-wrap: wrap;
}
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row > em { color: var(--faint); font-size: 11.5px; font-style: normal; }
.row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
.numInput {
  width: 62px; height: 32px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface2); text-align: center;
  font-variant-numeric: tabular-nums;
}
.numInput:focus { outline: none; border-color: var(--accent); }
.btnRow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btnRow:first-of-type { margin-top: 0; }
.btnRow .btnGhost { height: 38px; font-size: 13px; padding: 0 13px; }
.kv {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted);
}
.kv:last-of-type { border-bottom: 0; }
.kv b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- 详情抽屉 ---------- */
.sheetOverlay {
  background: rgba(0, 0, 0, .42);
  background: color-mix(in srgb, #000 42%, transparent);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(3px);
}
@media (min-width: 700px) {
  .sheetOverlay { align-items: center; }
}
.sheet {
  width: 100%; max-width: 760px;
  max-height: 92dvh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column;
  box-shadow: var(--shadowLg);
  animation: sheetUp .22s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 700px) {
  .sheet { border-radius: 20px; max-height: 84vh; }
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } }
.sheetHead {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.sheetHeadText { min-width: 0; }
.sheetTitle { font-size: 17px; font-weight: 650; line-height: 1.4; word-break: break-word; }
.sheetMeta { margin-top: 4px; color: var(--faint); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.sheetBody { padding: 16px 18px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.sheetBody pre {
  margin: 0;
  font: 13px/1.65 ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap; word-break: break-word;
}
.sheetBody .plain {
  white-space: pre-wrap; word-break: break-word;
  font-size: 14.5px; line-height: 1.7;
}
.sheetBody textarea {
  width: 100%; min-height: 40vh;
  padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface2);
  font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  resize: vertical; outline: none;
}
.sheetBody textarea:focus { border-color: var(--accent); }
.sheetBody .tableWrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.sheetBody table { border-collapse: collapse; width: 100%; font-size: 13px; }
.sheetBody th, .sheetBody td {
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left; white-space: nowrap; max-width: 280px;
  overflow: hidden; text-overflow: ellipsis;
}
.sheetBody th { background: var(--surface2); font-weight: 600; position: sticky; top: 0; }
.sheetBody tr:last-child td { border-bottom: 0; }
.sheetBody th:last-child, .sheetBody td:last-child { border-right: 0; }
.sheetFoot {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 12px 16px calc(14px + var(--safe-b));
  border-top: 1px solid var(--line);
}
.sheetFoot .btnGhost { flex: 1; min-width: 72px; height: 40px; font-size: 13px; padding: 0 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-b));
  transform: translate(-50%, 12px);
  z-index: 90;
  max-width: calc(100% - 40px);
  padding: 10px 16px;
  border-radius: 12px;
  background: #1b2233;
  background: color-mix(in srgb, var(--text) 92%, transparent);
  color: var(--bg);
  font-size: 13.5px;
  box-shadow: var(--shadowLg);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); color: #fff; }

/* ---------- 小屏 ---------- */
@media (max-width: 420px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .tabs { padding-left: 12px; padding-right: 12px; }
  .composerRow { gap: 6px; }
  .composerActions .btnGhost span { display: none; }
  .composerActions .btnGhost { padding: 0 12px; }
  .bulkActions button { padding: 0 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
