/* 匿聊 Pro
   首页：一比一还原 nvda.chat（背景图 + 温馨提示 + 昵称/性别/年龄 + 开始匹配）
   聊天页：卡片式会话（离开在顶栏、拉黑为右上角悬浮、好友折叠在左上抽屉） */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root[data-theme='dark'] {
  --page: #111827; --surface: #1f2937; --surface-2: #273449; --surface-3: #172033;
  --text: #d7dee9; --muted: #a8b3c4; --dim: #7c8798;
  --border: #3a3a3c; --accent: #62b7c7; --accent-strong: #8bd3df; --accent-soft: #173b43;
  --gold: #fbbf24; --danger: #ff6b6b; --ok: #5ddba4; --warn: #f6c86b;
  --bubble-me: linear-gradient(135deg, #4ea3b8, #2f7f96);
  --bubble-them: #273449; --shadow: 0 12px 32px rgba(0, 0, 0, .38);
  --track: #172033; --thumb: #52647d;
  /* 首页（背景图之上）的文字配色，取自 nvda 深色主题 */
  --home-title: #d9e7f7; --home-body: #f4c1ca; --home-label: #c5d3e3;
  --home-input: #dfe9f5; --home-placeholder: #aebfd2; --home-shadow: none;
  --home-veil: linear-gradient(180deg, rgba(9, 14, 26, .72), rgba(9, 14, 26, .86));
  /* 左上角展开列表（跟随首页明暗主题） */
  --drawer-bg: #0f0f13; --drawer-bg-2: #18181d; --drawer-border: #1a1a1f;
  --drawer-text: #e0e0e6; --drawer-muted: #a0a0a8; --drawer-dim: #6b6b74;
  --drawer-accent: #39ff14; --drawer-accent-soft: #132818;
  --drawer-shadow: 8px 0 28px rgba(0, 0, 0, .55);
  --overlay: rgba(0, 0, 0, .55);
  --male: #7cb8ff; --female: #ff9ec4;
}
:root[data-theme='light'] {
  --page: #edf1f7; --surface: #ffffff; --surface-2: #f6f9fd; --surface-3: #eef3f9;
  --text: #1e293b; --muted: #64748b; --dim: #94a3b8;
  --border: #d8e0ea; --accent: #287f96; --accent-strong: #176d81; --accent-soft: #e5f4f6;
  --gold: #b45309; --danger: #dc2626; --ok: #059669; --warn: #b45309;
  --bubble-me: linear-gradient(135deg, #3d99b0, #176d81);
  --bubble-them: #f1f5f9; --shadow: 0 12px 32px rgba(15, 23, 42, .14);
  --track: #f1f1f1; --thumb: #c1c1c1;
  --home-title: #16202e; --home-body: #d02a4a; --home-label: #37475c;
  --home-input: #1e293b; --home-placeholder: #8fa0b4;
  --home-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #e60073;
  --home-veil: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .28));
  /* 左上角展开列表（白天模式：浅色面板 + 深色文字） */
  --drawer-bg: #ffffff; --drawer-bg-2: #f1f5f9; --drawer-border: #dbe3ee;
  --drawer-text: #1e293b; --drawer-muted: #64748b; --drawer-dim: #94a3b8;
  --drawer-accent: #287f96; --drawer-accent-soft: #e5f4f6;
  --drawer-shadow: 8px 0 28px rgba(15, 23, 42, .28);
  --overlay: rgba(15, 23, 42, .38);
  --male: #2563eb; --female: #db2777;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  background: var(--page); color: var(--text); -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
/* SEO：仅对爬虫/读屏可见的主标题，不影响页面视觉 */
.seo-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:disabled { opacity: .5; cursor: not-allowed; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--track); }
::-webkit-scrollbar-thumb { background: var(--thumb); border-radius: 3px; }

