/* ==========================================================================
   一刻聊天 · 视觉系统
   设计语言：HyperOS 4 (beta) 风格
   —— 大圆角超椭圆、通透毛玻璃、柔和光晕渐变、胶囊控件、弹簧动效
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #F4F5F9;
  --bg-elev: #FFFFFF;
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #FFFFFF;
  --glass-strong: rgba(255, 255, 255, 0.86);
  --text: #0B0C10;
  --text-2: #6B7280;
  --text-3: #A0A6B4;
  --line: rgba(16, 20, 35, 0.08);
  --line-strong: rgba(16, 20, 35, 0.14);
  --brand: #FF6A00;
  --brand-2: #FF8A3D;
  --brand-deep: #F04E00;
  --brand-soft: rgba(255, 106, 0, 0.12);
  --blue: #2B7CFF;
  --ok: #00B578;
  --danger: #F43F5E;
  --shadow-xs: 0 1px 3px rgba(18, 24, 45, 0.05);
  --shadow-sm: 0 3px 12px rgba(18, 24, 45, 0.07);
  --shadow: 0 12px 32px rgba(18, 24, 45, 0.10);
  --shadow-lg: 0 20px 50px rgba(18, 24, 45, 0.16);
  --brand-glow: 0 10px 26px rgba(255, 106, 0, 0.32);
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 26px;
  --r-xl: 32px;
  --blur: saturate(180%) blur(22px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.22, 0.86, 0.28, 1);
}

/* ------- 深色模式变量：data-theme="dark" 手动指定 / data-theme="auto" 跟随系统 ------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0C0D12;
  --bg-elev: #14161D;
  --card: rgba(30, 33, 42, 0.72);
  --card-solid: #1A1D25;
  --glass-strong: rgba(26, 29, 37, 0.88);
  --text: #F2F3F7;
  --text-2: #9BA1AE;
  --text-3: #737A88;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 3px 12px rgba(0, 0, 0, 0.45);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --bg: #0C0D12;
    --bg-elev: #14161D;
    --card: rgba(30, 33, 42, 0.72);
    --card-solid: #1A1D25;
    --glass-strong: rgba(26, 29, 37, 0.88);
    --text: #F2F3F7;
    --text-2: #9BA1AE;
    --text-3: #737A88;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 3px 12px rgba(0, 0, 0, 0.45);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  }
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior-y: none;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "MiSans", "HarmonyOS Sans SC",
               "PingFang SC", "Helvetica Neue", "Source Han Sans SC",
               "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 顶部光晕：HyperOS 的通透渐变感 -------------------------------------------------- */
body::before {
  content: "";
  position: fixed;
  left: -25%;
  right: -25%;
  top: -30vh;
  height: 78vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(46% 52% at 22% 12%, rgba(255, 122, 40, 0.22), transparent 72%),
    radial-gradient(42% 48% at 82% 6%, rgba(43, 124, 255, 0.18), transparent 72%),
    radial-gradient(38% 42% at 55% 0%, rgba(139, 92, 246, 0.12), transparent 70%);
  filter: blur(6px);
  opacity: 0.9;
}
:root[data-theme="dark"] body::before { opacity: 0.55; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] body::before { opacity: 0.55; }
}

#app { position: relative; z-index: 1; height: 100%; }

button, input, textarea { font-family: inherit; }
button { cursor: pointer; }

/* ============================== 页面骨架 ============================== */

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 1;
  background: var(--bg);
  isolation: isolate;
}
.screen.enter { animation: screenIn 0.24s var(--ease) both; }
.screen.plain  { animation: none; }

