/* ============================================================
   WeChat · Lux
   Token 对齐 settings.css / editor.css
   ============================================================ */

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  overflow: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ===== VARIABLES (LIGHT) ===== */
.wechat-app {
  --bg: #f4f5f7;
  --text: #161718;
  --text-secondary: rgba(22, 23, 24, 0.35);
  --text-tertiary: rgba(22, 23, 24, 0.12);
  --card: rgba(255, 255, 255, 0.35);
  --card-hover: rgba(255, 255, 255, 0.5);
  --border: rgba(22, 23, 24, 0.03);
  --border-strong: rgba(22, 23, 24, 0.06);
  --input-bg: rgba(255, 255, 255, 0.15);
  --input-border: rgba(22, 23, 24, 0.08);
  --button-primary: #2d2e30;
  --button-primary-text: #f4f5f7;
  --danger: #b33a3a;
  --dock-bg: rgba(244, 245, 247, 0.85);
  --divider: rgba(22, 23, 24, 0.06);
  --npc-dot: rgba(22, 23, 24, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-inner-top: rgba(255, 255, 255, 0.8);
  --glass-inner-bottom: rgba(22, 23, 24, 0.02);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --bubble-user-bg: #2d2e30;
  --bubble-user-text: #f4f5f7;
  --bubble-ai-bg: rgba(255, 255, 255, 0.55);
  --bubble-ai-text: #161718;
  --send-bg: #2d2e30;
  --send-text: #f4f5f7;
}

/* ===== VARIABLES (DARK) ===== */
.wechat-app[data-theme="dark"] {
  --bg: #0d0e10;
  --text: #e8e6dc;
  --text-secondary: rgba(232, 230, 220, 0.35);
  --text-tertiary: rgba(232, 230, 220, 0.12);
  --card: rgba(255, 255, 255, 0.03);
  --card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.03);
  --border-strong: rgba(255, 255, 255, 0.06);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.08);
  --button-primary: #4a4c52;
  --button-primary-text: #e4e2dc;
  --danger: #d46060;
  --dock-bg: rgba(13, 14, 16, 0.85);
  --divider: rgba(255, 255, 255, 0.06);
  --npc-dot: rgba(232, 230, 220, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-inner-top: rgba(255, 255, 255, 0.12);
  --glass-inner-bottom: rgba(0, 0, 0, 0.2);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  --bubble-user-bg: #4a4c52;
  --bubble-user-text: #e4e2dc;
  --bubble-ai-bg: rgba(255, 255, 255, 0.05);
  --bubble-ai-text: #e8e6dc;
  --send-bg: #e8e6dc;
  --send-text: #161718;
}

/* ===== APP ===== */
.wechat-app {
  position: fixed;
  inset: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }

.login-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 20px);
  right: 24px;
  width: 40px;
  height: 40px;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-close:hover {
  color: var(--text);
  background: var(--input-bg);
}

.login-close:active {
  transform: scale(0.92);
}

.login-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   登录页
   ============================================================ */

.login-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 20px);
  left: 24px;
  width: 40px;
  height: 40px;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}

.login-close:hover {
  color: var(--text);
  background: var(--input-bg);
}

.login-close:active { transform: scale(0.92); }

.login-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-screen {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 80px) 40px calc(env(safe-area-inset-bottom, 0px) + 40px);
  min-height: 100vh;
  min-height: 100dvh;
}

.login-brand {
  margin-bottom: 56px;
}

.login-title {
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 64px;
  letter-spacing: 0.18em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 28px;
}

.login-rule {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--text);
  opacity: 0.4;
  margin-bottom: 18px;
}

.login-sub {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-secondary);
  line-height: 1.6;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.login-field {
  display: flex;
  flex-direction: column;
}

.login-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.login-input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--input-bg);
  border: 0.5px solid var(--input-border);
  border-radius: 12px;
  padding: 14px 16px;
  outline: none;
  letter-spacing: 0.02em;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.login-input:focus {
  border-color: var(--text-secondary);
  background: var(--card);
}

.login-input::placeholder {
  color: var(--text-tertiary);
}

.login-error {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--danger);
  min-height: 18px;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  margin-top: -4px;
}

.login-error.show { opacity: 1; }

