/* tgsrv 归档界面 —— 无框架、无构建，纯 CSS。
 *
 * 两种布局：
 *   手机（< 960px）  单栏 + 底部 tab + 详情从底部升起
 *   桌面（>= 960px） 左导航栏 + 会话列表 + 主内容，详情从右侧停靠
 *
 * 颜色优先跟随 Telegram 主题变量（--tg-theme-*）；浏览器里退回深色，
 * 系统是浅色时退回一套浅色（只有没被 Telegram 主题接管时才生效）。
 */

:root {
  --bg: var(--tg-theme-bg-color, #17212b);
  --bg-2: var(--tg-theme-secondary-bg-color, #0e1621);
  --card: var(--tg-theme-secondary-bg-color, #1c2733);
  --fg: var(--tg-theme-text-color, #f1f1f1);
  --muted: var(--tg-theme-hint-color, #8b98a5);
  --link: var(--tg-theme-link-color, #64b5ef);
  --accent: var(--tg-theme-button-color, #3390ec);
  --accent-fg: var(--tg-theme-button-text-color, #ffffff);
  --danger: #f0685e;
  --warn: #e5a94f;
  --ok: #4ec98a;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --radius: 12px;
  --tabs-h: 58px;
  --rail-w: 78px;
  --list-w: 320px;
  color-scheme: dark light;
}

/* 没被 Telegram 主题接管时，跟随系统浅色 */
@media (prefers-color-scheme: light) {
  :root:not([data-tg="1"]) {
    --bg: #f5f7f9;
    --bg-2: #eaeef3;
    --card: #ffffff;
    --fg: #101820;
    --muted: #5f6d7a;
    --link: #0b6bcb;
    --accent: #0b6bcb;
    --accent-fg: #ffffff;
    --line: rgba(0, 0, 0, .09);
    --line-strong: rgba(0, 0, 0, .16);
    --danger: #cc4a42;
    --warn: #b57a12;
    --ok: #1f8a55;
  }
}

* , *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body { overflow: hidden; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

button, input, select { font: inherit; color: inherit; }
a { color: var(--link); }

/* 键盘可达性：只有键盘聚焦才画圈，鼠标点击不闪 */
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* ------------------------------ 骨架 ------------------------------ */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.main { display: flex; flex-direction: column; min-height: 0; min-width: 0; flex: 1; }

.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 10px 10px calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom));
  scrollbar-width: thin;
}
.view::-webkit-scrollbar { width: 10px; height: 10px; }
.view::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 99px;
  border: 3px solid transparent; background-clip: content-box;
}
.view::-webkit-scrollbar-track { background: transparent; }

/* 桌面才出现的两栏 */
.rail, .list { display: none; }

/* ------------------------------ 图标 ------------------------------ */

.ico {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ------------------------------ 顶部栏 ------------------------------ */

.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.bar-title { min-width: 0; flex: 1; }
.bar-title span {
  display: block; font-weight: 600; font-size: 15.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bar-title small {
  display: block; color: var(--muted); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.icon {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--fg);
  cursor: pointer; transition: background .12s;
}
.icon:active { background: var(--card); }
@media (hover: hover) { .icon:hover { background: var(--card); } }
.back { margin-left: -4px; }

/* ------------------------------ 导航 ------------------------------ */

.nav { display: flex; flex-direction: column; gap: 2px; }

.tab {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 10px;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--muted);
  font-size: 13.5px; cursor: pointer;
  transition: background .12s, color .12s;
}
.tab:active { background: var(--card); }
.tab.active { color: var(--fg); background: var(--accent-soft); font-weight: 600; }
@media (hover: hover) { .tab:hover:not(.active) { background: var(--card); color: var(--fg); } }

/* 桌面导航栏 */
.rail {
  flex-direction: column;
  gap: 4px;
  padding: 14px 10px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  min-width: 0;
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 6px 14px; }
.brand-mark {
  display: grid; place-items: center;
  width: 28px; height: 28px; flex: none;
  border-radius: 9px;
  background: var(--accent); color: var(--accent-fg);
  font-weight: 700; font-size: 12.5px; letter-spacing: -.3px;
}
.brand-text { font-weight: 650; font-size: 14px; letter-spacing: .2px; white-space: nowrap; }
.brand-lg { justify-content: center; padding-bottom: 16px; }
.brand-lg .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; }
.brand-lg .brand-text { font-size: 18px; }

.rail-foot { margin-top: auto; padding: 10px 6px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.rail-foot .who { font-size: 12px; font-weight: 600; min-width: 0; }
.rail-foot .what { font-size: 11px; color: var(--muted); }
.rail-foot .avatar { width: 30px; height: 30px; font-size: 11.5px; }
.rail-foot .who, .rail-foot .what { display: none; }

/* 手机底部 tab */
.tabs {
  display: flex;
  flex: none;
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabs .tab {
  flex: 1 1 0; min-width: 0;
  flex-direction: column; gap: 2px;
  justify-content: center;
  padding: 6px 2px;
  border-radius: 0;
  font-size: 10.5px;
}
.tabs .tab.active { background: transparent; color: var(--link); }
.tabs .tab .ico { width: 20px; height: 20px; }

/* ------------------------------ 会话列表 ------------------------------ */

.list {
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.list-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 8px;
  flex: none;
}
.list-head .count { font-size: 12px; color: var(--muted); }
.list-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 0 8px 12px;
  scrollbar-width: thin;
}
.list-body::-webkit-scrollbar { width: 8px; }
.list-body::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 99px;
  border: 2px solid transparent; background-clip: content-box;
}

.row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 10px; margin-bottom: 4px;
  border: 0; border-radius: var(--radius);
  background: var(--card); color: inherit;
  cursor: pointer;
  transition: background .12s, box-shadow .12s;
}
.row:active { filter: brightness(1.12); }
@media (hover: hover) { .row:hover { filter: brightness(1.1); } }
.row.active { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--line-strong); }
.row-main { flex: 1; min-width: 0; }
.row-title { display: flex; gap: 7px; align-items: center; min-width: 0; }
.row-title b {
  font-weight: 600; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-sub {
  color: var(--muted); font-size: 12px; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-tail {
  color: var(--muted); font-size: 11px; text-align: right;
  white-space: nowrap; flex: none; font-variant-numeric: tabular-nums;
}

.avatar {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  background: hsl(var(--h, 210) 42% 34%);
  color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .3px;
  user-select: none;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

/* ------------------------------ 消息 ------------------------------ */

.timeline { display: flex; flex-direction: column; gap: 5px; }

/* 顶部这条（条数 + 排序开关）吸住，滑到哪儿都点得到 */
.tl-bar {
  position: sticky; top: 0; z-index: 6;
  margin: 0 0 6px; padding: 6px 2px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.older-wrap { justify-content: center; margin: 2px 0; }

.day {
  display: flex; justify-content: center;
  padding: 12px 0 2px;
  pointer-events: none;
}
.day span {
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  border: 1px solid var(--line);
  color: var(--muted); font-size: 11.5px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px;
}

.msg {
  display: flex; gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--card);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background .12s;
}
.msg:active { filter: brightness(1.12); }
@media (hover: hover) { .msg:hover { filter: brightness(1.1); } }
.msg.deleted { border-left-color: var(--danger); }
.msg.tombstone { border-left-color: var(--warn); }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg-head b {
  color: var(--fg); font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 62%;
}
.msg-head .tail {
  margin-left: auto; flex: none;
  color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums;
}
.msg-text {
  white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 14.5px; line-height: 1.5;
}
.msg.deleted .msg-text, .msg.deleted .msg-head b {
  text-decoration: line-through; opacity: .62;
}

/* 搜索高亮 */
mark {
  background: color-mix(in srgb, var(--warn) 38%, transparent);
  color: inherit; border-radius: 3px; padding: 0 1px;
}

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }

/* 相册：一条消息卡里放 N 个可点的小块 */
.album-items { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.album-item {
  padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2); color: var(--fg);
  font: inherit; font-size: 12px; cursor: pointer;
  min-height: 32px;
}
.album-item:hover { filter: brightness(1.15); }
.album-item.deleted { color: var(--muted); text-decoration: line-through; }
.msg.album.partial { border-left-color: var(--warn); }
/* 相册块整体可点（打开第一条详情），光标和悬停都要有反馈 */
.msg.album { cursor: pointer; }
@media (hover: hover) { .msg.album:hover { filter: brightness(1.1); } }
.chip {
  display: inline-flex; align-items: center;
  font-size: 11px; line-height: 1.6;
  padding: 0 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: var(--muted); white-space: nowrap;
}
@media (prefers-color-scheme: light) {
  :root:not([data-tg="1"]) .chip { background: rgba(0, 0, 0, .06); }
}
.chip.danger { background: color-mix(in srgb, var(--danger) 20%, transparent); color: color-mix(in srgb, var(--danger) 60%, var(--fg)); }
.chip.warn   { background: color-mix(in srgb, var(--warn) 20%, transparent);   color: color-mix(in srgb, var(--warn) 60%, var(--fg)); }
.chip.ok     { background: color-mix(in srgb, var(--ok) 20%, transparent);     color: color-mix(in srgb, var(--ok) 55%, var(--fg)); }
.chip.link   { background: color-mix(in srgb, var(--link) 20%, transparent);   color: color-mix(in srgb, var(--link) 75%, var(--fg)); }

/* ------------------------------ 表单 / 按钮 ------------------------------ */

.toolbar {
  display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; margin: 2px 0 10px;
}
.toolbar .grow { flex: 1; min-width: 0; }
.toolbar select { width: auto; min-width: 108px; flex: 0 0 auto; }

.field { display: block; text-align: left; margin-bottom: 10px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }

input[type=text], input[type=password], input[type=search], select {
  width: 100%;
  padding: 10px 12px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--fg);
  font-size: 14.5px;
  transition: border-color .12s, background .12s;
}
input::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
input:focus, select:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b98a5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 11px center;
  background-size: 12px 12px;
  background-repeat: no-repeat;
}

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 9px 14px;
  border: 1px solid transparent; border-radius: 10px;
  background: var(--card); color: var(--fg);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: filter .12s, background .12s;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.primary { background: var(--accent); color: var(--accent-fg); }
.btn.ghost { background: transparent; border-color: var(--line-strong); font-weight: 500; }
.btn.block { width: 100%; }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 12.5px; font-weight: 500; }
.btn.primary.sm { background: var(--accent); color: var(--accent-fg); }

.check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted); cursor: pointer;
  min-height: 42px;
}
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.error { color: var(--danger); font-size: 12.5px; margin: 10px 0 0; overflow-wrap: anywhere; }

