/* ============================================================================
   校捷通 · Web 设计系统 v3
   文件：web/css/app.css

   方向：编辑级深色产品站（Editorial Dark Product Site）
   · 桌面：左侧常驻导航 + 内容区（多栏布局），≥1180 侧栏展开、≤1180 收成图标条
   · 移动：底部 Tab 栏，内容单列
   · 质感：三层背景纵深 + 细颗粒噪点 + 内高光卡片 + 极低饱和的环境光
   · 排版：大号紧字距标题、等宽数字、克制的 13/14 正文字号
   ========================================================================== */

/* ---------------------------------------------------------------- 1. 令牌 */
:root {
  /* 背景（由深到浅，步进极小以制造纵深） */
  --bg-0: #05060A;
  --bg-1: #080A10;
  --bg-2: #0C0F17;
  --surface-1: rgba(255, 255, 255, 0.026);
  --surface-2: rgba(255, 255, 255, 0.045);
  --surface-3: rgba(255, 255, 255, 0.07);

  /* 描边 */
  --line-1: rgba(255, 255, 255, 0.062);
  --line-2: rgba(255, 255, 255, 0.105);
  --line-3: rgba(255, 255, 255, 0.17);
  --inset-hl: inset 0 1px 0 rgba(255, 255, 255, 0.055);

  /* 文字 */
  --tx-1: #F3F6FB;
  --tx-2: #A2AEC2;
  --tx-3: #6A768C;
  --tx-4: #4A5468;

  /* 强调色（蓝为主、紫为辅、青作高光） */
  --ac-1: #5B8CFF;
  --ac-2: #8B5CF6;
  --ac-3: #22D3EE;
  --grad: linear-gradient(135deg, #5B8CFF 0%, #7C6BFF 52%, #A855F7 100%);
  --grad-soft: linear-gradient(135deg, rgba(91, 140, 255, 0.16), rgba(168, 85, 247, 0.14));

  /* 语义 */
  --ok: #34D399;
  --warn: #FBBF24;
  --bad: #FB7185;

  /* 圆角 */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 26px;

  /* 阴影 */
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 12px 28px -12px rgba(0, 0, 0, 0.8);
  --sh-3: 0 28px 56px -24px rgba(0, 0, 0, 0.9);
  --sh-ac: 0 14px 34px -12px rgba(91, 140, 255, 0.5);

  /* 尺寸 */
  --sidebar-w: 238px;
  --sidebar-w-min: 78px;
  --tab-h: 62px;
  --topbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------------------------------------------------------------- 2. 基础 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg-0);
  color: var(--tx-1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
  min-height: 100vh;
}

/* 环境光：三团极低透明度的极光，制造"空间感"而不是"贴纸感" */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 8% -12%, rgba(91, 140, 255, 0.16), transparent 58%),
    radial-gradient(900px 520px at 96% -6%, rgba(168, 85, 247, 0.13), transparent 56%),
    radial-gradient(1000px 700px at 50% 112%, rgba(34, 211, 238, 0.055), transparent 62%);
}

/* 细颗粒噪点：让大面积深色不死板（约 3% 透明度） */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* 扉页期间：底层首页已经渲染好（比视口高），右侧会露出一条滚动条，很难看。
   做法：把 body 固定成视口大小 → 文档不再可滚 → 滚动条消失；
   同时 `html{overflow-y:scroll}` 让**滚动条通道常驻**，宽度不会因为显示/隐藏
   而变，所以揭开扉页时内容不会横向跳一下。
   · 不用 scrollbar-gutter：Chromium 在 overflow:hidden 下不会保留通道（实测 clientWidth 1280→1272）。
   · class 由 <head> 内联脚本加，app.js 在离开扉页时移除。 */
html { overflow-y: scroll; }
html.splash-lock body { position: fixed; inset: 0; overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: rgba(91, 140, 255, 0.32); }

/* ---------------------------------------------------------------- 3. 扉页 */
#splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 640px at 18% 8%, #14224A 0%, transparent 55%),
    radial-gradient(900px 560px at 88% 84%, #2B1147 0%, transparent 58%),
    radial-gradient(700px 500px at 50% 50%, #0A1626 0%, #05070C 70%);
  overflow: hidden;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), filter 0.7s;
}
#splash.leaving { opacity: 0; transform: scale(1.04); filter: blur(6px); pointer-events: none; }

.sp-orb { position: absolute; border-radius: 50%; filter: blur(70px); animation: orb 11s ease-in-out infinite; }
.sp-orb.a { width: 340px; height: 340px; background: rgba(59, 105, 255, 0.5); top: -90px; left: -60px; }
.sp-orb.b { width: 300px; height: 300px; background: rgba(139, 92, 246, 0.42); bottom: -40px; right: -70px; animation-delay: -4s; }
.sp-orb.c { width: 200px; height: 200px; background: rgba(34, 211, 238, 0.22); bottom: 26%; left: 22%; animation-delay: -7s; }
@keyframes orb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -26px, 0) scale(1.1); }
}

/* 扉页网格线：极淡，增加"编辑感" */
.sp-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
}

.sp-wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.sp-mark {
  width: 84px; height: 84px;
  border-radius: 24px;
  display: grid; place-items: center;
  font-size: 36px; font-weight: 700; color: #fff;
  background: var(--grad);
  box-shadow: 0 24px 60px -12px rgba(91, 140, 255, 0.62), var(--inset-hl);
  animation: markIn 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  margin-bottom: 30px;
}
@keyframes markIn {
  from { opacity: 0; transform: translateY(22px) scale(0.82) rotate(-6deg); }
  to { opacity: 1; transform: none; }
}

.sp-title {
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 700;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  line-height: 1.2;
  background: linear-gradient(180deg, #FFFFFF 12%, #A9BCDF 96%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: up 1s 0.16s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sp-en {
  margin-top: 14px;
  font-size: 10.5px;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  color: rgba(168, 185, 214, 0.55);
  animation: up 1s 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sp-rule {
  width: 46px; height: 1px;
  margin: 28px auto;
  background: linear-gradient(90deg, transparent, rgba(91, 140, 255, 0.9), transparent);
  animation: up 1s 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sp-tag {
  font-size: 13.5px; line-height: 2.05;
  color: rgba(162, 174, 194, 0.85);
  max-width: 320px;
  animation: up 1s 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.sp-foot {
  position: relative; z-index: 2;
  padding: 0 24px calc(52px + var(--safe-b));
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  animation: up 1s 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sp-enter {
  height: 50px; padding: 0 52px;
  border-radius: 99px;
  background: var(--grad);
  color: #fff;
  font-size: 14.5px; font-weight: 600; letter-spacing: 0.16em;
  box-shadow: var(--sh-ac), var(--inset-hl);
  transition: transform 0.2s, box-shadow 0.2s;
}
.sp-enter:hover { transform: translateY(-1px); box-shadow: 0 20px 40px -12px rgba(91, 140, 255, 0.62), var(--inset-hl); }
.sp-enter:active { transform: scale(0.97); }
.sp-meta { font-size: 10.5px; letter-spacing: 0.34em; color: var(--tx-4); }

/* ---------------------------------------------------------------- 4. 外壳 */
#app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.6s ease;
}
#app.revealed { opacity: 1; }

/* ---- 侧边栏 ---- */
.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line-1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0.006));
  backdrop-filter: blur(18px);
}

.sb-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 10px 22px;
}
.sb-mark {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700; color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 20px -6px rgba(91, 140, 255, 0.6), var(--inset-hl);
}
.sb-name { font-size: 16.5px; font-weight: 700; letter-spacing: 0.12em; }
.sb-tag { font-size: 10px; color: var(--tx-4); letter-spacing: 0.16em; margin-top: -2px; }

.sb-nav { display: flex; flex-direction: column; gap: 3px; }
.sb-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  height: 42px; padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--tx-2);
  font-size: 13.8px; font-weight: 500;
  transition: background 0.16s, color 0.16s;
}
.sb-item:hover { background: var(--surface-1); color: var(--tx-1); }
.sb-item.on { background: var(--grad-soft); color: #E8EEFF; }
.sb-item.on::before {
  content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--grad);
}
.sb-item svg { flex: 0 0 auto; opacity: 0.85; }
.sb-item.on svg { opacity: 1; }
.sb-divider { height: 1px; background: var(--line-1); margin: 14px 10px; }
.sb-label {
  font-size: 10.5px; letter-spacing: 0.18em; color: var(--tx-4);
  padding: 4px 12px 8px;
}

.sb-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-1); }
.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm);
  transition: background 0.16s;
}
.sb-user:hover { background: var(--surface-1); }
.sb-avatar {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 10px; display: grid; place-items: center;
  font-size: 14px; font-weight: 600; color: #fff;
  background: var(--grad); overflow: hidden;
}
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-uname { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-usub { font-size: 10.5px; color: var(--tx-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- 主区 ---- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 30px;
  background: rgba(6, 7, 11, 0.7);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--line-1);
}
.tb-back {
  width: 32px; height: 32px; margin-left: -8px;
  display: grid; place-items: center;
  border-radius: 9px; color: var(--tx-2);
  transition: background 0.16s, color 0.16s;
}
.tb-back:hover { background: var(--surface-2); color: var(--tx-1); }
/* AI 页左上角「三道杠」：打开会话抽屉（对齐小程序版导航栏菜单） */
.tb-menu {
  width: 32px; height: 32px; margin-left: -8px;
  display: grid; place-items: center;
  border-radius: 9px; color: var(--tx-2);
  transition: background 0.16s, color 0.16s;
}
.tb-menu:hover { background: var(--surface-2); color: var(--tx-1); }
.tb-menu:active { transform: scale(0.94); }

.tb-title { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; }
.tb-crumb { font-size: 12px; color: var(--tx-4); margin-left: 2px; }
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--tx-2);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  transition: all 0.16s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--tx-1); border-color: var(--line-2); }
.icon-btn:active { transform: scale(0.95); }

