/* Oriel · 手机端样式
   目标：像聊天 App，不像网页。深色为主，安全区留白，输入框永远在拇指够得到的地方。 */

:root {
  --bg: #101010;
  --bg-soft: #151515;
  --panel: #191919;
  --line: #2A2A2A;
  --text: #E8E8E8;
  --dim: #8C8C8C;
  --accent: #B8B8B8;
  --accent-2: #8F8F8F;
  --user-bubble: #3A3A3A;
  --bot-bubble: #1F1F1F;
  --danger: #C98A8A;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F2F2F2;
    --bg-soft: #FFFFFF;
    --panel: #FFFFFF;
    --line: #E0E0E0;
    --text: #0F0F0F;
    --dim: #666666;
    --bot-bubble: #ECECEC;
    --user-bubble: #666666;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 作者样式里 .sheet / .log 等设了 display，会盖掉 UA 的 [hidden]{display:none}，
   所以这里必须显式压回去，否则弹层一进页面就全开着。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding-top: var(--safe-top);
  background: radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,.06), transparent 60%), var(--bg);
}

/* ── 顶栏 ───────────────────────────────────────────── */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 12px; overflow: hidden; flex: 0 0 auto; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.avatar img, .empty-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.meta { min-width: 0; }
.name { font-weight: 650; letter-spacing: .2px; }
.status { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.status.live { color: var(--accent-2); }
.status.typing { color: var(--accent); }

.actions { display: flex; gap: 4px; }
.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid; place-items: center;
  cursor: pointer;
}
.icon-btn:active { transform: scale(.95); }