/* ------------------------------ 卡片 / 统计 ------------------------------ */

.kv { background: var(--card); border-radius: 10px; padding: 10px 12px; }
.kv .k { font-size: 11.5px; color: var(--muted); }
.kv .v { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }

/* 统计里的小表格（会话分布） */
.tbl { background: var(--card); border-radius: 10px; overflow: hidden; }
.tbl-row {
  display: grid; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 13px;
  border-top: 1px solid var(--line);
  min-height: 38px;
}
.tbl-row:first-child { border-top: 0; }
.tbl-head { color: var(--muted); font-size: 11.5px; font-weight: 600; min-height: 32px; }
.tbl-row.action { cursor: pointer; }
.tbl-row.action:active { background: var(--bg-2); }
@media (hover: hover) { .tbl-row.action:hover { background: var(--bg-2); } }

.section { margin: 18px 0 6px; font-size: 13px; font-weight: 650; color: var(--muted); letter-spacing: .3px; }

.card {
  width: 100%; max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 22px;
  text-align: center;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
}
.card .muted { margin: 0 0 18px; font-size: 13px; }
.card .btn.primary { width: 100%; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11.5px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.build-line { margin: 14px 0 0; }

.login {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh;
  padding: 20px;
  overflow-y: auto;
}
body.auth-out .app { display: none; }

.boot {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: var(--bg);
}

.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--muted); border-top-color: transparent;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------ 详情面板 ------------------------------ */