#page {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 30px 72px;
  animation: pageIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* ⚠️ 只动 opacity：任何 transform / filter（哪怕恒等矩阵）都会让
   #page 成为 position:fixed 子元素的包含块，导致 .fab 之类跑到页面底部 */
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------------------------------------------------------- 5. 布局工具 */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 322px; gap: 30px; align-items: start; }
.col-main { min-width: 0; display: flex; flex-direction: column; gap: 34px; }
.col-side { display: flex; flex-direction: column; gap: 22px; position: sticky; top: calc(var(--topbar-h) + 22px); }

.block { display: flex; flex-direction: column; gap: 14px; }
.block-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.block-hd h2 {
  font-size: 17px; font-weight: 650; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 9px;
}
.block-hd h2::before {
  content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--grad);
}
.block-meta { font-size: 12px; color: var(--tx-4); }
.block-more { font-size: 12.5px; color: var(--tx-3); transition: color 0.16s; }
.block-more:hover { color: var(--ac-1); }

.stack { display: flex; flex-direction: column; gap: 10px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 14px; }
.grid-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ---------------------------------------------------------------- 6. Hero */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  min-height: 320px;
  display: flex; flex-direction: column; justify-content: flex-end;
  border: 1px solid var(--line-1);
  box-shadow: var(--sh-3);
  margin-bottom: 34px;
  isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 6, 10, 0.34) 0%, rgba(4, 6, 10, 0.62) 46%, rgba(4, 6, 10, 0.94) 100%),
    linear-gradient(100deg, rgba(6, 12, 26, 0.86) 0%, rgba(6, 12, 26, 0.24) 58%, transparent 100%);
}
.hero-fallback {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 400px at 18% 10%, rgba(91, 140, 255, 0.35), transparent 60%),
    radial-gradient(700px 400px at 88% 90%, rgba(168, 85, 247, 0.3), transparent 62%),
    linear-gradient(150deg, #101A2E 0%, #0A0F1A 60%, #120C22 100%);
}
.hero-inner { position: relative; padding: 38px 40px 34px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(200, 214, 236, 0.72);
  margin-bottom: 14px;
}
.hero-eyebrow::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--ac-3); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}
.hero-title {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.24;
  max-width: 15em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}
.hero-sub { margin-top: 12px; font-size: 13.5px; color: rgba(178, 192, 214, 0.9); max-width: 34em; }
.hero-search {
  margin-top: 26px;
  display: flex; align-items: center; gap: 10px;
  max-width: 520px;
  height: 50px;
  padding: 0 7px 0 16px;
  border-radius: 99px;
  background: rgba(12, 16, 24, 0.72);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(18px);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.hero-search:focus-within { border-color: rgba(91, 140, 255, 0.55); box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.1); }
.hero-search input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: none;
  font-size: 14px; color: var(--tx-1);
}
.hero-search input::placeholder { color: var(--tx-4); }
.hero-go {
  height: 36px; padding: 0 20px;
  border-radius: 99px;
  background: var(--grad);
  color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: var(--sh-ac);
  transition: transform 0.16s;
}
.hero-go:hover { transform: translateY(-1px); }
.hero-go:active { transform: scale(0.96); }
.hero-hint { margin-top: 12px; font-size: 11.5px; color: rgba(150, 166, 190, 0.6); }
.hero-dots { position: absolute; right: 22px; bottom: 22px; display: flex; gap: 6px; z-index: 2; }
.hero-dot { width: 6px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.3); transition: all 0.3s; }
.hero-dot.on { width: 18px; background: #fff; }

/* ---------------------------------------------------------------- 7. 卡片与列表 */
.card {
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--sh-1), var(--inset-hl);
  transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
}
.card-pad-sm { padding: 14px 16px; border-radius: var(--r-md); }

