/* 闪念 · Web 时间线（视觉规范 = design/timeline.html 暖纸质感 · C 时间轴定稿） */
:root {
  --paper: #f3ede1;
  --paper-deep: #eae2d2;
  --card: #fffdf7;
  --ink: #3b3428;
  --ink-2: #6f665a;
  --ink-3: #a29781;
  --line: rgba(93, 78, 55, 0.14);
  --accent: #b4593b;
  --accent-soft: rgba(180, 89, 59, 0.10);
  --amber: #a97b24;
  --amber-soft: rgba(185, 138, 47, 0.15);
  --moss-soft: rgba(95, 125, 84, 0.14);
  --rec: #c04a35;
  --rec-soft: rgba(192, 74, 53, 0.10);
  --moss: #5f7d54;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: -apple-system, "SF Pro Text", "Segoe UI", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
/* 作者样式的 display（.gate 的 flex、.more 的 block）会覆盖 UA 对 [hidden] 的 display:none，
   必须显式补回，否则令牌框/加载更多按钮永远可见 */
[hidden] { display: none !important; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  background:
    radial-gradient(1000px 500px at 50% -100px, rgba(255, 252, 244, 0.9), transparent 70%),
    var(--paper);
  min-height: 100vh;
}

/* ===== 窗壳标题条：仅本地窗（body.local-win，app.js 按 isLocal 加）=====
   浏览器 / 服务器窗有各自窗壳，不渲染；本地窗 decorations:false 由它承担拖拽与窗控 */
.titlebar {
  display: none;
  height: 36px;
  align-items: center;
  padding-left: 13px;
  background: rgba(234, 226, 210, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  user-select: none;
  -webkit-user-select: none;
}
body.local-win .titlebar { display: flex; position: sticky; top: 0; z-index: 30; }
body.local-win header { top: 36px; }
.tb-app {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.tb-title { font-size: 11.5px; color: var(--ink-3); margin-left: 9px; }
.tb-btns { margin-left: auto; display: flex; align-self: stretch; }
.tbtn {
  width: 40px;
  border: none;
  background: transparent;
  color: var(--ink-2);
  font: 11px var(--sans);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.tbtn:hover { background: rgba(93, 78, 55, 0.10); color: var(--ink); }
.tbtn.close:hover { background: var(--accent); color: #fff8f0; }

/* ===== 顶栏 ===== */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(243, 237, 225, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 20px 12px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
h1 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
h1 small { font-size: 12px; color: var(--ink-3); font-family: var(--sans); font-weight: 400; margin-left: 8px; letter-spacing: 0; }
.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  width: 220px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within { border-color: rgba(180, 89, 59, 0.45); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { width: 13px; height: 13px; color: var(--ink-3); flex: none; }
.search input {
  border: none; outline: none; background: transparent;
  font: 13.5px var(--sans); color: var(--ink); width: 100%;
}
.search input::placeholder { color: var(--ink-3); }

/* ===== 同步状态芯片（仅本地时间线窗；七态文案/色彩与 Android 芯片、托盘菜单、设置页同源）===== */
.syncchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1;
  color: var(--moss);
  background: var(--moss-soft);
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
  align-self: center;
  flex: none;
}
.syncchip:hover { filter: brightness(0.96); }
.syncchip.pending { color: var(--amber); background: var(--amber-soft); }
/* 墨灰 = 未验证（未连接/已暂停）；砖红 = 异常；绿「已同步」唯一含义 = 已验证 */
.syncchip.muted { color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.syncchip.err { color: var(--rec); background: var(--rec-soft); }
.syncchip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.syncchip .dot.pulse { animation: dotPulse 1.1s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ===== 筛选栏 ===== */
.filters {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dd { position: relative; }
.dd-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: 12.5px var(--sans);
  padding: 3px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.dd-btn:hover { color: var(--ink); }
.dd-btn.set { background: var(--accent-soft); border-color: rgba(180, 89, 59, 0.35); color: var(--accent); }
.dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 128px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px -8px rgba(70, 55, 30, 0.25);
  padding: 5px;
  display: none;
  z-index: 20;
}
.dd.open .dd-menu { display: block; }
.dd-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  font: 12.5px var(--sans);
  color: var(--ink-2);
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.dd-menu button:hover { background: var(--paper); color: var(--ink); }
.dd-menu button.on { color: var(--accent); background: var(--accent-soft); }

/* ===== C 时间轴 ===== */
main { max-width: 640px; margin: 0 auto; padding: 10px 20px 80px; }
#list { position: relative; padding-left: 26px; }
#list::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(to bottom, rgba(180, 89, 59, 0.35), rgba(93, 78, 55, 0.18));
}

.day {
  position: relative;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink-2);
  letter-spacing: 0.06em;
  margin: 26px 0 4px;
}
/* 日级节点：陶土菱形 */
.day::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 7px;
  width: 10px; height: 10px;
  background: var(--accent);
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: 0 0 0 3px var(--paper);
}

.cap {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px 11px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(70, 55, 30, 0.04);
  transition: box-shadow 0.15s;
}
.cap:hover { box-shadow: 0 6px 18px -8px rgba(70, 55, 30, 0.16); }
/* 条目节点：空心圆；编辑过的 → 琥珀实心 */
.cap::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 21px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink-3);
  box-sizing: border-box;
  box-shadow: 0 0 0 3px var(--paper);
}
.cap:has(.edited)::before { background: var(--amber); border-color: var(--amber); }
.cap .content { white-space: pre-line; text-wrap: pretty; overflow-wrap: break-word; }
.cap .meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cap .meta .dev { color: var(--ink-2); }
.cap .meta .sep { opacity: 0.6; }
.cap .edited { color: var(--amber); }
.cap .save-err { color: var(--accent); }

/* 操作组：常驻 meta 行右端，永不与正文重叠 */
.card-ops {
  display: flex;
  gap: 2px;
  margin-left: auto;
  flex: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.cap:hover .card-ops, .card-ops:focus-within { opacity: 1; }
.op-btn {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.op-btn:hover { color: var(--accent); background: var(--accent-soft); }
.op-btn svg { width: 13px; height: 13px; }
.op-btn.done { color: var(--moss); }

/* 编辑态：内描边强调，盒子外轮廓零变化（不挤左侧节点） */
.cap.editing {
  border-color: rgba(180, 89, 59, 0.45);
  box-shadow: inset 0 0 0 1px rgba(180, 89, 59, 0.45);
}
.edit-area {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font: inherit;
  line-height: inherit;
  color: var(--ink);
  white-space: pre-line;
  overflow: hidden;
  min-height: 52px;
}
.edit-hint-row {
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}
.edit-hint { font-size: 11.5px; color: var(--ink-3); }
.edit-hint.error { color: var(--accent); }
/* 取消/保存按钮仅触屏显示（软键盘无 Esc、Enter=换行）；桌面零按钮 */
.edit-ops {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}
.edit-ops .spacer { flex: 1; }
@media (pointer: coarse) {
  .edit-hint-row { display: none; }
  .edit-ops { display: flex; }
}
.op {
  border-radius: 7px;
  font: 12.5px var(--sans);
  padding: 4px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.op.cancel { border: 1px solid var(--line); background: transparent; color: var(--ink-2); }
.op.cancel:hover { color: var(--ink); border-color: rgba(93, 78, 55, 0.32); }
.op.save { border: none; background: var(--accent); color: #fff8f0; }
.op.save:hover { background: #a34e33; }
.op.save[disabled] { opacity: 0.55; cursor: default; }

.empty { text-align: center; color: var(--ink-3); padding: 70px 0; font-size: 14px; }

/* ===== 图片（布局一：图随文走 · 定稿）===== */
.cap .meta .pic-n { color: var(--ink-2); }
.pics-row { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.pic {
  position: relative;
  display: block;
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  cursor: zoom-in;
  overflow: hidden;
  background: var(--paper);
  transition: filter 0.15s;
}
.pic:hover { filter: brightness(1.04); }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 文件缺失（加载失败）→ 虚线占位 */
.pic-broken { border-style: dashed; cursor: default; }
.pic-broken::after {
  content: "图片缺失";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  color: var(--ink-3);
}
/* 远程图未就绪（服务端还没有字节）→ 琥珀虚线占位，点击不进灯箱 */
.pic-pending-th { border-style: dashed; border-color: rgba(169, 123, 36, 0.5); cursor: default; }
.pic-pending-th::after {
  content: "待同步";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  color: var(--amber);
}
/* 普通文件附件 → 芯片（图标 + 文件名 + 大小），点击打开/下载 */
.files-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 260px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink-2);
  font: 12px var(--sans);
  cursor: pointer;
  transition: all 0.15s;
}
.file-chip:hover { border-color: var(--ink-3); color: var(--ink); }
.file-chip svg { width: 15px; height: 15px; flex: none; color: var(--amber); }
.file-chip .fc-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.file-chip .fc-size { flex: none; color: var(--ink-3); font-size: 11px; }
/* 纯语音胶囊：正文为空时的占位（转写回填为二期能力） */
.cap .content .ph-empty { color: var(--ink-3); font-style: normal; }
/* 语音附件芯片：与文件芯片同族，声波图标 + 「录音」+ 时长；点击播放/暂停 */
.file-chip.voice-chip svg { color: var(--accent); }
.file-chip.voice-chip .fc-size { font-family: ui-monospace, monospace; }
.file-chip.voice-chip.playing {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.file-chip.voice-chip.playing > svg { display: none; }
.file-chip.voice-chip .eq { display: none; }
.file-chip.voice-chip.playing .eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.file-chip.voice-chip .eq i {
  width: 3px;
  border-radius: 1px;
  background: var(--accent);
  animation: eq 0.7s ease-in-out infinite;
}
.file-chip.voice-chip .eq i:nth-child(1) { height: 6px;  animation-delay: 0s; }
.file-chip.voice-chip .eq i:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.file-chip.voice-chip .eq i:nth-child(3) { height: 8px;  animation-delay: 0.3s; }
.file-chip.voice-chip .eq i:nth-child(4) { height: 11px; animation-delay: 0.45s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); } }
/* 附件壳 + 删除按钮：hover / 编辑态显现，平时连点击区一并隐藏（防误删），与输入窗移除键同视觉 */
.att { position: relative; display: block; }
.files-row .att { display: inline-flex; }
.att-rm {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--paper);
  border-radius: 50%;
  background: rgba(35, 32, 27, 0.62);
  color: #f3ede1;
  font: 10px/1 var(--sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s, background 0.12s;
}
.att:hover .att-rm, .att:focus-within .att-rm, .cap.editing .att-rm { opacity: 1; pointer-events: auto; }
.att-rm:hover { background: var(--accent); }
.att-rm:disabled { cursor: default; }

/* ===== Snackbar「已修改 · 撤销」：吸顶（header 下方，top 由 app.js 按实测 header 底边写入），
   与删除撤销条同族（6s、单槽、新改顶旧改） ===== */
.snackbar {
  position: fixed;
  left: 50%;
  transform: translate(-50%, -6px);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(59, 52, 40, 0.92);
  color: #f3ede1;
  font: 12.5px var(--sans);
  padding: 9px 16px;
  border-radius: 999px;
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.snackbar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.snackbar button {
  border: none;
  background: none;
  color: var(--accent);
  font: 13px var(--sans);
  font-weight: 500;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 5px;
  transition: background 0.15s;
}
.snackbar button:hover { background: rgba(243, 237, 225, 0.14); }

/* 本地：附件元数据已同步但字节未下载 → 待同步横条（重试立即唤醒同步） */.pic-pending {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  border: 1.5px dashed rgba(169, 123, 36, 0.5);
  background: var(--amber-soft);
  border-radius: 9px;
  padding: 10px 14px;
}
.pic-pending svg { width: 18px; height: 18px; color: var(--amber); flex: none; }
.pic-pending .tx { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.pic-pending .tx b { color: var(--amber); font-weight: 500; }
.pic-pending .retry {
  margin-left: auto;
  flex: none;
  border: 1px solid rgba(169, 123, 36, 0.45);
  background: none;
  color: var(--amber);
  font: 12px var(--sans);
  padding: 3px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.pic-pending .retry:hover { background: rgba(169, 123, 36, 0.14); }
.pic-pending .retry[disabled] { opacity: 0.6; cursor: default; }

/* ===== 删除撤销条（视觉源 design/timeline.html）：卡片原位折叠，倒计时 + 底边进度线 =====
   删除按钮复用 .op-btn 默认 hover（陶土 accent，与附件 ✕ 同危险色），不另设色 */
.cap.undo {
  padding: 0;
  border-style: dashed;
  background: transparent;
  box-shadow: none;
}
.cap.undo:hover { box-shadow: none; }
.undo-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  overflow: hidden;
}
.undo-bar .undo-tx { font-size: 12.5px; color: var(--ink-3); }
.undo-bar .undo-count { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.undo-bar .undo-btn {
  margin-left: auto;
  flex: none;
  border: 1px solid var(--line);
  background: none;
  color: var(--accent);
  font: 12px var(--sans);
  padding: 2px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.undo-bar .undo-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
/* 剩余时间进度线：贴条底边，6s 匀速消退 */
.undo-bar .undo-line {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  opacity: 0.55;
  transform-origin: left;
  animation: undo-eat 6s linear forwards;
}
@keyframes undo-eat { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ===== 灯箱 ===== */
.lb { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(28, 25, 20, 0.78); backdrop-filter: blur(10px); }
.lb-body {
  position: relative;
  width: min(880px, 84vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: lb-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes lb-in {
  from { opacity: 0; transform: scale(0.965); }
  to { opacity: 1; transform: none; }
}
.lb-frame { position: relative; }
.lb-img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(28, 25, 20, 0.4);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}
.lb-dim {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font: 11px ui-monospace, monospace;
  color: rgba(255, 250, 240, 0.92);
  background: rgba(35, 32, 27, 0.45);
  border-radius: 5px;
  padding: 2px 8px;
}
.lb-cap {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(243, 237, 225, 0.85);
  font-size: 13px;
}
.lb-cap .lb-count {
  font: 11.5px ui-monospace, monospace;
  color: rgba(243, 237, 225, 0.55);
  margin-left: auto;
}
.lb-cap .lb-keys { font-size: 11.5px; color: rgba(243, 237, 225, 0.5); }
.lb-cap kbd {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  border: 1px solid rgba(243, 237, 225, 0.28);
  border-radius: 4px;
  padding: 0 5px;
  margin: 0 2px;
  color: rgba(243, 237, 225, 0.65);
}
.lb-x, .lb-nav {
  position: absolute;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(243, 237, 225, 0.12);
  color: rgba(243, 237, 225, 0.85);
  transition: background 0.15s;
}
.lb-x { width: 34px; height: 34px; top: -42px; right: 0; font-size: 15px; }
.lb-x:hover, .lb-nav:hover { background: rgba(243, 237, 225, 0.24); }
.lb-nav { width: 38px; height: 38px; top: 50%; transform: translateY(-50%); font-size: 17px; }
.lb-prev { left: -54px; }
.lb-next { right: -54px; }
.lb-nav[disabled] { opacity: 0.3; cursor: default; }
.lb-nav[disabled]:hover { background: rgba(243, 237, 225, 0.12); }
@media (max-width: 980px) {
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

.more {
  display: block;
  margin: 26px auto 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: 13.5px var(--sans);
  padding: 8px 26px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.more:hover { border-color: rgba(93, 78, 55, 0.32); color: var(--ink); background: var(--card); }
.more[disabled] { color: var(--ink-3); cursor: default; background: none; border-style: dashed; }

/* ===== token 门 ===== */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-deep); padding: 20px;
}
.gate-panel {
  width: 320px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 50px -16px rgba(70, 55, 30, 0.25);
  padding: 26px 28px 24px; text-align: center;
}
.gate-panel h2 { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: 0.1em; }
.gate-sub { font-size: 12.5px; color: var(--ink-3); margin: 8px 0 18px; line-height: 1.6; }
.gate-sub span { font-size: 11.5px; }
.gate-panel input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); padding: 7px 12px;
  font: 13px ui-monospace, monospace; color: var(--ink);
  outline: none; text-align: center;
}
.gate-panel input:focus { border-color: rgba(180, 89, 59, 0.45); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card); }
.gate-err { font-size: 12px; color: var(--accent); margin-top: 8px; }
.gate-btn {
  margin-top: 16px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff8f0;
  font: 13.5px var(--sans); padding: 7px 30px; cursor: pointer;
}
.gate-btn:hover { background: #a34e33; }

/* ===== 去浏览器化：细滚动条 + 控件区不可选字 ===== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(93, 78, 55, 0.18);
  border-radius: 999px;
  border: 3px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover { background: rgba(93, 78, 55, 0.32); }
header, .filters, .more, .lb-x, .lb-nav, .titlebar {
  user-select: none;
  -webkit-user-select: none;
}

/* ===== 深色（暖夜）===== */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #23201b;
    --paper-deep: #1b1915;
    --card: #2c2923;
    --ink: #e8dfd0;
    --ink-2: #b5aa94;
    --ink-3: #847a65;
    --line: rgba(232, 223, 208, 0.13);
    --accent: #cd7a5b;
    --accent-soft: rgba(205, 122, 91, 0.15);
    --amber: #c99a4b;
    --amber-soft: rgba(201, 154, 75, 0.18);
    --moss: #8aa87e;
    --moss-soft: rgba(138, 168, 126, 0.16);
    --rec: #d96a52;
    --rec-soft: rgba(217, 106, 82, 0.14);
  }
  body {
    background:
      radial-gradient(1000px 500px at 50% -100px, rgba(60, 52, 40, 0.55), transparent 70%),
      var(--paper);
  }
  header { background: rgba(35, 32, 27, 0.88); }
  .titlebar { background: rgba(27, 25, 21, 0.9); }
  .tbtn:hover { background: rgba(232, 223, 208, 0.10); }
  ::-webkit-scrollbar-thumb { background: rgba(232, 223, 208, 0.16); }
  ::-webkit-scrollbar-thumb:hover { background: rgba(232, 223, 208, 0.30); }
  #list::before {
    background: linear-gradient(to bottom, rgba(205, 122, 91, 0.4), rgba(232, 223, 208, 0.12));
  }
  .cap { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
  .att-rm { border-color: var(--paper-deep); }
  .cap:hover { box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.45); }
  .cap.editing {
    border-color: rgba(205, 122, 91, 0.5);
    box-shadow: inset 0 0 0 1px rgba(205, 122, 91, 0.5);
  }
  .day::before, .cap::before { box-shadow: 0 0 0 3px var(--paper); }
  .op.save:hover { background: #b96a4c; }
  .gate-panel { box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.5); }
}

/* ===== 移动端 ===== */
@media (max-width: 560px) {
  .header-inner { flex-wrap: wrap; padding-bottom: 10px; }
  .search { width: 100%; order: 3; margin-left: 0; }
  h1 { font-size: 19px; }
  main { padding: 8px 14px 60px; }
  .filters { padding: 0 14px 8px; }
  #list { padding-left: 20px; }
  #list::before { left: 4px; }
  .day::before { left: -20px; }
  .cap { padding: 12px 14px 9px; }
  .cap::before { left: -19px; top: 19px; }
  .card-ops { opacity: 0.55; }
  .cap.editing { padding: 12px 14px 9px; }
  .pics-row .pic { width: 84px; height: 84px; }
}