.sheet {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .5);
  animation: fade .16s ease-out;
}
.sheet-body {
  position: relative;
  width: 100%; max-width: 660px; max-height: 86dvh;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg);
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 18px 18px 0 0;
  padding: 8px 14px calc(20px + env(safe-area-inset-bottom));
  scrollbar-width: thin;
  animation: rise .2s cubic-bezier(.2, .8, .3, 1);
}
.sheet-grip {
  width: 38px; height: 4px; border-radius: 99px;
  background: var(--line-strong);
  margin: 4px auto 10px;
}
.sheet-close { position: absolute; top: 10px; right: 10px; }
.sheet-content { padding-top: 4px; }
.sheet-content h2 { font-size: 15px; margin: 0 0 6px; padding-right: 40px; }
.sheet-content h3 { font-size: 12.5px; color: var(--muted); margin: 16px 0 6px; letter-spacing: .3px; }
.sheet-content dl {
  display: grid; grid-template-columns: 88px 1fr;
  gap: 5px 10px; margin: 12px 0 0; font-size: 13px;
}
.sheet-content dt { color: var(--muted); }
.sheet-content dd { margin: 0; overflow-wrap: anywhere; }
.sheet-content pre {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; overflow: auto; font-size: 11.5px;
  max-height: 46dvh; margin: 0;
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(14px); opacity: .6; } }
@keyframes slide-in { from { transform: translateX(24px); opacity: .5; } }