/* 服务磁贴 */
.tile {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 14px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}
.tile:hover { background: var(--surface-2); border-color: var(--line-2); transform: translateY(-2px); }
.tile:active { transform: scale(0.985); }
.tile-ico {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #9DBCFF;
  background: linear-gradient(160deg, rgba(91, 140, 255, 0.2), rgba(168, 85, 247, 0.13));
  border: 1px solid rgba(91, 140, 255, 0.22);
  transition: color 0.18s, box-shadow 0.18s;
}
.tile:hover .tile-ico { color: #C7DBFF; box-shadow: 0 6px 18px -6px rgba(91, 140, 255, 0.55); }
.tile-name { font-size: 13px; font-weight: 550; color: var(--tx-1); }
.tile-sub { font-size: 11px; color: var(--tx-4); }

/* 信息流卡片 */
.post {
  display: block;
  padding: 17px 18px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.post:hover { background: var(--surface-2); border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--sh-2), var(--inset-hl); }
.post-hd { display: flex; align-items: flex-start; gap: 10px; }
.post-title {
  font-size: 15px; font-weight: 600; line-height: 1.5;
  letter-spacing: -0.008em;
  flex: 1; min-width: 0;
}
.post-body {
  margin-top: 7px;
  font-size: 13px; color: var(--tx-2); line-height: 1.72;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-ft {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-top: 12px;
  font-size: 11.5px; color: var(--tx-4);
}
.post-ft .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--tx-4); opacity: 0.6; }
.post-stats { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.post-stat { display: flex; align-items: center; gap: 4px; }

/* 行列表 */
.row {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  transition: all 0.16s;
}
.row:hover { background: var(--surface-2); border-color: var(--line-2); }
.row + .row { margin-top: 9px; }
.row-ico {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px; display: grid; place-items: center;
  color: #9DBCFF;
  background: rgba(91, 140, 255, 0.1);
  border: 1px solid rgba(91, 140, 255, 0.16);
}
.row-body { flex: 1; min-width: 0; }
.row-t { font-size: 14px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-s { font-size: 12px; color: var(--tx-4); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-arrow { color: var(--tx-4); flex: 0 0 auto; transition: transform 0.16s, color 0.16s; }
.row:hover .row-arrow { transform: translateX(2px); color: var(--tx-2); }

/* 迷你行（侧栏） */
.mini {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--tx-2);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  transition: all 0.16s;
}
.mini:hover { background: var(--surface-2); color: var(--tx-1); }
.mini + .mini { margin-top: 8px; }

/* 统计 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  padding: 13px 10px; text-align: center;
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
}
.stat-n { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.stat-l { font-size: 10.5px; color: var(--tx-4); letter-spacing: 0.06em; margin-top: 2px; }

/* ---------------------------------------------------------------- 8. 控件 */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 10px;
  border-radius: 99px;
  font-size: 11.5px; font-weight: 500;
  color: var(--tx-3);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  white-space: nowrap;
  transition: all 0.16s;
}
.chip.on { color: #fff; background: var(--grad); border-color: transparent; box-shadow: var(--sh-ac); }
.chip.brand { color: #B7CEFF; background: rgba(91, 140, 255, 0.12); border-color: rgba(91, 140, 255, 0.26); }
.chip.ok { color: var(--ok); background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.24); }
.chip.warn { color: var(--warn); background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.24); }
.chip.danger { color: var(--bad); background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.24); }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .chip { cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; padding: 0 20px;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 550;
  color: var(--tx-1);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  transition: all 0.16s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: var(--sh-ac), var(--inset-hl);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn[disabled] { opacity: 0.42; pointer-events: none; }

.field {
  width: 100%; height: 44px; padding: 0 14px;
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  color: var(--tx-1); outline: none;
  font-size: 13.8px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.field::placeholder { color: var(--tx-3); opacity: 1; }
.field:focus { border-color: rgba(91, 140, 255, 0.5); background: rgba(91, 140, 255, 0.055); box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.08); }
textarea.field { height: auto; min-height: 116px; padding: 12px 14px; line-height: 1.75; resize: vertical; }

/* 搜索（页内） */
.search {
  display: flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 14px;
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search:focus-within { border-color: rgba(91, 140, 255, 0.45); box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.07); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 13.8px; color: var(--tx-1); }
.search input::placeholder { color: var(--tx-4); }

/* FAB */
.fab {
  position: fixed; right: 28px; bottom: 28px; z-index: 70;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
  box-shadow: var(--sh-ac), var(--inset-hl);
  transition: transform 0.18s;
}
.fab:hover { transform: translateY(-2px) rotate(90deg); }

/* 价格 */
.price { color: #FFB088; font-weight: 700; letter-spacing: -0.01em; }
.price small { font-size: 11px; font-weight: 500; margin-left: 2px; opacity: 0.75; }

/* 骨架 */
.sk {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.085) 37%, rgba(255,255,255,.04) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 7px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-line { height: 12px; margin-bottom: 9px; }
.w60 { width: 60%; } .w85 { width: 85%; } .w40 { width: 40%; }

/* 空态 */
.empty { text-align: center; padding: 64px 24px; color: var(--tx-4); }
.empty-ico {
  width: 52px; height: 52px; margin: 0 auto 16px;
  border-radius: 16px; display: grid; place-items: center;
  font-size: 21px;
  background: var(--surface-1); border: 1px solid var(--line-1);
  color: var(--tx-3);
}
.empty-t { font-size: 14px; color: var(--tx-2); }
.empty-s { font-size: 12.5px; margin-top: 6px; }

.loadmore { text-align: center; padding: 20px 0 4px; font-size: 12px; color: var(--tx-4); letter-spacing: 0.04em; }

/* Toast */
.toast-wrap {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border-radius: 99px;
  background: rgba(22, 27, 38, 0.94);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(20px);
  font-size: 13px; color: var(--tx-1);
  box-shadow: var(--sh-3);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  max-width: 82vw;
}
.toast.err { border-color: rgba(251, 113, 133, 0.42); color: #FFC9D2; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.94); } to { opacity: 1; transform: none; } }

/* 弹层 */
.sheet-mask {
  position: fixed; inset: 0; z-index: 1600;
  background: rgba(3, 4, 7, 0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: maskIn 0.24s ease both;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 560px;
  background: #0D111A;
  border: 1px solid var(--line-2);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 22px 22px calc(22px + var(--safe-b));
  box-shadow: var(--sh-3);
  animation: sheetIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
  max-height: 84vh; overflow-y: auto;
}
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
.sheet-bar { width: 40px; height: 4px; border-radius: 99px; background: var(--line-3); margin: -6px auto 16px; }
.sheet-title { font-size: 15.5px; font-weight: 650; margin-bottom: 14px; }

/* ---------------------------------------------------------------- 9. 底部 Tab（移动端） */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  align-items: center;
  background: rgba(8, 10, 16, 0.88);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid var(--line-1);
}
.tab {
  flex: 1; height: 100%;
  /* 底对齐 + 统一底边距：五个 Tab 的文字**一定在同一条基线**上。
     以前用 center：AI 那颗 48px 圆钮比其它 21px 图标高 27px，
     居中后它的「AI」标签就被挤到比旁边低 2~5px，看着像没对齐。 */
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 3px;
  padding-bottom: 9px;
  color: var(--tx-4); font-size: 10.5px;
  transition: color 0.18s;
}
/* inline 的 svg 会带一条基线以下的留白（实测多 5px），
   图标与文字之间的间隙会比 gap 大很多；改成 flex 就只剩 gap */
.tab .ti { display: flex; flex: 0 0 auto; transition: transform 0.22s cubic-bezier(0.16,1,0.3,1); }
.tab.on { color: var(--ac-1); }
.tab.on .ti { transform: translateY(-1px) scale(1.06); }
.tab-ai { flex: 0 0 74px; }
.ai-btn {
  /* flex-shrink 会把 48px 的圆钮压成 32px（栏高装不下 48+文字），必须写死 */
  flex: 0 0 48px;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
  margin-top: 0;
  box-shadow: 0 10px 26px -8px rgba(91, 140, 255, 0.7), var(--inset-hl);
}
.ai-label { margin-top: 0; }

/* ---------------------------------------------------------------- 10. AI 对话 */
/* 对话页是"固定外壳 + 内部滚动"：必须给 #page 一个确定高度，
   否则 flex 的 min-content 会把页面撑高，输入框被顶出视口 */
#page.page-fill {
  flex: 0 0 auto;
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
  padding: 18px 30px 20px;
}
.ai-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.chat-scroll {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 16px;
  width: 100%; max-width: 860px; margin: 0 auto;
  padding: 6px 4px 10px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent;
}
.chat-scroll::-webkit-scrollbar { width: 8px; }
.chat-scroll::-webkit-scrollbar-track { background: transparent; }
.chat-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 99px; }
.chat-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

.msg { display: flex; }
.msg.me { justify-content: flex-end; }
.bubble {
  max-width: min(78%, 640px);
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px; line-height: 1.78;
  white-space: pre-wrap; word-break: break-word;
}
.msg.ai .bubble {
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  border-bottom-left-radius: 5px;
  box-shadow: var(--inset-hl);
}
.msg.me .bubble {
  background: var(--grad); color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: var(--sh-ac);
}
.src-list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 7px; }
.src {
  padding: 7px 11px; border-radius: 9px;
  background: rgba(91, 140, 255, 0.07);
  border: 1px solid rgba(91, 140, 255, 0.16);
  font-size: 11.5px; color: var(--tx-2);
}
.src b { color: #B7CEFF; font-weight: 600; }

/* 等待首字时的三点动画 */
.typing { display: inline-flex; align-items: center; gap: 4px; height: 22px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--tx-4); animation: tdot 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.16s; }
.typing i:nth-child(3) { animation-delay: 0.32s; }
@keyframes tdot {
  0%, 60%, 100% { opacity: 0.22; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

/* 欢迎态：垂直居中，不再靠 padding-top 硬顶 */
.ai-hello {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  min-height: 240px; padding: 24px 12px 40px;
}
.ai-hello-ico {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center;
  color: #C6D8FF;
  background: linear-gradient(160deg, rgba(91, 140, 255, 0.22), rgba(168, 85, 247, 0.14));
  border: 1px solid rgba(91, 140, 255, 0.26);
  box-shadow: 0 18px 40px -16px rgba(91, 140, 255, 0.72), var(--inset-hl);
  margin-bottom: 20px;
}
.ai-hello-t { font-size: 19px; font-weight: 650; letter-spacing: -0.012em; }
.ai-hello-s { font-size: 12.8px; color: var(--tx-4); margin-top: 8px; }
.ai-hello-qs { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 22px; max-width: 540px; }
.ai-q {
  padding: 9px 15px; border-radius: 99px;
  font-size: 12.8px; color: var(--tx-2);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  transition: all 0.16s;
}
.ai-q:hover { color: #fff; background: rgba(91, 140, 255, 0.14); border-color: rgba(91, 140, 255, 0.34); transform: translateY(-1px); }

/* 输入栏：处于流式布局底部，不再 sticky 到视口 */
.chat-bar {
  flex: 0 0 auto;
  display: flex; align-items: flex-end; gap: 9px;
  width: 100%; max-width: 860px; margin: 0 auto;
  padding: 14px 0 2px;
  border-top: 1px solid var(--line-1);
}
.ai-hist {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--tx-3);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  transition: all 0.16s;
}
.ai-hist:hover { color: var(--tx-1); background: var(--surface-2); border-color: var(--line-2); }
.ai-hist:active { transform: scale(0.94); }

.chat-field {
  flex: 1; min-width: 0;
  display: flex;
  border-radius: 22px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--inset-hl);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.chat-field:focus-within {
  background: var(--surface-1);
  border-color: rgba(91, 140, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.08);
}
.chat-field textarea {
  flex: 1; min-width: 0;
  /* 单行内容 = 行高 21.7 + 上下 padding 20 ≈ 42，再加 .chat-field 的 1px 边框，
     整条输入框就是 44px —— 与两侧直径 44 的圆钮顶底对齐（之前是 46，高出 2px） */
  min-height: 42px; max-height: 132px;
  padding: 10px 18px;
  background: none; border: 0; outline: none; resize: none;
  color: var(--tx-1);
  font-family: inherit; font-size: 14px; line-height: 1.55;
}
.chat-field textarea::placeholder { color: var(--tx-4); }

.ai-send {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
  box-shadow: var(--sh-ac), var(--inset-hl);
  transition: transform 0.16s, opacity 0.16s;
}
.ai-send:hover { transform: translateY(-1px); }
.ai-send:active { transform: scale(0.94); }
.ai-send[disabled] { opacity: 0.42; pointer-events: none; }

/* 语音输入 */
.ai-mic {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--tx-2);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  transition: all 0.16s;
}
.ai-mic:hover { color: var(--tx-1); background: var(--surface-2); border-color: var(--line-2); }
.ai-mic:active { transform: scale(0.94); }
.ai-mic.is-rec {
  color: #fff;
  background: rgba(251, 113, 133, 0.92);
  border-color: transparent;
  animation: micPulse 1.2s ease-in-out infinite;
}
.ai-mic.is-busy { color: var(--ac-3); opacity: 0.65; pointer-events: none; }
.ai-mic.is-off { opacity: 0.45; }
/* 切到语音模式时按钮高亮（图标已换成键盘） */
.ai-mic.is-on { color: #fff; background: rgba(91, 140, 255, 0.18); border-color: rgba(91, 140, 255, 0.42); }

/* 微信式「按住 说话」：语音模式下顶替输入框 */
.ai-hold {
  display: none;
  flex: 1; min-width: 0;
  height: 44px;
  align-items: center; justify-content: center;
  border-radius: 22px;
  font-size: 14px; font-weight: 550; letter-spacing: 0.02em;
  color: var(--tx-2);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--inset-hl);
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.1s;
}
.ai-hold:active { transform: scale(0.995); }
.ai-hold.is-rec {
  color: #fff;
  background: rgba(91, 140, 255, 0.22);
  border-color: rgba(91, 140, 255, 0.55);
}
.ai-hold.will-cancel {
  color: #FFB4C0;
  background: rgba(251, 113, 133, 0.16);
  border-color: rgba(251, 113, 133, 0.5);
}
.ai-hold.is-busy { opacity: 0.65; pointer-events: none; }
.ai-page[data-voice="on"] .chat-field { display: none; }
.ai-page[data-voice="on"] .ai-hold { display: flex; }
.ai-page[data-voice="on"] .ai-send { display: none; }
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(251, 113, 133, 0); }
}

