/* ============ 主题变量 ============ */
:root, html[data-theme="light"] {
  --bg: #f5f0e8;
  --text: #3a3a3a;
  --card-bg: #fffdf7;
  --accent: #b0723a;
  --border: #e2d9c8;
  --shadow: 0 2px 12px rgba(90, 70, 40, .10);
  --menu-bg: rgba(255, 253, 247, .96);
  --hover: #f0e7d8;
  --danger: #c0392b;
}

html[data-theme="dark"] {
  --bg: #1a1a2e;
  --text: #c8c8c8;
  --card-bg: #252540;
  --accent: #e0a86a;
  --border: #33335a;
  --shadow: 0 2px 16px rgba(0, 0, 0, .5);
  --menu-bg: rgba(37, 37, 64, .96);
  --hover: #2e2e4e;
  --danger: #e06c5c;
}

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

/* ============ 布局尺寸 ============ */
:root {
  /* 应用内容最大宽度（电脑/平板上居中，两侧留白） */
  --max-w: 1200px;
  /* 正文最佳阅读宽度：中文一行 45~50 字最舒服，比容器窄一些 */
  --measure: 860px;
  /* 每页正文的**基础**内边距。悬浮栏的预留区是另外追加的，而预留区本身
     已经提供了视觉间隙，所以这个值在窄屏上要调小 —— 两个 22px 叠起来
     会在手机上吃掉上下各 ~100px（实测正文区只剩 700/890px）。
     现在它只在 JS 还没写入预留区之前当兜底（见 .rd-page 的 max()）。 */
  --pad-base: 22px;

  /* 顶/底浮层离屏幕边缘的额外间隙（安全区之外的）。
     桌面上栏贴边是原设计；手机上必须让开状态栏和 Home 指示条。 */
  --chrome-gap: 0px;

  /* 浮层卡片到正文之间的净间隙。
     预留区口径 = 浮层离屏边距离 + 卡片高 + 这个值，syncChromePad() 从变量里读，
     别在 JS 里写死。桌面沿用原来的观感（基础内边距 22 + 间隙 12 = 34），
     窄屏收紧到 8 —— 安全区那笔不再重复叠加，省下的高度全给正文。 */
  --chrome-text-gap: 34px;
}

@media (max-width: 1240px) {
  :root { --max-w: 100%; }
}

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  transition: background .25s, color .25s;
}

body { overflow: hidden; }

a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ============ 通用 ============ */
.hidden { display: none !important; }

.btn {
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.icon { padding: 8px 11px; font-size: 17px; line-height: 1; }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }

.input {
  width: 100%; padding: 11px 13px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card-bg); color: var(--text); outline: none;
}
.input:focus { border-color: var(--accent); }

.msg { margin-top: 12px; font-size: 13px; min-height: 18px; text-align: center; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--accent); }

#toast {
  position: fixed; left: 50%; bottom: 12%; transform: translateX(-50%) translateY(16px);
  background: rgba(0,0,0,.82); color: #fff; padding: 9px 18px; border-radius: 20px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 999;
  max-width: 80vw; text-align: center; overflow-wrap: anywhere;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 登录页 ============ */