/* ===================== 首页（nvda.chat 结构） ===================== */
.home-container {
  position: relative; max-width: 700px; margin: 0 auto;
  height: 100svh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; overflow-x: hidden; overflow-y: auto;
  background-color: #edefe4;
  background-image: url('/assets/home-bg.jpg?v=2');
  background-repeat: no-repeat; background-position: center; background-size: cover;
  -webkit-user-select: none; user-select: none;
}
/* 深色主题下压暗背景图，保证文字对比度 */
.home-container::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: var(--home-veil); pointer-events: none;
}
.home-container > * { position: relative; z-index: 1; }

.home-topbar {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; flex: none;
}
.home-topbar-right { display: flex; align-items: center; gap: 8px; }
/* 首页顶部品牌名称：居中，不加底板，靠描边保证在背景图上可读 */
.home-topbar-brand {
  flex: 1; min-width: 0; text-align: center;
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  color: #16202e;
  text-shadow: 0 1px 3px rgba(255, 255, 255, .75), 0 0 10px rgba(255, 255, 255, .35);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:root[data-theme='dark'] .home-topbar-brand {
  color: #eaf1fb;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8), 0 0 10px rgba(0, 0, 0, .45);
}
.home-round-btn {
  position: relative; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, .72); color: #1f2937;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12); font-size: 15px;
}
:root[data-theme='dark'] .home-round-btn { background: rgba(20, 28, 44, .72); color: #d7dee9; }
.home-vip {
  font-size: 12px; font-weight: 600; padding: 8px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .78); color: var(--accent-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.home-vip.join { background: linear-gradient(135deg, var(--gold), #f59e0b); color: #1f2937; }

/* 公告条 */
.notice-bar {
  width: calc(100% - 28px); max-width: 460px; flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px; margin-bottom: 12px;
  background: var(--accent-soft); color: var(--accent-strong); font-size: 12.5px;
}
.notice-text { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-close { font-size: 17px; line-height: 1; color: inherit; opacity: .7; padding: 0 2px; }

/* 温馨提示 */
.home-tips-wrapper {
  width: calc(100% - 28px); max-width: 460px; flex: none;
  text-align: center; text-shadow: var(--home-shadow);
  margin-bottom: 16px;
}
.home-tips-title h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 4px; }
.home-tips-title span { color: var(--home-title); }
/* 标题整行可点击折叠：按钮不能带浏览器默认样式，否则会浮出一圈灰底 */
.home-tips-title {
  display: block; width: 100%; cursor: pointer;
  background: none; border: 0; padding: 0; margin: 0; font: inherit;
  text-shadow: var(--home-shadow);
  -webkit-tap-highlight-color: transparent;
}
.home-tips-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.tips-arrow {
  font-size: 13px; line-height: 1; opacity: .75;
  transition: transform .18s ease; display: inline-block;
}
.home-tips-body {
  color: var(--home-body); font-size: 13px; text-align: left;
  margin-top: 6px; line-height: 1.65;
}
/* 折叠态：收起正文、箭头翻转 */
.home-tips-wrapper.folded .home-tips-body { display: none; }
.home-tips-wrapper.folded .tips-arrow { transform: rotate(-90deg); }
.tip-content { margin: 5px 0; }
.bottom-tip { margin-top: 8px; }

/* 表单 */
.home-form {
  width: calc(100% - 28px); max-width: 460px; flex: none;
  display: flex; flex-direction: column; gap: 14px; margin-top: auto; padding-bottom: 18px;
}
.home-field {
  background: rgba(0, 0, 0, .05); border-radius: 12px; overflow: hidden;
  text-shadow: none;
}
:root[data-theme='dark'] .home-field { background: rgba(0, 0, 0, .28); }
.field-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.field-row:last-child { border-bottom: none; }
.field-row.col { flex-direction: column; align-items: stretch; }
.field-label {
  width: 50px; flex: none; text-align: left; font-size: 14px;
  color: var(--home-label); text-shadow: none;
}
/* 纵向行（兴趣标签）：label 占满整行，标题 + 提示 + 计数排在一行，禁止逐字竖排 */
.field-row.col .field-label {
  width: auto; display: flex; align-items: center; flex-wrap: wrap;
  gap: 2px 6px; line-height: 1.5;
}
.field-row.col .field-label .tip { flex: 1 1 auto; min-width: 0; font-size: 12px; opacity: .85; }
.field-row.col .field-label .tip-count { margin-left: auto; flex: none; }
/* 文案较长的行标题（如「只匹配异性」）：不再套用 50px 窄列，避免逐字竖排 */
.field-label.wide { width: auto; white-space: nowrap; }
.field-control {
  flex: 1; min-width: 0; padding: 4px 2px; font-size: 14px; font-family: inherit;
  border: none; background: transparent; color: var(--home-input);
  text-align: center; outline: none; text-shadow: none;
}
.field-control::placeholder { color: var(--home-placeholder); }
/* 省份下拉：只到省级，手选优先于 IP 定位。半透明底 + 描边，保证在背景图上可读 */
.field-select {
  flex: none; width: 104px; padding: 5px 4px; border-radius: 8px;
  font-size: 13px; font-family: inherit; text-align: center; text-align-last: center;
  color: var(--home-input); background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(0, 0, 0, .1); outline: none; text-shadow: none;
}
:root[data-theme='dark'] .field-select {
  background: rgba(0, 0, 0, .42); border-color: rgba(255, 255, 255, .16);
}
.field-btn {
  flex: none; width: 45px; padding: 5px 0; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: var(--accent); color: #fff; text-shadow: none;
}
.field-range {
  flex: 1; min-width: 0; height: 18px; -webkit-appearance: none; appearance: none;
  background: transparent; outline: none;
}
.field-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px; background: rgba(120, 130, 145, .45);
}
.field-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; margin-top: -5px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  border: 1px solid rgba(0, 0, 0, .12); box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.field-range::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(120, 130, 145, .45); }
.field-range::-moz-range-thumb {
  width: 14px; height: 14px; border: none; border-radius: 50%; background: #fff;
  border: 1px solid rgba(0, 0, 0, .12);
}
.age-button {
  flex: none; width: 26px; color: #fff; font-size: 10px; line-height: 18px;
  text-align: center; background: var(--accent); border-radius: 100px; text-shadow: none;
}
.field-hint {
  flex: 1; min-width: 0; font-size: 12px; color: var(--home-label);
  text-align: left; text-shadow: none; opacity: .9;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 分段选择（性别 / 想找） */
.seg-slider {
  flex: 1; display: flex; padding: 3px; border-radius: 8px;
  background: rgba(0, 0, 0, .08);
}
:root[data-theme='dark'] .seg-slider { background: rgba(0, 0, 0, .3); }
.seg-slider button {
  flex: 1; padding: 6px 4px; font-size: 13px; border-radius: 6px;
  color: var(--home-label); text-shadow: none;
  transition: background .15s ease, color .15s ease;
}
.seg-slider button.on {
  background: #fff; color: var(--accent-strong); font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
:root[data-theme='dark'] .seg-slider button.on { background: var(--surface-2); }
.seg-slider button.locked { opacity: .45; }

/* 开始匹配 */
.btn-start {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 46px; border-radius: 10px;
  font-size: 16px; font-weight: 600; color: #fff; text-shadow: none;
  background: var(--accent); box-shadow: 0 8px 20px rgba(40, 127, 150, .28);
}
.btn-start:active { transform: translateY(1px); }
.btn-icon { flex: none; }

.extra-toggle {
  align-self: center; font-size: 12.5px; color: var(--home-label);
  text-shadow: none; padding: 4px 8px; opacity: .9;
}
/* 兴趣标签：圆角 chip，选中前置 ✓，数量随主题走 */
.tags { display: flex; flex-wrap: wrap; gap: 8px 7px; }
.tags button.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 13px; font-size: 13px; border-radius: 999px; text-shadow: none;
  background: rgba(255, 255, 255, .62); color: var(--home-label);
  border: 1px solid rgba(0, 0, 0, .1);
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.tags button.tag:active { transform: scale(.95); }
:root[data-theme='dark'] .tags button.tag {
  background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .14);
}
.tags button.tag .tag-mark { display: none; font-size: 11px; line-height: 1; }
.tags button.tag.on {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(40, 127, 150, .25);
}
.tags button.tag.on .tag-mark { display: inline-block; }
.tip-count {
  margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px;
  background: rgba(255, 255, 255, .5); color: var(--home-label); text-shadow: none;
}
:root[data-theme='dark'] .tip-count { background: rgba(255, 255, 255, .12); }
.tip-count.full { background: var(--accent); color: #fff; }
.extra-toggle.on { color: var(--accent); font-weight: 600; text-shadow: none; }
.lock-tip {
  font-size: 12px; color: var(--gold); text-shadow: none;
  background: rgba(255, 255, 255, .6); border-radius: 10px; padding: 8px 10px; line-height: 1.6;
}
:root[data-theme='dark'] .lock-tip { background: rgba(0, 0, 0, .3); }
.lock-tip a { color: var(--gold); font-weight: 600; text-decoration: none; }
.home-foot { font-size: 11.5px; color: var(--home-label); text-shadow: none; opacity: .85; }

/* ===================== 聊天页 ===================== */
.app {
  position: relative; width: 100%; max-width: 480px; margin: 0 auto; height: 100dvh;
  display: flex; flex-direction: column; background: var(--page);
}
.topbar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.menu-btn {
  position: relative; width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: var(--surface-2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.brand { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.peer { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }

/* ===== 排队中的加载动画 ===== */
/* 顶栏状态前的小圆点：三个点轮流弹一下 */
.spin-dots { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.spin-dots i {
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
  animation: nl-dot 1.05s ease-in-out infinite;
}
.spin-dots i:nth-child(2) { animation-delay: .18s; }
.spin-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes nl-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-3px); opacity: 1; }
}
/* 聊天页居中的寻找动画 */
.waiting-box {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 24px;
}
.waiting-ring {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  animation: nl-spin .9s linear infinite;
}
.waiting-title { margin: 0; font-size: 15px; color: var(--text); }
.waiting-sub { margin: 0; font-size: 12.5px; color: var(--dim); }
@keyframes nl-spin { to { transform: rotate(360deg); } }
/* 尊重系统「减少动态效果」设置：动画降级为静态提示，不闪 */
@media (prefers-reduced-motion: reduce) {
  .spin-dots i, .waiting-ring { animation: none; }
}
.icon-btn { width: 34px; height: 34px; border-radius: 11px; flex: none; background: var(--surface-2); font-size: 15px; }
.btn-leave {
  flex: none; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface-2); color: var(--danger); border: 1px solid var(--border);
}

/* 匹配成功后：顶部展示匹配者资料（昵称 / 性别 / 年龄 / 兴趣） */
.peer-card {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.peer-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none; font-size: 22px;
  background: var(--surface-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.peer-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.peer-line1 { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.peer-name {
  max-width: 52%; font-size: 14.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.peer-tag {
  flex: none; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--border);
}
.peer-tag.male { color: var(--male); border-color: var(--male); }
.peer-tag.female { color: var(--female); border-color: var(--female); }
.peer-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.peer-tags span {
  font-size: 11px; padding: 2px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent-strong);
}

.messages {
  flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 10px;
}
.msg {
  max-width: 78%; padding: 9px 13px; border-radius: 16px;
  font-size: 14.5px; line-height: 1.55; word-break: break-word; white-space: pre-wrap;
}
.msg.them { background: var(--bubble-them); align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.me { background: var(--bubble-me); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.msg.media { padding: 5px; }
.msg.media img { max-width: 190px; max-height: 240px; border-radius: 12px; display: block; }
.msg-image { cursor: zoom-in; }

/* ===== 图片点击放大预览 ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, .92);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.lightbox.hidden { display: none; }
.lightbox-img {
  max-width: 100%; max-height: 100%;
  border-radius: 10px; object-fit: contain;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6);
}
.lightbox-close {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .12);
  color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
.lightbox-tip {
  position: absolute; bottom: 22px; left: 0; right: 0; text-align: center;
  color: rgba(255, 255, 255, .62); font-size: 12px; pointer-events: none;
}
.sys {
  align-self: center; max-width: 90%; font-size: 11.5px; color: var(--muted);
  background: var(--surface-3); padding: 5px 11px; border-radius: 10px; text-align: center; line-height: 1.5;
}
.sys.warn { color: var(--warn); }
.sys.ok { color: var(--ok); }

/* 右侧悬浮：拉黑 / 举报（挂在聊天页内，与聊天栏右缘对齐，主题切换在左侧导航里）。
   top 由 app.js 的 syncFabTop() 动态计算：顶栏 + 对方资料条 + 间距。 */
.fab-wrap {
  position: absolute; right: 12px; top: 126px; z-index: 20;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.fab {
  width: 42px; height: 42px; border-radius: 50%; font-size: 18px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center;
}
/* 文字版悬浮按钮：拉黑 / 举报 */
.fab.fab-text {
  width: auto; height: auto; border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  color: var(--muted); letter-spacing: .5px;
}
.fab.fab-text:disabled { opacity: .55; }
.fab-pop-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.reason-btn {
  padding: 6px 10px; border-radius: 9px; font-size: 12px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.reason-btn.on {
  background: rgba(220, 38, 38, .12); color: var(--danger); border-color: rgba(220, 38, 38, .35);
}
.fab-pop {
  width: 210px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px; box-shadow: var(--shadow);
  font-size: 12px; color: var(--muted); line-height: 1.6;
}
.fab-pop-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.mini-btn {
  padding: 7px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.mini-btn.danger { background: rgba(220, 38, 38, .12); color: var(--danger); border-color: rgba(220, 38, 38, .35); }

/* 输入栏 */
.inputbar {
  flex: none; display: flex; gap: 8px; padding: 10px 12px;
  background: var(--surface); border-top: 1px solid var(--border);
}
input[type='text'] {
  flex: 1; min-width: 0; padding: 10px 12px; font-size: 14px; font-family: inherit;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); outline: none;
}
input[type='text']:focus { border-color: var(--accent); }
input::placeholder { color: var(--dim); }
.att-btn {
  width: 38px; height: 38px; border-radius: 12px; flex: none; font-size: 17px;
  background: var(--surface-2); border: 1px solid var(--border);
  position: relative;
}
/* 未解锁图片时的置灰 + 小锁角标 */
.att-btn.locked { opacity: .5; }
.att-lock {
  position: absolute; right: -3px; top: -3px; font-size: 9px; line-height: 1;
  background: var(--surface); border-radius: 50%; padding: 1px;
}
.btn-send {
  flex: none; padding: 0 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}
.btn-send:disabled { background: var(--surface-2); color: var(--dim); }
.emoji-panel {
  flex: none; height: 190px; overflow-y: auto; padding: 10px 12px;
  background: var(--surface); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
}
.emoji-panel button { height: 34px; font-size: 20px; border-radius: 8px; background: transparent; }

/* ===================== 左侧导航菜单（跟随首页明暗主题） ===================== */
.drawer {
  position: fixed; left: 0; top: 0; bottom: 0; width: 260px; max-width: 82vw;
  background: var(--drawer-bg); border-right: 1px solid var(--drawer-border);
  color: var(--drawer-text);
  transform: translateX(-100%);
  transition: transform .22s ease, background .2s ease, color .2s ease;
  z-index: 60; display: flex; flex-direction: column; box-shadow: var(--drawer-shadow);
}
.drawer.open { transform: translateX(0); }
.drawer-brand {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px; border-bottom: 1px solid var(--drawer-border);
}
.brand-logo {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--drawer-bg-2); display: flex; align-items: center; justify-content: center;
  font-size: 20px; overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-name {
  font-size: 16px; font-weight: 700; color: var(--drawer-accent); letter-spacing: .5px;
}
.drawer-nav {
  flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 12px; border-radius: 10px;
  color: var(--drawer-muted); font-size: 14.5px; text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.nav-item .nav-icon { width: 22px; text-align: center; font-size: 16px; flex: none; }
.nav-item:hover { background: var(--drawer-bg-2); color: var(--drawer-text); }
.nav-item.on { background: var(--drawer-accent-soft); color: var(--drawer-accent); font-weight: 600; }
/* 日间 / 夜间切换：点一下直接切换，不进二级页，所以不加 on 高亮 */
.nav-item.nav-theme { cursor: pointer; }
/* 抽屉子页面（不雅词过滤 / 社区规范 / 关于我们） */
.sub-panel {
  position: absolute; inset: 0; background: var(--drawer-bg); color: var(--drawer-text);
  display: flex; flex-direction: column;
}
.sub-head {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 14px 12px; border-bottom: 1px solid var(--drawer-border);
}
.sub-head .back {
  font-size: 13px; color: var(--drawer-accent); padding: 4px 6px; border-radius: 6px;
  background: transparent;
}
.sub-head h3 { font-size: 14.5px; color: var(--drawer-text); }
.sub-head h3 span { font-size: 11.5px; color: var(--drawer-dim); font-weight: 400; }
.panel-body { flex: 1; overflow-y: auto; padding: 12px 14px 16px; }
.panel-tip {
  font-size: 12.5px; color: var(--drawer-dim); line-height: 1.7;
  margin-bottom: 12px;
}
.panel-tip b { color: var(--drawer-accent); }
/* 竖排选项列表（不雅词过滤）：一个选项独占一行，比横排滑块更好点也更说得清 */
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; box-sizing: border-box;
  padding: 10px 12px; border: 1px solid var(--drawer-border); border-radius: 10px;
  background: transparent; cursor: pointer; text-align: left; font: inherit;
  color: var(--drawer-text); transition: background .15s, border-color .15s;
}
.opt-item:hover { background: rgba(127, 127, 127, .08); }
.opt-dot {
  flex: none; position: relative; box-sizing: border-box; margin-top: 2px;
  width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--drawer-dim);
}
.opt-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.opt-main b { font-size: 13.5px; font-weight: 600; color: var(--drawer-text); line-height: 1.3; }
.opt-main i { font-style: normal; font-size: 11.5px; color: var(--drawer-dim); line-height: 1.5; }
.opt-item.on { border-color: var(--drawer-accent); background: var(--drawer-accent-soft); }
.opt-item.on .opt-dot { border-color: var(--drawer-accent); }
.opt-item.on .opt-dot::after {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--drawer-accent);
}
.opt-item.on .opt-main b { color: var(--drawer-accent); }
.filter-state {
  margin-top: 10px; font-size: 12.5px; color: var(--drawer-dim); text-align: center;
}
.filter-state.on { color: var(--drawer-accent); font-weight: 600; }
.page-text {
  font-size: 13px; line-height: 1.85; color: var(--drawer-text);
  white-space: pre-wrap; word-break: break-word;
}
/* 抽屉内的分段滑块跟随抽屉主题 */
.drawer .seg-slider { background: rgba(255, 255, 255, .08); }
.drawer .seg-slider button { color: var(--drawer-dim); }
.drawer .seg-slider button.on {
  background: var(--drawer-accent-soft); color: var(--drawer-accent);
  box-shadow: none; font-weight: 600;
}
.drawer-foot { flex: none; padding: 10px 14px; font-size: 11px; color: var(--drawer-dim); text-align: center; }
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 55; }

/* ===================== 会员中心 ===================== */
.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-box {
  width: 100%; max-width: 380px; max-height: 86dvh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 18px; box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { font-size: 16px; }
.modal-head .close { font-size: 24px; color: var(--muted); line-height: 1; padding: 0 4px; }
/* 会员中心里的「展示 VIP 图标」勾选：用户自己控制要不要让别人看出他是会员 */
.vip-check {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; user-select: none;
}
.vip-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent-strong); }

/* VIP 标识：聊天页昵称后面的小标（用户在会员中心自己开关） */
.vip-mark {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; font-style: normal; letter-spacing: .5px;
  padding: 2px 5px; border-radius: 5px; margin-right: 4px;
  background: linear-gradient(135deg, var(--gold), #f59e0b); color: #1f2937;
}
.vip-mark.small { margin-left: 6px; margin-right: 0; vertical-align: middle; }
.limit-body { font-size: 14px; line-height: 1.7; color: var(--text); }
.limit-body #limitMsg { font-weight: 600; margin-bottom: 8px; }
.vip-state { background: var(--surface-2); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.vip-state-line { font-size: 13px; color: var(--muted); line-height: 1.8; }
.vip-state-line b { color: var(--gold); }
.privileges { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pv { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.pv span { font-size: 14px; width: 18px; text-align: center; }

/* 开关（首页位置 / 会员中心异性·同城） */
.switch {
  position: relative; flex: none; width: 44px; height: 24px; border-radius: 999px;
  background: rgba(120, 130, 145, .4); transition: background .18s ease;
}
.switch .switch-dot {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s ease;
}
.switch.on { background: var(--accent); }
.switch.on .switch-dot { transform: translateX(20px); }
.switch.locked { opacity: .45; }
:root[data-theme='dark'] .switch { background: rgba(255, 255, 255, .16); }
:root[data-theme='dark'] .switch.on { background: var(--accent); }

/* 会员中心：异性 / 同城开关 */
.perk-title {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  margin: 0 0 8px; letter-spacing: .5px;
}
.perk-switches { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.perk-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
}
.perk-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.perk-txt b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.perk-txt span { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.perk-lock { font-size: 12px; color: var(--gold); line-height: 1.6; }
.perk-lock a { color: var(--gold); font-weight: 600; text-decoration: none; }
.vip-buy {
  display: block; text-align: center; padding: 12px; border-radius: 12px;
  background: linear-gradient(135deg, #39ff14, #2cb307); color: #0f0f13;
  font-size: 14px; font-weight: 600; text-decoration: none; margin-bottom: 12px;
}
.activate-box { display: flex; gap: 8px; }
.activate-box input { letter-spacing: .5px; }
.activate-box button {
  flex: none; padding: 0 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  background: linear-gradient(135deg, var(--gold), #f59e0b); color: #1f2937;
}
.activate-msg { min-height: 20px; font-size: 12.5px; margin-top: 10px; text-align: center; }
.activate-msg.ok { color: var(--ok); }
.activate-msg.err { color: var(--danger); }
.vip-foot { font-size: 11.5px; color: var(--dim); margin-top: 10px; text-align: center; }

/* ===================== 提示 ===================== */
/* 离开确认弹窗 */
.confirm-box { max-width: 320px; text-align: center; }
.confirm-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.confirm-desc { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 16px; }
.confirm-acts { display: flex; gap: 10px; }
.confirm-btn {
  flex: 1; padding: 11px 0; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 14px; cursor: pointer;
}
.confirm-btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.toast {
  position: fixed; left: 50%; top: 68px; transform: translateX(-50%);
  background: var(--surface); color: var(--text); padding: 10px 18px;
  border-radius: 12px; font-size: 13.5px; z-index: 99; max-width: 86vw;
  text-align: center; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.toast.err { border-color: var(--danger); color: var(--danger); }
.toast.ok { border-color: var(--ok); color: var(--ok); }

@media (max-height: 640px) {
  .home-tips-body { font-size: 12px; }
  .home-form { padding-bottom: 12px; }
}