/* ---- 模式切换（问答 / Agent）---- */
.ai-body { flex: 1; min-height: 0; display: flex; gap: 18px; }
.chat-col { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chat-col > .chat-scroll { flex: 1; min-height: 0; }

.ai-top {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  width: 100%; max-width: 860px; margin: 0 auto;
  padding: 0 4px 12px;
}
.ai-seg {
  display: inline-flex; gap: 2px; padding: 3px;
  border-radius: 11px;
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
}
.ai-seg button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 13px;
  border-radius: 8px;
  font-size: 12.5px; font-weight: 550; color: var(--tx-3);
  transition: all 0.16s;
}
.ai-seg button i { display: grid; place-items: center; font-style: normal; }
.ai-seg button:hover { color: var(--tx-1); background: rgba(255, 255, 255, 0.045); }
.ai-seg button.on { color: #fff; background: var(--grad); box-shadow: var(--sh-ac); }
.ai-hint { font-size: 11.5px; color: var(--tx-4); }

/* 模型来源徽标：本机 / 云端 */
.ai-model {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border-radius: 99px;
  font-size: 11px; color: var(--tx-4);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  white-space: nowrap;
}
.ai-model i { width: 6px; height: 6px; border-radius: 50%; background: var(--tx-4); flex: 0 0 6px; }
.ai-model.on {
  color: #8FE3C0;
  background: rgba(52, 211, 153, 0.09);
  border-color: rgba(52, 211, 153, 0.3);
}
.ai-model.on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16); }
/* DeepSeek（深度求索）：用品牌蓝区分于「本机绿」 */
.ai-model.deepseek {
  color: #9AB4FF;
  background: rgba(77, 107, 254, 0.12);
  border-color: rgba(77, 107, 254, 0.34);
}
.ai-model.deepseek i { background: #4D6BFE; box-shadow: 0 0 0 3px rgba(77, 107, 254, 0.2); }

/* ---- 会话抽屉（左上角三道杠打开，对齐小程序版侧边栏） ---- */
.ai-drawer-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(2, 3, 6, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.22s, visibility 0.22s;
}
.ai-drawer-mask.on { opacity: 1; visibility: visible; }
.ai-drawer {
  position: fixed; z-index: 81;
  top: 0; left: 0; bottom: 0;
  width: min(304px, 84vw);
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 14px calc(16px + var(--safe-b));
  background: linear-gradient(180deg, #0B0E16, #07090F 72%);
  border-right: 1px solid var(--line-2);
  box-shadow: 26px 0 60px -30px rgba(0, 0, 0, 0.95);
  transform: translateX(-104%);
  transition: transform 0.26s cubic-bezier(0.22, 0.8, 0.28, 1);
  will-change: transform;
}
.ai-drawer.on { transform: none; }
.dr-hd { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 2px 4px; }
.dr-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; letter-spacing: 0.01em; }
.dr-logo {
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center; color: #fff;
  background: var(--grad);
  box-shadow: var(--sh-ac), var(--inset-hl);
}
.dr-x { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--tx-3); }
.dr-x:hover { color: var(--tx-1); background: var(--surface-2); }

.dr-new {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; color: #fff;
  background: var(--grad);
  box-shadow: 0 12px 26px -14px rgba(91, 140, 255, 0.95), var(--inset-hl);
  transition: transform 0.16s, filter 0.16s;
}
.dr-new:hover { filter: brightness(1.06); }
.dr-new:active { transform: scale(0.98); }

.dr-search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 11px;
  border-radius: 11px;
  color: var(--tx-4);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
}
.dr-search input {
  flex: 1; min-width: 0; height: 100%;
  background: none; border: 0; outline: none;
  color: var(--tx-1); font-family: inherit; font-size: 12.8px;
}
.dr-search input::placeholder { color: var(--tx-4); }
.dr-search:focus-within { border-color: rgba(91, 140, 255, 0.45); background: rgba(91, 140, 255, 0.06); }

.dr-list {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 2px;
  margin: 0 -4px; padding: 0 4px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.dr-list::-webkit-scrollbar { width: 5px; }
.dr-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }
.dr-item { display: flex; align-items: center; gap: 2px; border-radius: 11px; }
.dr-item:hover { background: var(--surface-1); }
.dr-item.on { background: rgba(91, 140, 255, 0.13); box-shadow: inset 0 0 0 1px rgba(91, 140, 255, 0.28); }
.dr-conv {
  flex: 1; min-width: 0; text-align: left;
  display: flex; flex-direction: column; gap: 3px;
  padding: 9px 10px;
  border-radius: 11px;
  color: var(--tx-2);
}
.dr-item.on .dr-conv { color: var(--tx-1); }
.dr-conv-t { font-size: 13px; font-weight: 550; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-conv-s { font-size: 11px; color: var(--tx-4); font-variant-numeric: tabular-nums; }
.dr-del {
  width: 28px; height: 28px; flex: 0 0 28px; margin-right: 4px;
  border-radius: 8px; display: grid; place-items: center;
  color: var(--tx-4); opacity: 0.5;   /* 常显：只靠 hover 显示的按钮，用户根本找不到删除入口 */
  transition: opacity 0.14s, color 0.14s, background 0.14s;
}
.dr-item:hover .dr-del, .dr-item.on .dr-del { opacity: 1; }
.dr-del:hover { color: var(--bad); background: rgba(251, 113, 133, 0.12); }
.dr-tip { padding: 18px 8px; text-align: center; font-size: 12px; color: var(--tx-4); }
.dr-retry {
  align-self: center; padding: 7px 16px; border-radius: 99px;
  font-size: 12px; color: var(--tx-2);
  background: var(--surface-1); border: 1px solid var(--line-1);
}
.dr-foot { flex: 0 0 auto; padding-top: 10px; border-top: 1px solid var(--line-1); }
.dr-clear {
  width: 100%; height: 38px; border-radius: 11px;
  font-size: 12.5px; color: var(--tx-3);
  background: var(--surface-1); border: 1px solid var(--line-1);
  transition: all 0.16s;
}
.dr-clear:hover { color: var(--bad); border-color: rgba(251, 113, 133, 0.4); background: rgba(251, 113, 133, 0.08); }

/* 触屏设备没有 hover：删除按钮常显 */
@media (hover: none) {
  .dr-del { opacity: 0.7; }
}

/* ---- 输入栏左侧：模型切换（对齐小程序版输入框左侧的「上拉」按钮） ---- */
.ai-model-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; flex: 0 0 auto; max-width: 136px;
  padding: 0 13px;
  border-radius: 22px;
  font-size: 12px; color: var(--tx-2);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  white-space: nowrap;
  transition: all 0.16s;
}
.ai-model-btn:hover { color: var(--tx-1); background: var(--surface-2); border-color: var(--line-2); }
.ai-model-btn:active { transform: scale(0.97); }
.ai-model-btn span { overflow: hidden; text-overflow: ellipsis; }
.ai-model-btn.is-local { color: #8FE3C0; background: rgba(52, 211, 153, 0.09); border-color: rgba(52, 211, 153, 0.3); }
.ai-model-btn.is-deepseek { color: #9AB4FF; background: rgba(77, 107, 254, 0.12); border-color: rgba(77, 107, 254, 0.34); }
.ai-caret {
  width: 0; height: 0; flex: 0 0 auto;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4.5px solid currentColor;
  opacity: 0.7;
}

/* 模型选择面板（复用 ui.sheet 的自底向上弹层） */
.mopt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 12px 13px; margin-bottom: 8px;
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  transition: all 0.16s;
}
.mopt:hover { background: var(--surface-2); border-color: var(--line-2); }
.mopt.on { background: rgba(91, 140, 255, 0.12); border-color: rgba(91, 140, 255, 0.38); }
.mopt.off { opacity: 0.5; }
.mopt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mopt-main b { font-size: 13.5px; font-weight: 600; color: var(--tx-1); }
.mopt-main em { font-style: normal; font-size: 11.5px; line-height: 1.6; color: var(--tx-4); }
.mopt-ck {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--ac-1);
}
.msheet-tip { font-size: 11.5px; line-height: 1.7; color: var(--tx-4); }


/* 窄屏用输入栏里的「任务」按钮，宽屏用右侧常驻面板 */
.ai-task {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%;
  display: none; place-items: center;
  color: var(--tx-3);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  transition: all 0.16s;
}
.ai-task:hover { color: var(--tx-1); background: var(--surface-2); border-color: var(--line-2); }
.ai-page[data-mode="agent"] .ai-hist { display: none; }

/* ---- Agent 任务面板 ---- */
.agent-side {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 0; min-width: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line-1);
}
.ai-page[data-mode="qa"] .agent-side { display: none; }
.ai-page[data-mode="agent"] .ai-body { display: grid; grid-template-columns: minmax(0, 1fr) 312px; }

.agent-side-hd { display: flex; align-items: center; justify-content: space-between; padding-right: 2px; }
.agent-side-t { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--tx-4); }
.agent-refresh {
  width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center;
  color: var(--tx-4);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  transition: all 0.16s;
}
.agent-refresh:hover { color: var(--tx-1); background: var(--surface-2); }

.agent-list {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
  padding-right: 3px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.agent-list::-webkit-scrollbar { width: 6px; }
.agent-list::-webkit-scrollbar-track { background: transparent; }
.agent-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }
.agent-list--sheet { max-height: 52vh; }

.agent-group-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 7px;
  font-size: 11px; letter-spacing: 0.04em; color: var(--tx-4);
}
.agent-group-hd b { font-weight: 600; color: var(--tx-3); font-variant-numeric: tabular-nums; }

.agent-empty {
  margin-top: 44px; padding: 0 8px;
  text-align: center; font-size: 11.5px; line-height: 1.9; color: var(--tx-4);
}
.agent-empty-ico {
  width: 34px; height: 34px; margin: 0 auto 10px;
  border-radius: 10px; display: grid; place-items: center;
  color: var(--tx-3);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
}
.agent-empty span { opacity: 0.72; }

/* 提醒条目 */
.arem {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
}
.arem + .arem { margin-top: 6px; }
.arem-check {
  width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: transparent;
  background: transparent;
  border: 1.5px solid var(--line-3);
  transition: all 0.16s;
}
.arem-check:hover { color: var(--ok); border-color: var(--ok); background: rgba(52, 211, 153, 0.12); }
.arem-check[disabled] { opacity: 0.45; }
.arem-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.arem-t { font-size: 12.5px; line-height: 1.45; color: var(--tx-1); word-break: break-word; }
.arem-s { font-size: 10.5px; color: var(--tx-4); font-variant-numeric: tabular-nums; }