@keyframes screenIn {
  from { transform: translateY(8px) scale(0.996); }
  to   { transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(112px + var(--safe-b));
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }
.scroll.plain-bottom { padding-bottom: calc(30px + var(--safe-b)); }

/* ============================== 顶栏 ============================== */

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-t) + 14px) 16px 10px;
  min-height: 56px;
}
.nav .grow { flex: 1; min-width: 0; }
.nav .title {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav .sub { font-size: 12px; color: var(--text-3, #8A8F98); margin-top: 1px; }

.hero {
  padding: calc(var(--safe-t) + 22px) 20px 6px;
}
.hero h1 {
  margin: 0;
  font-size: 33px;
  font-weight: 800;
  letter-spacing: -0.9px;
  line-height: 1.15;
}
.hero p { margin: 6px 0 0; color: var(--text-2); font-size: 13.5px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: var(--text);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
  flex: none;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 20px; height: 20px; }

/* ============================== 卡片 / 列表 ============================== */

.card {
  background: var(--card);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-3, #8A8F98);
  letter-spacing: 0.4px;
  margin: 18px 6px 10px;
  text-transform: uppercase;
}

.list { display: flex; flex-direction: column; gap: 10px; }

.row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 13px;
  border-radius: 22px;
  background: var(--card);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s var(--ease), box-shadow 0.2s var(--ease);
  animation: fadeIn 0.25s var(--ease) both;
  text-align: left;
  width: 100%;
  color: inherit;
  font-size: 15px;
}
.row:active { transform: scale(0.978); box-shadow: var(--shadow-sm); }
.row .body { flex: 1; min-width: 0; }
.row .name {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.1px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.row .desc {
  font-size: 13px;
  color: var(--text-3, #8A8F98);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .desc.unread-text { color: var(--text-2); font-weight: 500; }
.row .tail {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: none;
}
.row .time { font-size: 11.5px; color: var(--text-3, #8A8F98); }

/* 头像（超椭圆） */
.avatar {
  width: 50px;
  height: 50px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 19px;
  flex: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  letter-spacing: -0.5px;
  user-select: none;
}
.avatar.sm { width: 42px; height: 42px; border-radius: 15px; font-size: 16px; }
.avatar.xs { width: 34px; height: 34px; border-radius: 12px; font-size: 14px; }
.avatar.xl { width: 82px; height: 82px; border-radius: 28px; font-size: 32px; }
.avatar-wrap { position: relative; flex: none; }

.dot-online {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ok);
  border: 2.5px solid var(--bg);
}

.badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-deep));
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px var(--brand-soft);
}
.dot-red {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.16);
}
.pill {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 9px;
  background: rgba(43, 124, 255, 0.12);
  color: var(--blue);
  font-weight: 600;
}
.pill.brand { background: rgba(255, 106, 0, 0.13); color: var(--brand); }
.pill.ok { background: rgba(0, 181, 120, 0.14); color: var(--ok); }

/* ============================== 按钮 ============================== */

.btn {
  height: 50px;
  padding: 0 22px;
  border-radius: 25px;
  border: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.16s var(--ease), opacity 0.2s var(--ease);
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; }
.btn.primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand) 58%, var(--brand-deep));
  color: #fff;
  box-shadow: var(--brand-glow);
}
.btn.ghost {
  background: var(--card-solid);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.btn.soft {
  background: var(--brand-soft);
  color: var(--brand);
}
.btn.full { width: 100%; }
.btn.sm { height: 36px; border-radius: 18px; font-size: 13.5px; padding: 0 15px; font-weight: 600; }
.btn.danger-soft { background: rgba(244, 63, 94, 0.12); color: var(--danger); }

/* ============================== 输入 ============================== */

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 18px;
  border-radius: 27px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16.5px;
  color: var(--text);
}
.field input::placeholder { color: var(--text-3, #8A8F98); }
.field input.mono {
  letter-spacing: 6px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 19px;
}
.field .pre { color: var(--text-3, #8A8F98); font-size: 15px; flex: none; }

.hint { font-size: 12.5px; color: var(--text-3, #8A8F98); margin: 10px 8px 0; line-height: 1.55; }

/* ============================== 底部 Tab ============================== */

.tabbar {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(12px + var(--safe-b));
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 32px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 30;
}
.tab {
  flex: 1;
  height: 52px;
  border: 0;
  background: transparent;
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-3, #8A8F98);
  font-size: 10.5px;
  font-weight: 600;
  position: relative;
  transition: color 0.2s var(--ease), background 0.24s var(--ease), transform 0.2s var(--ease);
}
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--brand); background: var(--brand-soft); }
.tab:active { transform: scale(0.94); }
.tab .badge {
  position: absolute;
  top: 3px;
  right: 50%;
  margin-right: -22px;
}

/* ============================== 聊天页 ============================== */

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 8px 14px 12px;
  scrollbar-width: none;
}
.chat-scroll::-webkit-scrollbar { display: none; }

.msg-wrap { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }

.msg { display: flex; gap: 9px; align-items: flex-end; animation: msgIn 0.24s var(--ease) both; }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.msg.other { justify-content: flex-start; }
.msg.me { justify-content: flex-end; }

.bubble {
  max-width: 74%;
  padding: 10px 15px;
  border-radius: 20px;
  font-size: 15.5px;
  line-height: 1.46;
  word-break: break-word;
  white-space: pre-wrap;
  animation: none;
}
.msg.me .bubble {
  background: linear-gradient(135deg, var(--brand-2), var(--brand) 62%, var(--brand-deep));
  color: #fff;
  border-bottom-right-radius: 7px;
  box-shadow: 0 8px 20px var(--brand-soft);
}
.msg.other .bubble {
  background: var(--card-solid);
  color: var(--text);
  border: 1px solid var(--line);
  border-bottom-left-radius: 7px;
  box-shadow: var(--shadow-xs);
}
.msg .bubble.pending { opacity: 0.62; }
.msg .bubble.failed { background: rgba(244, 63, 94, 0.14); color: var(--danger); }

.sys-line {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3, #8A8F98);
  margin: 12px 0 8px;
}
.sys-line span {
  padding: 3px 11px;
  border-radius: 10px;
  background: rgba(120, 128, 148, 0.12);
}

.composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 9px 13px calc(9px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 68%, transparent);
}
.composer .box {
  flex: 1;
  display: flex;
  align-items: flex-end;
  min-height: 46px;
  padding: 11px 17px;
  border-radius: 23px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.composer textarea {
  flex: 1;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.42;
  max-height: 108px;
  min-height: 22px;
}
.composer textarea::placeholder { color: var(--text-3, #8A8F98); }
.send-btn {
  width: 46px;
  height: 46px;
  flex: none;
  border: 0;
  border-radius: 23px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-deep));
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--brand-glow);
  transition: transform 0.16s var(--ease), opacity 0.2s var(--ease);
}
.send-btn:active { transform: scale(0.9); }
.send-btn:disabled { opacity: 0.4; box-shadow: none; }
.send-btn svg { width: 21px; height: 21px; }

/* ============================== 我的 / 申请码 ============================== */

.code-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 22px 22px 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 52%, var(--brand-deep) 100%);
  box-shadow: 0 18px 42px var(--brand-soft);
}
.code-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(2px);
}
.code-card .label { font-size: 12.5px; opacity: 0.88; letter-spacing: 0.6px; }
.code-card .code {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 6px;
  margin: 12px 0 6px;
  font-variant-numeric: tabular-nums;
}
.code-card .tip { font-size: 12.5px; opacity: 0.9; }
.code-card .acts { margin-top: 15px; display: flex; gap: 9px; position: relative; z-index: 1; }
.code-card .acts button {
  height: 38px;
  padding: 0 16px;
  border-radius: 19px;
  border: 0;
  font-size: 13.5px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.94);
  color: #E24A00;
  transition: transform 0.16s var(--ease);
}
.code-card .acts button:active { transform: scale(0.94); }
.code-card .acts button.ghost {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.42);
}