.auth-wrap {
  height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-card {
  width: 100%; max-width: 340px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 32px 26px; box-shadow: var(--shadow); text-align: center;
}
.auth-card h1 {
  margin: 0 0 6px; font-size: 20px; font-weight: 600; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.auth-card .sub { font-size: 12px; color: var(--text); opacity: .6; margin-bottom: 22px; }
.auth-card .input { text-align: center; letter-spacing: 2px; }
.auth-card .btn { width: 100%; margin-top: 14px; padding: 11px; font-size: 15px; }
.theme-corner { position: fixed; top: 14px; right: 14px; z-index: 50; }

/* ============ 书架页 ============ */
.lib { height: 100%; display: flex; flex-direction: column; }

.lib-head {
  flex: 0 0 auto;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}
/* 顶栏内层：限制最大宽度并居中 */
.lib-head-inner {
  display: flex; align-items: center; gap: 10px;
  max-width: var(--max-w); margin: 0 auto;
}
.lib-head h1 { margin: 0; font-size: 17px; font-weight: 600; flex: 1;
  display: flex; align-items: center; gap: 8px; }
.lib-head .count { font-size: 12px; opacity: .55; font-weight: 400; }
.ico { display: inline-flex; align-items: center; opacity: .85; }
.btn.icon { display: inline-flex; align-items: center; justify-content: center; }

.lib-body {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 16px 90px;
}
/* 书架内容：限制最大宽度并居中 */
.lib-inner { max-width: var(--max-w); margin: 0 auto; }

.empty {
  text-align: center; padding: 60px 20px; opacity: .5; font-size: 14px;
  line-height: 2;
}
.empty .big { font-size: 40px; display: block; margin-bottom: 10px; }
.empty .big svg { display: inline-block; vertical-align: middle; }

/* 列宽必须写 minmax(0, 1fr)，不能写 1fr。
   1fr 等价于 minmax(auto, 1fr)，而 grid 项的最小宽度默认是 auto ——
   超长文件名的标题（nowrap）会把 min-content 抬得很高，列被撑到装得下整个标题，
   总宽超出容器后右边的卡片直接跑出屏幕（实测 1440 宽屏只剩 2 列且溢出）。 */
.book-grid { display: grid; gap: 11px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.book-card {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;   /* 双保险：flex 容器自身也不许被内容撑宽 */
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 14px; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .12s, background .15s;
}
.book-card:hover { background: var(--hover); }
.book-card:active { transform: scale(.985); }

.book-cover {
  flex: 0 0 46px; height: 62px; border-radius: 5px;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; font-weight: 700; overflow: hidden;
}
.book-info { flex: 1 1 auto; min-width: 0; }
.book-title {
  font-size: 15px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.book-meta {
  font-size: 11.5px; opacity: .55; margin-top: 4px;
  display: flex; gap: 9px; flex-wrap: wrap;
}
.bar {
  height: 3px; background: var(--border); border-radius: 2px;
  margin-top: 8px; overflow: hidden;
}
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.book-del {
  flex: 0 0 auto; border: none; background: transparent; color: var(--danger);
  padding: 8px; border-radius: 6px; opacity: .4;
  display: inline-flex; align-items: center; justify-content: center;
}
.book-del:hover { opacity: 1; background: var(--hover); }

/* 上传悬浮按钮 */
.fab {
  position: fixed; right: 18px; bottom: 18px; width: 54px; height: 54px;
  border-radius: 50%; border: none; background: var(--accent); color: #fff;
  font-size: 27px; line-height: 1; box-shadow: var(--shadow); z-index: 40;
  transition: transform .12s;
}
.fab:active { transform: scale(.92); }
.fab.busy { pointer-events: none; opacity: .55; }
/* 存书配额满了：置灰但仍可点（点了给提示，比彻底禁掉更好懂） */
.fab.full { background: var(--border); color: var(--text); opacity: .7; }

/* 上传进度遮罩 */
#up-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
#up-mask .box {
  background: var(--card-bg); border-radius: 12px; padding: 24px 30px;
  text-align: center; min-width: 210px; max-width: min(84vw, 440px);
  box-shadow: var(--shadow);
}
/* 长文件名（尤其是无空格的长串）必须能被折断，否则会把弹窗撑出屏幕 */
#up-mask .t { font-size: 14px; margin-bottom: 12px; overflow-wrap: anywhere; }
.spin {
  width: 26px; height: 26px; margin: 0 auto 12px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 阅读页 ============ */
.rd { height: 100%; display: flex; flex-direction: column; position: relative; }

/* 顶栏同样悬浮，正文区才能从屏幕最顶端开始 */
.rd-top {
  position: absolute; left: 0; right: 0; top: 0;
  z-index: 20; pointer-events: none;
  /* 必须让开状态栏：viewport-fit=cover 下（加到主屏图标全屏打开时）页面顶到
     屏幕最上沿，不加 safe-area 卡片就压在时间/信号上，看起来是「一片糊」。 */
  padding: calc(var(--chrome-gap) + env(safe-area-inset-top, 0px)) 12px 12px;
}
.rd-top-inner {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  max-width: var(--max-w); margin: 0 auto;
  background: var(--menu-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 8px 12px;
}
.rd-top .t {
  flex: 1; text-align: center; font-size: 13px; opacity: .8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.rd-stage {
  flex: 1 1 auto; position: relative; overflow: hidden; touch-action: pan-y;
}

/* 正文容器：限宽居中 + 裁剪。
   注意 .rd-pages 的 transform 是翻页用的（translateX(-N%)），
   居中必须靠父级 flex，不能给 .rd-pages 加 transform。

   overflow:hidden 必须放在 .rd-view 这一层：
   - 放在 .rd-column（铺满 stage，1920px）上，剪不掉 860px 之外的页；
   - 放在 .rd-pages 自己身上也不行，它无法裁剪自身溢出的子元素。
   所以结构是 column(居中) > view(裁剪, 860px) > pages(flex 轨道, 可平移)。 */
.rd-column {
  position: absolute; inset: 0;
  display: flex; justify-content: center;
  pointer-events: none;
}
.rd-view {
  width: 100%; max-width: var(--measure); height: 100%;
  overflow: hidden; position: relative;
  pointer-events: auto;
}
.rd-pages {
  width: 100%; height: 100%;
  display: flex;
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
/* 跳章 / 重排时瞬移，不做滑动动画（见 reader.js setPageOffset） */
.rd-pages.no-anim { transition: none; }
.rd-page {
  flex: 0 0 100%; width: 100%; height: 100%; overflow: hidden;
  padding: var(--pad-base) 24px; box-sizing: border-box;
  /* 悬浮栏不占布局高度，所以正文默认铺满整屏；
     只有栏可见时才由 JS 写入 --page-pad-top/bottom 预留出遮挡区。
     safe-area 单独加 —— viewport-fit=cover 下（加到桌面图标全屏打开时）
     页面会顶到屏幕最上沿，不加就会钻到状态栏底下。

     预留区（JS 写入）已经是「离屏幕顶/底边的**绝对**距离」，而安全区同时也
     抬高了浮层本身，两边都算一遍就会多留一整个状态栏的高度。所以取 max()：
     谁大听谁的。第一行是给不支持 max() 的老内核的兜底（回到老行为）。 */
  padding-top: calc(var(--pad-base) + env(safe-area-inset-top, 0px) + var(--page-pad-top, 0px));
  padding-top: max(calc(var(--pad-base) + env(safe-area-inset-top, 0px)),
                   var(--page-pad-top, 0px));
  padding-bottom: calc(var(--pad-base) + env(safe-area-inset-bottom, 0px) + var(--page-pad-bottom, 0px));
  padding-bottom: max(calc(var(--pad-base) + env(safe-area-inset-bottom, 0px)),
                      var(--page-pad-bottom, 0px));
}
/* 分页测量区：必须与 .rd-page 完全同宽，否则测量结果和实际渲染对不上 */
.rd-work {
  position: absolute; inset: 0;
  display: flex; justify-content: center;
  visibility: hidden; pointer-events: none; z-index: -1; overflow: hidden;
}
.rd-work .rd-page {
  flex: 0 0 100%; width: 100%; max-width: var(--measure); height: 100%;
}
.rd-page p {
  margin: 0 0 .82em; line-height: 1.95; text-align: justify;
  word-break: break-word; font-size: var(--fs, 18px); letter-spacing: .04em;
}
.rd-page p.indent { text-indent: 2em; }

/* 翻页时的边缘提示 */
.rd-hint {
  position: absolute; left: 0; right: 0; text-align: center;
  font-size: 12px; opacity: .35; pointer-events: none;
}
.rd-hint.b { bottom: 6px; }
.rd-hint.t { top: 6px; }

.rd-loading, .rd-empty {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; flex-direction: column; gap: 12px;
  color: var(--text); opacity: .6; font-size: 14px;
}

/* 底栏：悬浮浮层，不占用布局高度。
   正文区一路铺到屏幕底部，浮层盖在上面。
   代价：正文必须为浮层预留出底部空间，否则末页文字会被按钮压住 ——
   预留量由 JS 测量浮层高度后写入 --page-pad-b（见 reader.js）。 */
.rd-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 20; pointer-events: none;
  /* 同理让开 Home 指示条，否则按钮卡片的下沿被屏幕圆角/指示条切掉 */
  padding: 0 12px calc(var(--chrome-gap) + env(safe-area-inset-bottom, 0px));
}
.rd-bottom-inner {
  pointer-events: auto;
  max-width: var(--max-w);
  margin: 0 auto;
  background: var(--menu-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 8px 12px;
}
.rd-bottom .row1 {
  display: flex; align-items: center; gap: 8px; justify-content: center;
}
.rd-bottom .row1 .pg {
  font-size: 12px; opacity: .6; min-width: 92px; text-align: center;
  /* 页码行预留稳定高度，避免 "- / -" 变成 "12 / 30" 时浮层高度跳动 */
  min-height: 18px; display: flex; align-items: center; justify-content: center;
}
/* 底栏第一行 = 书名。整行只有它一个元素，可以吃满宽度。
   必须单行 + 省略号：一旦换行，浮层高度变化 → 预留区变化 → 分页全废。 */
.rd-bottom .row1 .nav {
  text-align: center; font-size: 12.5px; opacity: .75;
  max-width: 100%; min-width: 0; padding: 0 4px; box-sizing: border-box;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 6px;
}
/* 书名这一行必须在首屏就有稳定高度。
   否则 #nav 拿到文字后行高从 0 变成 ~17px，浮层整体变高，
   预留空间和分页全部对不上。 */
.rd-bottom .row1.nav-row {
  min-height: 20px;
  align-items: center;
  overflow: hidden;
}
.rd-bottom .row2 {
  display: flex; gap: 5px; justify-content: center;
  align-items: center; flex-wrap: nowrap;
}
.rd-bottom .row2 .btn { padding: 6px 10px; font-size: 13px; }
.rd-bottom .row2 .btn.icon { padding: 6px 9px; }
.rd-bottom .row2 .fs-val { min-width: 40px; cursor: default; }
/* 竖线分隔 */
.rd-bottom .sep {
  width: 1px; height: 18px; background: var(--border);
  margin: 0 3px; flex: 0 0 auto;
}

/* 目录抽屉 */
.toc-mask {
  position: absolute; inset: 0; background: rgba(0,0,0,.4); z-index: 30;
  display: flex; align-items: flex-end; justify-content: center;
}
.toc {
  width: 100%; max-width: 640px; max-height: 72%; background: var(--card-bg);
  border-radius: 14px 14px 0 0; display: flex; flex-direction: column;
  animation: up .22s ease;
}
@media (min-width: 700px) {
  .toc-mask { align-items: center; }
  .toc { border-radius: 14px; max-height: 78%; }
  @keyframes up { from { transform: translateY(20px) scale(.98); opacity: .5; } }
}
.toc-head {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto;
}
.toc-head b { font-size: 14px; }
.toc-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 0 14px; }
.toc-item {
  padding: 11px 18px; font-size: 13.5px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 3px solid transparent;
}
.toc-item:active { background: var(--hover); }
.toc-item.cur { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

.rd-chrome { transition: transform .22s, opacity .22s; }
.rd-chrome.hide-up { transform: translateY(-100%); opacity: 0; }
.rd-chrome.hide-dn { transform: translateY(100%); opacity: 0; }

/* ============ 「另一台设备读到别处」提示条 ============
   多设备同步用：另一个设备把进度写到更后面时，本页飘一条提示，由用户决定
   跳不跳（见 reader.js 的 maybeHint）。

   它**必须**是浮层，绝不能进排版流 —— 排版区高度首屏恒定是分页铁律，
   提示条一旦占位就会把正文挤走、让分页结果漂移。所以：
     * position:absolute，位置与 .rd-top 完全同槽（顶栏那块本来就是预留区，
       正文不会到那儿去）；不显示时 display:none，连几何都不存在。
     * 不加 .rd-chrome —— 它不跟着菜单隐藏，否则用户根本看不到提示。
     * 菜单展开时它会盖在顶栏卡片上（z-index 25 > 20）。两者同位置同卡片样式，
       看起来就是「顶栏换成了通知」，可接受。
     * 它不参与 --page-pad-* 的计算：预留区只认顶/底栏，这里不变。 */
.rd-hint {
  position: absolute; left: 0; right: 0; top: 0;
  z-index: 25; pointer-events: none;
  padding: calc(var(--chrome-gap) + env(safe-area-inset-top, 0px)) 12px 12px;
}
.rd-hint-inner {
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  max-width: var(--max-w); margin: 0 auto;
  background: var(--menu-bg);
  border: 1px solid var(--accent);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 8px 12px;
}
.rd-hint-t {
  flex: 1 1 auto; min-width: 0;
  font-size: 12.5px; opacity: .85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rd-hint .btn { flex: 0 0 auto; padding: 4px 10px; font-size: 12.5px; }
@media (prefers-reduced-motion: no-preference) {
  .rd-hint-inner { animation: rd-hint-in .22s ease-out; }
  @keyframes rd-hint-in {
    from { transform: translateY(-8px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}

/* ============ 窄屏（手机）：浮层瘦身 + 去掉重复留白 ============
   手机上屏高只有 ~890px，原来「基础内边距 22px」+「悬浮栏预留区（卡片高+12）」
   上下叠起来要吃掉约 189px（正文区只剩 700px）。这里把两个来源一起收：
   基础内边距 22 → 12，浮层卡片/按钮各缩一档。
   预留区依然**恒定**（菜单开合只切 class，不重排）—— 这条铁律不动。 */
@media (max-width: 560px) {
  :root {
    --pad-base: 12px;
    /* 手机上顶/底栏贴边太死：顶栏糊在状态栏里、底栏被 Home 指示条切掉。
       留 6px 视觉间隙（真正的状态栏由 env(safe-area-inset-*) 让开）。 */
    --chrome-gap: 6px;
    /* 正文贴浮层近一点，把省下来的高度还给正文 */
    --chrome-text-gap: 8px;
  }
  .rd-page { padding-left: 18px; padding-right: 18px; }

  .rd-top-inner, .rd-bottom-inner { padding: 6px 10px; }
  .rd-top-inner .btn.icon { padding: 6px 8px; }
  .rd-top .t { font-size: 12.5px; }

  .rd-bottom .row1.nav-row { min-height: 18px; }
  .rd-bottom .row1 .nav { font-size: 12px; margin-bottom: 4px; }
  .rd-bottom .row1 .pg { font-size: 11.5px; min-width: 76px; min-height: 17px; }
  .rd-bottom .row2 { gap: 4px; }
  .rd-bottom .row2 .btn { padding: 5px 8px; font-size: 12.5px; }
  .rd-bottom .row2 .btn.icon { padding: 5px 7px; font-size: 15px; }
  .rd-bottom .row2 .fs-val { min-width: 34px; }
  .rd-bottom .sep { height: 16px; margin: 0 2px; }

  /* 提示条跟顶栏缩同一档，免得手机上一行放不下（文案会被省略号截） */
  .rd-hint-inner { padding: 6px 10px; gap: 6px; }
  .rd-hint-t { font-size: 12px; }
  .rd-hint .btn { padding: 4px 8px; font-size: 12px; }
}

/* ============ 账号弹窗（书架页） ============ */
.lib-head .who {
  font-size: 12px; font-weight: 400; opacity: .7; flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 10px; cursor: pointer; max-width: 140px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .15s, opacity .15s;
}
.lib-head .who:hover { background: var(--hover); opacity: 1; }

.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.acct {
  width: 100%; max-width: 460px; max-height: 82%;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.acct-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.acct-head b { font-size: 14px; }
.acct-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 0; }
.acct-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  font-size: 13.5px; border-bottom: 1px solid var(--border);
}
.acct-item:last-child { border-bottom: none; }
.acct-item .n {
  flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acct-item .tag {
  flex: 0 0 auto; font-size: 11px; padding: 1px 7px; border-radius: 6px;
  background: var(--hover); opacity: .85;
}
.acct-item .cnt { flex: 0 0 auto; font-size: 11.5px; opacity: .5; }
.acct-item .btn { padding: 4px 9px; font-size: 12px; flex: 0 0 auto; }
.acct-add {
  border-top: 1px solid var(--border); padding: 12px 14px; flex: 0 0 auto;
}
.acct-add .row { display: flex; gap: 8px; flex-wrap: wrap; }
.acct-add .input { flex: 1 1 110px; min-width: 0; padding: 8px 10px; font-size: 13px; }
.acct-add .hint { font-size: 11.5px; opacity: .55; margin-top: 8px; line-height: 1.7; }
.acct .msg { padding: 0 14px; }