/* 执行记录条目 */
.atask {
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  cursor: pointer;
  transition: all 0.16s;
}
.atask + .atask { margin-top: 6px; }
.atask:hover { background: var(--surface-2); border-color: var(--line-2); }
.atask-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.atask-hd .chip { height: 19px; padding: 0 7px; font-size: 10px; }
.atask-time { font-size: 10px; color: var(--tx-4); font-variant-numeric: tabular-nums; }
.atask-t { margin-top: 6px; font-size: 12.5px; line-height: 1.5; word-break: break-word; }
.atask-a {
  margin-top: 8px; height: 24px; padding: 0 10px;
  border-radius: 7px;
  font-size: 11px; color: var(--tx-3);
  background: transparent;
  border: 1px solid var(--line-1);
  transition: all 0.16s;
}
.atask-a:hover { color: var(--bad); border-color: rgba(251, 113, 133, 0.35); background: rgba(251, 113, 133, 0.08); }
.atask-a[disabled] { opacity: 0.45; }

/* ---- Agent 执行卡片 ---- */
.arun { display: flex; flex-direction: column; gap: 8px; }
.arun-q {
  align-self: flex-end;
  display: inline-flex; align-items: flex-start; gap: 8px;
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px; border-bottom-right-radius: 5px;
  background: var(--grad); color: #fff;
  font-size: 13.5px; line-height: 1.6;
  box-shadow: var(--sh-ac);
}
.arun-tag {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 1px 6px; border-radius: 5px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.2);
}
.arun-card {
  padding: 12px 14px;
  border-radius: 14px; border-bottom-left-radius: 5px;
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
}
.arun-card.ok { border-color: rgba(52, 211, 153, 0.26); }
.arun-card.bad { border-color: rgba(251, 113, 133, 0.3); }
.arun-hd { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--tx-2); }
.arun-ico { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.arun-ico.ok { background: rgba(52, 211, 153, 0.92); }
.arun-ico.bad { background: rgba(251, 113, 133, 0.92); }
.arun-src {
  margin-left: auto;
  padding: 2px 7px; border-radius: 99px;
  font-size: 10px; color: var(--tx-4);
  border: 1px solid var(--line-1);
}
.arun-steps { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.arun-step { display: flex; gap: 8px; }
.arun-step-dot {
  width: 6px; height: 6px; flex: 0 0 6px; margin-top: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}
.arun-step-dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.14); }
.arun-step-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.arun-step-body b { font-size: 12.5px; font-weight: 600; }
.arun-step-body em { font-style: normal; font-size: 11.5px; line-height: 1.6; color: var(--tx-3); word-break: break-word; }
.arun-err { margin-top: 10px; font-size: 11.5px; color: var(--bad); line-height: 1.6; }
.arun-tip { margin-top: 8px; font-size: 11px; color: var(--tx-4); line-height: 1.7; }

/* 窄屏：右侧任务面板收起，改用输入栏里的「任务」按钮 + 底部弹层 */
@media (max-width: 1080px) {
  .ai-page[data-mode="agent"] .ai-body { display: flex; }
  .agent-side { display: none; }
  .ai-page[data-mode="agent"] .ai-task { display: grid; }
}

/* ---------------------------------------------------------------- 11. 详情页 */
.article { max-width: 780px; }
.article-eyebrow { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 12px; color: var(--tx-4); }
.article-title {
  font-size: clamp(23px, 2.6vw, 31px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.32;
  margin: 14px 0 6px;
}
.article-body { font-size: 15px; line-height: 1.9; color: #CBD5E5; white-space: pre-wrap; margin-top: 20px; }
.article-actions { display: flex; gap: 10px; margin-top: 22px; }

/* ---------------------------------------------------------------- 12. 校园地图（Leaflet 实装） */
.map-page { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 20px; align-items: start; }

/* ---- 画布 ---- */
.map-shell {
  position: relative;
  height: clamp(440px, calc(100dvh - 190px), 720px);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line-1);
  background: #070B12;
  box-shadow: var(--inset-hl), 0 30px 70px -40px rgba(0, 0, 0, 0.95);
  isolation: isolate;
}
.map-view {
  position: absolute; inset: 0;
  z-index: 1;
  background:
    radial-gradient(90% 80% at 28% 16%, rgba(91, 140, 255, 0.1), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 42px),
    linear-gradient(155deg, #0C131F 0%, #080C14 100%);
}
/* Leaflet 的样式晚于本站样式注入，需提高一位特异性 */
.map-view.leaflet-container { background: transparent; font-family: inherit; outline: none; }
/* 暗色底图：反色 + 降饱和，让浅色瓦片融进深色界面 */
.map-view .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.82) contrast(0.92) saturate(0.45); }
.map-view--noTiles .leaflet-tile-pane { display: none; }
.map-view--fail { display: grid; place-items: center; }

.map-fail { text-align: center; color: var(--tx-4); font-size: 12.5px; }
.map-fail-t { color: var(--tx-2); font-size: 14px; margin-top: 10px; }
.map-fail-s { margin-top: 6px; font-size: 12px; }

/* ---- 缩放控件 ---- */
.map-view .leaflet-control-zoom { border: 0; box-shadow: none; margin: 0 14px 14px 0; }
.map-view .leaflet-control-zoom a,
.map-view .leaflet-touch .leaflet-control-zoom-in,
.map-view .leaflet-touch .leaflet-control-zoom-out {
  width: 34px; height: 34px; line-height: 32px;
  background: rgba(10, 16, 26, 0.86);
  backdrop-filter: blur(14px);
  color: var(--tx-1);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  margin-bottom: 6px;
  font-size: 16px;
  transition: all 0.16s;
}
.map-view .leaflet-control-zoom a:hover { background: rgba(91, 140, 255, 0.24); border-color: rgba(91, 140, 255, 0.42); color: #fff; }

/* ---- 悬浮控件 ---- */
.map-float { position: absolute; z-index: 500; display: flex; gap: 8px; }
/* 搜索独占顶部一行（不再给右侧按钮留位），宽度随容器自适应 */
.tf-tl { top: 14px; left: 14px; width: min(340px, calc(100% - 28px)); }
/* 定位 / 全部地点放左下角：离搜索框远，且不挡住弹窗与图例 */
.tf-bl { left: 14px; bottom: 14px; }

.map-search {
  display: flex; align-items: center; gap: 8px;
  width: 100%; height: 40px; padding: 0 13px;
  border-radius: 12px;
  background: rgba(10, 16, 26, 0.86);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 30px -16px rgba(0, 0, 0, 0.9), var(--inset-hl);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.map-search:focus-within {
  border-color: rgba(91, 140, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.12), 0 12px 30px -16px rgba(0, 0, 0, 0.9);
}
.map-search input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: none;
  color: var(--tx-1); font-size: 13px; font-family: inherit;
}
.map-search input::placeholder { color: var(--tx-4); }
.map-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ms-ico { display: grid; place-items: center; color: var(--tx-4); }
.ms-clear {
  width: 20px; height: 20px; flex: 0 0 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--tx-4);
  background: rgba(255, 255, 255, 0.07);
  transform: rotate(45deg);
  transition: all 0.16s;
}
.ms-clear:hover { color: var(--tx-1); background: rgba(255, 255, 255, 0.15); }
.ms-clear[hidden] { display: none; }

.map-btn { 
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  color: var(--tx-2);
  background: rgba(10, 16, 26, 0.86);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 30px -16px rgba(0, 0, 0, 0.9), var(--inset-hl);
  transition: all 0.16s;
}
/* 带文字的地图按钮：定位 / 全部地点 */
.map-btn-wide {
  width: auto; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 13px; height: 38px;
  border-radius: 12px;
  font-size: 12.5px; font-weight: 550;
  color: var(--tx-2);
}
.map-btn:hover { color: #fff; background: rgba(91, 140, 255, 0.24); border-color: rgba(91, 140, 255, 0.42); }
.map-btn:active { transform: scale(0.94); }
.map-btn.is-busy { color: var(--ac-3); animation: btnPulse 1.1s ease-in-out infinite; }
@keyframes btnPulse { 50% { opacity: 0.45; } }

.map-tip {
  position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%);
  z-index: 500; max-width: calc(100% - 110px);
  padding: 8px 14px; border-radius: 10px;
  font-size: 11.5px; text-align: center; color: var(--warn);
  background: rgba(38, 27, 8, 0.92);
  border: 1px solid rgba(251, 191, 36, 0.3);
  backdrop-filter: blur(10px);
}
.map-tip[hidden] { display: none; }

/* ---- 地图标记 ---- */
.xjt-pin-wrap { background: none; border: 0; }
/* 悬浮名称 */
.xjt-tip {
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(6, 10, 16, 0.92);
  border: 1px solid var(--line-2);
  color: var(--tx-1);
  font-size: 11.5px;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.9);
}
.xjt-tip::before { display: none; }
.xjt-pin {
  position: relative;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #0A111B;
  border: 1.5px solid var(--c);
  color: var(--c);
  box-shadow: 0 0 0 4px var(--c18), 0 6px 18px rgba(0, 0, 0, 0.6);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s;
  cursor: pointer;
}
.xjt-pin::after {
  content: "";
  position: absolute; left: 50%; bottom: -3px;
  width: 8px; height: 8px;
  transform: translateX(-50%) rotate(45deg);
  background: #0A111B;
  border-right: 1.5px solid var(--c);
  border-bottom: 1.5px solid var(--c);
  border-radius: 0 0 2px 0;
}
.xjt-pin i { display: grid; place-items: center; font-style: normal; }
.xjt-pin-wrap:hover .xjt-pin { transform: scale(1.12); }
.xjt-pin.on { box-shadow: 0 0 0 7px var(--c18), 0 10px 26px rgba(0, 0, 0, 0.72); }

