:root {
  --bg: #F4F2EE;
  --page: #E7E3DD;
  --ink: #2B2724;
  --ink-2: #5E5751;
  --muted: #A39B92;
  --ai-bubble: #E8E4DF;
  --user-bubble: #EEE6E3;
  --accent: #D97757;
  --glass: rgba(255, 253, 250, 0.58);
  --glass-strong: rgba(250, 248, 245, 0.78);
  --glass-border: rgba(255, 255, 255, 0.7);
  --shadow: 0 10px 30px rgba(70, 52, 36, 0.09), 0 2px 6px rgba(70, 52, 36, 0.05);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --top-offset: calc(var(--sat) + 28px);      /* 顶部栏离顶的距离 */
  --bottom-offset: calc(var(--sab) + 22px);   /* 输入框离底的距离（上移） */
  --composer-h: 118px;
  --avatar: 32px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); overscroll-behavior: none; }
/* 不让手机浏览器自己把字放大（有的浏览器会按屏幕或系统设置自动放大，两台手机字号就不一样了） */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
svg { display: block; width: 100%; height: 100%; }

#app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  overflow: clip; /* 防止聚焦输入框时整个容器被滚上去 */
}
@media (min-width: 520px) {
  body { background: var(--page); }
  #app { box-shadow: 0 0 80px rgba(60, 45, 30, 0.1); }
}

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

/* ---------- 顶部栏 ---------- */
#topbar {
  position: absolute; z-index: 20;
  top: var(--top-offset); left: 16px; right: 16px;
  display: flex; align-items: center; gap: 10px;
  pointer-events: none;
}
#btn-todo { margin-left: auto; }   /* 清单按钮在右上角 ··· 左边 */
#btn-todo svg { width: 18px; height: 18px; }
#topbar > * { pointer-events: auto; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  transition: transform .15s;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:active { transform: scale(.92); }
.title {
  height: 40px; display: flex; align-items: center;
  padding: 0 18px; border-radius: 999px;
  font-weight: 500; font-size: 14.5px; letter-spacing: 1px;
}
body.searching #topbar { opacity: 0; pointer-events: none; }
#topbar { transition: opacity .2s; }