/* ------------------------------ 提示 ------------------------------ */

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px);
  transform: translateX(-50%);
  z-index: 60;
  max-width: 86vw;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(18, 22, 28, .94);
  color: #f2f2f2;
  border: 1px solid var(--line-strong);
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  animation: rise .16s ease-out;
}

/* 「N 条新消息」浮条：翻上去看历史时才出现，点了才跳回最新 */
.newbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabs-h) + 14px + env(safe-area-inset-bottom));
  z-index: 35;
  padding: 8px 16px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-fg);
  font-size: 12.5px; font-weight: 650;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  animation: rise .16s ease-out;
}

.empty {
  text-align: center; color: var(--muted);
  padding: 44px 16px; font-size: 13.5px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty .ico { width: 30px; height: 30px; opacity: .5; }
/* 桌面空态：在没有会话被选中时占满主区并居中 */
.empty.placeholder { min-height: calc(100dvh - 160px); justify-content: center; }

/* ============================== 桌面 ============================== */

@media (min-width: 960px) {
  .app {
    display: grid;
    grid-template-columns: var(--rail-w) var(--list-w) minmax(0, 1fr);
  }
  .rail { display: flex; }
  .list { display: flex; }
  .tabs { display: none; }

  /* 不在会话 tab 时，中栏让给内容 */
  body:not([data-tab="chats"]) .app { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  body:not([data-tab="chats"]) .list { display: none; }

  .view {
    padding: 14px clamp(16px, 3vw, 40px) 30px;
    width: 100%;
    max-width: 1040px;
  }

  .bar { padding: 10px clamp(16px, 3vw, 40px); }
  .bar-title span { font-size: 16px; }

  .list-head { padding: 16px 12px 8px; }

  .toast { left: 24px; transform: none; bottom: 20px; }
  .newbar { left: auto; right: 28px; transform: none; bottom: 24px; }

  .sheet {
    align-items: stretch; justify-content: flex-end;
    background: transparent;
    pointer-events: none;
  }
  /* 停靠面板会遮住主内容，所以让 app 让出位置（手机上是浮层，不需要让） */
  .app { transition: padding-right .18s ease-out; }
  body.sheet-open .app { padding-right: min(480px, 44vw); }
  .sheet-body {
    pointer-events: auto;
    width: min(480px, 44vw);
    max-width: none; max-height: none; height: 100%;
    border-radius: 0; border: 0;
    border-left: 1px solid var(--line);
    box-shadow: -24px 0 60px rgba(0, 0, 0, .38);
    padding: 14px 18px 24px;
    animation: slide-in .2s cubic-bezier(.2, .8, .3, 1);
  }
  .sheet-grip { display: none; }
}

/* 宽屏：导航栏显示文字、列表宽一点 */
@media (min-width: 1280px) {
  :root { --rail-w: 210px; --list-w: 340px; }
  .rail-foot { flex-wrap: wrap; }
  .rail-foot .who, .rail-foot .what { display: block; width: 100%; }
}

@media (min-width: 960px) and (max-width: 1279px) {
  .rail { padding-left: 8px; padding-right: 8px; align-items: center; }
  .rail .brand { padding: 2px 0 14px; }
  .brand-text { display: none; }
  .rail .tab { justify-content: center; width: 46px; padding: 10px 0; }
  .rail .tab .label { display: none; }
  .rail-foot { justify-content: center; padding-left: 0; padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* 页签切换的加载骨架 */
.tab-loading {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 48px 20px;
}
.tab-loading .spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: tabspin .8s linear infinite;
}
@keyframes tabspin { to { transform: rotate(360deg); } }
