/* ============================================================
   阳语 YANGYU · 液态玻璃视觉系统
   浅色 / 深色自适应 · 可调节通透度与雾化 · 内联 SVG 图标
   ============================================================ */

:root {
  --r-xl: 30px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --brand-1: #ff7a3d;
  --brand-2: #ff3d7f;
  --brand-3: #7b5cff;
  --brand-4: #22d3ee;
  --brand: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 38%, var(--brand-3) 72%, var(--brand-4) 100%);
  --edge: rgba(255, 255, 255, .16);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --tab-h: 70px;
  --ease: cubic-bezier(.22, .7, .26, 1);
  --glass-max: .30;
  --see: .62;
  --frost: 18px;
  --text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

html[data-theme="dark"] {
  --bg: #05070f;
  --bg-2: #0b1020;
  --text: #f2f5ff;
  --muted: #9aa6c2;
  --dim: #6c7899;
  --line: rgba(255, 255, 255, .11);
  --line-strong: rgba(255, 255, 255, .18);
  --glass-rgb: 255, 255, 255;
  --glass-max: .30;
  --solid: #10162a;
  --solid-2: #0c1120;
  --shadow: 0 24px 60px rgba(2, 5, 15, .55), 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-sm: 0 10px 26px rgba(2, 5, 15, .38);
  --bubble-peer: rgba(255, 255, 255, .12);
  --bubble-peer-text: #f2f5ff;
  --input-bg: rgba(255, 255, 255, .08);
  --dim-veil: rgba(8, 12, 24, .55);
  --wp-1: #7b5cff;
  --wp-2: #22d3ee;
  --wp-3: #ff3d7f;
  --wp-4: #ff8a3d;
  --wp-op: .55;
}

html[data-theme="light"] {
  --bg: #edf2fb;
  --bg-2: #f7f9ff;
  --text: #0f1729;
  --muted: #5a6782;
  --dim: #8290a8;
  --line: rgba(15, 23, 41, .10);
  --line-strong: rgba(15, 23, 41, .18);
  --glass-rgb: 255, 255, 255;
  --glass-max: .86;
  --solid: #ffffff;
  --solid-2: #f7f9ff;
  --shadow: 0 24px 60px rgba(42, 62, 112, .16), 0 2px 8px rgba(42, 62, 112, .08);
  --shadow-sm: 0 10px 26px rgba(42, 62, 112, .12);
  --bubble-peer: rgba(255, 255, 255, .92);
  --bubble-peer-text: #10182b;
  --input-bg: rgba(255, 255, 255, .9);
  --dim-veil: rgba(255, 255, 255, .6);
  --wp-1: #c8b6ff;
  --wp-2: #a9e9f4;
  --wp-3: #ffc4d6;
  --wp-4: #ffd9b8;
  --wp-op: .8;
  --text-shadow: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.lock { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
input, textarea, select { outline: none; }

/* ---------------- 背景与光 ---------------- */

.wallpaper {
  position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 48%, var(--bg) 100%);
}
.wp {
  position: absolute; border-radius: 50%;
  filter: blur(70px);
  opacity: var(--wp-op);
  will-change: transform;
  animation: float 22s var(--ease) infinite alternate;
}
.wp-a { width: 62vw; height: 62vw; left: -18vw; top: -12vh; background: radial-gradient(circle at 40% 40%, var(--wp-1), transparent 70%); }
.wp-b { width: 58vw; height: 58vw; right: -20vw; top: 8vh; background: radial-gradient(circle at 50% 50%, var(--wp-2), transparent 70%); animation-delay: -6s; }
.wp-c { width: 70vw; height: 70vw; right: -14vw; bottom: -18vh; background: radial-gradient(circle at 50% 50%, var(--wp-3), transparent 70%); animation-delay: -12s; }
.wp-d { width: 46vw; height: 46vw; left: 8vw; bottom: 4vh; background: radial-gradient(circle at 50% 50%, var(--wp-4), transparent 70%); animation-delay: -18s; }
.wp-grain {
  position: absolute; inset: 0; opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}
@keyframes float {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(3vw, 4vh, 0) scale(1.08); }
  100% { transform: translate3d(-2vw, -3vh, 0) scale(.96); }
}
.lg-filters { position: fixed; width: 0; height: 0; overflow: hidden; }