/* ---------- 多选 ---------- */
#selecthead, #selectbar { position: absolute; z-index: 21; display: none; align-items: center; }
body.selecting #topbar, body.selecting #composer { opacity: 0; pointer-events: none; }
body.selecting #selecthead, body.selecting #selectbar { display: flex; }
#selecthead {
  top: var(--top-offset); left: 16px; right: 16px; height: 40px;
  padding: 0 16px; border-radius: 999px; justify-content: space-between;
  font-size: 14px;
}
#sel-cancel { font-size: 14px; color: var(--ink-2); }
#sel-count { font-weight: 600; }
.sel-max { font-size: 11.5px; color: var(--muted); }
#selectbar {
  left: 14px; right: 14px; bottom: var(--bottom-offset);
  padding: 10px; gap: 10px; border-radius: 26px;
}
#selectbar button { flex: 1; height: 44px; border-radius: 999px; font-size: 14.5px; font-weight: 600; transition: opacity .15s; }
#selectbar button:disabled { opacity: .35; }
#sel-delete { background: rgba(196, 85, 58, .1); color: #C4553A; }
#sel-pack { background: #1F1C1A; color: #fff; }
/* 每条消息左边一个小圆圈，选中打勾 */
body.selecting .msg { position: relative; padding-left: 30px; cursor: pointer; }
.sel-dot {
  position: absolute; left: 0; top: 50%; margin-top: -10px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid rgba(120, 100, 80, .35); background: rgba(255, 255, 255, .7);
}
.msg.picked .sel-dot { background: #1F1C1A; border-color: #1F1C1A; }
.msg.picked .sel-dot::after {
  content: ''; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.msg.picked .bubble { box-shadow: 0 0 0 2px rgba(31, 28, 26, .18); }

/* 打包的聊天记录方框 */
/* 白底、无边框、分层阴影 */
.msg.user .bubble.bundle, .msg .bubble.bundle {
  background: #fff; width: 230px; padding: 10px 13px; cursor: pointer;
  box-shadow:
    0 1px 2px rgba(60, 44, 30, .07),
    0 4px 12px rgba(60, 44, 30, .07),
    0 12px 28px rgba(60, 44, 30, .06);
}
.bundle-title { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.bundle-line { font-size: 12px; color: var(--ink-2); line-height: 1.55; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bundle-line b { font-weight: 500; color: var(--muted); }
.bundle-foot { font-size: 11px; color: var(--muted); margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(120, 100, 80, .12); }
.bundle-list { white-space: normal; }
.bundle-item { padding: 10px 2px; border-bottom: 1px solid rgba(120, 100, 80, .1); font-size: 14px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; }
.bundle-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; white-space: normal; }
.bundle-meta b { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.bundle-meta span { font-size: 11px; color: var(--muted); }

.bubble mark { background: rgba(217, 119, 87, .22); color: inherit; border-radius: 3px; }
.bubble.hit-current mark { background: rgba(217, 119, 87, .5); }


/* ---------- 消息列表 ---------- */
#messages {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--top-offset) + 60px) 16px calc(var(--composer-h) + var(--bottom-offset) + 40px);
  scrollbar-width: none;
}
#messages::-webkit-scrollbar { display: none; }

.msg { display: flex; flex-direction: column; gap: 8px; }
.msg.same { margin-top: 8px; }     /* 同一个人连续消息 */
.msg.switch { margin-top: 26px; }  /* 换人说话，间距更大 */

.meta {
  display: flex; align-items: center; gap: 8px;
  padding-left: calc(var(--avatar) + 12px);
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
  margin: 4px 0 -3px;   /* 往下靠近气泡一点 */
}
.meta-dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .7; margin-right: -3px; flex: none; }
.meta-btn { width: 14px; height: 14px; color: var(--muted); opacity: .8; transition: color .15s, transform .15s; }
.meta-btn:active { transform: scale(.85); }
.meta-btn.on { color: var(--accent); opacity: 1; }
.meta-btn::before { content: ''; position: absolute; } /* 扩大点击区 */
.meta-btn { position: relative; }
.meta-btn::after { content: ''; position: absolute; inset: -10px; }

.tools {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
  padding-left: calc(var(--avatar) + 10px);
  margin-top: -4px;
}
.tools.open { grid-template-rows: 1fr; }
.tools > div { overflow: hidden; }
.tool-line { font-size: 12px; color: var(--ink-2); padding: 3px 0 2px; line-height: 1.5; word-break: break-all; }
.tool-line code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; }
.tool-result { font-size: 11.5px; color: var(--muted); padding-bottom: 4px; }

.row { display: flex; align-items: flex-start; gap: 10px; }
.msg.user .row { flex-direction: row-reverse; }
.avatar {
  width: var(--avatar); height: var(--avatar); border-radius: var(--avatar-radius, 50%); flex: none;   /* 圆形 / 圆角方形（设置里选） */
  background: #EEE no-repeat;
  background-size: var(--zoom); background-position: var(--pos);
}
/* 头像裁剪：--zoom 越大脸越大，--pos 是脸在原图里的位置（横 纵） */
.avatar.ai   { background-image: url(../assets/avatar-ai.webp);   --zoom: 190%; --pos: 66% 30%; }
.avatar.user { background-image: url(../assets/avatar-user.webp); --zoom: 200%; --pos: 22% 88%; }

/* 生成中：头像旁的三个跳动黑点 */
#typing { display: none; }
#typing.show { display: flex; animation: pop .3s ease; }
/* 三个黑点依次跳动 */
.typing-dots { height: var(--avatar); display: flex; align-items: center; gap: 5px; padding-left: 4px; }
.typing-dots i {
  width: 7px; height: 7px; border-radius: 50%; background: #1F1C1A;
  animation: dot 1.2s ease-in-out infinite;
}
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-6px); opacity: 1; }
}
.bubble {
  max-width: min(72%, 320px);
  padding: 8px 12px;
  border-radius: 12px;   /* 圆角方形 */
  font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.msg.ai .bubble { background: var(--ai-bubble); }
.msg.user .bubble { background: var(--user-bubble); }
/* 带排版的回复（Markdown） */
.bubble.rich { white-space: normal; max-width: min(84%, 380px); }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .6em; }
.md h1, .md h2, .md h3, .md h4 { margin: .7em 0 .35em; line-height: 1.35; }
.md h1 { font-size: 17px; } .md h2 { font-size: 16px; } .md h3 { font-size: 15px; } .md h4 { font-size: 14px; }
.md ul, .md ol { margin: .3em 0 .6em; padding-left: 1.3em; }
.md li { margin: .15em 0; }
.md blockquote { margin: .4em 0; padding: 2px 10px; border-left: 3px solid rgba(120, 100, 80, .25); color: var(--ink-2); }
.md code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; background: rgba(120, 100, 80, .1); padding: 1px 4px; border-radius: 4px; }
.md pre { margin: .5em 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .6); overflow-x: auto; }
.md pre code { background: none; padding: 0; font-size: 12px; line-height: 1.5; white-space: pre; }
.md hr { border: 0; border-top: 1px solid rgba(120, 100, 80, .18); margin: .8em 0; }
.md a { color: #9A6A52; }
.bubble b { font-weight: 600; }

.msg .bubble.photo { background: none; padding: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.bubble.photo img { display: block; max-width: 200px; max-height: 260px; object-fit: cover; pointer-events: none; }
/* 他用工具做的事 */
.ev-note { padding: 2px 0 4px calc(var(--avatar) + 12px); }   /* 灰色斜体小字，没有气泡，对齐气泡 */
.ev-note span { display: inline-block; font-size: 12.5px; color: var(--muted); transform: skewX(-8deg); transform-origin: left bottom; }
.msg.ai .bubble.fav-card {   /* 收藏卡片 */
  display: flex; align-items: center; gap: 12px; width: min(72vw, 300px);
  padding: 10px 14px 10px 10px; border-radius: 18px;
  background: #FBF9F5; box-shadow: 0 1px 2px rgba(60, 44, 30, .06), 0 4px 14px rgba(60, 44, 30, .07); white-space: normal;
}
.fav-thumb { position: relative; flex: none; width: 64px; height: 64px; }
.fav-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; pointer-events: none; }
.fav-thumb i { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: #C9775A; color: #fff; border: 2px solid #FBF9F5; }
.fav-thumb i svg { width: 12px; height: 12px; }
.fav-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fav-info em { font-style: normal; font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.fav-info b { font-size: 15px; font-weight: 700; color: var(--ink); }
.fav-info p { margin: 0; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: inline-block; transform: skewX(-8deg); transform-origin: left bottom; }
.msg .bubble.photo.photo-card {   /* 从相册发来的照片：下面一条白底"来自 相册 · 分组" */
  background: #FBF9F5; border-radius: 18px; box-shadow: 0 1px 2px rgba(60, 44, 30, .06), 0 4px 14px rgba(60, 44, 30, .07);
}
.bubble.photo-card img { max-width: min(62vw, 250px); max-height: 300px; }
.photo-from { display: flex; align-items: center; gap: 4px; padding: 8px 12px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.photo-from i { width: 13px; height: 13px; color: #C9775A; display: grid; }
.photo-from i svg { width: 13px; height: 13px; }
.photo-from b { color: var(--ink); font-weight: 600; }
.msg .bubble.sticker { background: none; padding: 0; border-radius: 14px; }
.bubble.sticker img { display: block; max-width: 130px; max-height: 130px; border-radius: 14px; pointer-events: none; }
.bubble.pressing { transform: scale(.97); }
.bubble.selected { transform: scale(1.03); box-shadow: 0 8px 24px rgba(70, 52, 36, .16); position: relative; z-index: 61; }
.bubble.pop { animation: pop .32s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
.att-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.att-chip i { width: 15px; height: 15px; display: inline-block; }

.empty { text-align: center; color: var(--muted); font-size: 14px; margin-top: 30vh; }

/* ---------- 输入框 ---------- */
#composer {
  position: absolute; z-index: 20;
  left: 14px; right: 14px; bottom: var(--bottom-offset);
  border-radius: 26px;
  padding: 9px 10px 8px;
}
#input {
  display: block; width: 100%;
  border: 0; outline: 0; resize: none; background: transparent;
  font: inherit; font-size: 15px; line-height: 1.5; color: var(--ink);
  padding: 3px 8px 6px; max-height: 132px;
}
#input::placeholder { color: #BDB4AA; }
.composer-row { display: flex; align-items: center; gap: 5px; }
#btn-emoji { margin-left: auto; }
.c-btn {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: rgba(120, 100, 80, 0.08); color: var(--ink-2);
  transition: transform .15s, background .15s;
}
.c-btn svg { width: 20px; height: 20px; }
.c-btn:active { transform: scale(.9); }
.pill {
  height: 36px; padding: 0 9px; border-radius: 999px;
  background: rgba(120, 100, 80, 0.08);
  font-size: 11.5px; font-weight: 500; color: #1F1C1A; white-space: nowrap;
  min-width: 0; flex-shrink: 1; overflow: hidden; text-overflow: ellipsis;
}
.send-btn {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: #1F1C1A; color: #fff;
  transition: transform .15s, opacity .2s, background .2s;
}
.send-btn svg { width: 21px; height: 21px; }
.send-btn:active { transform: scale(.9); }

#attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }
#attachments:not(:empty) { padding-bottom: 8px; }
.att {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; padding: 5px 6px 5px 10px; border-radius: 12px;
  background: rgba(120, 100, 80, 0.08); font-size: 13px; color: var(--ink-2);
}
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.att img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; }
.att button { width: 18px; height: 18px; color: var(--muted); }

.drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.drawer.open { grid-template-rows: 1fr; }
.drawer-inner { overflow: hidden; }
.panel { display: none; padding-top: 14px; }
.panel.show { display: block; }

/* 加号面板：一页 4×2，横向滑动翻页 */
.plus-pages {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.plus-pages::-webkit-scrollbar { display: none; }
.plus-page {
  flex: 0 0 100%; scroll-snap-align: start;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 88px; gap: 12px 8px; padding: 4px 2px;
  min-height: 188px;   /* 永远留两行的高度，跟微信一样 */
}
.plus-dots { display: flex; justify-content: center; gap: 6px; height: 14px; align-items: center; }
.plus-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(120, 100, 80, .2); }
.plus-dots i.on { background: rgba(120, 100, 80, .55); }
.tile { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.tile-ico {
  width: 58px; height: 58px; border-radius: 18px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .75); color: var(--ink);
  box-shadow: 0 2px 8px rgba(70, 52, 36, .07);
  transition: transform .15s;
}
.tile-ico svg { width: 26px; height: 26px; }
.tile:active .tile-ico { transform: scale(.92); }
/* minmax(0, 1fr)：不让大图把格子撑开（旧版手机浏览器会按图片原尺寸撑） */
/* 表情板（学微信）：上面分组横排可滑，下面表情 5 列上下滑 */
#panel-sticker { height: 300px; padding-top: 10px; flex-direction: column; }
#panel-sticker.show { display: flex; }
.sg-tabs {
  display: flex; gap: 6px; overflow-x: auto; flex: none;
  padding: 2px 2px 10px; scrollbar-width: none;
}
.sg-tabs::-webkit-scrollbar { display: none; }
/* 分组只放图：默认是线条爱心，其他是组里第一张表情 */
.sg-tab {
  position: relative; flex: none; width: 38px; height: 38px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; color: var(--ink-2);
  -webkit-touch-callout: none; user-select: none;
}
.sg-tab.on { background: #fff; box-shadow: 0 1px 2px rgba(60, 44, 30, .08), 0 3px 8px rgba(60, 44, 30, .08); }
.sg-tab svg { width: 20px; height: 20px; }
.sg-tab img { width: 30px; height: 30px; object-fit: contain; pointer-events: none; }
.sg-tab span { font-size: 14px; font-weight: 600; color: var(--muted); }
.sg-tab[data-newgroup] { color: var(--muted); }
.sg-tab[data-newgroup] svg { width: 17px; height: 17px; }
.sg-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.sg-scroll::-webkit-scrollbar { display: none; }
.sg-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sg-tile {
  position: relative; display: block; width: 100%; height: 0; padding-bottom: 100%;
  border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .6);
  -webkit-touch-callout: none; user-select: none; transition: transform .15s;
}
.sg-tile:active { transform: scale(.92); }
.sg-tile img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.sg-tile.sg-addtile { background: transparent; border: 1.5px dashed #D5CBBF; }
.sg-tile.sg-addtile svg { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); color: var(--muted); }
.sg-tip { font-size: 11.5px; color: var(--muted); text-align: center; margin: 12px 0 4px; }
/* 他的表情库页：同一套板子，只是不限高、4 列 */
.page-board .sg-tabs { padding-bottom: 14px; }
.page-board .sg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.st-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; width: 100%; -webkit-touch-callout: none; user-select: none; }
/* 正方形格子用 padding-bottom:100% 的老写法，所有浏览器都认 */
.st-img {
  position: relative; display: block;
  width: 100%; height: 0; padding-bottom: 100%;
  border-radius: 14px; overflow: hidden;
  background: rgba(255, 255, 255, .75); box-shadow: 0 2px 8px rgba(70, 52, 36, .07);
  transition: transform .15s;
}
.st-img > img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.st-img > svg { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); }
.st-add { color: var(--muted); border: 1.5px dashed #D5CBBF; background: transparent; box-shadow: none; }
.st-tile:active .st-img { transform: scale(.93); }
.st-desc { width: 100%; font-size: 11.5px; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.st-form { white-space: normal; display: flex; flex-direction: column; gap: 12px; }
.st-preview { width: 120px; height: 120px; object-fit: contain; align-self: center; border-radius: 16px; background: rgba(255,255,255,.6); }
.st-label { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.st-label em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 6px; }
.st-label span { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.st-input {
  width: 100%; border: 1px solid rgba(120, 100, 80, .15); border-radius: 14px; outline: none; resize: none;
  background: rgba(255, 255, 255, .7); padding: 10px 12px; font: inherit; font-size: 16px; line-height: 1.5; color: var(--ink);
}
.st-input:focus { border-color: rgba(217, 119, 87, .5); }
.st-actions { display: flex; gap: 10px; }
.st-sync { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.st-sync input { width: 18px; height: 18px; accent-color: #1F1C1A; }
.batch-row { display: flex; gap: 10px; align-items: center; }
.b-sync { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); }
.b-sync input { width: 18px; height: 18px; margin: 0; accent-color: #1F1C1A; }
.batch-row img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: rgba(255, 255, 255, .6); flex: none; }
.grp-cover { display: grid; place-items: center; }
.grp-cover img, .grp-cover svg { width: 80px; height: 80px; object-fit: contain; }
.st-actions button { flex: 1; height: 44px; border-radius: 999px; font-size: 15px; font-weight: 600; }
.st-save { background: #1F1C1A; color: #fff; }
.st-del { background: rgba(196, 85, 58, .1); color: #C4553A; }
.st-move { height: 44px; border-radius: 999px; font-size: 15px; font-weight: 600; background: rgba(120, 100, 80, .08); color: var(--ink); }
/* 移入模式：顶上一条操作栏，表情右上角打勾 */
.sg-movebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; padding: 0 2px 10px; }
.sg-movebar > button { font-size: 14px; font-weight: 600; padding: 6px 4px; color: var(--muted); }
.sg-movebar > [data-move-save] { color: var(--accent); }
.sg-movebar > [data-move-save].off { opacity: .4; }
.sg-movegoal { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.sg-movegoal .sg-tab { width: 28px; height: 28px; background: #fff; }
.sg-movegoal .sg-tab img { width: 22px; height: 22px; }
.sg-check { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid rgba(255, 255, 255, .95); background: rgba(0, 0, 0, .12); color: transparent; }
.sg-check svg { width: 12px; height: 12px; }
.sg-tile.sel .sg-check { background: #1F1C1A; border-color: #1F1C1A; color: #fff; }
.sg-tile.sel img { opacity: .75; }

/* 像素小螃蟹 */
.crab-track {
  position: absolute; right: 30px; top: -24px;
  width: 120px; height: 25px; pointer-events: none;
}
/* 整只螃蟹（含气泡、灯泡）靠 --x 左右移动；身体单独做蹦跳/走路的小动作 */
#crab {
  position: absolute; right: 0; bottom: 0;
  width: 36px; height: 24px; pointer-events: auto;
  transform: translateX(var(--x, 0px));
  transition: transform .8s linear;
}
#crab svg { image-rendering: pixelated; overflow: visible; }
.crab-body { display: block; width: 100%; height: 100%; }

/* 表情层默认：睁眼、钳子放平 */
#crab .eyes-closed, #crab .eyes-rush, #crab .arm-r-up, #crab .curl { visibility: hidden; }
#crab .eye { animation: blink 4s steps(1) infinite; }
@keyframes blink { 0%, 95% { opacity: 1; } 96%, 100% { opacity: 0; } }

/* 平时的小动作（JS 随机加 class） */
#crab.hop .crab-body { animation: crab-hop .65s ease; }
@keyframes crab-hop {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-7px); }
  55% { transform: translateY(0); }
  75% { transform: translateY(-2px); }
}
#crab.look .eyes-open { animation: look 1.7s steps(1); }
@keyframes look { 0%, 100% { transform: none; } 15% { transform: translateX(-1px); } 50% { transform: translateX(1px); } 80% { transform: none; } }
#crab.wave .arm-r { animation: arm-off .4s steps(1) infinite; }
#crab.wave .arm-r-up { animation: arm-on .4s steps(1) infinite; }
@keyframes arm-on { 0% { visibility: visible; } 50% { visibility: hidden; } }
@keyframes arm-off { 0% { visibility: hidden; } 50% { visibility: visible; } }
#crab.shuffle .crab-body { animation: shuffle .75s steps(1); }
#crab.shuffle .l1 { animation: leg .19s steps(1) infinite; }
#crab.shuffle .l2 { animation: leg .19s steps(1) infinite reverse; }
@keyframes shuffle { 0% { transform: translateX(-3px); } 25% { transform: translateX(3px); } 50% { transform: translateX(-3px); } 75% { transform: translateX(3px); } 100% { transform: none; } }

/* 走路：一颠一颠，腿交替抬 */
#crab.walking .crab-body { animation: crab-step .24s steps(1) infinite; }
#crab.walking .l1 { animation: leg .24s steps(1) infinite; }
#crab.walking .l2 { animation: leg .24s steps(1) infinite reverse; }
@keyframes crab-step { 0% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes leg { 0% { transform: translateY(0); } 50% { transform: translateY(-1px); } }

/* 赶路（走出去时）：> < 眼，腿倒腾得更快，颠得更厉害 */
#crab.rushing .eyes-open { visibility: hidden; }
#crab.rushing .eyes-rush { visibility: visible; }
#crab.rushing .crab-body { animation: crab-step .16s steps(1) infinite; }
#crab.rushing .l1 { animation: leg .16s steps(1) infinite; }
#crab.rushing .l2 { animation: leg .16s steps(1) infinite reverse; }

/* 思考（照参考图）：闭眼，右钳子弯成小把手贴在身侧 */
#crab.thinking .eyes-open, #crab.thinking .arm-r { visibility: hidden; }
#crab.thinking .eyes-closed, #crab.thinking .curl { visibility: visible; }
#crab.thinking .crab-body { animation: crab-think 1.6s ease-in-out infinite; }
@keyframes crab-think { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }

/* 想到了（照参考图）：头顶右上角举起一个小钳子，冒灯泡 */
#crab.idea .arm-r { visibility: hidden; }
#crab.idea .arm-r-up { visibility: visible; }
/* 整体蹦跳放在 .crab-inner 上，灯泡和气泡会跟着一起跳 */
.crab-inner { position: absolute; inset: 0; display: block; }
#crab.jump .crab-inner { animation: crab-jump .6s cubic-bezier(.3, 0, .4, 1); }
@keyframes crab-jump {
  0%, 100% { transform: translateY(0); }
  12% { transform: translateY(2px); }        /* 先蹲一下 */
  45% { transform: translateY(-28px); }      /* 蹦高 */
  80% { transform: translateY(0); }
  90% { transform: translateY(1px); }
}

/* 冒着灯泡滑跳回原位：左右位移靠 --x 的过渡，上下弧线靠这里 */
#crab.hophome .crab-inner { animation: hop-home .7s cubic-bezier(.3, 0, .4, 1); }
@keyframes hop-home {
  0%, 100% { transform: translateY(0); }
  10% { transform: translateY(2px); }     /* 先蹲一下 */
  45% { transform: translateY(-24px); }
  85% { transform: translateY(0); }
  92% { transform: translateY(1px); }
}

/* ---------- 螃蟹的新动作（照参考图；动作幅度小，不一直抖） ---------- */
#crab .happy-pose, #crab .love-pose, #crab .cry-pose, #crab .blush, #crab .pad, #crab .pad-arms,
#crab .eyes-happy, #crab .eyes-love, #crab .eyes-cry { visibility: hidden; }
.crab-type, .crab-sleep, .crab-z, .crab-spark { position: absolute; display: none; pointer-events: none; }
.crab-type svg, .crab-sleep svg, .crab-z svg, .crab-spark svg { width: 100%; height: 100%; }
.crab-fx { position: absolute; left: 50%; bottom: 100%; width: 0; height: 0; pointer-events: none; }

/* 替他开心：换成开心的样子（笑眼、钳子捂脸颊、翘一条腿），钳子轻轻上下 */
#crab.happy .base, #crab.happy .legs, #crab.happy .eyes-open { visibility: hidden; }
#crab.happy .happy-pose, #crab.happy .eyes-happy { visibility: visible; }
#crab.happy .cheek-l { animation: nudge 1s steps(1) infinite; }
#crab.happy .cheek-r { animation: nudge 1s steps(1) infinite .5s; }
@keyframes nudge { 0% { transform: translateY(0); } 50% { transform: translateY(-.5px); } }

/* 替他冒爱心（照图）：平时是普通的样子；每冒一颗心，身体往上伸长、钳子举成小耳朵，头上一颗实心的心；
   身体缩回来的时候，心变成空心的一圈，散开消失。点一下冒一颗 */
#crab.love.stretch .base, #crab.love.stretch .eyes-open { visibility: hidden; }
#crab.love.stretch .love-pose, #crab.love.stretch .eyes-love { visibility: visible; }
.crab-heart { position: absolute; left: -10px; bottom: 6px; width: 20px; height: 17px; }
.crab-heart svg { position: absolute; image-rendering: pixelated; opacity: 0; }
.crab-heart .h-solid { left: 3px; bottom: 5px; width: 14px; height: 12px; animation: heart-solid 1.3s forwards; }
.crab-heart .h-ring { left: 0; bottom: 0; width: 20px; height: 16.4px; animation: heart-ring 1.3s ease-out forwards; }
@keyframes heart-solid {
  0%   { opacity: 0; transform: translateY(3px) scale(.5); }
  12%  { opacity: 1; transform: translateY(0) scale(1.1); }
  20%  { transform: scale(1); }
  49.9% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes heart-ring {
  0%, 49.9% { opacity: 0; }
  50%  { opacity: 1; transform: scale(.85); }
  100% { opacity: 0; transform: translateY(-3px) scale(1.25); }
}

/* 替他哭：一直是第一帧的大眼睛；左眼一小滴泪往下掉，身体一抖一抖 */
#crab.cry .eyes-open, #crab.cry .arm-l, #crab.cry .arm-r { visibility: hidden; }
#crab.cry .eyes-cry, #crab.cry .cry-pose, #crab.cry .blush { visibility: visible; }
#crab.cry .shine.s2 { visibility: hidden; }
#crab.cry .drop { animation: drop 1.6s ease-in infinite; }
@keyframes drop { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(3px); } }
#crab.cry .crab-body { animation: sob-shake .45s steps(2) infinite; }
@keyframes sob-shake { 0% { transform: translateX(-.5px); } 50% { transform: translateX(.5px); } }

/* 睡觉（照图）：换成钻被窝的样子，头上的 Z 轻轻冒出来又消失 */
#crab.sleep .crab-body { display: none; }
#crab.sleep .crab-sleep { display: block; width: 51px; height: 27px; left: -13.5px; bottom: 0; }
#crab.sleep .crab-z { display: block; width: 8px; height: 8px; left: 22px; bottom: 20px; opacity: 0; animation: zzz 3.2s ease-in-out infinite; }
#crab.sleep .crab-z.z2 { width: 5px; height: 5px; left: 15px; bottom: 16px; animation-delay: 1.6s; }
@keyframes zzz { 0% { opacity: 0; transform: translateY(2px); } 30%, 60% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-3px); } }

/* 打游戏（照图）：身体不动，两只手轮流按，偶尔眯一下 > < */
#crab.gaming .arm-l, #crab.gaming .arm-r { visibility: hidden; }
#crab.gaming .pad, #crab.gaming .pad-arms { visibility: visible; }
#crab.gaming .pa-l { animation: nudge .5s steps(1) infinite; }
#crab.gaming .pa-r { animation: nudge .5s steps(1) infinite .25s; }
#crab.gaming .eyes-open { animation: game-blink 4s steps(1) infinite; }
#crab.gaming .eyes-rush { animation: game-squint 4s steps(1) infinite; }
@keyframes game-blink { 0%, 88% { visibility: visible; } 89%, 100% { visibility: hidden; } }
@keyframes game-squint { 0%, 88% { visibility: hidden; } 89%, 100% { visibility: visible; } }
#crab.gaming .eye { animation: none; }
#crab.gaming .crab-spark { display: block; width: 8px; height: 8px; right: -9px; top: -7px; animation: spark 1.6s steps(1) infinite; }
@keyframes spark { 0% { opacity: 1; } 50% { opacity: .35; } }

/* 敲电脑（他搜索、读网页、写文件时）：照图的四帧快速循环，敲一会停一会 */
#crab.typing .crab-body { display: none; }
#crab.typing .crab-type { display: block; width: 54px; height: 36px; left: -16.5px; bottom: 0; }
#crab .crab-type .tf { display: none; }
#crab[data-f="1"] .crab-type .f1, #crab[data-f="2"] .crab-type .f2,
#crab[data-f="3"] .crab-type .f3, #crab[data-f="4"] .crab-type .f4 { display: inline; }
#crab.typing .crab-bubble { opacity: 0; }

/* 思考气泡 */
.crab-bubble {
  position: absolute; left: 66%; bottom: calc(100% + 5px);   /* 稍微抬高，让开头顶的小凸起 */
  width: 27px; height: 21px;
  opacity: 0; transform: scale(.3); transform-origin: 10% 100%;
  transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
#crab.thinking .crab-bubble { opacity: 1; transform: none; }
.crab-bubble .d { animation: bdot 1.2s steps(1) infinite; }
.crab-bubble .d2 { animation-delay: .2s; }
.crab-bubble .d3 { animation-delay: .4s; }
@keyframes bdot { 0%, 50% { opacity: 1; } 51%, 100% { opacity: .25; } }

/* 完成时的灯泡 */
.crab-bulb {
  position: absolute; left: 40%; bottom: calc(100% + 3px);
  width: 21px; height: 30px; margin-left: -10.5px;
  opacity: 0; transform-origin: 50% 100%;
  filter: drop-shadow(0 0 5px rgba(255, 196, 70, .75));
}
/* 灯泡冒出来，亮着一起滑跳回去，落地后再慢慢消失 */
#crab.idea .crab-bulb { animation: bulb 2.2s ease both; }
@keyframes bulb {
  0%   { opacity: 0; transform: translateY(8px) scale(.3); }
  15%  { opacity: 1; transform: translateY(-2px) scale(1.15); }
  25%  { transform: none; }
  80%  { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-8px); }
}

/* ---------- 遮罩 ---------- */
.scrim {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(40, 32, 26, .22);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.scrim.clear { background: transparent; }
.scrim.show { opacity: 1; pointer-events: auto; }
#ctx-scrim { position: fixed; z-index: 60; background: rgba(40, 32, 26, .08); }

/* ---------- 侧边栏 ---------- */
#sidebar {
  position: absolute; z-index: 41; top: 0; bottom: 0; left: 0;
  width: min(84%, 320px);
  border-radius: 0 28px 28px 0;
  background: var(--glass-strong);
  padding: calc(var(--top-offset) + 6px) 18px calc(var(--sab) + 22px);
  display: flex; flex-direction: column;
  overflow: hidden;   /* 分割线以上固定，只有下面的功能列表滚动 */
  transform: translateX(-105%); visibility: hidden;
  transition: transform .3s cubic-bezier(.3, .8, .3, 1), visibility 0s .3s;
}
#sidebar::-webkit-scrollbar { display: none; }
#sidebar.show { transform: none; visibility: visible; transition-delay: 0s; }

/* 圆角方块 + 分层阴影（侧边栏和全屏页的卡片共用） */
.card {
  background: rgba(255, 255, 255, .74);
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(60, 44, 30, .06),
    0 4px 12px rgba(60, 44, 30, .06),
    0 12px 28px rgba(60, 44, 30, .05);
}

.sb-brand {
  font-family: "Didot", "Bodoni 72", Georgia, "Songti SC", serif;
  font-size: 27px; letter-spacing: 1px; text-align: center;
  padding: 4px 0 20px;
}
/* 三列：头像 | 缠绕线 | 头像，第二行名字各自对齐在头像正下方 */
.sb-couple {
  display: grid; grid-template-columns: 58px 54px 58px; justify-content: center;
  align-items: center; row-gap: 10px;
}
/* 侧边栏的大头像保留分层阴影（聊天里的小头像不要阴影） */
.sb-av {
  --avatar: 58px;
  box-shadow: 0 1px 2px rgba(60, 44, 30, 0.14), 0 4px 10px rgba(60, 44, 30, 0.12), 0 12px 26px rgba(60, 44, 30, 0.10);
}
.sb-wave { width: 54px; height: 16px; }
.sb-name {
  text-align: center; white-space: nowrap;
  font-family: Georgia, "Songti SC", serif; font-size: 12.5px; letter-spacing: 1.5px; color: var(--muted);
}

.sb-divider { height: 1px; background: rgba(120, 100, 80, .16); margin: 22px 4px 18px; flex: none; }

/* 磨砂方块：标题 + 灰色小字，分层阴影 */
.sb-menu {
  display: flex; flex-direction: column; gap: 10px;
  flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none;
  margin: 0 -18px; padding: 2px 18px 24px;   /* 左右留出阴影的位置，不被裁掉 */
}
.sb-menu::-webkit-scrollbar { display: none; }
.sb-brand, .sb-couple, .sb-divider { flex: none; }
.sb-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 12px 16px; border-radius: 16px; text-align: left;
  background: rgba(255, 255, 255, .42);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow:
    0 1px 2px rgba(60, 44, 30, .06),
    0 4px 12px rgba(60, 44, 30, .06),
    0 12px 28px rgba(60, 44, 30, .05),
    inset 0 1px 0 rgba(255, 255, 255, .8);
  transition: transform .15s;
}
.sb-item:active { transform: scale(.97); }
.sb-item b { font-size: 13px; font-weight: 600; display: flex; align-items: baseline; gap: 6px; }
.sb-item b small { font-size: 11px; font-weight: 400; color: var(--muted); }
.sb-item em { font-style: normal; font-size: 11.5px; color: var(--muted); }

/* ---------- 菜单 ---------- */
.menu {
  position: absolute; z-index: 42;
  min-width: 170px; padding: 6px; border-radius: 18px;
  background: var(--glass-strong);
  display: flex; flex-direction: column;
  opacity: 0; transform: scale(.94); pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.menu.show { opacity: 1; transform: none; pointer-events: auto; }
.menu button {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px; text-align: left; font-size: 14px;
}
/* 带分隔线的菜单 */
.menu.lined { padding: 4px 6px; }
.menu.lined button { border-radius: 0; padding: 12px 10px; }
.menu.lined button + button { border-top: 1px solid rgba(120, 100, 80, .13); }
.menu.lined button:active { background: none; opacity: .6; }
.menu button:active { background: rgba(120, 100, 80, .1); }
.menu button i { width: 19px; height: 19px; color: var(--ink-2); flex: none; }
.menu button.danger, .menu button.danger i { color: #C4553A; }
#more-menu { top: calc(var(--top-offset) + 48px); right: 16px; transform-origin: top right; }
#ctx { position: fixed; z-index: 62; }

/* ---------- 底部面板 ---------- */
#sheet-scrim { z-index: 47; }   /* 盖在全屏页上面（表情库页面里编辑表情要用） */
#sheet {
  position: absolute; z-index: 48; left: 0; right: 0; bottom: 0;
  height: 58%;
  border-radius: 30px 30px 0 0;
  background: rgba(248, 246, 243, 0.72);
  padding: 10px 26px calc(var(--sab) + 24px);
  display: flex; flex-direction: column;
  transform: translateY(105%); visibility: hidden;
  transition: transform .32s cubic-bezier(.3, .8, .3, 1), visibility 0s .32s;
}
#sheet.show { transform: none; visibility: visible; transition-delay: 0s; }
/* 模型切换（照官端样子）：不透明，没有拖动条和居中大标题，用自己的顶栏：左边 × / ‹，中间标题 */
#sheet.mp-sheet {
  background: #F9F7F4; -webkit-backdrop-filter: none; backdrop-filter: none; border: 0;
  height: auto; max-height: 86%; padding: 14px 18px calc(var(--sab) + 22px);
}
#sheet.mp-sheet .sheet-handle, #sheet.mp-sheet h2 { display: none; }
#sheet.mp-sheet #sheet-body { white-space: normal; }
.mp-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; margin: 4px 0 22px; }
.mp-head button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink); }
.mp-head button svg { width: 20px; height: 20px; }
.mp-head b { text-align: center; font-size: 19px; font-weight: 700; color: var(--ink); }
.mp { display: flex; flex-direction: column; gap: 14px; padding-bottom: 6px; }
.mp-group { border-radius: 22px; overflow: hidden; background: #F1EDE8; }
.mp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 18px 22px; text-align: left; }
.mp-row + .mp-row { border-top: 1px solid rgba(120, 100, 80, .1); }
.mp-row:active { background: rgba(120, 100, 80, .06); }
.mp-row b { display: block; font-size: 16px; font-weight: 600; color: var(--ink); }
.mp-row em { display: block; font-style: normal; font-size: 13.5px; color: #9A928A; margin-top: 4px; }
.mp-val { font-size: 15px; color: #9A928A; }
.mp-check { width: 18px; height: 18px; color: var(--ink); flex: none; }
/* 全屏编辑页（编辑表情用）：不透明、不磨砂，标题靠左，右上角 × */
#sheet-close { display: none; }
#sheet.full-sheet {
  top: 0; height: auto; border-radius: 0; border: 0;
  background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
  padding: var(--top-offset) 22px calc(var(--sab) + 20px);
}
#sheet.full-sheet .sheet-handle { display: none; }
#sheet.full-sheet h2 { display: none; }   /* 不要大标题，只留右上角 × */
#sheet.full-sheet #sheet-body { padding-top: 46px; }
#sheet.full-sheet .st-input { font-size: 14px; }
#sheet.full-sheet textarea.st-input { white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: hidden; }
#sheet.full-sheet #sheet-close {
  display: grid; place-items: center; position: absolute; top: calc(var(--top-offset) - 2px); right: 14px;
  width: 44px; height: 44px; color: var(--ink-2);
}
#sheet.full-sheet #sheet-close svg { width: 22px; height: 22px; }
#sheet.full-sheet .st-preview { width: 120px; height: 120px; border-radius: 16px; }
#sheet.dragging { transition: none; }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: #D5CBBF; margin: 0 auto 18px; flex: none; }
#sheet h2 { margin: 0 0 18px; text-align: center; font-size: 20px; font-weight: 700; }
#sheet-body { overflow-y: auto; flex: 1; font-size: 14.5px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; }
.info-row { display: flex; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid rgba(120, 100, 80, .1); white-space: normal; }
.info-row b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- 全屏页 ---------- */
.page {
  position: absolute; inset: 0; z-index: 45;
  background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(100%); visibility: hidden;
  transition: transform .32s cubic-bezier(.3, .8, .3, 1), visibility 0s .32s;
}
.page.show { transform: none; visibility: visible; transition-delay: 0s; }
.page-head {
  display: flex; align-items: center; gap: 12px;
  padding: var(--top-offset) 16px 14px;
}
.page-title { font-size: 17px; font-weight: 700; }
#page-count { font-weight: 400; color: var(--muted); font-size: 14px; }
.page-body { flex: 1; overflow-y: auto; padding: 4px 16px calc(var(--sab) + 24px); }
.page-body > .card { margin-bottom: 10px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 12px; }
.file-ico {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: rgba(120, 100, 80, .08); color: var(--ink-2);
}
.file-ico svg { width: 21px; height: 21px; }
.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-info b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info em { font-style: normal; font-size: 12px; color: var(--muted); }
.page-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin-top: 26vh; text-align: center; padding: 0 30px;
}
.page-empty .file-ico { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 10px; }
.page-empty .file-ico svg { width: 26px; height: 26px; }
.page-empty b { font-size: 15px; font-weight: 600; color: var(--ink); }
.page-empty em { font-style: normal; font-size: 13px; color: var(--muted); line-height: 1.6; }
.page-note { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 4px 4px 14px; }
.page-label { font-size: 12px; color: var(--muted); letter-spacing: 1px; margin: 22px 4px 10px; }
.file-ico img { display: block; width: 42px; height: 42px; object-fit: cover; }
.file-row .file-ico { overflow: hidden; }   /* 大图不再凸出来 */
.file-row[data-src] { cursor: pointer; }