.xjt-me { position: relative; width: 18px; height: 18px; }
.xjt-me span {
  position: absolute; inset: 3px; border-radius: 50%;
  background: #4DA3FF; border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.5);
}
.xjt-me::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: rgba(77, 163, 255, 0.4);
  animation: mePulse 2.2s ease-out infinite;
}
@keyframes mePulse {
  0% { transform: scale(0.4); opacity: 0.85; }
  100% { transform: scale(2.4); opacity: 0; }
}
.xjt-start {
  width: 14px; height: 14px; border-radius: 50%;
  background: #0A111B;
  border: 2px solid var(--ok);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2);
}

/* ---- 点位详情卡 ---- */
.map-pop {
  position: absolute; z-index: 600;
  left: 14px; right: 14px; bottom: 14px;
  max-width: 420px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  background: rgba(9, 14, 22, 0.94);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line-2);
  box-shadow: 0 26px 60px -22px rgba(0, 0, 0, 0.95), var(--inset-hl);
  animation: popIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.map-pop[hidden] { display: none; }
@keyframes popIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.mp-x {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--tx-4);
  background: var(--surface-1); border: 1px solid var(--line-1);
  transform: rotate(45deg);
  transition: all 0.16s;
}
.mp-x:hover { color: var(--tx-1); background: var(--surface-2); }
.mp-hd { display: flex; align-items: center; gap: 8px; padding-right: 32px; }
.mp-cat {
  display: inline-flex; align-items: center;
  height: 21px; padding: 0 9px; border-radius: 99px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--c);
  background: var(--c18);
  border: 1px solid var(--c18);
}
.mp-dist { margin-left: auto; font-size: 11px; color: var(--ac-3); }
.mp-name { font-size: 17px; font-weight: 650; letter-spacing: -0.012em; margin-top: 9px; }
.mp-desc { font-size: 12.5px; color: var(--tx-2); line-height: 1.65; margin-top: 6px; }
.mp-meta { font-size: 10.5px; color: var(--tx-4); margin-top: 9px; font-variant-numeric: tabular-nums; }
.mp-acts { display: flex; gap: 8px; margin-top: 13px; }

/* ---- 右侧面板 ---- */
.map-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.map-side-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.map-count { font-size: 11.5px; color: var(--tx-4); font-variant-numeric: tabular-nums; }
.chip-poi i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex: 0 0 6px; }
/* 侧栏空间足够，分类条改为换行而不是横向滑动（避免最后一项被截断） */
.map-side .chip-row { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }

.map-plist {
  display: flex; flex-direction: column; gap: 6px;
  max-height: clamp(240px, calc(100dvh - 340px), 520px);
  overflow-y: auto; padding-right: 2px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.map-plist::-webkit-scrollbar { width: 6px; }
.map-plist::-webkit-scrollbar-track { background: transparent; }
.map-plist::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }

.mpi {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 11px;
  border-radius: 12px; text-align: left;
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  transition: all 0.16s;
}
.mpi:hover { background: var(--surface-2); border-color: var(--line-2); transform: translateX(2px); }
.mpi.on {
  background: rgba(91, 140, 255, 0.1);
  border-color: rgba(91, 140, 255, 0.45);
}
.mpi-ico {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 9px; display: grid; place-items: center;
  color: var(--c); background: var(--c18);
  border: 1px solid var(--c18);
}
.mpi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mpi-t {
  font-size: 13px; font-weight: 550; color: var(--tx-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mpi-s {
  font-size: 11px; color: var(--tx-4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mpi-dist { flex: 0 0 auto; font-size: 11px; color: var(--ac-3); font-variant-numeric: tabular-nums; }

/* ---- 路线结果 ---- */
.route-box {
  padding: 13px 14px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(91, 140, 255, 0.12), rgba(91, 140, 255, 0.05));
  border: 1px solid rgba(91, 140, 255, 0.28);
  box-shadow: var(--inset-hl);
  animation: popIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.route-box[hidden] { display: none; }
.rb-hd { display: flex; align-items: center; justify-content: space-between; }
.rb-title { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #B7CEFF; }
.rb-x {
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  color: var(--tx-4); background: rgba(255, 255, 255, 0.05);
  transform: rotate(45deg);
  transition: all 0.16s;
}
.rb-x:hover { color: var(--tx-1); background: rgba(255, 255, 255, 0.1); }
.rb-main { display: flex; align-items: baseline; gap: 9px; margin-top: 10px; }
.rb-k { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rb-v { font-size: 12px; color: var(--tx-2); }
.rb-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.rb-note { font-size: 11px; color: var(--tx-4); margin-top: 9px; }
.rb-target { font-size: 11.5px; color: var(--tx-3); margin-top: 6px; }

/* ---- 建筑详情 ---- */
.bld-hd { display: flex; align-items: center; gap: 14px; }
.bld-ico {
  width: 52px; height: 52px; flex: 0 0 52px;
  border-radius: 15px; display: grid; place-items: center;
  color: #C6D8FF;
  background: linear-gradient(160deg, rgba(91, 140, 255, 0.22), rgba(168, 85, 247, 0.14));
  border: 1px solid rgba(91, 140, 255, 0.26);
  box-shadow: 0 16px 34px -16px rgba(91, 140, 255, 0.7), var(--inset-hl);
}
.bld-txt { min-width: 0; }
.bld-name { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.bld-sub { font-size: 12px; color: var(--tx-4); margin-top: 5px; }

.floor-block { margin-top: 14px; }
.floor-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.floor-tag {
  padding: 3px 8px; border-radius: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: #B7CEFF; background: rgba(91, 140, 255, 0.12);
  border: 1px solid rgba(91, 140, 255, 0.22);
  font-variant-numeric: tabular-nums;
}
.floor-line { flex: 1; height: 1px; background: var(--line-1); }
.floor-n { font-size: 11px; color: var(--tx-4); }
.room-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; border-radius: 11px;
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
}
.room-row + .room-row { margin-top: 6px; }
.room-main { flex: 1; min-width: 0; }
.room-name { font-size: 13px; font-weight: 550; }
.room-sub { font-size: 11px; color: var(--tx-4); margin-top: 2px; }

/* ---------------------------------------------------------------- 13. 座位 */
.seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 7px; }
.seat {
  aspect-ratio: 1; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 600;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.22);
  color: var(--ok);
  transition: all 0.16s;
}
.seat:hover { background: rgba(52, 211, 153, 0.16); }
.seat.taken { background: var(--surface-1); border-color: var(--line-1); color: var(--tx-4); cursor: not-allowed; }
.seat.sel { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--sh-ac); }

/* ---------------------------------------------------------------- 14. 登录 */
.login-wrap { min-height: 62vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.login-mark {
  width: 76px; height: 76px; border-radius: 22px;
  display: grid; place-items: center;
  font-size: 32px; font-weight: 700; color: #fff;
  background: var(--grad);
  box-shadow: 0 22px 50px -14px rgba(91, 140, 255, 0.65), var(--inset-hl);
  margin-bottom: 26px;
}
.login-t { font-size: 24px; font-weight: 700; letter-spacing: 0.1em; }
.login-s { font-size: 12.5px; color: var(--tx-4); letter-spacing: 0.16em; margin: 10px 0 34px; }

/* ---------------------------------------------------------------- 14b. 我的 */
.me-page { max-width: 760px; margin-left: auto; margin-right: auto; }
.me-logout-wrap {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line-1);
}
.me-logout {
  width: 100%; height: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 550; line-height: 1; letter-spacing: 0.01em;
  color: #FF8A9B;
  background: rgba(251, 113, 133, 0.09);
  border: 1px solid rgba(251, 113, 133, 0.3);
  transition: all 0.16s;
}
.me-logout:hover {
  color: #FFF2F4;
  background: rgba(251, 113, 133, 0.19);
  border-color: rgba(251, 113, 133, 0.58);
  box-shadow: 0 10px 26px -14px rgba(251, 113, 133, 0.85);
}
.me-logout:active { transform: scale(0.99); }
.me-logout svg { flex: 0 0 auto; }

/* 用户栏：整行可点，进个人资料页绑定学号 */
.me-profile { cursor: pointer; transition: background 0.16s, border-color 0.16s, transform 0.16s; }
.me-profile:hover { background: var(--surface-2); border-color: var(--line-2); transform: translateY(-1px); }
.me-profile:active { transform: translateY(0); }
.me-profile:focus-visible { outline: 2px solid var(--ac-1); outline-offset: 2px; }
.me-bind-chip {
  flex: 0 0 auto;
  height: 24px; padding: 0 11px;
  display: inline-flex; align-items: center;
  border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  color: #B7CEFF;
  background: rgba(91, 140, 255, 0.15);
  border: 1px solid rgba(91, 140, 255, 0.3);
}

/* ---------------------------------------------------------------- 15. 工具类 */
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mt22 { margin-top: 22px; } .mt24 { margin-top: 24px; } .mt30 { margin-top: 30px; }
.muted { color: var(--tx-4); font-size: 12.5px; }
.center { text-align: center; }
.flex { display: flex; } .between { justify-content: space-between; } .aic { align-items: center; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- 16. 响应式 */
@media (max-width: 1180px) {
  #app { grid-template-columns: var(--sidebar-w-min) minmax(0, 1fr); }
  .sb-name, .sb-tag, .sb-uname, .sb-usub, .sb-label, .sb-divider { display: none; }
  .sb-brand { justify-content: center; padding: 6px 0 20px; }
  .sb-item { justify-content: center; padding: 0; }
  .sb-item span { display: none; }
  .sb-user { justify-content: center; padding: 9px 0; }
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .map-page { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-side { position: static; order: -1; }
  .map-page { grid-template-columns: minmax(0, 1fr); }
  .map-side { order: 2; }
  .map-shell { height: 54dvh; min-height: 330px; }
  .map-plist { max-height: none; }
  #page { padding: 24px 22px 64px; }
  #page.page-fill { padding: 16px 22px 18px; }
  .topbar { padding: 0 22px; }
  .hero-inner { padding: 30px 26px 28px; }
}

@media (max-width: 820px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .tabbar { display: flex; }
  .tabbar.hidden { display: none !important; }
  #page { padding: 18px 16px calc(var(--tab-h) + var(--safe-b) + 24px); }
  #page.page-fill { padding: 12px 16px calc(var(--tab-h) + var(--safe-b) + 8px); }
  .topbar { padding: 0 16px; }
  .hero { min-height: 258px; border-radius: var(--r-lg); margin-bottom: 24px; }
  .hero-inner { padding: 24px 20px 22px; }
  .hero-dots { right: 16px; bottom: 14px; }
  .fab { right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); }
  .grid-tiles { gap: 9px; }
  .chip-row { margin-right: -16px; padding-right: 16px; }
  .col-main { gap: 26px; }
  .toast-wrap { bottom: calc(var(--tab-h) + var(--safe-b) + 22px); }
  .map-shell { height: 46dvh; min-height: 260px; }
  /* 窄屏：按钮只留图标，避免和底部图例挤在一起 */
  .map-btn-wide { width: 38px; padding: 0; justify-content: center; }
  .map-btn-wide span { display: none; }
  .tf-tl { width: calc(100% - 28px); }
  .map-pop { max-width: none; }
}

/* 桌面才启用 hover 位移，触屏设备避免"粘住" */
@media (hover: none) {
  .post:hover, .tile:hover, .row:hover { transform: none; }
}

/* AI 页（#page 带 page-fill）：底部 AI 凸起按钮铺平，
   让输入栏能贴到五功能栏上方，而不是被 -18px 的凸起顶着 */
@media (max-width: 820px) {
  /* AI 页打开时底栏不需要「凸起主按钮」：直接展平成普通 Tab。
     以前是压成 42×26 的圆角方块（宽度/高度/圆角都与旁边的 Tab 不一致），
     看起来就像「彩色块和一个奇怪的框没对齐」。 */
  body.fill-route .tabbar .tab-ai { flex: 1; }
  body.fill-route .tabbar .ai-btn {
    /* flex 也要复位：基类为了不被压扁写了 flex: 0 0 48px，
       否则这里 width/height 设成 auto 也仍会被 flex-basis 撑成 48 高 */
    flex: 0 0 auto;
    width: auto; height: auto;
    margin-top: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: inherit;
  }
  body.fill-route .tabbar .ai-btn svg { width: 21px; height: 21px; }
  body.fill-route .tabbar .ai-label { margin-top: 0; }
  body.fill-route .tabbar .tab.on .ai-btn { transform: none; }

  /* 竖屏：历史入口收进左上角抽屉，模型状态改由输入栏左侧按钮承载 */
  .ai-hist { display: none; }
  .ai-model { display: none; }
  .ai-model-btn { max-width: 106px; padding: 0 11px; font-size: 11.5px; }
  .chat-bar { gap: 7px; }
}

/* 尊重系统"减少动态" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   17. 兼容层（v2 类名 → v3 视觉）
   内页仍在用 v2 的语义类名，这里做等价映射，保证全站视觉一致
   ========================================================================== */

/* 分区标题 */
.section { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.section-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title {
  font-size: 17px; font-weight: 650; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 9px;
}
.section-title::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--grad); }
.section-more { font-size: 12px; color: var(--tx-4); }

/* 服务宫格 */
.grid6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-item {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 14px; text-align: left;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.grid-item:hover { background: var(--surface-2); border-color: var(--line-2); transform: translateY(-2px); }
.grid-ico {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  color: #9DBCFF;
  background: linear-gradient(160deg, rgba(91, 140, 255, 0.2), rgba(168, 85, 247, 0.13));
  border: 1px solid rgba(91, 140, 255, 0.22);
}
.grid-name { font-size: 13px; font-weight: 550; }

/* 最近使用 */
.quick3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-item {
  display: flex; align-items: center; gap: 9px;
  padding: 14px 12px; border-radius: var(--r-md);
  background: var(--surface-1); border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
}
.quick-txt { font-size: 13px; font-weight: 550; }

/* 信息流条目 */
.feed-item {
  padding: 17px 18px; border-radius: var(--r-md);
  background: var(--surface-1); border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.feed-item:hover { background: var(--surface-2); border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--sh-2), var(--inset-hl); }
.feed-item + .feed-item { margin-top: 10px; }
.feed-t { font-size: 15px; font-weight: 600; line-height: 1.5; letter-spacing: -0.008em; margin-bottom: 7px; }
.feed-c {
  font-size: 13px; color: var(--tx-2); line-height: 1.72;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.feed-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 12px; font-size: 11.5px; color: var(--tx-4); }
.feed-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--tx-4); opacity: 0.6; }

/* ==========================================================================
   论坛帖子卡（v3 精修版）：封面图 + 大标题 + 作者条 + 数据条
   目标：列表页从「一行文字」升级成可扫读的内容卡片
   ========================================================================== */
.post-card {
  display: block;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.048), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s, box-shadow 0.22s;
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 140, 255, 0.32);
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.95), var(--inset-hl);
}
.post-card + .post-card { margin-top: 12px; }