/* ---------------- 玻璃基座 ---------------- */

.glass {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(135deg,
      rgba(var(--glass-rgb), calc((var(--glass-max) * (1 - var(--see))) + .03)) 0%,
      rgba(var(--glass-rgb), calc((var(--glass-max) * (1 - var(--see))) * .62 + .02)) 52%,
      rgba(var(--glass-rgb), calc((var(--glass-max) * (1 - var(--see))) * .34 + .015)) 100%);
  -webkit-backdrop-filter: blur(var(--frost)) saturate(160%);
  backdrop-filter: blur(var(--frost)) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(255, 255, 255, .05);
  overflow: hidden;
  color: var(--text);
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, -10%), rgba(255, 255, 255, .22), transparent 62%);
  opacity: .9; z-index: 0; transition: opacity .3s;
}
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .30), transparent 24%, transparent 68%, rgba(255, 255, 255, .16)),
    conic-gradient(from 210deg at 88% 8%, rgba(34, 211, 238, .18), rgba(255, 61, 127, .16), rgba(123, 92, 255, .18), rgba(34, 211, 238, .18));
  mix-blend-mode: screen; opacity: .55;
  filter: url(#lg-warp-soft);
}
.glass > * { position: relative; z-index: 2; }
.glass .no-sheen::after { display: none; }

html.liquid-off .glass {
  -webkit-backdrop-filter: none; backdrop-filter: none;
  background: var(--solid);
  box-shadow: var(--shadow-sm);
}
html.liquid-off .glass::before,
html.liquid-off .glass::after { display: none; }
html.liquid-off .wp { animation: none; filter: blur(90px) saturate(.9); }

/* 滚动时光线形变 */
body.scrolling .wp { transform: translate3d(0, calc(var(--warp, 0) * 1px), 0) scale(1.02); }
@media (prefers-reduced-motion: reduce) {
  .wp, .glass::after { animation: none !important; }
}

/* ---------------- 基础布局 ---------------- */