/* 额度消耗 */
.quota { padding: 16px 16px 14px; }
#quota-box > .card { margin-bottom: 10px; }
.quota-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; }
.quota-top b { font-weight: 600; font-variant-numeric: tabular-nums; }
.quota-bar { height: 7px; border-radius: 4px; background: rgba(120, 100, 80, .1); margin: 10px 0 8px; overflow: hidden; }
.quota-bar i { display: block; height: 100%; border-radius: inherit; background: #C98A70; }
.quota em { font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* 缓存数据 2×2 */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 上下文管理 */
.ctx-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.ctx-row b { display: block; font-size: 14px; font-weight: 600; }
.ctx-row em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
/* 开关（注意别叫 .switch，那个名字消息间距在用） */
.toggle {
  position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px;
  background: rgba(120, 100, 80, .18); transition: background .2s;
}
.toggle i {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); transition: transform .2s;
}
.toggle.on { background: #C98A70; }
.toggle.on i { transform: translateX(18px); }

/* 全屏页右上角的文字按钮（编辑 / 完成 / 删除分组） */
.page-action { margin-left: auto; font-size: 14px; font-weight: 500; color: var(--ink-2); padding: 8px 4px; }

/* 缓存卡片（参考图样式） */
.cache-card { padding: 16px 18px 16px; }
.cache-head { display: flex; align-items: center; gap: 7px; padding-bottom: 12px; border-bottom: 1px solid rgba(201, 138, 112, .22); }
.cache-head i { width: 6px; height: 6px; border-radius: 50%; background: #1F1C1A; flex: none; }
.cache-head b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.cache-head span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cache-head em { margin-left: auto; font-style: normal; font-size: 18px; font-weight: 500; color: #C98A70; font-variant-numeric: tabular-nums; }
.cache-stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 14px 0; }
.cache-stats div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cache-stats div + div { border-left: 1px solid rgba(120, 100, 80, .12); }
.cache-stats b { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cache-stats span { font-size: 11.5px; color: var(--muted); }
.cache-foot { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.cache-card .quota-bar { margin: 0; }

/* 表情库页 */
.sticker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; }
.sticker-grid .st-desc { font-size: 12px; }
.st-tile-wrap { position: relative; min-width: 0; }
.st-tile-wrap .st-tile { width: 100%; }
.st-x {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%;
  display: none; place-items: center; padding: 5px;
  background: #C4553A; color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.sticker-grid.editing .st-x { display: grid; }
.sticker-grid.editing .st-tile-wrap { animation: wiggle .3s ease-in-out infinite alternate; }
@keyframes wiggle { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }

/* 相册首页：左上角新建分组 + 一个分组一张长条卡片 */
.album-new {
  height: 32px; padding: 0 14px; margin: 0 0 14px 2px; border-radius: 999px;
  border: 1px dashed rgba(120, 100, 80, .35); font-size: 13px; color: var(--ink-2);
}
.album-card { display: block; width: 100%; text-align: left; padding: 14px 14px 14px; transition: transform .15s; }
.album-card:active { transform: scale(.98); }
.album-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.album-head b { font-size: 14.5px; font-weight: 600; }
.album-head span { font-size: 12px; color: var(--muted); }
.album-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.album-thumb { position: relative; display: block; height: 0; padding-bottom: 100%; border-radius: 8px; overflow: hidden; background: rgba(120, 100, 80, .08); }
.album-thumb img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.album-thumb em {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(30, 24, 20, .45); color: #fff; font-style: normal; font-size: 14px; font-weight: 600;
}
.album-none {
  height: 64px; border-radius: 8px; border: 1px dashed rgba(120, 100, 80, .2);
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; color: var(--muted);
}
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.photo-tile { position: relative; display: block; width: 100%; height: 0; padding-bottom: 100%; overflow: hidden; border-radius: 6px; background: rgba(120, 100, 80, .08); }
.photo-tile img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* 选分组 */
.group-pick { gap: 8px; }
.group-opt { width: 100%; text-align: left; padding: 14px 16px; font-size: 14px; }
.group-opt.add { color: var(--muted); }

/* 看大图 */
#viewer {
  position: absolute; inset: 0; z-index: 80;
  background: rgba(12, 10, 9, .94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#viewer.show { opacity: 1; pointer-events: auto; }
#viewer img { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-touch-callout: default; }
.viewer-bar {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--sat) + 16px) 16px 16px;
}
.viewer-actions { display: flex; gap: 10px; }
.viewer-btn {
  height: 40px; min-width: 40px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 10px;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 13px;
}
.viewer-btn svg { width: 20px; height: 20px; }
.viewer-btn.wide { padding: 0 14px; }

/* 弹窗里的输入框 */
.dlg-input {
  display: block; width: calc(100% - 36px); margin: 4px 18px 18px;
  border: 1px solid rgba(120, 100, 80, .18); border-radius: 12px; outline: none;
  background: rgba(255, 255, 255, .8); padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ink);
}

/* ---------- 居中小弹窗 ---------- */
#dialog-scrim { z-index: 50; }
#dialog {
  position: absolute; z-index: 51; left: 50%; top: 50%;
  width: 270px; border-radius: 20px; overflow: hidden;
  background: var(--glass-strong);
  text-align: center;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%) scale(1.08);
  transition: opacity .18s, transform .18s;
}
#dialog.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
#dialog h3 { margin: 20px 18px 6px; font-size: 16px; font-weight: 700; }
#dialog p { margin: 0 18px 18px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.dlg-actions { display: flex; border-top: 1px solid rgba(120, 100, 80, .15); }
.dlg-actions button { flex: 1; height: 46px; font-size: 15px; }
.dlg-actions button + button { border-left: 1px solid rgba(120, 100, 80, .15); font-weight: 600; }
.dlg-actions button.danger { color: #C4553A; }
.dlg-actions button:active { background: rgba(120, 100, 80, .08); }

/* ---------- 记忆摘要 ---------- */
.mem-label { display: flex; justify-content: space-between; align-items: center; }
.mem-label button { font-size: 12.5px; color: var(--ink-2); letter-spacing: 0; }
.mem-card { display: block; width: 100%; text-align: left; padding: 14px 16px; }
.mem-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mem-top b { font-size: 14px; font-weight: 600; }
.mem-tag { flex: none; font-size: 11px; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: rgba(120, 100, 80, .08); }
.mem-tag.on { color: #fff; background: #1F1C1A; }
.mem-card p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.mem-warn { display: block; margin-top: 6px; font-style: normal; font-size: 11.5px; color: #B0654B; }
.mem-replace { align-self: flex-start; font-size: 13px; padding: 7px 12px; border-radius: 999px; background: rgba(120, 100, 80, .08); color: var(--ink-2); }

/* ---------- 登录页 ---------- */
#login {
  position: absolute; inset: 0; z-index: 90;
  display: none; align-items: center; justify-content: center; padding: 24px;
  background: var(--bg);
}
#login.show { display: flex; }
.login-card { width: 100%; max-width: 320px; padding: 30px 22px 22px; border-radius: 26px; display: flex; flex-direction: column; gap: 12px; }
.login-brand { font-family: "Didot", "Bodoni 72", Georgia, serif; font-size: 30px; text-align: center; }
.login-sub { margin: -4px 0 8px; text-align: center; font-size: 13.5px; color: var(--muted); }
.login-input {
  height: 46px; border-radius: 14px; border: 1px solid rgba(120, 100, 80, .16); outline: none;
  background: rgba(255, 255, 255, .75); padding: 0 14px; font: inherit; font-size: 16px; color: var(--ink);
}
.login-input:focus { border-color: rgba(120, 100, 80, .4); }
.login-btn { height: 46px; border-radius: 999px; background: #1F1C1A; color: #fff; font-size: 15px; font-weight: 600; margin-top: 4px; }
.login-btn:disabled { opacity: .5; }
.login-err { min-height: 18px; margin: 0; font-size: 13px; color: #C4553A; text-align: center; }
.login-note { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); text-align: center; }

/* ---------- toast ---------- */
#toast {
  position: absolute; z-index: 70; left: 50%;
  bottom: calc(var(--composer-h) + var(--bottom-offset) + 46px);
  transform: translate(-50%, 10px);
  padding: 9px 18px; border-radius: 999px; font-size: 14px; white-space: nowrap;
  background: var(--glass-strong);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 运行日志 */
.log-row { display: flex; gap: 10px; padding: 8px 4px; font-size: 13px; line-height: 1.5; border-bottom: 1px solid rgba(120, 100, 80, .08); }
.log-row time { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; }
.log-row span { word-break: break-all; }
.log-row.warn span { color: #B8863B; }
.log-row.error span { color: #C4553A; }

/* 搬家检查中：聊天锁着 */
.card.lock-card { padding: 14px 16px; margin-bottom: 10px; background: #FBF1EC; border: 1px solid rgba(201, 119, 90, .25); display: flex; flex-direction: column; gap: 4px; }
.lock-card b { font-size: 14.5px; color: #B8603F; }
.lock-card em { font-style: normal; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
#sheet.full-sheet .mem-text { min-height: 55vh; }   /* 长摘要：输入框占大半屏 */

/* ---------- 他回复里的卡片 ---------- */
.card-row { padding: 4px 0 4px calc(var(--avatar) + 10px); }   /* 和气泡左边对齐 */

/* 选项卡：圆角、阴影、半透明，点一个就当成我的话发出去 */
.opt-card {
  display: flex; flex-direction: column; gap: 6px; width: min(72%, 300px); padding: 8px;
  border-radius: 18px; background: rgba(255, 253, 250, .72);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .8); box-shadow: 0 2px 6px rgba(60, 44, 30, .06), 0 8px 22px rgba(60, 44, 30, .08);
  animation: card-in .35s cubic-bezier(.3, 1.3, .5, 1) both;
}
.opt { text-align: left; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; color: var(--ink);
  background: rgba(120, 100, 80, .06); transition: background .15s, transform .15s; }
.opt:active { transform: scale(.98); background: rgba(217, 119, 87, .14); }
@keyframes card-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

/* 任务在聊天里留一行记录 */
.task-inline { display: inline-flex; align-items: center; gap: 8px; max-width: min(72%, 300px); padding: 7px 12px; border-radius: 12px;
  font-size: 12.5px; color: var(--ink-2); background: rgba(255, 253, 250, .7); box-shadow: 0 1px 4px rgba(60, 44, 30, .06); }
.task-inline i { width: 6px; height: 6px; border-radius: 50%; background: #B5705A; flex: none; }
.task-inline span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-inline em { font-style: normal; font-size: 11.5px; color: var(--muted); flex: none; }
.task-inline.done em { color: #6E9B6A; }
.task-inline.cancel em, .task-inline.timeout em { color: #C4553A; }

/* 任务卡：浮在输入框上面，照参考图 */
#taskcard {
  position: absolute; z-index: 30; right: 14px; bottom: calc(var(--composer-h) + var(--bottom-offset) + 12px);
  width: min(62vw, 250px); padding: 11px 13px 10px; border-radius: 20px;
  background: rgba(252, 250, 247, .9); box-shadow: 0 4px 12px rgba(60, 44, 30, .08), 0 16px 40px rgba(60, 44, 30, .14);
  opacity: 0; visibility: hidden; transform: translateY(24px) scale(.94);
  transition: transform .45s cubic-bezier(.3, 1.35, .5, 1), opacity .3s, visibility 0s .45s;
  touch-action: pan-y; -webkit-user-select: none; user-select: none;
}
#taskcard.show { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
#taskcard.dragging { transition: none; }
#taskcard.done-out, #taskcard.cancel-out { opacity: 0; transition: transform .38s ease-in, opacity .38s; }
.tk-head { display: flex; align-items: center; gap: 8px; }
.tk-tag { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: #8A5A48; letter-spacing: .08em; }
.tk-tag i { width: 7px; height: 7px; border-radius: 50%; background: #B5705A; animation: tk-dot 1.6s ease-in-out infinite; }
@keyframes tk-dot { 50% { opacity: .35; } }
.tk-mini-time { display: none; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; }
.tk-fold { margin-left: auto; width: 24px; height: 24px; display: grid; place-items: center; color: var(--muted); }
.tk-fold svg { width: 16px; height: 16px; }
.tk-title { margin: 6px 0 5px; font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.tk-clock { display: flex; align-items: baseline; gap: 8px; }
.tk-time { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 27px; font-weight: 700; letter-spacing: 1px; color: #1F1C1A; line-height: 1; }
.tk-left { font-size: 11.5px; color: var(--ink-2); }
.tk-start { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tk-bar { height: 4px; border-radius: 2px; background: rgba(120, 100, 80, .12); margin: 8px 0 7px; overflow: hidden; }
.tk-bar i { display: block; height: 100%; border-radius: inherit; background: #5E5751; transition: width .25s linear; }
.tk-hint { display: flex; gap: 14px; font-size: 11px; color: var(--muted); }
#taskcard.over .tk-time, #taskcard.over .tk-left { color: #C4553A; }
#taskcard.over .tk-bar i { background: #C4553A; }
/* 收起：只剩一小条 */
#taskcard.mini { width: auto; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
#taskcard.mini .tk-title, #taskcard.mini .tk-clock, #taskcard.mini .tk-bar, #taskcard.mini .tk-hint, #taskcard.mini .tk-fold { display: none; }
#taskcard.mini .tk-mini-time { display: inline; }

/* artifact：可以玩的网页卡片 */
.art-card { position: relative; width: min(78%, 330px); border-radius: 18px; overflow: hidden; background: #fff;
  box-shadow: 0 2px 6px rgba(60, 44, 30, .06), 0 8px 22px rgba(60, 44, 30, .1); animation: card-in .35s cubic-bezier(.3, 1.3, .5, 1) both; }
.art-frame { display: block; width: 100%; height: 160px; border: 0; background: #fff; }
.art-full { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--ink-2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.art-full svg { width: 15px; height: 15px; }
.art-title { margin: 6px 0 0 4px; font-size: 11.5px; color: var(--muted); }
#artview { position: absolute; inset: 0; z-index: 85; background: var(--bg); display: none; flex-direction: column; }
#artview.show { display: flex; animation: card-in .25s ease both; }
.artview-head { display: flex; align-items: center; gap: 10px; padding: var(--top-offset) 16px 10px; }
#artview-title { flex: 1; font-size: 15px; font-weight: 600; color: var(--ink); }
#artview-close { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
#artview-close svg { width: 20px; height: 20px; }
#artview .art-frame { flex: 1; height: auto; }

/* 选项卡：题目 + 「其它」自己输入 */
.opt-q { padding: 4px 6px 4px; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.opt.other { color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1px rgba(120, 100, 80, .16); }
.opt-input { display: none; align-items: flex-end; gap: 6px; }
.opt-card.typing-other .opt { display: none; }
.opt-card.typing-other .opt-input { display: flex; }
.opt-input textarea { flex: 1; min-height: 38px; max-height: 120px; resize: none; border: 1px solid rgba(120, 100, 80, .16); border-radius: 12px;
  padding: 9px 12px; font: inherit; font-size: 13.5px; line-height: 1.5; color: var(--ink); background: rgba(255, 255, 255, .8); outline: none; }
.opt-send { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #1F1C1A; color: #fff; }
.opt-send svg { width: 16px; height: 16px; }

/* 我发给他的卡片（选项答案 / 任务结果） */
.msg .bubble.ucard { min-width: 150px; max-width: min(66%, 260px); padding: 10px 13px; border-radius: 16px; white-space: normal;
  background: rgba(255, 253, 250, .85); box-shadow: 0 1px 4px rgba(60, 44, 30, .06), 0 6px 16px rgba(60, 44, 30, .07); }
.uc-head { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.uc-dot { width: 6px; height: 6px; border-radius: 50%; background: #B5705A; }
.uc-q { margin: 4px 0 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.uc-a { display: flex; align-items: flex-start; gap: 6px; padding: 7px 10px; border-radius: 10px; font-size: 13.5px; line-height: 1.5;
  color: var(--ink); background: rgba(217, 119, 87, .12); }
.uc-a i { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--accent); }
.uc-a i svg { width: 100%; height: 100%; }
.uc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }
.uc-st { font-size: 12.5px; }
.uc-st.done { color: #6E9B6A; }
.uc-st.cancel { color: var(--muted); }
.uc-st.timeout { color: #C4553A; }

/* ---------- 背景图（设置里换） ---------- */
#bg { position: absolute; inset: 0; z-index: 0; background: center / cover no-repeat; display: none; pointer-events: none; }
#bg.on { display: block; }
#bg.blur { filter: blur(var(--bg-blur, 12px)); transform: scale(1.08); }   /* 放大一点，模糊的边缘不露白 */

/* ---------- 设置页 ---------- */
.set-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 999px; background: rgba(120, 100, 80, .08); position: relative; }
.set-tabs button { flex: 1; height: 34px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); position: relative; z-index: 1; transition: color .2s; }
.set-tabs button.on { color: var(--ink); }
.set-tabs i { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: 999px; background: #fff;
  box-shadow: 0 1px 3px rgba(60, 44, 30, .1); transition: transform .28s cubic-bezier(.3, 1.2, .5, 1); }
.set-tabs.sys i { transform: translateX(calc(100% + 4px)); }
.set-card { padding: 4px 14px; margin-bottom: 10px; }
.set-row { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 0; }
.set-row + .set-row { border-top: 1px solid rgba(120, 100, 80, .08); }
.set-row > b { font-size: 14px; font-weight: 500; color: var(--ink); flex: none; }
.set-row > em { font-style: normal; font-size: 12px; color: var(--muted); }
.set-row .grow { flex: 1; min-width: 0; }
.set-row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.set-row.off { opacity: .4; pointer-events: none; }
.set-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; padding: 0 0 8px; }
.set-tag { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: rgba(120, 100, 80, .1); color: var(--muted); margin-left: 6px; font-weight: 400; }
.set-input { width: 100%; height: 38px; border: 1px solid rgba(120, 100, 80, .15); border-radius: 12px; padding: 0 12px; font: inherit; font-size: 14px;
  color: var(--ink); background: rgba(255, 255, 255, .7); outline: none; }
textarea.set-input { height: auto; min-height: 110px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.set-input:focus { border-color: rgba(217, 119, 87, .5); }
/* 分段选择（圆形/圆角方形、禁用/询问/允许）：一个圆角框，里面一块小黑块滑到选中的那个上 */
.seg { position: relative; display: flex; padding: 3px; border-radius: 12px; background: rgba(120, 100, 80, .08); flex: none; }
.seg button { position: relative; z-index: 1; min-width: 44px; height: 28px; padding: 0 10px; font-size: 12.5px; color: var(--ink-2); transition: color .2s; }
.seg button.on { color: #fff; }
.seg i { position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 9px; background: #1F1C1A; transition: transform .25s cubic-bezier(.3, 1.2, .5, 1), width .25s; }
.set-color { display: flex; align-items: center; gap: 10px; }
.set-color input[type=color] { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: none; overflow: hidden; flex: none; }
.set-color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.set-color input[type=color]::-webkit-color-swatch { border: 1px solid rgba(120, 100, 80, .2); border-radius: 10px; }
.set-range { flex: 1; accent-color: #1F1C1A; }
.set-val { font-size: 12px; color: var(--muted); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.set-preview { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--bg); }
.set-preview span { max-width: 70%; padding: 7px 11px; border-radius: 12px; font-size: 13px; }
.set-preview .pv-me { align-self: flex-end; }
.set-img { width: 64px; height: 64px; border-radius: 12px; background: rgba(120, 100, 80, .08) center / cover no-repeat; flex: none; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.set-themes { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.set-themes::-webkit-scrollbar { display: none; }
.set-actions { display: flex; gap: 10px; margin: 16px 0 30px; }
.set-actions button { flex: 1; height: 44px; border-radius: 999px; font-size: 15px; font-weight: 600; }
.set-save { background: #1F1C1A; color: #fff; }
.set-reset { background: rgba(120, 100, 80, .1); color: var(--ink-2); }
.set-row > b { min-width: 96px; }   /* 左边标题对齐 */

/* ---------- 设置页（第二版） ---------- */
/* 设置页的卡片是磨砂的；有背景图时，设置页也铺上同一张背景 */
body.has-bg #page.is-settings { background: var(--bg) var(--bg-image) center / cover no-repeat; }
#page.is-settings .card { background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 1px 3px rgba(60, 44, 30, .05), 0 6px 18px rgba(60, 44, 30, .06); }
.set-sec { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); margin: 20px 4px 8px; }
.set-sec em { font-style: normal; font-size: 11px; font-weight: 400; color: var(--muted); }
.sec-btn { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 400; color: var(--ink-2); }
.sec-btn svg { width: 13px; height: 13px; }
.set-row > b { font-size: 13px; }
.set-note { font-size: 11px; }
.set-note.pad { padding: 0 6px; }
/* 头像：不装卡片，直接隔开放，阴影分层；下面是侧边栏名字 + 小铅笔 */
.set-avatars { display: flex; justify-content: center; gap: 44px; padding: 8px 0 18px; }
.set-av { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.set-av .avatar { --avatar: 72px; box-shadow: 0 1px 2px rgba(60, 44, 30, .1), 0 6px 14px rgba(60, 44, 30, .12), 0 16px 30px rgba(60, 44, 30, .1); }
.set-name { display: flex; align-items: center; gap: 4px; }
.set-name input { width: 84px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--ink); text-align: center; outline: none; padding: 2px 0; }
.set-name input:focus { border-bottom: 1px solid rgba(120, 100, 80, .3); }
.set-name .pen { width: 13px; height: 13px; color: var(--muted); flex: none; }
.set-name .pen svg { width: 100%; height: 100%; }
.set-link { width: 100%; text-align: left; }
.set-link em { font-style: normal; color: var(--muted); font-size: 15px; }
.set-sw { width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(120, 100, 80, .15); }
.set-card.locked .set-link { opacity: .4; }
.set-card.small .set-row { min-height: 40px; }
.set-card.small .set-row > b { font-size: 12.5px; }
.set-card.small .set-input { height: 32px; font-size: 12.5px; border-radius: 10px; }
/* 滑条：圆角的槽，推钮在槽里面滑 */
.pill-range { -webkit-appearance: none; appearance: none; height: 22px; border-radius: 11px; outline: none; cursor: pointer;
  background: var(--track, linear-gradient(90deg, #1F1C1A var(--p, 50%), rgba(120, 100, 80, .14) var(--p, 50%))); }
.pill-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); margin: 0 2px; }
.pill-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
/* 小预览（一截聊天界面） */
.mini { position: relative; width: 100%; height: 108px; border-radius: 12px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; }
.mini.big { height: 190px; padding: 22px 16px; gap: 10px; }
.mini-bg { position: absolute; inset: 0; background: var(--mini-bg, none) center / cover no-repeat; filter: blur(var(--mini-blur, 0px)); transform: scale(1.08); }
.mb { position: relative; height: 16px; border-radius: 6px; width: 62%; }
.mini.big .mb { height: 26px; border-radius: 9px; }
.mb.me { align-self: flex-end; width: 50%; }
.mb.s { width: 38%; }
.bg-prev { position: relative; width: 100%; padding: 0; }
.prev-full { position: absolute; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px;
  font-size: 11px; color: var(--ink-2); background: rgba(255, 255, 255, .8); }
.prev-full svg { width: 12px; height: 12px; }
/* 已有主题：可以左右滑的小预览卡，每张都能全屏看 */
.set-themes { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.set-themes::-webkit-scrollbar { display: none; }
.th-card { position: relative; flex: none; width: 118px; padding: 6px; border-radius: 16px; display: flex; flex-direction: column; gap: 6px; scroll-snap-align: start;
  background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 1px 3px rgba(60, 44, 30, .06); }
.th-card.on { box-shadow: 0 0 0 2px #1F1C1A; }
.th-card b { font-size: 11px; font-weight: 500; color: var(--ink-2); padding: 0 4px 2px; text-align: left; }
.th-full { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .85); color: var(--ink-2); }
.th-full svg { width: 11px; height: 11px; }
.th-card.add { justify-content: center; align-items: center; min-height: 138px; color: var(--muted); }
.th-card.add span { font-size: 22px; }
/* 桌面图标：自己上传的，最多十个 */
.set-icons { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.set-icons::-webkit-scrollbar { display: none; }
.ic-card { flex: none; width: 58px; height: 58px; border-radius: 14px; background: rgba(255, 255, 255, .55) center / cover no-repeat;
  box-shadow: 0 1px 3px rgba(60, 44, 30, .08); }
.ic-card.on { box-shadow: 0 0 0 2px #1F1C1A; }
.ic-card.add { display: grid; place-items: center; font-size: 22px; color: var(--muted); }
/* API 分组方块 */
.grp { padding: 12px 14px; margin: -2px 0 10px; border-radius: 18px; background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 1px 3px rgba(60, 44, 30, .05); }
.grp-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 2px 0 8px; }
.grp-head b { font-size: 14px; font-weight: 600; color: var(--ink); }
.grp-head em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.grp-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 10px; }
.grp-list button { padding: 5px 11px; border-radius: 999px; font-size: 12px; color: var(--ink-2); background: rgba(120, 100, 80, .08); }
.grp-list button.on { background: #1F1C1A; color: #fff; }
.grp-list button.add { background: none; box-shadow: inset 0 0 0 1px rgba(120, 100, 80, .2); }
.grp-fields { display: flex; flex-direction: column; gap: 8px; }
.grp-fields .set-input { height: 36px; font-size: 13px; }
.grp-del, .grp-first { align-self: flex-start; font-size: 12px; color: #C4553A; padding: 4px 0 0; }
.grp-first { color: var(--ink-2); }
/* 弹出来的卡片、对话框：一律磨砂，不带颜色（有也是白） */
#sheet, #sheet.full-sheet, #dialog { background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(24px) saturate(1.3); backdrop-filter: blur(24px) saturate(1.3); }
#sheet.mp-sheet { background: #F9F7F4; -webkit-backdrop-filter: none; backdrop-filter: none; }   /* 模型切换照官端，不改 */
.card.lock-card { background: rgba(255, 255, 255, .6); border-color: rgba(255, 255, 255, .8); }
/* 调气泡颜色的卡片 */
#sheet.color-sheet { height: auto; padding: 14px 20px calc(var(--sab) + 16px); }
#sheet.color-sheet .sheet-handle { margin-bottom: 10px; }
#sheet.color-sheet h2 { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
#sheet.color-sheet #sheet-body { white-space: normal; }
.cp-main { display: flex; gap: 16px; align-items: stretch; }
.cp-sw { width: 104px; height: 104px; border-radius: 22px; flex: none; }
.cp-sliders { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.cp-sliders label { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); }
.cp-sliders .pill-range { flex: 1; min-width: 0; }
.cp-h { --track: linear-gradient(90deg, #f25c54, #f2c14e, #9bd46a, #5cc9d6, #6f8ef2, #c56ae0, #f25c54); }
.cp-hist { display: flex; justify-content: flex-end; align-items: center; gap: 7px; min-height: 22px; margin-top: 12px; }
.cp-hist em { font-style: normal; font-size: 11px; color: var(--muted); margin-right: 2px; }
.cp-hist button { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(120, 100, 80, .15); }
.cp-actions { display: flex; justify-content: flex-end; gap: 22px; margin-top: 12px; }
.cp-actions button { font-size: 14px; font-weight: 600; color: #1F1C1A; padding: 6px 2px; }
.cp-actions .cp-cancel { color: var(--ink-2); font-weight: 500; }
/* 全屏预览 */
#setpreview { position: absolute; inset: 0; z-index: 86; background: var(--bg); display: none; overflow: hidden; }
#setpreview.show { display: block; animation: card-in .25s ease both; }
.pv-bg { position: absolute; inset: 0; background: center / cover no-repeat; transform: scale(1.08); }
.pv-top { position: absolute; top: var(--top-offset); left: 16px; }
.pv-title { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; font-size: 14.5px; letter-spacing: 1px;
  background: rgba(255, 253, 250, .6); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.pv-msgs { position: absolute; left: 16px; right: 16px; top: 35%; display: flex; flex-direction: column; gap: 10px; }
.pv-row { display: flex; align-items: flex-start; gap: 10px; }
.pv-row.me { justify-content: flex-end; }
.pv-av { width: 32px; height: 32px; border-radius: var(--pv-r); background: #ddd center / cover; flex: none; }
.pv-row.ai .pv-av { background-image: url(../assets/avatar-ai.webp); }
.pv-row.me .pv-av { background-image: url(../assets/avatar-user.webp); }
.pv-row span { padding: 8px 12px; border-radius: 12px; font-size: 13.5px; background: var(--pv-ai); }
.pv-row.me span { background: var(--pv-me); }
.pv-composer { position: absolute; left: 14px; right: 14px; bottom: calc(var(--sab) + 22px); height: 96px; border-radius: 26px; padding: 16px 18px; color: var(--muted);
  font-size: 14px; background: rgba(255, 253, 250, .6); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.pv-close { position: absolute; top: var(--top-offset); right: 16px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 253, 250, .75); color: var(--ink-2); }
.pv-close svg { width: 18px; height: 18px; }

/* ---------- 屏幕中间的磨砂小方块（调气泡颜色、选压缩模型） ---------- */
#pop-scrim { z-index: 52; }
#popcard { position: absolute; z-index: 53; left: 50%; top: 50%; width: min(88vw, 340px); max-height: 80%; overflow-y: auto; padding: 16px 18px 12px; border-radius: 26px;
  background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(24px) saturate(1.3); backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .75); box-shadow: 0 10px 40px rgba(40, 30, 20, .18);
  opacity: 0; visibility: hidden; transform: translate(-50%, -50%) scale(.92);
  transition: opacity .2s, transform .28s cubic-bezier(.3, 1.3, .5, 1), visibility 0s .28s; }
#popcard.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%); transition-delay: 0s; }
#popcard.small { width: min(70vw, 250px); padding: 12px 10px 8px; }
/* 气泡预览：在聊天背景上放一个气泡 */
.cp-prev { display: flex; padding: 16px 14px; margin-bottom: 14px; border-radius: 16px; background: var(--bg) var(--bg-image, none) center / cover; }
.cp-prev.me { justify-content: flex-end; }
.cp-bubble { padding: 8px 12px; border-radius: 12px; font-size: 13px; color: var(--ink); }
.cp-sw { width: 88px; height: 88px; border-radius: 20px; }
/* 压缩模型小卡片 */
.mp2-title { font-size: 12.5px; font-weight: 600; color: var(--ink); padding: 2px 8px 8px; }
.mp2-group { font-size: 10.5px; color: var(--muted); padding: 8px 8px 3px; }
.mp2-row { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 8px; border-radius: 10px; font-size: 12.5px; color: var(--ink); text-align: left; }
.mp2-row:active { background: rgba(120, 100, 80, .08); }
.mp2-row.on { font-weight: 600; }
.mp2-row i { width: 14px; height: 14px; color: var(--ink); }
.mp2-row i svg { width: 100%; height: 100%; }
.mp2-btn { display: flex; align-items: center; justify-content: space-between; text-align: left; }
.mp2-btn em { font-style: normal; color: var(--muted); }

/* 整理记忆的状态 */
.mem-tag.pend { background: rgba(217, 119, 87, .14); color: #B5603F; }
.cmp-st { display: block; margin-top: 6px; font-style: normal; font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.cmp-st.warn { color: #B5603F; }
.cmp-btn { margin-top: 10px; height: 34px; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #1F1C1A; color: #fff; }


/* 搜到的图（第二版，照官端）：按原比例、同样高度，往右一直排出屏幕，直接滑；来源贴在图片左下角 */
.img-row { padding-right: 0; margin-right: -16px; }
.img-strip { display: flex; gap: 8px; overflow-x: auto; max-width: none; padding: 2px 16px 4px 2px; scrollbar-width: none; scroll-snap-type: none; }
.img-it { position: relative; flex: none; width: auto; display: block; scroll-snap-align: none; }
.img-it img { display: block; width: auto; height: 170px; max-width: 78vw; min-width: 110px; object-fit: cover; border-radius: 16px;
  background: rgba(120, 100, 80, .08); box-shadow: none; }
.img-it .img-site { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 5px; max-width: calc(100% - 16px);
  padding: 4px 10px 4px 7px; border-radius: 999px; font-size: 11.5px; color: #fff; line-height: 1.3;
  background: rgba(30, 26, 22, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-it .img-site i { width: 13px; color: #fff; height: 13px; flex: none; display: grid; }
.img-site i svg { width: 100%; height: 100%; }
.img-from { text-align: right; padding: 4px 18px 0 0; font-size: 11px; color: var(--muted); }

/* 设置页：顶上不要一整条挡着，只留浮着的返回键，内容从它下面滑过 */
#page.is-settings .page-head { position: absolute; top: 0; left: 0; right: 0; z-index: 3; pointer-events: none; }
#page.is-settings .page-head > * { pointer-events: auto; }
#page.is-settings .page-body { padding-top: calc(var(--top-offset) + 56px); }

/* 记忆摘要：卡片之间留空，存档的折起来 */
#mem-list .mem-card { margin-bottom: 10px; }
.mem-fold { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 10px 0 14px; font-size: 12.5px; color: var(--ink-2); }
.mem-fold i { display: inline-block; transition: transform .2s; }
.mem-fold.open i { transform: rotate(180deg); }

.img-strip::-webkit-scrollbar { display: none; }
.img-it .img-site em { font-style: normal; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 聊天记录：搜全部聊天 / 按日期翻 */
.hist-bar { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 14px; height: 46px; margin-bottom: 14px; position: relative; }
.hist-bar > i { width: 17px; height: 17px; color: var(--muted); flex: none; display: grid; }
.hist-bar > i svg { width: 100%; height: 100%; }
#hist-q { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); }
#hist-q::-webkit-search-cancel-button { display: none; }
.hist-cal { display: flex; align-items: center; gap: 4px; flex: none; height: 32px; padding: 0 10px; border-radius: 999px;
  background: rgba(120, 100, 80, .08); color: var(--ink-2); font-size: 13px; }
.hist-cal svg { width: 15px; height: 15px; }
#hist-date { position: absolute; right: 6px; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.hist-tip { text-align: center; margin-top: 18px; }
.hist-hit { display: block; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 10px; }
.hist-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.hist-top b { font-size: 13px; font-weight: 600; color: var(--ink); }
.hist-top em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.hist-hit p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); word-break: break-word; }
.hist-hit mark { background: rgba(217, 119, 87, .22); color: inherit; border-radius: 3px; }
.hist-load { display: block; margin: 6px auto 14px; padding: 6px 16px; border-radius: 999px; font-size: 13px; color: var(--ink-2); background: rgba(120, 100, 80, .08); }
.hist-view { padding-top: 4px; }
.hist-day { text-align: center; font-size: 12px; color: var(--muted); margin: 22px 0 6px; letter-spacing: .5px; }
.hist-view .msg.hist-on .bubble { box-shadow: 0 0 0 2px rgba(217, 119, 87, .55); }

/* 他截的图：就一张图片，稍微大一点 */
.bubble.photo.shot img { max-width: min(66vw, 260px); max-height: 340px; }

/* 截图模式（他视角的聊天）：左右对调，他的气泡在右边、用「我的」气泡颜色；不要输入栏和动画 */
body.as-ai .msg.ai .row { flex-direction: row-reverse; }
body.as-ai .msg.user .row { flex-direction: row; }
body.as-ai .msg.ai .bubble { background: var(--user-bubble); }
body.as-ai .msg.user .bubble { background: var(--ai-bubble); }
body.as-ai .msg.ai .meta { flex-direction: row-reverse; padding: 0 calc(var(--avatar) + 12px) 0 0; }
body.as-ai .msg.ai .ev-note { text-align: right; padding: 2px calc(var(--avatar) + 12px) 4px 0; }
body.as-ai .msg.ai .card-row { display: flex; justify-content: flex-end; padding: 4px calc(var(--avatar) + 10px) 4px 0; }
body.as-ai .tools, body.as-ai .meta-btn, body.as-ai #composer, body.as-ai #typing { display: none !important; }
body.as-ai #messages { padding-bottom: 28px; }
body.as-ai *, body.as-ai *::before, body.as-ai *::after { animation: none !important; transition: none !important; }

/* ---------- 相册首页（Gallery） ---------- */
.page-action.page-plus { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; color: var(--ink); }
.page-action.page-plus svg { width: 22px; height: 22px; }
.gal-top { padding: 2px 4px 0; margin-bottom: 40px; }
.gal-kicker { font-size: 12px; color: var(--muted); letter-spacing: 2px; }
.gal-title { margin: 4px 0 10px; font: 400 40px/1.1 Georgia, 'Times New Roman', 'Noto Serif', serif; letter-spacing: .5px; color: var(--ink); }
.gal-stat { font-size: 13px; color: #8C847B; letter-spacing: .5px; }
.gal-note { margin: 16px 0 0; font-size: 15px; font-weight: 400; line-height: 1.6; color: #ADA59C; transform: skewX(-14deg); transform-origin: left bottom; }
.gal-group { display: block; margin-bottom: 38px; cursor: pointer; }
.gal-gh { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.gal-gh h2 { margin: 0; font-size: 23px; font-weight: 500; line-height: 1.3; color: var(--ink); letter-spacing: .5px; }
.gal-n { margin-left: auto; font-size: 12px; color: var(--muted); }
.gal-gh i { width: 17px; height: 17px; display: grid; color: #D6A08A; }
.gal-gh i svg { width: 100%; height: 100%; }
.gal-why { margin: 6px 4px 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); transform: skewX(-8deg); transform-origin: left bottom; }
.gal-why.in { margin: 0 4px 14px; }
.gal-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.gal-thumb { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: rgba(120, 100, 80, .08); }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-thumb.more img { filter: brightness(.55); }
.gal-thumb em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 17px; font-weight: 500; color: #fff; letter-spacing: .5px; }
.gal-none { margin: 12px 4px 0; font-size: 12.5px; color: #C2BAB1; }
.gal-empty { margin: 0 4px; font-size: 13px; line-height: 1.8; color: var(--muted); }

/* 新开一本相册（磨砂小卡片） */
.na { padding: 6px 4px 2px; }
.na-title { font-size: 17px; font-weight: 600; color: var(--ink); }
.na-sub { margin: 6px 0 22px; font-size: 12.5px; color: var(--muted); transform: skewX(-8deg); transform-origin: left bottom; }
.na-field { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.na-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.na-dot.pink { background: #D5A9AE; }
.na-dot.yellow { background: #D9C48E; }
.na-field input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid rgba(120, 100, 80, .28); border-radius: 0; background: transparent;
  padding: 6px 0; font: inherit; font-size: 15px; color: var(--ink); outline: 0; }
.na-field input::placeholder { color: #B9B1A8; }
.na-field input:focus { border-bottom-color: rgba(120, 100, 80, .5); }
.na-pen { width: 16px; height: 16px; flex: none; color: #B0A79D; display: grid; }
.na-pen svg { width: 100%; height: 100%; }
.na-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.na-actions button { padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2); }
.na-actions button.ok { color: #fff; background: #2B2724; }

/* 安全：登录的设备、备份 */
.sec-row { gap: 10px; }
.sec-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sec-info b { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.sec-info em { font-style: normal; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-btn { flex: none; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; color: var(--ink-2); background: rgba(120, 100, 80, .08); }
.sec-btn:disabled { opacity: .6; }
.sec-all b { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.sec-top { padding-top: 10px; }
.sec-wait { padding: 14px 0; }