/* 宽屏：卡片网格（单列铺满会把 16:9 封面拉成一堵墙，反而难扫读） */
@media (min-width: 900px) {
  .post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
  .post-grid > .post-card + .post-card { margin-top: 0; }
  .post-grid > .empty, .post-grid > .error, .post-grid > .loadmore { grid-column: 1 / -1; }
}

/* 封面：16:9，底部渐变压住图片亮度，图片本身轻微放大制造「活着」的感觉 */
.pc-cover { position: relative; aspect-ratio: 16 / 9; background: #0A0D14; overflow: hidden; }
.pc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.post-card:hover .pc-cover img { transform: scale(1.035); }
.pc-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5, 6, 10, 0) 42%, rgba(5, 6, 10, 0.74));
  pointer-events: none;
}
.pc-badges { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; z-index: 1; }
.pc-badges .chip { height: 21px; padding: 0 9px; font-size: 10.5px; background: rgba(8, 10, 16, 0.58); backdrop-filter: blur(8px); border-color: rgba(255, 255, 255, 0.14); }
.pc-more {
  position: absolute; right: 12px; bottom: 10px; z-index: 1;
  font-size: 11px; padding: 3px 9px; border-radius: 99px;
  color: #E8EEF9; background: rgba(8, 10, 16, 0.62);
  backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}