.app {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 14px;
  display: flex;
  flex-direction: column;
}
.app.full { max-width: 560px; padding: 0; }
.page { flex: 1; padding: 12px 0 26px; }
body.has-tab .page { padding-bottom: calc(var(--tab-h) + 26px + env(safe-area-inset-bottom)); }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; letter-spacing: .02em; }
.bold { font-weight: 650; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.hidden { display: none !important; }

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

.topbar {
  position: sticky; top: 0; z-index: 40;
  margin: 10px -2px 6px;
  padding: 10px 12px;
  border-radius: var(--r-lg);
  display: flex; align-items: center; gap: 10px;
  min-height: 60px;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 17px; font-weight: 680; letter-spacing: .01em; }
.topbar-title p { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.topbar-actions { display: flex; gap: 6px; }
.brand-mini { display: flex; align-items: center; gap: 9px; }
.brand-orb {
  width: 30px; height: 30px; border-radius: 11px;
  background: var(--brand);
  box-shadow: 0 6px 18px rgba(255, 61, 127, .35), inset 0 1px 2px rgba(255, 255, 255, .5);
  position: relative; flex: none;
}
.brand-orb::after {
  content: ""; position: absolute; inset: 3px 3px auto 3px; height: 42%;
  border-radius: 9px; background: linear-gradient(180deg, rgba(255, 255, 255, .55), transparent);
  filter: blur(.4px);
}
.brand-word { font-weight: 750; letter-spacing: .12em; font-size: 16px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); flex: none;
  background: rgba(var(--glass-rgb), .10);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .15s var(--ease), background .2s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn.brand { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 8px 22px rgba(255, 61, 127, .35); }
.icon { display: inline-block; vertical-align: -3px; flex: none; }

/* ---------------- 卡片 / 列表 ---------------- */

.card { border-radius: var(--r-lg); padding: 16px; }
.card.tight { padding: 12px; }
.card-title { font-size: 15px; font-weight: 680; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 4px 8px; }
.section-head h2 { font-size: 12.5px; font-weight: 650; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.section-head a, .section-head .link { font-size: 12px; color: var(--muted); }

.list { border-radius: var(--r-lg); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; position: relative;
  transition: background .2s;
}
.list-row + .list-row::before {
  content: ""; position: absolute; top: 0; left: 62px; right: 14px; height: 1px;
  background: var(--line);
}
.list-row:active { background: rgba(var(--glass-rgb), .08); }
.list-row .grow p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.list-row .name { font-size: 15px; font-weight: 620; display: flex; align-items: center; gap: 5px; }
.list-row .chev { color: var(--dim); }

.avatar {
  border-radius: 14px; overflow: hidden; flex: none; position: relative;
  background:
    linear-gradient(140deg, hsl(var(--h, 220) 92% 66%), hsl(calc(var(--h, 220) + 46) 86% 54%));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
  box-shadow: 0 6px 16px rgba(10, 20, 45, .22), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .ava-letter { line-height: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.avatar.round { border-radius: 50%; }
.avatar.sm { border-radius: 11px; }
.avatar .vbadge { position: absolute; right: -2px; bottom: -2px; }

.vbadge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%;
  color: #fff; background: linear-gradient(135deg, #2ea8ff, #6a5cff);
  box-shadow: 0 2px 8px rgba(46, 120, 255, .45);
  font-size: 0; flex: none;
}
.vbadge .icon { width: 11px; height: 11px; }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  font-size: 14px; font-weight: 650; letter-spacing: .02em;
  color: #fff; background: var(--brand);
  border: 1px solid transparent;
  box-shadow: 0 10px 26px rgba(255, 61, 127, .30), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .16s var(--ease), box-shadow .2s, opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97) translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.ghost {
  background: rgba(var(--glass-rgb), .10); color: var(--text);
  border-color: var(--line-strong); box-shadow: none;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.btn.quiet { background: transparent; border-color: var(--line); color: var(--muted); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #ff5a5a, #d92d20); box-shadow: 0 10px 24px rgba(217, 45, 32, .3); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn.xs { height: 28px; padding: 0 11px; font-size: 11.5px; }
.btn.block { width: 100%; }
.btn.soft { background: rgba(123, 92, 255, .14); color: #7b5cff; border-color: rgba(123, 92, 255, .25); box-shadow: none; }

/* ---------------- 输入 ---------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); padding-left: 4px; }
.input, .textarea, .select {
  width: 100%; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--input-bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding: 12px 14px; font-size: 14.5px; color: var(--text);
  transition: border .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .select:focus { border-color: rgba(123, 92, 255, .55); box-shadow: 0 0 0 3px rgba(123, 92, 255, .16); }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23808aa3' stroke-width='1.8'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.input-icon .input { padding-left: 44px; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  width: 48px; height: 28px; border-radius: 999px; position: relative; flex: none;
  background: rgba(var(--glass-rgb), .14); border: 1px solid var(--line-strong);
  transition: .28s var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  transition: .28s var(--ease);
}
.switch input:checked + .track { background: var(--brand); border-color: transparent; box-shadow: 0 6px 16px rgba(255, 61, 127, .3); }
.switch input:checked + .track::after { left: 23px; }

/* 滑杆 */
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; }
.slider::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(90deg, rgba(123, 92, 255, .85), rgba(34, 211, 238, .8));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #dfe6f7 60%, #b9c4de);
  box-shadow: 0 4px 12px rgba(10, 20, 45, .35), inset 0 1px 1px #fff;
  border: 1px solid rgba(255, 255, 255, .7);
}
.slider::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, #7b5cff, #22d3ee); }
.slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0; }

/* 分段控件 */
.segment {
  display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px;
  background: rgba(var(--glass-rgb), .10); border: 1px solid var(--line);
}
.segment button {
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; color: var(--muted);
  transition: .2s var(--ease);
}
.segment button.on { color: #fff; background: var(--brand); box-shadow: 0 6px 16px rgba(255, 61, 127, .28); }

/* 角标 */
.dot-badge {
  position: absolute; top: 6px; right: 16px;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px;
  background: linear-gradient(135deg, #ff5a7a, #ff2d55);
  color: #fff; font-size: 10.5px; font-style: normal; line-height: 17px; text-align: center;
  box-shadow: 0 4px 10px rgba(255, 45, 85, .35);
}
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--line); color: var(--muted); background: rgba(var(--glass-rgb), .08);
}
.pill.warn { color: #ff9d5c; border-color: rgba(255, 157, 92, .35); background: rgba(255, 122, 61, .12); }
.pill.ok { color: #34d399; border-color: rgba(52, 211, 153, .3); background: rgba(52, 211, 153, .1); }
.pill.danger { color: #ff6b81; border-color: rgba(255, 107, 129, .3); background: rgba(255, 61, 127, .1); }
.pill.info { color: #7cc6ff; border-color: rgba(124, 198, 255, .3); background: rgba(34, 163, 238, .1); }

/* ---------------- 品牌 ---------------- */

.brand-gif { display: flex; justify-content: center; }
.brand-gif img { height: var(--h); width: auto; }
.brand-gif .gif-light { display: none; }
html[data-theme="light"] .brand-gif .gif-dark { display: none; }
html[data-theme="light"] .brand-gif .gif-light { display: block; }

/* ---------------- 登录/注册 ---------------- */

.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 30px 4px; }
.auth-card { padding: 26px 20px 22px; border-radius: 32px; }
.auth-title { font-size: 22px; font-weight: 720; letter-spacing: .04em; margin-top: 18px; }
.auth-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.auth-form { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.auth-tabs { display: flex; padding: 4px; border-radius: 999px; background: rgba(var(--glass-rgb), .10); border: 1px solid var(--line); margin-top: 20px; }
.auth-tabs a, .auth-tabs button {
  flex: 1; text-align: center; padding: 9px; border-radius: 999px; font-size: 13.5px; color: var(--muted);
}
.auth-tabs .on { color: #fff; background: var(--brand); box-shadow: 0 8px 20px rgba(255, 61, 127, .28); }
.auth-foot { margin-top: 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.auth-link { color: var(--text); font-weight: 620; }
.auth-note { text-align: center; color: var(--dim); font-size: 11.5px; line-height: 1.9; margin-top: 22px; }
.auth-links { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.code-box {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: var(--r-md); border: 1px dashed rgba(123, 92, 255, .4);
  background: rgba(123, 92, 255, .1); color: #b8a8ff; font-weight: 700; letter-spacing: .2em;
  font-size: 18px;
}

/* ---------------- 首页 ---------------- */

.hello { padding: 18px 18px 16px; border-radius: var(--r-xl); margin-bottom: 12px; }
.hello h2 { font-size: 19px; font-weight: 720; letter-spacing: .01em; }
.hello p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.hello .row { margin-top: 12px; flex-wrap: wrap; gap: 6px; }
.kbd-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px; font-size: 11.5px;
  color: var(--muted); border: 1px solid var(--line); background: rgba(var(--glass-rgb), .08);
}
.conv { padding: 6px 4px; }
.conv .list-row { padding: 12px 12px; border-radius: var(--r-md); }
.conv .list-row + .list-row::before { display: none; }
.conv .list-row:hover { background: rgba(var(--glass-rgb), .07); }
.conv .list-row.flash { animation: rowflash .9s var(--ease); }
@keyframes rowflash { 0% { background: rgba(123,92,255,.18); } 100% { background: transparent; } }
.conv .list-row .time { font-size: 11px; color: var(--dim); flex: none; }
.conv .list-row .last { color: var(--muted); font-size: 12.5px; max-width: 100%; }
.unread {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: linear-gradient(135deg, #ff5a7a, #ff2d55); color: #fff;
  font-size: 10.5px; line-height: 19px; text-align: center; flex: none;
  box-shadow: 0 4px 10px rgba(255, 45, 85, .3);
}
.avatar-wrap { position: relative; flex: none; }
.avatar-wrap .online-dot {
  position: absolute; right: 1px; bottom: 1px; width: 9px; height: 9px; border-radius: 50%;
  background: #34d399; box-shadow: 0 0 0 2px var(--bg);
}

body.chat-page .app { max-width: 560px; padding: 0; height: 100vh; height: 100dvh; overflow: hidden; }
body.chat-page .page { display: none; }

/* ---------------- 聊天 ---------------- */

.chat-app { max-width: 560px; padding: 0; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.chat-head {
  margin: 8px 8px 0; padding: 8px 10px; border-radius: var(--r-lg);
  display: flex; align-items: center; gap: 10px; flex: none;
}
.chat-head .t { flex: 1; min-width: 0; }
.chat-head .t h1 { font-size: 16px; font-weight: 680; }
.chat-head .t p { font-size: 11px; color: var(--muted); }
.chat-body {
  flex: 1; overflow-y: auto; padding: 14px 14px 10px; overscroll-behavior: contain;
  scrollbar-width: thin; display: flex; flex-direction: column; gap: 12px;
}
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.chat-notice {
  border-radius: var(--r-md); padding: 10px 12px; font-size: 12px; color: var(--muted);
  display: flex; gap: 8px; align-items: flex-start; margin-bottom: 4px;
}
.chat-notice .icon { color: #ffb26b; margin-top: 2px; }
.date-sep { text-align: center; font-size: 10.5px; color: var(--dim); letter-spacing: .08em; margin: 6px 0; }
.msg-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-main { max-width: 74%; display: flex; flex-direction: column; gap: 4px; }
.msg-row.mine .msg-main { align-items: flex-end; }
.msg-name { font-size: 10.5px; color: var(--dim); padding-left: 4px; display: flex; align-items: center; gap: 4px; }
.bubble {
  padding: 10px 13px; border-radius: 18px 18px 18px 5px;
  background: var(--bubble-peer); color: var(--bubble-peer-text);
  border: 1px solid var(--line);
  font-size: 14.5px; line-height: 1.55; word-break: break-word;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 6px 18px rgba(5, 10, 25, .12);
}
.bubble.mine {
  border-radius: 18px 18px 5px 18px;
  background: linear-gradient(135deg, rgba(255, 122, 61, .95), rgba(255, 61, 127, .95) 48%, rgba(123, 92, 255, .95));
  color: #fff; border-color: transparent;
  box-shadow: 0 10px 24px rgba(255, 61, 127, .26), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.bubble.mine .msg-text { text-shadow: 0 1px 2px rgba(90, 20, 60, .25); }
.msg-img { border-radius: 14px; max-width: 240px; max-height: 300px; object-fit: cover; }
.msg-system { text-align: center; }
.msg-system span {
  display: inline-block; padding: 4px 12px; border-radius: 99px;
  background: rgba(var(--glass-rgb), .10); border: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}
.typing { font-size: 11px; color: var(--dim); padding: 0 16px 4px; height: 16px; }
.chat-input {
  flex: none; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; align-items: flex-end;
}
.chat-input .box {
  flex: 1; display: flex; align-items: flex-end; gap: 6px;
  border-radius: 22px; padding: 6px 8px 6px 12px;
  background: rgba(var(--glass-rgb), .10); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.chat-input textarea {
  color: var(--text);
  flex: 1; border: 0; background: transparent; resize: none; max-height: 110px;
  padding: 6px 0; font-size: 14.5px; line-height: 1.5;
}
.chat-input .send {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff;
  box-shadow: 0 10px 24px rgba(255, 61, 127, .35);
  transition: transform .15s var(--ease);
}
.chat-input .send:active { transform: scale(.92); }
.link-banner {
  margin: 10px 14px; padding: 14px; border-radius: var(--r-md); text-align: center;
  background: rgba(255, 122, 61, .12); border: 1px solid rgba(255, 122, 61, .3);
  color: var(--text); font-size: 13px;
}

/* ---------------- 通讯录/发现 ---------------- */

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick {
  position: relative;
  border-radius: var(--r-md); padding: 14px 10px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text);
}
.quick .qi {
  width: 42px; height: 42px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: var(--brand); box-shadow: 0 8px 20px rgba(255, 61, 127, .25);
}
.quick:nth-child(2) .qi { background: linear-gradient(135deg, #7b5cff, #22d3ee); box-shadow: 0 8px 20px rgba(123, 92, 255, .28); }
.quick:nth-child(3) .qi { background: linear-gradient(135deg, #ff8a3d, #ff3d7f); }

.cat-card { border-radius: var(--r-lg); margin-bottom: 10px; overflow: hidden; }
.cat-head { display: flex; align-items: center; gap: 8px; padding: 12px 15px 8px; }
.cat-head .name { font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.cat-head .count { margin-left: auto; font-size: 11px; color: var(--dim); }
.cat-head .chev { margin-left: 4px; color: var(--dim); transition: transform .25s; }
.cat-card.closed .chev { transform: rotate(-90deg); }
.cat-card.closed .cat-body { display: none; }
.cat-body .list-row { padding: 10px 15px; }
.cat-body .list-row + .list-row::before { left: 60px; }

.badge-line { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- 发现 ---------------- */

.nearby-card { border-radius: var(--r-md); padding: 12px 14px; display: flex; gap: 12px; align-items: center; margin-bottom: 9px; }
.nearby-card .info { flex: 1; min-width: 0; }
.nearby-card .info .nm { font-weight: 650; display: flex; align-items: center; gap: 5px; }
.nearby-card .info .meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.nearby-card .dist { font-size: 11px; color: var(--dim); flex: none; text-align: right; }
.locate-tip {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-md);
  font-size: 12px; color: var(--muted); margin-bottom: 12px;
}
.locate-tip .icon { color: var(--brand-3); }

/* ---------------- 朋友圈 ---------------- */

.moment { border-radius: var(--r-lg); padding: 15px; margin-bottom: 12px; }
.moment-head { display: flex; align-items: center; gap: 10px; }
.moment-head .nm { font-weight: 650; font-size: 14px; display: flex; gap: 5px; align-items: center; }
.moment-head .tm { font-size: 11px; color: var(--dim); }
.moment-text { margin-top: 10px; font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.moment-imgs { display: grid; gap: 5px; margin-top: 10px; border-radius: var(--r-sm); overflow: hidden; }
.moment-imgs.n1 { grid-template-columns: 1fr; }
.moment-imgs.n2 { grid-template-columns: 1fr 1fr; }
.moment-imgs.n3 { grid-template-columns: repeat(3, 1fr); }
.moment-imgs.n4, .moment-imgs.n5, .moment-imgs.n6, .moment-imgs.n7, .moment-imgs.n8, .moment-imgs.n9 { grid-template-columns: repeat(3, 1fr); }
.moment-imgs img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.moment-imgs.n1 img { aspect-ratio: 4 / 3; }
.moment-foot { display: flex; align-items: center; gap: 16px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.moment-act { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.moment-act.liked { color: #ff5a7a; }
.moment-act.liked .icon { color: #ff5a7a; }
.comments { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.comment { font-size: 12.5px; line-height: 1.6; padding: 8px 10px; border-radius: 12px; background: rgba(var(--glass-rgb), .07); }
.comment b { color: var(--brand-3); font-weight: 650; }
.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form input { flex: 1; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--input-bg); padding: 0 14px; font-size: 12.5px; }
.comment-form button { color: var(--brand-2); font-weight: 650; font-size: 12.5px; padding: 0 6px; }

/* ---------------- 个人资料 / 空间 ---------------- */

.cover { position: relative; border-radius: 0 0 var(--r-xl) var(--r-xl); overflow: hidden; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-grad {
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 90% at 88% 6%, rgba(34, 211, 238, .55), transparent 60%),
    radial-gradient(60% 75% at 74% 58%, rgba(123, 92, 255, .55), transparent 64%),
    radial-gradient(80% 95% at 2% 100%, rgba(255, 61, 127, .6), transparent 62%),
    radial-gradient(55% 65% at 18% 6%, rgba(255, 138, 61, .55), transparent 60%),
    linear-gradient(140deg, #161d36, #0e1324 55%, #070a13);
}
.profile-hero { position: relative; margin: 0 0 0; }
.profile-hero .back-fab { position: absolute; left: 14px; top: 14px; z-index: 5; }
.profile-id { position: relative; margin: -46px 16px 0; padding: 14px 16px; border-radius: var(--r-lg); display: flex; gap: 12px; align-items: center; }
.profile-id .avatar { width: 74px; height: 74px; border-radius: 22px; }
.profile-id .nm { font-size: 19px; font-weight: 720; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.profile-id .meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 14px 0 10px; }
.stat { text-align: center; position: relative; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.stat b { display: block; font-size: 18px; font-weight: 700; }
.stat span { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; }
.sig { padding: 12px 14px; border-radius: var(--r-md); font-size: 13px; color: var(--muted); margin-top: 10px; }
.rows-card { border-radius: var(--r-lg); overflow: hidden; }
.rows-card .list-row { padding: 13px 16px; }
.rows-card .list-row + .list-row::before { left: 16px; }
.action-row { display: flex; gap: 8px; margin-top: 12px; }
.action-row .btn { flex: 1; }

/* ---------------- 群 ---------------- */

.member-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px 6px; padding: 14px; }
.member { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); text-align: center; }
.member .avatar { width: 44px; height: 44px; border-radius: 14px; }
.member .role { font-size: 9.5px; color: #ffb26b; }
.group-hero { padding: 16px; border-radius: var(--r-lg); display: flex; gap: 12px; align-items: center; }
.group-hero .avatar { width: 64px; height: 64px; border-radius: 18px; }
.group-hero h2 { font-size: 18px; font-weight: 700; }
.group-hero p { font-size: 11.5px; color: var(--muted); }
.notice-card { border-radius: var(--r-md); padding: 12px 14px; font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; }
.qr-card { padding: 22px; text-align: center; border-radius: var(--r-xl); }
.qr-card img { width: 220px; height: 220px; margin: 0 auto; border-radius: 18px; background: #fff; padding: 8px; }
.qr-card .gno { letter-spacing: .2em; color: var(--dim); font-size: 12px; }
.group-actions { display: flex; flex-direction: column; gap: 0; }
.group-card { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: var(--r-lg); margin-bottom: 10px; }
.group-card .avatar { width: 50px; height: 50px; border-radius: 16px; }
.group-card-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.group-card-actions .btn { min-width: 58px; }

/* ---------------- 我的 ---------------- */

.me-hero { padding: 0; border-radius: var(--r-xl); overflow: hidden; position: relative; }
.me-hero .cover-grad { height: 116px; position: relative; }
.me-body { padding: 0 18px 18px; margin-top: -34px; position: relative; }
.me-body .avatar { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--bg-2); }
.capacity { padding: 12px 14px; border-radius: var(--r-md); margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.bar { height: 6px; border-radius: 99px; background: rgba(var(--glass-rgb), .12); overflow: hidden; margin-top: 7px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

.menu-card { border-radius: var(--r-lg); overflow: hidden; margin-top: 12px; }
.menu-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; }
.menu-row + .menu-row::before { content: ""; position: absolute; left: 54px; right: 14px; top: 0; height: 1px; background: var(--line); }
.menu-row { position: relative; }
.menu-ic {
  width: 34px; height: 34px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(123, 92, 255, .14); color: #a896ff; flex: none;
}
.menu-row:nth-child(2) .menu-ic { background: rgba(255, 122, 61, .14); color: #ffa06a; }
.menu-row:nth-child(3) .menu-ic { background: rgba(34, 211, 238, .14); color: #6ed7e8; }
.menu-row:nth-child(4) .menu-ic { background: rgba(255, 61, 127, .14); color: #ff7f9e; }
.menu-row .label { flex: 1; font-size: 14px; }
.menu-row .val { font-size: 11.5px; color: var(--dim); }

/* ---------------- 设置 / 液态玻璃面板 ---------------- */

.panel-block { border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; }
.panel-block h3 { font-size: 14px; font-weight: 680; display: flex; align-items: center; gap: 7px; }
.panel-block .desc { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.65; }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row .sl { flex: 1; }
.setting-row .sl b { display: block; font-size: 13.5px; font-weight: 600; }
.setting-row .sl span { font-size: 11px; color: var(--muted); }
.swatch { display: flex; gap: 8px; }
.swatch span { width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--line); }

/* ---------------- 弹层 ---------------- */

.sheet-mask {
  position: fixed; inset: 0; z-index: 90; background: var(--dim-veil);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .22s var(--ease);
}
.sheet {
  width: 100%; max-width: 520px; border-radius: 28px 28px 0 0;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto;
  transform-origin: var(--origin-x, 50%) var(--origin-y, 100%);
  animation: sheetIn .34s var(--ease);
}
.sheet-grip { width: 44px; height: 4px; border-radius: 99px; background: var(--line-strong); margin: 4px auto 8px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 10px; }
.sheet-head h3 { font-size: 16px; font-weight: 680; }
.sheet-body { display: flex; flex-direction: column; gap: 10px; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(22px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 24px); transform: translate(-50%, 12px);
  z-index: 120; padding: 10px 16px; border-radius: 999px;
  background: rgba(12, 18, 34, .88); color: #fff; font-size: 13px;
  border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  opacity: 0; pointer-events: none; transition: .28s var(--ease); max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.flash-toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-md);
  margin-bottom: 12px; font-size: 12.5px;
  background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .3); color: #34d399;
}
.flash-toast.err { background: rgba(255, 61, 127, .12); border-color: rgba(255, 61, 127, .3); color: #ff7f9e; }

/* ---------------- 空状态 ---------------- */

.empty { padding: 54px 20px; text-align: center; color: var(--dim); }
.empty .icon { color: var(--dim); opacity: .7; }
.empty h3 { font-size: 14px; color: var(--muted); margin-top: 12px; font-weight: 600; }
.empty p { font-size: 12px; margin-top: 4px; color: var(--dim); }
.empty .btn { margin-top: 16px; }

/* ---------------- 图片选择 ---------------- */

.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pick-grid .pick {
  aspect-ratio: 1; border-radius: 12px; border: 1px dashed var(--line-strong);
  display: flex; align-items: center; justify-content: center; color: var(--dim);
  background: rgba(var(--glass-rgb), .06); position: relative; overflow: hidden;
}
.pick-grid .pick img { width: 100%; height: 100%; object-fit: cover; }
.pick-grid .pick .rm { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; display: flex; align-items: center; justify-content: center; }

/* ---------------- 未登录宣传 ---------------- */

.hero-line { font-size: 12px; color: var(--muted); line-height: 2; }
.theme-fab { position: fixed; right: 16px; bottom: calc(var(--tab-h) + 18px); z-index: 60; }

/* ---------------- 桌面 ---------------- */

@media (min-width: 720px) {
  body { font-size: 15px; }
  .app { margin: 0 auto; }
  .wallpaper .wp { filter: blur(90px); }
}

/* 减少动效 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------------- 底部导航 ---------------- */
:root { --tab-h: 70px; }
.tabbar {
  position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 45; width: min(492px, calc(100vw - 28px));
  border-radius: 24px; padding: 6px 8px;
  background: rgba(var(--glass-rgb), calc((var(--glass-max) * (1 - var(--see))) + .10));
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(calc(var(--frost) + 6px)) saturate(170%);
  backdrop-filter: blur(calc(var(--frost) + 6px)) saturate(170%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.tabbar-inner { display: flex; align-items: center; justify-content: space-around; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0 6px; border-radius: 16px; position: relative;
  color: var(--muted); font-size: 10.5px; letter-spacing: .04em; transition: color .18s, background .18s, transform .18s;
}
.tab .icon { width: 22px; height: 22px; }
.tab.active { color: var(--text); font-weight: 650; }
.tab.active .icon {
  color: #fff; padding: 5px; width: 32px; height: 32px; border-radius: 12px; box-sizing: border-box;
  background: var(--brand); box-shadow: 0 8px 18px rgba(255, 61, 127, .34);
}
.tab.active span { margin-top: -1px; }
.tab:active { transform: scale(.94); }
.dot-badge {
  position: absolute; top: 3px; right: calc(50% - 26px);
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: #ff3b5c; color: #fff; font-size: 9.5px; font-style: normal;
  line-height: 17px; text-align: center; box-shadow: 0 3px 8px rgba(255, 59, 92, .35);
}

/* hidden 属性优先级修正 */
[hidden] { display: none !important; }