/* ── 横幅 ───────────────────────────────────────────── */
.banner {
  flex: 0 0 auto;
  margin: 8px 14px 0;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(201,138,138,.10);
  border: 1px solid rgba(201,138,138,.35);
  color: #D8B4B4;
}
@media (prefers-color-scheme: light) { .banner { color: #7A3B3B; } }

/* ── 消息区 ─────────────────────────────────────────── */
.log {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 12px 8px;
  scroll-behavior: smooth;
}
.log-inner { display: flex; flex-direction: column; gap: 10px; max-width: 780px; margin: 0 auto; }

.empty { text-align: center; color: var(--dim); padding: 18vh 24px 0; font-size: 14px; }
.empty-avatar { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 18px; overflow: hidden; opacity: .95; }
.empty p { margin: 4px 0; }
.dim { color: var(--dim); }
.tiny { font-size: 12px; }

.msg { display: flex; gap: 8px; align-items: flex-end; width: 100%; max-width: 100%; animation: pop .18s ease-out; }
/* 关键：气泡的百分比 max-width 必须有确定的父宽度，否则会塌成 min-content（每行一两个字） */
.msg-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.msg.user .msg-body { align-items: flex-end; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user { flex-direction: row-reverse; }

.bubble-avatar { width: 28px; height: 28px; border-radius: 9px; overflow: hidden; flex: 0 0 auto; opacity: .95; }
.bubble-avatar svg { display: block; width: 100%; height: 100%; }

.bubble {
  max-width: min(76%, 560px);
  padding: 9px 13px;
  border-radius: var(--radius);
  background: var(--bot-bubble);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  position: relative;
}
.msg.bot .bubble { border-bottom-left-radius: 6px; }
.msg.user .bubble { background: var(--user-bubble); color: #F2F2F2; border-bottom-right-radius: 6px; }
.bubble.streaming::after {
  content: "";
  display: inline-block;
  width: 7px; height: 16px;
  margin-left: 2px;
  background: currentColor;
  opacity: .55;
  vertical-align: -2px;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.bubble-time { font-size: 11px; color: var(--dim); margin: 2px 4px 0; user-select: none; }
.msg.user .bubble-time { text-align: right; }
.msg.failed .bubble { outline: 1px solid rgba(201,138,138,.55); }

.divider { align-self: center; font-size: 11px; color: var(--dim); padding: 6px 10px; }

/* ── 跳到底部 ───────────────────────────────────────── */
.jump {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(88px + var(--safe-bottom));
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  cursor: pointer;
  z-index: 12;
}

/* ── 输入区 ─────────────────────────────────────────── */
.composer {
  flex: 0 0 auto;
  padding: 8px 12px calc(8px + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 780px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 6px 6px 6px 14px;
}
#input {
  flex: 1 1 auto;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  max-height: 132px;
  padding: 6px 0;
}
#input::placeholder { color: var(--dim); }
.send {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #141414;
  display: grid; place-items: center;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.send:disabled { opacity: .35; cursor: default; }
.send:active:not(:disabled) { transform: scale(.94); }
.composer-hint { max-width: 780px; margin: 4px auto 0; font-size: 11px; color: var(--dim); min-height: 14px; }

/* ── 弹层 ───────────────────────────────────────────── */
.sheet {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.60);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.sheet-card {
  width: 100%;
  max-width: 560px;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(22px + var(--safe-bottom));
  box-shadow: 0 -12px 40px rgba(0,0,0,.35);
  animation: slide .2s cubic-bezier(.2,.8,.3,1);
}
@keyframes slide { from { transform: translateY(18px); opacity: .6; } }
.sheet-card h2 { margin: 0 0 6px; font-size: 18px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-card p { margin: 8px 0; font-size: 14px; }
.sheet-card hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.sheet-card code { background: var(--panel); padding: 1px 5px; border-radius: 5px; font-size: 12px; }

.field { display: block; margin: 14px 0; }
.field span { display: block; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.field input, .mem-add input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
.field input:focus, .mem-add input:focus { outline: 2px solid rgba(255,255,255,.30); }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #141414; border: 0; }
.btn.danger { color: var(--danger); border-color: rgba(201,138,138,.45); }
.btn:active { transform: scale(.97); }
.row { display: flex; gap: 8px; margin-top: 12px; }
.row .btn { flex: 1; }

.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; }
.kv span { color: var(--dim); }
.kv b { font-weight: 600; max-width: 60%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-of-type { border-bottom: 0; }
.setting-row .btn { flex: 0 0 auto; padding: 8px 14px; font-size: 14px; }

.mem-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.mem-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}
.mem-item .txt { flex: 1; }
.mem-item button { background: none; border: 0; color: var(--dim); font-size: 16px; cursor: pointer; padding: 0 4px; }
.mem-add { display: flex; gap: 8px; margin-top: 10px; }
.mem-add .btn { flex: 0 0 auto; }

/* 设置面板里的「这台电脑」：只在桌面端出现 */
.desk-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin: 4px 0 2px; font-size: 15px;
}
.desk-head span { font-size: 12px; }
.qr-box {
  display: flex; justify-content: center;
  padding: 12px 0 4px;
}
.qr-box img {
  width: 168px; height: 168px;
  background: #F2F2F2; border-radius: 14px; padding: 8px;
}
.link-line {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--line);
}
.link-line code {
  flex: 1; min-width: 0;
  font-size: 12px; line-height: 1.5;
  color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.link-line .btn { flex: 0 0 auto; padding: 8px 14px; font-size: 14px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  transform: translateX(-50%);
  background: rgba(26,26,26,.94);
  color: #E8E8E8;
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 80;
  animation: pop .16s ease-out;
}

.err { color: var(--danger); }

@media (min-width: 720px) {
  .log { padding: 20px 24px 8px; }
  .bubble { max-width: min(66%, 620px); }
}
/* ══════════════════════════════════════════════════════════════
   聊天增强 + 桌面分页
   ══════════════════════════════════════════════════════════════ */

.stage { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.view { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.only-mobile { display: none; }

/* ── 左侧导航（桌面）── */
.rail {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 208px;
  flex: 0 0 208px;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}
.rail-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 8px 14px; font-weight: 600; letter-spacing: .3px;
}
.rail-brand img { border-radius: 9px; }
.rail-tab {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border: 0; border-radius: 10px;
  background: transparent; color: var(--dim);
  font-size: 14px; text-align: left; cursor: pointer;
  font-family: inherit;
}
.rail-tab i { font-style: normal; width: 18px; text-align: center; opacity: .9; }
.rail-tab:hover { background: var(--panel); color: var(--text); }
.rail-tab.is-active { background: var(--panel); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.rail-foot { margin-top: auto; padding: 10px 12px; font-size: 11px; color: var(--dim); }

@media (min-width: 900px) {
  .app { flex-direction: row; }
  .rail { display: flex; }
  .only-mobile { display: none; }
  .view-chat .log-inner { max-width: 820px; }
}

@media (max-width: 899px) {
  .only-mobile { display: inline-flex; }
  .rail { display: none; }
}

/* ── 输入区工具 ── */
.composer-inner { position: relative; }
.tool {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: transparent; color: var(--dim);
  font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; font-family: inherit;
}
.tool:hover { background: var(--panel); color: var(--text); }

.tray {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  padding: 10px 10px 4px; max-width: 780px; margin: 0 auto;
}
.tray-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px; border: 0; border-radius: 12px;
  background: var(--panel); color: var(--dim); font-size: 12px;
  cursor: pointer; font-family: inherit;
}
.tray-item:hover { color: var(--text); }
.tray-ico { font-size: 20px; }

.panel { max-width: 780px; margin: 0 auto; padding: 8px 10px 6px; }
.panel-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.panel-tab {
  border: 0; background: var(--panel); color: var(--dim);
  padding: 5px 12px; border-radius: 999px; font-size: 12px; cursor: pointer;
  font-family: inherit;
}
.panel-tab.is-active { background: var(--user-bubble); color: var(--text); }
.panel-tab.ghost { margin-left: auto; background: transparent; }
.panel-body { max-height: 232px; overflow-y: auto; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; }
.emoji-cell {
  border: 0; background: transparent; font-size: 22px; padding: 5px 0;
  border-radius: 8px; cursor: pointer; line-height: 1;
}
.emoji-cell:hover { background: var(--panel); }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.sticker-cell { border: 0; background: transparent; padding: 0; cursor: pointer; border-radius: 14px; }
.sticker-cell img, .sticker-cell svg { width: 100%; height: auto; display: block; border-radius: 14px; }
.sticker-missing { padding: 10px; font-size: 11px; color: var(--dim); }

/* ── 引用 / 附件 ── */
.reply-bar {
  display: flex; align-items: center; gap: 8px;
  max-width: 780px; margin: 0 auto 6px; padding: 7px 10px;
  background: var(--panel); border-left: 2px solid var(--accent); border-radius: 8px;
}
.reply-inner { min-width: 0; flex: 1 1 auto; }
.reply-who { display: block; font-size: 11px; color: var(--accent); }
.reply-text { display: block; font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.attach-strip { display: flex; gap: 8px; flex-wrap: wrap; max-width: 780px; margin: 0 auto 6px; }
.att-chip {
  display: flex; align-items: center; gap: 6px; max-width: 200px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 9px; padding: 4px 6px; font-size: 12px;
}
.att-chip img { width: 30px; height: 30px; object-fit: cover; border-radius: 6px; }
.att-chip-ico { font-size: 16px; }
.att-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip-x { border: 0; background: transparent; color: var(--dim); cursor: pointer; font-size: 12px; }

.bubble-text { white-space: pre-wrap; word-break: break-word; }
.atts { display: flex; flex-direction: column; gap: 6px; }
.atts + .bubble-text { margin-top: 6px; }
.att-img {
  max-width: 240px; max-height: 300px; border-radius: 12px;
  display: block; cursor: zoom-in; object-fit: cover;
}
.att-video { max-width: 260px; border-radius: 12px; display: block; background: #000; }
.att-file {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  color: var(--text); text-decoration: none; max-width: 260px;
}
.att-ico { font-size: 20px; }
.att-meta { min-width: 0; display: flex; flex-direction: column; }
.att-meta b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta i { font-style: normal; font-size: 11px; color: var(--dim); }

.bubble-sticker { background: transparent !important; padding: 0 !important; border: 0 !important; }
.bubble-sticker .atts .att-img { max-width: 132px; max-height: 132px; border-radius: 16px; }
.sticker-body svg { display: block; }

.quote {
  display: flex; flex-direction: column; gap: 2px;
  border-left: 2px solid var(--accent); padding: 4px 8px; margin-bottom: 6px;
  background: color-mix(in srgb, var(--panel) 70%, transparent); border-radius: 6px;
  max-width: 100%;
}
.quote-who { font-size: 11px; color: var(--accent); }
.quote-txt { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.recall-tip {
  font-size: 12px; color: var(--dim); font-style: italic;
  background: transparent; padding: 2px 4px;
}
.msg .msg-body { min-width: 0; }

/* ── 右键菜单 / 图片查看 ── */
.ctx {
  position: fixed; z-index: 90; min-width: 132px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 5px; box-shadow: 0 12px 32px rgba(0,0,0,.45);
  display: flex; flex-direction: column;
}
.ctx button {
  border: 0; background: transparent; color: var(--text);
  text-align: left; padding: 9px 12px; border-radius: 8px;
  font-size: 14px; cursor: pointer; font-family: inherit;
}
.ctx button:hover { background: var(--bg-soft); }
.lightbox {
  position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.88);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ── 抽屉（手机）── */
.drawer { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.55); }
.drawer-card {
  width: 76%; max-width: 300px; height: 100%;
  background: var(--bg-soft); border-right: 1px solid var(--line);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 4px;
  animation: slideIn .18s ease-out;
}
@keyframes slideIn { from { transform: translateX(-16px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 12px; }
.drawer-tab {
  border: 0; background: transparent; color: var(--text); text-align: left;
  padding: 12px 12px; border-radius: 10px; font-size: 15px; cursor: pointer; font-family: inherit;
}
.drawer-tab:hover { background: var(--panel); }

/* ── 分页内容 ── */
.page-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 16px calc(24px + var(--safe-bottom)); }
.page-body .sheet-card {
  background: transparent; border: 0; box-shadow: none;
  padding: 0; max-width: 760px; margin: 0 auto;
}
.sect-title { font-size: 13px; color: var(--dim); font-weight: 600; margin: 20px 0 8px; letter-spacing: .3px; }
.page-empty { color: var(--dim); font-size: 13px; padding: 18px 4px; }
.page-note { color: var(--dim); font-size: 12px; margin: 6px 0; }
.page-error { color: var(--danger); font-size: 13px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat-v { font-size: 22px; font-weight: 600; letter-spacing: -.5px; }
.stat-l { font-size: 12px; color: var(--dim); margin-top: 2px; }
.stat-h { font-size: 11px; color: var(--dim); opacity: .8; margin-top: 4px; }

.chart { display: flex; flex-direction: column; gap: 6px; }
.chart-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.chart-day { width: 48px; color: var(--dim); flex: 0 0 auto; }
.chart-bar { flex: 1 1 auto; height: 8px; background: var(--panel); border-radius: 4px; overflow: hidden; }
.chart-fill { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.chart-val { width: 66px; text-align: right; color: var(--dim); flex: 0 0 auto; }

.sess-list { display: flex; flex-direction: column; gap: 8px; }
.sess-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; cursor: pointer;
}
.sess-row:hover { border-color: var(--accent-2); }
.sess-head { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--dim); }
.badge { padding: 1px 7px; border-radius: 999px; background: var(--bg-soft); color: var(--dim); }
.badge.ok { color: #8FBF8F; }
.badge.bad { color: var(--danger); }
.sess-time { color: var(--text); opacity: .85; }
.sess-dur { margin-left: auto; }
.sess-tok { margin-left: 10px; }
.sess-trigger { font-size: 13px; margin-top: 6px; }
.sess-reply {
  font-size: 12px; color: var(--dim); margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sess-detail { max-width: 760px; margin: 0 auto; }
.prompt-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 12px; line-height: 1.5; white-space: pre-wrap;
  word-break: break-word; max-height: 340px; overflow: auto; margin: 0 0 10px;
  font-family: ui-monospace, Consolas, monospace;
}

.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.feat-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.feat-card.off { opacity: .6; }
.feat-name { font-size: 14px; font-weight: 600; }
.feat-desc { font-size: 12px; color: var(--dim); margin-top: 3px; word-break: break-all; }
.feat-dot { display: inline-block; margin-top: 8px; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--bg-soft); }
.feat-dot.on { color: #8FBF8F; }
.feat-dot.off { color: var(--dim); }

.skill-list { display: flex; flex-direction: column; gap: 6px; }
.skill-row { display: flex; gap: 10px; align-items: baseline; background: var(--panel); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.skill-row b { flex: 0 0 auto; font-weight: 600; }
.skill-row span { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.settings-form { display: flex; flex-direction: column; gap: 10px; }
.desk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 4px 0 2px; }
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--dim); }
.fld input, .fld textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 9px 11px; font-size: 14px; font-family: inherit;
  width: 100%; resize: vertical;
}
.fld input:focus, .fld textarea:focus { outline: none; border-color: var(--accent-2); }
.fld-row { display: flex; gap: 8px; }
.fld-row .fld { flex: 1 1 0; min-width: 0; }
.fld-row .fld.wide { flex: 2 1 0; }

/* 戳一戳：整窗抖一下 */
@keyframes nudgeShake {
  0%, 100% { transform: none; }
  15% { transform: translate(-7px, 3px) rotate(-.5deg); }
  35% { transform: translate(7px, -3px) rotate(.5deg); }
  55% { transform: translate(-5px, 2px); }
  75% { transform: translate(4px, -1px); }
}
.app.nudging { animation: nudgeShake .55s ease-in-out; }
.log.dragging { outline: 2px dashed var(--accent-2); outline-offset: -8px; }

/* 分页里挂载的卡片：顶部标题由分页头负责，卡片自己的 h2 隐藏 */
.page-body .sheet-card > .sheet-head h2 { display: none; }
.page-body .sheet-card > .sheet-head { justify-content: flex-end; }
.skill-row { overflow: hidden; }
.skill-row span { white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