.pc-body { padding: 15px 16px 13px; }
/* 无封面的帖子：左侧一道主色竖线，避免整块看起来像未加载完 */
.post-card.no-cover .pc-body { border-left: 2px solid transparent; }
.pc-title {
  font-size: 16.5px; font-weight: 650; line-height: 1.45;
  letter-spacing: -0.014em; color: var(--tx-1);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-excerpt {
  margin-top: 8px;
  font-size: 13px; line-height: 1.75; color: var(--tx-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line-1);
}
.pc-avatar {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 600; color: #fff;
  background: var(--grad);
  box-shadow: 0 6px 14px -8px rgba(91, 140, 255, 0.9), var(--inset-hl);
}
.pc-author { font-size: 12px; color: var(--tx-2); max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-time { font-size: 11px; color: var(--tx-4); font-variant-numeric: tabular-nums; }
.pc-stats { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: var(--tx-4); }
.pc-stat { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.pc-stat.liked { color: #FF8A9B; }

/* 详情页图集：1 张走大图，其余等分方格 */
.pc-gallery { display: grid; gap: 8px; margin-top: 18px; grid-template-columns: repeat(3, 1fr); }
.pc-gallery.one { grid-template-columns: 1fr; }
.pc-gallery.two { grid-template-columns: repeat(2, 1fr); }
.pc-gallery figure {
  position: relative; margin: 0; overflow: hidden; border-radius: var(--r-sm);
  border: 1px solid var(--line-1); background: #0A0D14; aspect-ratio: 1 / 1;
}
.pc-gallery.one figure { aspect-ratio: 16 / 9; }
.pc-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; transition: transform 0.4s; }
.pc-gallery img:hover { transform: scale(1.03); }

/* 发帖页：选图/上传 */
.upl-hd { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 9px; }
.upl-hd span { font-size: 12px; color: var(--tx-4); font-variant-numeric: tabular-nums; }
.upl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.upl-cell {
  position: relative; aspect-ratio: 1 / 1;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line-1); background: var(--surface-1);
}
.upl-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upl-del {
  position: absolute; right: 5px; top: 5px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; background: rgba(6, 8, 12, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.upl-mask {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 11.5px; font-variant-numeric: tabular-nums;
  background: rgba(5, 7, 11, 0.68);
  backdrop-filter: blur(2px);
}
.upl-mask.bad { color: #FFB4C0; }
.upl-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.14); }
.upl-bar i { display: block; height: 100%; background: var(--grad); transition: width 0.2s; }
.upl-add {
  aspect-ratio: 1 / 1; border-radius: 12px;
  display: grid; place-items: center; gap: 5px;
  color: var(--tx-4); font-size: 11px;
  background: var(--surface-1);
  border: 1px dashed var(--line-3);
  transition: all 0.16s;
}
.upl-add:hover { color: #9DBCFF; border-color: rgba(91, 140, 255, 0.5); background: rgba(91, 140, 255, 0.06); }
.upl-tip { font-size: 11px; color: var(--tx-4); margin-top: 9px; line-height: 1.7; }

/* 图片放大（详情页点击图集） */
.img-lightbox {
  position: fixed; inset: 0; z-index: 95;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(3, 4, 8, 0.9);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
  animation: lbIn 0.18s ease-out;
}
.img-lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-sm); box-shadow: var(--sh-3); }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   空教室查询（联动校园地图的教学楼 / 楼层 / 教室名）
   ========================================================================== */
.free-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
/* 页头「校园地图」改纯图标：文案在窄屏会被挤成两行（「校园地 / 图」），很难看 */
.free-hd-map {
  width: 34px; flex: 0 0 34px;
  padding: 0;
  color: var(--ac-1);
}
.free-hd-map:hover { color: var(--ac-1); border-color: rgba(91, 140, 255, 0.4); background: rgba(91, 140, 255, 0.08); }
.free-t { font-size: 20px; font-weight: 650; letter-spacing: -0.018em; margin: 0; }
.free-s { font-size: 12px; color: var(--tx-4); margin-top: 6px; font-variant-numeric: tabular-nums; }
.free-bld {
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  overflow: hidden;
  margin-bottom: 12px;
}
.free-bld-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-1);
  background: linear-gradient(180deg, rgba(91, 140, 255, 0.07), rgba(91, 140, 255, 0));
}
.free-bld-n { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.free-bld-c { font-size: 11.5px; color: var(--tx-4); font-variant-numeric: tabular-nums; }
.free-bld-map {
  margin-left: auto;
  width: 28px; height: 28px; flex: 0 0 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--ac-1);
  background: rgba(91, 140, 255, 0.12);
  border: 1px solid rgba(91, 140, 255, 0.2);
  transition: all 0.16s;
}
.free-bld-map:hover { color: #fff; background: var(--grad); border-color: transparent; }
.free-rooms { padding: 4px 0; }
.free-room { display: flex; align-items: center; gap: 10px; padding: 9px 14px; }
.free-room + .free-room { border-top: 1px solid rgba(255, 255, 255, 0.04); }
.free-floor {
  width: 32px; flex: 0 0 32px;
  font-size: 11px; font-weight: 600; text-align: center;
  padding: 3px 0; border-radius: 7px;
  color: #9DBCFF;
  background: rgba(91, 140, 255, 0.12);
  border: 1px solid rgba(91, 140, 255, 0.2);
  font-variant-numeric: tabular-nums;
}
.free-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.free-name { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.free-sub { font-size: 11px; color: var(--tx-4); }



/* 行列表 */
.row-icon {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px; display: grid; place-items: center;
  color: #9DBCFF;
  background: rgba(91, 140, 255, 0.1);
  border: 1px solid rgba(91, 140, 255, 0.16);
}
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 14px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 12px; color: var(--tx-4); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 详情页 */
.article-t {
  font-size: clamp(23px, 2.6vw, 31px);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.32;
  margin: 14px 0 10px;
}
.article-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 12px; color: var(--tx-4); }

/* AI 会话（类名已在 §10 定义，这里只保留历史遗留容器的兜底） */

/* 地图（v2 的 .map-box/.map-ph 已随 mapPage.js 重写移除） */

/* 网格内的 feed-item 不再需要相邻间距 */
.grid-cards > .feed-item + .feed-item,
.grid-cards > .post + .post { margin-top: 0; }

/* ---- 设置页的外观选择卡片 ---- */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.theme-opt {
  position: relative;
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px 12px 11px;
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  transition: all 0.16s;
  text-align: left;
}
.theme-opt:hover { background: var(--surface-2); border-color: var(--line-2); }
.theme-opt.is-on { border-color: rgba(91, 140, 255, 0.55); background: rgba(91, 140, 255, 0.1); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.1); }
/* 配色预览：上半是「底」，下半是「卡片」，直观看出两种主题的差别 */
.theme-swatch {
  height: 46px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line-2);
  display: flex; flex-direction: column;
}
.theme-swatch i { flex: 1; display: block; }
.theme-swatch.dark i:first-child { background: #0A0E16; }
.theme-swatch.dark i:last-child { background: #1A2233; }
.theme-swatch.light i:first-child { background: #FFFFFF; }
.theme-swatch.light i:last-child { background: #E9EEF6; }
.theme-swatch.auto { flex-direction: row; }
.theme-swatch.auto i:first-child { background: #0A0E16; }
.theme-swatch.auto i:last-child { background: #FFFFFF; }
.theme-name { font-size: 12.5px; font-weight: 600; }
.theme-desc { font-size: 11px; color: var(--tx-4); }
.theme-opt.is-on .theme-name { color: var(--ac-1); }
.theme-opt .theme-ck {
  position: absolute; right: 9px; top: 9px;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; background: var(--ac-1);
}

@media (max-width: 520px) {
  .theme-grid { grid-template-columns: 1fr; }
  .theme-opt { flex-direction: row; align-items: center; gap: 12px; }
  .theme-swatch { width: 64px; height: 40px; flex: 0 0 64px; }
  .theme-opt .theme-ck { position: static; margin-left: auto; }
}

/* ---------------------------------------------------------------- 18. 系统通知 */
/* 右上角铃铛只承载系统通知（登录 / 安全 / 平台消息），校园公告走「服务 → 校园通知」 */
.icon-btn-bell { position: relative; }
.bell-dot {
  position: absolute; top: -3px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 99px;
  font-size: 9.5px; font-weight: 700; line-height: 1;
  color: #fff; background: #FF5A6A;
  box-shadow: 0 0 0 2px var(--bg-0);
  pointer-events: none;
}

.sys-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 14px;
}
.sys-top-s { font-size: 12.5px; color: var(--tx-4); }

.sys-list { display: flex; flex-direction: column; gap: 10px; }
.sys-item {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--inset-hl);
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, transform 0.16s;
}
.sys-item:hover { background: var(--surface-2); border-color: var(--line-2); }
.sys-item:active { transform: translateY(1px); }
.sys-item:focus-visible { outline: 2px solid var(--ac-1); outline-offset: 2px; }
.sys-item.is-unread { background: var(--surface-2); }

.sys-ico {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px; display: grid; place-items: center;
  color: #9DBCFF;
  background: rgba(91, 140, 255, 0.12);
  border: 1px solid rgba(91, 140, 255, 0.18);
}
.sys-item.tone-security .sys-ico {
  color: #FFC36B;
  background: rgba(255, 176, 74, 0.12);
  border-color: rgba(255, 176, 74, 0.2);
}
.sys-item.tone-system .sys-ico {
  color: var(--tx-3);
  background: var(--surface-2);
  border-color: var(--line-2);
}

.sys-main { flex: 1; min-width: 0; }
.sys-hd { display: flex; align-items: baseline; gap: 10px; }
.sys-title {
  font-size: 14px; font-weight: 550;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sys-item.is-unread .sys-title { font-weight: 650; }
.sys-item.is-unread .sys-title::before {
  content: ""; display: inline-block; vertical-align: 2px;
  width: 6px; height: 6px; margin-right: 7px;
  border-radius: 50%; background: #FF5A6A;
}
.sys-time { margin-left: auto; flex: 0 0 auto; font-size: 11.5px; color: var(--tx-4); }
.sys-body {
  margin-top: 5px;
  font-size: 12.5px; line-height: 1.62;
  color: var(--tx-3); word-break: break-word;
}

@media (max-width: 520px) {
  .sys-hd { flex-wrap: wrap; }
  .sys-time { margin-left: 0; }
}

/* ---------------------------------------------------------------- 19. 评论楼中楼 */
.cmt + .cmt { margin-top: 9px; }
.cmt-reply {
  margin-left: 22px;
  border-left: 2px solid var(--line-2);
}
.cmt-who { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cmt-to { font-size: 11.5px; color: var(--ac-1); }
.cmt-reply-btn {
  margin-top: 6px; height: 24px; padding: 0 10px;
  border-radius: 99px;
  font-size: 11.5px; color: var(--tx-3);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  transition: all 0.16s;
}
.cmt-reply-btn:hover { color: var(--ac-1); border-color: rgba(91, 140, 255, 0.35); background: rgba(91, 140, 255, 0.08); }
.cmt-reply-tip {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 8px; height: 26px; padding: 0 6px 0 12px;
  border-radius: 99px;
  font-size: 12px; color: var(--ac-1);
  background: rgba(91, 140, 255, 0.1);
  border: 1px solid rgba(91, 140, 255, 0.24);
}
.cmt-reply-tip b { font-weight: 600; }
.cmt-reply-tip button {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  color: inherit; background: rgba(91, 140, 255, 0.16);
}
.cmt-reply-tip button:hover { background: rgba(91, 140, 255, 0.28); }

/* ---------------------------------------------------------------- 20. 简历附件 */
.resume-drop {
  margin-top: 10px; padding: 18px 14px;
  border: 1px dashed var(--line-3);
  border-radius: var(--r-sm);
  text-align: center; font-size: 12.5px; color: var(--tx-3);
  cursor: pointer;
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}
.resume-drop:hover,
.resume-drop.is-over {
  border-color: rgba(91, 140, 255, 0.55);
  color: var(--ac-1);
  background: rgba(91, 140, 255, 0.06);
}
.resume-item {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--tx-2);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
}
.resume-ico { display: grid; place-items: center; flex: 0 0 auto; color: var(--ac-1); }
.resume-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-sz { flex: 0 0 auto; color: var(--tx-4); font-variant-numeric: tabular-nums; }
#resumeDel {
  width: 20px; height: 20px; flex: 0 0 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--tx-3);
  transition: all 0.16s;
}
#resumeDel:hover { color: var(--bad); background: rgba(251, 113, 133, 0.12); }