.login-btn {
  margin-top: auto;
  display: block;
  width: 100%;
  appearance: none;
  border: none;
  background: var(--button-primary);
  color: var(--button-primary-text);
  border-radius: 12px;
  padding: 16px 24px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.login-btn:hover { opacity: 0.9; }
.login-btn:active { transform: scale(0.985); opacity: 0.85; }
.login-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.login-foot {
  margin-top: 24px;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-align: center;
}

/* ============================================================
   主界面
   ============================================================ */

.main-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ===== 顶部标题栏 ===== */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px 16px;
}

.topbar-title {
  flex: 1;
  text-align: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 28px;
  letter-spacing: 0.18em;
  color: var(--text);
  line-height: 1.1;
}

.topbar-back {
  width: 34px;
  height: 34px;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  margin-right: 8px;
  margin-left: -6px;
}

.topbar-back:hover {
  color: var(--text);
  background: var(--input-bg);
}

.topbar-back:active {
  transform: scale(0.92);
}

.topbar-back svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-action {
  width: 34px;
  height: 34px;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.topbar-action:hover {
  color: var(--text);
  background: var(--input-bg);
}

.topbar-action:active {
  transform: scale(0.92);
}

.topbar-action svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== 内容区 ===== */
.content {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 100px;
  position: relative;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== 搜索框 ===== */
.search-bar {
  margin-bottom: 20px;
}

.search-bar input {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--input-bg);
  border: 0.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 14px;
  outline: none;
  letter-spacing: 0.02em;
  transition: border-color 0.25s ease;
}

.search-bar input:focus {
  border-color: var(--text-secondary);
}

.search-bar input::placeholder {
  color: var(--text-tertiary);
}

/* ===== 空状态 ===== */
.empty-state {
  padding: 48px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  line-height: 1.8;
}

.empty-state .empty-title {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.card.clickable { cursor: pointer; }
.card.clickable:hover { background: var(--card-hover); }
.card.clickable:active { transform: scale(0.985); }

/* ===== Me · 头像卡片 ===== */
.me-profile {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 20px;
}

.me-avatar {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #8a9a8b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 26px;
  color: #f4f5f7;
  user-select: none;
  background-size: cover;
  background-position: center;
}

.me-info { flex: 1; min-width: 0; }

.me-name {
  font-size: 18px;
  font-weight: 450;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-wechat {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Me · 卡片行 ===== */
.me-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.me-row:hover { background: var(--card-hover); }
.me-row:active { transform: scale(0.985); }

.me-row-label {
  font-size: 14px;
  font-weight: 450;
  color: var(--text);
  letter-spacing: 0.02em;
}

.me-row-arrow {
  font-size: 18px;
  color: var(--text-tertiary);
  font-weight: 300;
}

/* ===== Discover · 朋友圈卡片 ===== */
.discover-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}

.discover-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(215, 205, 190, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.wechat-app[data-theme="dark"] .discover-icon {
  background: rgba(215, 205, 190, 0.08);
}

.discover-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.discover-text {
  font-size: 14px;
  font-weight: 450;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* ===== 底部 Dock ===== */
.dock {
  flex: 0 0 auto;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 12px 14px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  background: var(--dock-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 0.5px solid var(--divider);
}

.dock-tab {
  flex: 1;
  position: relative;
  appearance: none;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 8px 4px 12px;
  font-family: inherit;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-tab svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-tab:active svg {
  transform: scale(0.9);
}

.dock-tab.is-active {
  color: var(--text);
}

.dock-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--text);
  transform: translateX(-50%);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-tab.is-active::after {
  width: 14px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 420px) {
  .login-screen { padding-left: 28px; padding-right: 28px; }
  .login-title { font-size: 52px; letter-spacing: 0.16em; }
  .content { padding: 0 14px 100px; }
}

/* ============================================================
   + 气泡菜单
   ============================================================ */

.plus-menu {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  right: 20px;
  z-index: 200;
  background: var(--card-solid, #ffffff);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  min-width: 180px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    0 12px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: top right;
}

.wechat-app[data-theme="dark"] .plus-menu {
  background: #1c1e22;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.4),
    0 20px 56px rgba(0, 0, 0, 0.5);
}

.plus-menu.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.plus-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.02em;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.plus-menu-item:hover {
  background: var(--input-bg);
}

.plus-menu-item:active {
  background: var(--card-hover);
}

.plus-menu-item svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  stroke: var(--text-secondary);
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 气泡小三角（指向 + 按钮） */
.plus-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 14px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-top: 0.5px solid var(--border);
  border-left: 0.5px solid var(--border);
  transform: rotate(45deg);
  border-radius: 2px;
}

.wechat-app[data-theme="dark"] .plus-menu::before {
  border-color: rgba(255, 255, 255, 0.06);
}

/* ============================================================
   WeChat 通用弹窗
   ============================================================ */

.wechat-modal {
  position: fixed;
  inset: 0;
  background: rgba(22, 23, 24, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.wechat-app[data-theme="dark"] .wechat-modal {
  background: rgba(0, 0, 0, 0.5);
}

.wechat-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.wechat-modal-box {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border: 0.5px solid rgba(22, 23, 24, 0.08);
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 24px 64px rgba(0, 0, 0, 0.14);
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.wechat-app[data-theme="dark"] .wechat-modal-box {
  background: #1c1e22;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.4),
    0 24px 64px rgba(0, 0, 0, 0.6);
}

.wechat-modal.show .wechat-modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.wechat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 12px;
}

.wechat-modal-title {
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--text);
}

.wechat-modal-close {
  width: 32px;
  height: 32px;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.wechat-modal-close:hover {
  color: var(--text);
  background: var(--input-bg);
}

.wechat-modal-close:active { transform: scale(0.92); }

.wechat-modal-body {
  padding: 0 22px 20px;
  overflow-y: auto;
  flex: 1;
}

.wechat-modal-footer {
  padding: 0 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   搜索微信号
   ============================================================ */

.search-field {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-field input {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--input-bg);
  border: 0.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  letter-spacing: 0.02em;
  transition: border-color 0.25s ease;
}

.search-field input:focus {
  border-color: var(--text-secondary);
}

.search-field input::placeholder {
  color: var(--text-tertiary);
}

.search-btn {
  flex: 0 0 auto;
  appearance: none;
  border: none;
  background: var(--button-primary);
  color: var(--button-primary-text);
  border-radius: 10px;
  padding: 11px 18px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.search-btn:hover { opacity: 0.9; }
.search-btn:active { transform: scale(0.97); }
.search-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.search-result {
  min-height: 20px;
}

.search-result .hint {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 12px 0;
  letter-spacing: 0.02em;
}

.search-result .hint.error {
  color: var(--danger);
}

/* ============================================================
   资料卡
   ============================================================ */

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 20px;
  border-bottom: 0.5px solid var(--border);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 28px;
  color: #f4f5f7;
  user-select: none;
  background-size: cover;
  background-position: center;
  margin-bottom: 16px;
}

.profile-name {
  font-size: 18px;
  font-weight: 450;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.profile-wechat {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.profile-tagline {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-align: center;
}

.profile-section {
  padding: 16px 0;
  border-bottom: 0.5px solid var(--border);
}

.profile-section:last-child {
  border-bottom: none;
}

.profile-section-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.profile-section-text {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: pre-wrap;
}

.profile-section-text.muted {
  color: var(--text-tertiary);
}

/* 添加方式按钮 */
.profile-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  appearance: none;
  border: 0.5px solid var(--border-strong);
  background: var(--input-bg);
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.02em;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.profile-action-btn:hover {
  background: var(--card-hover);
}

.profile-action-btn:active {
  transform: scale(0.985);
}

.profile-action-btn .action-title {
  display: block;
  font-size: 13px;
  font-weight: 450;
  color: var(--text);
  margin-bottom: 2px;
}

.profile-action-btn .action-sub {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.profile-action-btn .action-arrow {
  margin-left: auto;
  font-size: 18px;
  color: var(--text-tertiary);
  font-weight: 300;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Toast
   ============================================================ */

.wechat-toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 90px);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #2d2e30;
  color: #f4f5f7;
  padding: 11px 22px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 450;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
  white-space: nowrap;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.12);
}

.wechat-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.wechat-app[data-theme="dark"] .wechat-toast {
  background: #e8e6dc;
  color: #161718;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 12px 32px rgba(0, 0, 0, 0.4);
}

.wechat-toast .toast-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(244, 245, 247, 0.65);
}

.wechat-app[data-theme="dark"] .wechat-toast .toast-icon {
  color: rgba(22, 23, 24, 0.55);
}

.wechat-toast .toast-icon svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   Chats / Contacts 列表
   ============================================================ */

.chat-list,
.contact-list {
  display: flex;
  flex-direction: column;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.chat-item:last-child { border-bottom: none; }
.chat-item:active { opacity: 0.55; }

.chat-avatar,
.contact-avatar {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 20px;
  color: #f4f5f7;
  user-select: none;
  background-size: cover;
  background-position: center;
}

.contact-avatar {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.chat-info {
  flex: 1;
  min-width: 0;
}

.chat-name {
  font-size: 14px;
  font-weight: 450;
  color: var(--text);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-preview {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-time {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-align: right;
  max-width: 80px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.contact-item:hover { background: var(--input-bg); }
.contact-item:active { background: var(--card-hover); }

.contact-name {
  font-size: 14px;
  font-weight: 450;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* ============================================================
   聊天页
   ============================================================ */

.chat-view {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  transition: background 0.3s ease;
}

.chat-view.active {
  display: flex;
}

/* ---- 顶部导航 ---- */
.chat-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px 14px;
  border-bottom: 0.5px solid var(--divider);
}

.chat-back {
  width: 34px;
  height: 34px;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  margin-left: -6px;
  flex-shrink: 0;
}

.chat-back:hover {
  color: var(--text);
  background: var(--card);
}

.chat-back:active { transform: scale(0.92); }

.chat-back svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.chat-name {
  font-family: "Bodoni 72", Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--text);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.chat-status {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  height: 14px;
  line-height: 14px;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.chat-status.show { opacity: 1; }

.chat-more {
  width: 34px;
  height: 34px;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  flex-shrink: 0;
}

.chat-more:hover {
  color: var(--text);
  background: var(--card);
}

.chat-more:active { transform: scale(0.92); }

.chat-more svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- 消息区 ---- */
.messages {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 20px 140px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  animation: msgIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.msg-row.user {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-row.assistant {
  align-self: flex-start;
  align-items: flex-start;
}

@keyframes msgIn {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.msg {
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  word-wrap: break-word;
  white-space: pre-wrap;
  max-width: 100%;
}

.msg.user {
  background: var(--bubble-user-bg);
  color: var(--bubble-user-text);
  border-radius: 18px 18px 4px 18px;
}

.msg.assistant {
  background: var(--bubble-ai-bg);
  color: var(--bubble-ai-text);
  border: 0.5px solid var(--border-strong);
  border-radius: 18px 18px 18px 4px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.msg-time {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-top: 5px;
  padding: 0 4px;
  user-select: none;
}

.messages-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  line-height: 1.8;
}

/* ---- 悬浮输入区（Liquid Glass） ---- */
.composer-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 16px 16px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.composer-dock > * { pointer-events: auto; }

.glass-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  appearance: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  background: var(--glass-bg);
  border: 0.5px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    inset 0 1px 0 var(--glass-inner-top),
    inset 0 -1px 0 var(--glass-inner-bottom),
    var(--glass-shadow);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.glass-btn:hover { opacity: 0.92; }
.glass-btn:active { transform: scale(0.92); }

.glass-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* AI 按钮：实心深色 */
.glass-btn.ai {
  background: var(--send-bg);
  color: var(--send-text);
  border-color: var(--send-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.15),
    0 2px 6px rgba(0, 0, 0, 0.08);
}

.wechat-app[data-theme="dark"] .glass-btn.ai {
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.3);
}

.glass-btn.ai:hover { opacity: 0.9; }

.glass-btn.ai:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.composer-capsule {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  background: var(--glass-bg);
  border: 0.5px solid var(--glass-border);
  border-radius: 100px;
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow:
    inset 0 1px 0 var(--glass-inner-top),
    inset 0 -1px 0 var(--glass-inner-bottom),
    var(--glass-shadow);
  transition: border-color 0.25s ease;
  overflow: hidden;
}

.composer-capsule:focus-within {
  border-color: var(--text-secondary);
}

.composer-input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 48px 12px 18px;
  letter-spacing: 0.02em;
  line-height: 1.4;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
}

.composer-input::placeholder {
  color: var(--text-tertiary);
}

.composer-send {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 34px;
  height: 34px;
  appearance: none;
  background: var(--send-bg);
  color: var(--send-text);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.composer-send:hover { opacity: 0.9; }
.composer-send:active { transform: scale(0.9); }

.composer-send:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.composer-send svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}