/* 登录码卡片：与好友申请码卡片区分（蓝紫渐变） */
.code-card.blue {
  background: linear-gradient(135deg, #6E9BFF 0%, #2B5CFF 55%, #5B3DF5 100%);
  box-shadow: 0 18px 42px rgba(43, 92, 255, 0.32);
}
.code-card.blue .acts button { color: #1E45D8; }

.link-btn {
  display: block;
  margin: 18px auto 0;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--text-3, #8A8F98);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--card);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

/* ============================== 空状态 / 骨架 ============================== */

.empty {
  text-align: center;
  padding: 54px 24px;
  color: var(--text-3, #8A8F98);
  animation: fadeIn 0.35s var(--ease) both;
}
.empty .ico {
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.empty .ico svg { width: 32px; height: 32px; opacity: 0.55; }
.empty .t { font-size: 15px; font-weight: 600; color: var(--text-2); }
.empty .s { font-size: 13px; margin-top: 5px; line-height: 1.6; }

.skeleton {
  height: 74px;
  border-radius: 22px;
  background: linear-gradient(90deg, var(--card) 25%, rgba(160, 166, 180, 0.16) 37%, var(--card) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  margin-bottom: 10px;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ============================== 欢迎页 ============================== */

.welcome {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 5;
}
.logo-mark {
  width: 96px;
  height: 96px;
  border-radius: 32px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-2), var(--brand) 58%, var(--brand-deep));
  box-shadow: 0 22px 46px var(--brand-soft);
  animation: logoPop 0.6s var(--ease) both;
}
.logo-mark svg { width: 52px; height: 52px; color: #fff; }
@keyframes logoPop {
  0% { opacity: 0; transform: scale(0.7) rotate(-8deg); }
  60% { opacity: 1; transform: scale(1.04) rotate(1deg); }
  100% { opacity: 1; transform: scale(1); }
}
.welcome .app-name { font-size: 25px; font-weight: 800; letter-spacing: -0.6px; }
.welcome .slogan { font-size: 13.5px; color: var(--text-2); margin-top: -10px; }
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--brand-soft);
  border-top-color: var(--brand);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================== Toast / 弹层 ============================== */

#toast-layer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(96px + var(--safe-b));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 90;
  pointer-events: none;
}
.toast {
  max-width: 84%;
  padding: 11px 19px;
  border-radius: 22px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 550;
  color: var(--text);
  animation: popIn 0.24s var(--ease) both;
  text-align: center;
}

.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 18, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.2s var(--ease) both;
}
.sheet {
  width: 100%;
  background: var(--bg-elev);
  border-radius: 30px 30px 0 0;
  padding: 20px 20px calc(24px + var(--safe-b));
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.22);
  animation: sheetUp 0.32s var(--ease) both;
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: none; }
}
.sheet h3 { margin: 0 0 6px; font-size: 19px; font-weight: 750; letter-spacing: -0.3px; }
.sheet p { margin: 0 0 16px; font-size: 13.5px; color: var(--text-2); }
.sheet .handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong, var(--line));
  margin: 0 auto 14px;
}
.sheet .stack { display: flex; flex-direction: column; gap: 10px; }

.divider { height: 1px; background: var(--line); margin: 16px 4px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; } .mt28 { margin-top: 28px; }
.center { text-align: center; }
.muted { color: var(--text-3, #8A8F98); font-size: 12.5px; }

/* ========================= 收尾补齐：导航标题 / 表单 / 个人资料 / 申请操作 ========================= */

.nav-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.25;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-form { margin-top: 4px; }
.auth-form .field + .field { margin-top: 10px; }
.auth-form .btn.full { margin-top: 18px; }
.auth-form .switch-line { margin-top: 16px; }

.profile-name {
  margin-top: 12px;
  font-size: 21px;
  font-weight: 780;
  letter-spacing: -0.4px;
  color: var(--text-1);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.req-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: 4px;
}
.req-acts .btn.sm { min-width: 62px; padding: 8px 12px; font-size: 13px; border-radius: 13px; }


/* ==========================================================================
   个性化（头像 / 主题） · 媒体消息 · 点击闪白修复
   ========================================================================== */

/* 头像：支持上传的照片 */
.avatar { overflow: hidden; position: relative; }
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar.has-img { color: transparent; }
.avatar-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  border: 2.5px solid var(--bg);
  box-shadow: var(--shadow-xs);
}
.avatar-edit svg { width: 13px; height: 13px; }

/* 点击不再出现白色高亮块 */
html { -webkit-tap-highlight-color: transparent; }
button {
  -webkit-appearance: none;
  appearance: none;
  background-color: transparent;
  -webkit-tap-highlight-color: transparent;
}
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 主题设置 */
.seg {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 19px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.seg button {
  flex: 1;
  height: 40px;
  border: 0;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 620;
  color: var(--text-2);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.seg button.on {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px var(--brand-soft);
}
.color-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 2px;
}
.color-dot {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  border: 2px solid transparent;
  box-shadow: var(--shadow-xs);
  position: relative;
  transition: transform 0.16s var(--ease);
}
.color-dot:active { transform: scale(0.92); }
.color-dot.on { border-color: var(--text); }
.color-dot.on::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}
.color-dot.none {
  background: var(--card-solid);
  border: 1px dashed var(--line-strong, var(--line));
  color: var(--text-3, #8A8F98);
  font-size: 11px;
  display: grid;
  place-items: center;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
  height: 32px;
}

/* 聊天输入区：加号与附件面板 */
.plus-btn {
  width: 46px;
  height: 46px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--card-solid);
  color: var(--brand);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.plus-btn svg { width: 22px; height: 22px; transition: transform 0.24s var(--ease); }
.plus-btn.on { background: var(--brand-soft); }
.plus-btn.on svg { transform: rotate(45deg); }
.plus-btn:active { transform: scale(0.92); }

.attach-panel {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 0 13px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.26s var(--ease), opacity 0.2s var(--ease), padding 0.2s var(--ease);
}
.attach-panel.open {
  max-height: 120px;
  opacity: 1;
  padding: 12px 13px 2px;
}
.attach-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card-solid);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s var(--ease);
}
.attach-item:active { transform: scale(0.96); }
.attach-item .ico {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.attach-item .ico svg { width: 21px; height: 21px; }
.attach-item.video .ico { background: rgba(43, 124, 255, 0.14); color: #2B7CFF; }

/* 媒体消息气泡 */
.bubble.media {
  padding: 4px;
  background: var(--card-solid) !important;
  border: 1px solid var(--line);
  overflow: hidden;
  max-width: 66%;
}
.bubble.media img,
.bubble.media video {
  display: block;
  max-width: 100%;
  max-height: 340px;
  border-radius: 16px;
  background: rgba(120, 128, 148, 0.12);
}
.bubble.media .cap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 8px;
  font-size: 11.5px;
  color: var(--text-3, #8A8F98);
}
.bubble.media .cap svg { width: 13px; height: 13px; }
.msg.me .bubble.media { border-bottom-right-radius: 8px; }
.msg.other .bubble.media { border-bottom-left-radius: 8px; }

.upload-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  font-size: 12.5px;
  color: var(--text-2);
}
.upload-bar .spinner { width: 16px; height: 16px; border-width: 2px; }

/* 图片全屏预览 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s var(--ease) both;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 14px;
  object-fit: contain;
}


/* ==========================================================================
   用户中心卡片 / 头像上传按钮 / 点击反馈（配合个性化与媒体消息）
   ========================================================================== */

.card {
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 16px 16px 18px;
  box-shadow: var(--shadow-xs);
}
.row-label {
  font-size: 12.5px;
  font-weight: 640;
  color: var(--text-2);
  margin-bottom: 9px;
  letter-spacing: 0.2px;
}
button.avatar-wrap {
  border: 0;
  padding: 0;
  background: transparent;
  display: inline-flex;
  position: relative;
  line-height: 0;
  flex: none;
}
button.avatar-wrap:active { opacity: 0.9; }
