:root {
  --bg: #eef1f8;
  --surface: #ffffff;
  --surface2: #f6f8fd;
  --border: #e2e7f0;
  --text: #1f2a44;
  --text-dim: #7a86a6;
  --primary: #4f7cff;
  --primary-hover: #3d6bf0;
  --primary-glow: rgba(79,124,255,0.13);
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --success: #16a34a;
  --warning: #d97706;
  --gold: #d99e17;
  --gold-dim: rgba(217,158,23,0.15);
  --cyan: #0891b2;
  --cyan-dim: rgba(8,145,178,0.13);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --max-width: 480px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.chat-container {
  height: 100vh;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2%;
  text-align: left;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: max(8px, env(safe-area-inset-top));
}

.app-header .logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.app-header .logo span { color: var(--primary); }
.app-header .logo.nav-brand { display: flex; align-items: center; gap: 7px; }
.app-header .logo.nav-brand .brand-logo { color: #0a1628; }

.app-header .user-info {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header .btn-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
}

.app-header .btn-logout:hover { border-color: var(--danger); color: var(--danger); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2%;
  text-align: left;
}

/* ===== 大卡片容器 — 固定尺寸，内容滑动 ===== */
/* 卡片上下贴边不留空，占领全部纵向空间；内容超出时卡片内滚动 */
.page-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5% 3%;
  margin: 0;
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: left;
  box-shadow: 0 2px 12px rgba(31,42,68,0.08);
  display: flex;
  flex-direction: column;
}

/* 群首页：卡片自适应高度，不滚动，让内容全部显示 */
.room-page .page-wrapper {
  height: auto;
  min-height: 100vh;
  overflow-y: visible;
}

/* 透明占位 — APP 预留约1%防止状态栏遮挡，浏览器中接近0 */
.top-spacer {
  height: 1vh;
  min-height: max(8px, env(safe-area-inset-top));
  flex-shrink: 0;
  background: transparent;
}

/* hero 区域已移入大卡片内部，不再需要独立时的顶部留白 */
.download-hero,
.install-hero {
  margin-top: 0 !important;
}

/* 大卡片为 flex 纵向布局，hero 若被 flex-shrink 压缩会塌陷并把内容裁掉（如二维码被 hidden） */
.download-hero {
  flex-shrink: 0;
}

/* ===== 顶部导航（大卡片内第一个位置）— sticky固定 ===== */
.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
  backdrop-filter: blur(8px);
}
.page-nav .nav-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.2s;
}
.page-nav .nav-brand:hover { opacity: 1; }
.page-nav .nav-brand .brand-logo { color: #0a1628; }
.page-nav .nav-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.page-nav .nav-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
}
.page-nav .nav-btn:hover {
  background: rgba(79,124,255,0.1);
  border-color: rgba(79,124,255,0.4);
  color: var(--primary);
  transform: translateY(-1px);
}

/* 小卡片（page-wrapper 内的 .card） */
.page-wrapper > .card,
.page-wrapper > .sub-card {
  margin-bottom: 1.2%;
}

.page-wrapper > .card:last-child,
.page-wrapper > .sub-card:last-child {
  margin-bottom: 0;
}

/* hero-card 在 page-wrapper 内不需要顶部间距 */
.page-wrapper > .hero-card:first-child {
  margin-top: 0;
}

/* 后台 tab 内容区（#adminPanel 是大卡片，不需要嵌套卡片） */
.admin-main > .container {
  max-width: var(--max-width-admin);
  padding: 2%;
  text-align: left;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-xs);
  border: none;
  font-size: 0.95rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.btn:active { transform: scale(0.97); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); }

.btn-sm { padding: 6px 12px; font-size: 0.85rem; min-height: 36px; }

.btn-block { width: 100%; }

.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); }

.textarea { resize: vertical; min-height: 80px; }

.label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.form-group { margin-bottom: 16px; }

.form-row {
  display: flex;
  gap: 12px;
}
.form-row > * { flex: 1; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 2%;
  text-align: left;
}

/* ===== 品牌Logo（密字图标） ===== */
.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: #0a1628;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.brand-logo::after {
  content: '🔒';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  font-size: 8px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
}
.brand-logo.lg {
  width: 56px;
  height: 56px;
  font-size: 32px;
  border-radius: 14px;
}
.brand-logo.lg::after {
  width: 22px;
  height: 22px;
  font-size: 11px;
  top: -5px;
  right: -5px;
  border-width: 2px;
}

/* 导航栏品牌区域 */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.nav-brand .nav-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-brand .nav-brand-name .dot { color: var(--primary); }

/* ===== 登录页背景 ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #f2f4fb 0%, #e6ecfb 45%, #eef1f8 100%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 2%;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('/splash-bg.jpg') center / cover no-repeat;
  opacity: 0.12;
  z-index: 0;
}
.login-page::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(238,241,248,0.4) 0%, rgba(238,241,248,0.75) 100%);
  z-index: 1;
}
.login-box {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 360px;
}

/* ===== 卡片头部（图标 + 彩色标题） ===== */
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.card-head .card-head-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.card-head .card-head-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.card-head .card-head-title.gold { color: var(--gold); }
.card-head .card-head-title.cyan { color: var(--cyan); }
.card-head .card-head-title.primary { color: var(--primary); }

/* ===== 子卡片（嵌套） ===== */
.sub-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}

.sub-card:last-child { margin-bottom: 0; }

.sub-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}

/* ===== 数据展示网格 ===== */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}

.data-item {
  text-align: center;
  padding: 10px 6px;
  background: var(--surface2);
  border-radius: var(--radius-xs);
}

.data-item .data-icon {
  font-size: 1rem;
  margin-bottom: 4px;
}

.data-item .data-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.data-item .data-value.gold { color: var(--gold); }
.data-item .data-value.cyan { color: var(--cyan); }
.data-item .data-value.primary { color: var(--primary); }

.data-item .data-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ===== 功能入口网格 ===== */
.func-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.func-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.func-item:hover {
  background: var(--border);
  border-color: var(--primary);
}

.func-item .func-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.func-item .func-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
}

/* ===== 品牌横幅卡片 ===== */
.hero-card {
  background: linear-gradient(135deg, #4f7cff 0%, #7c5cff 100%);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(84,104,255,0.28);
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 60%);
  pointer-events: none;
}

.hero-card .hero-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
  position: relative;
}

.hero-card .hero-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
  position: relative;
}

.hero-card .hero-subtitle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
  position: relative;
}

/* ===== 进度条增强 ===== */
.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.progress-info .progress-value {
  color: var(--gold);
  font-weight: 600;
}

/* ===== 标签徽章 ===== */
.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.tag-gold { background: var(--gold-dim); color: var(--gold); }
.tag-cyan { background: var(--cyan-dim); color: var(--cyan); }
.tag-primary { background: var(--primary-glow); color: var(--primary); }
.tag-success { background: rgba(22,163,74,0.15); color: var(--success); }
.tag-danger { background: rgba(220,38,38,0.15); color: var(--danger); }

.card-title {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-bar .fill.warning { background: var(--warning); }
.progress-bar .fill.danger { background: var(--danger); }

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

/* 微信风格：时间分隔条 */
.msg-time-divider {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 8px 0;
  margin: 4px auto;
  max-width: 200px;
  background: rgba(31,42,68,0.07);
  border-radius: 4px;
}

/* ===== 微信风格消息布局 ===== */
.message-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-direction: row;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.message-item .msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  font-weight: 600;
  background: var(--primary);
}

.message-item .msg-body {
  flex: 1;
  min-width: 0;
  max-width: 75%;
  display: flex;
  flex-direction: column;
}

.message-item .sender {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
}

.message-item .sender .msg-time-inline {
  font-size: 0.62rem;
  color: rgba(122,134,166,0.85);
  margin-left: 6px;
}

.message-item.own .sender .msg-time-inline {
  margin-left: 0;
  margin-right: 6px;
}

.message-item .bubble {
  background: var(--surface2);
  border-radius: 4px 12px 12px 12px;
  padding: 9px 12px;
  display: inline-block;
  word-break: break-word;
  position: relative;
}

.message-item .content {
  font-size: 0.92rem;
  word-break: break-word;
}

.message-item .meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 3px;
  display: flex;
  gap: 10px;
}

/* 自己的消息：右侧 */
.message-item.own {
  flex-direction: row-reverse;
}

.message-item.own .msg-body {
  align-items: flex-end;
}

.message-item.own .sender {
  text-align: right;
}

.message-item.own .bubble {
  background: #07c160;
  color: #fff;
  border-radius: 12px 4px 12px 12px;
}

.message-item.own .meta {
  justify-content: flex-end;
}

.message-item.risk .bubble {
  border: 1px solid var(--danger);
}

.member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.member-item .info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-item .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #fff;
  flex-shrink: 0;
}

.member-item .nickname { font-size: 0.9rem; }
.member-item .role-tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
}
.member-item .muted-tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--danger);
  color: #fff;
}

.room-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.room-card:hover { border-color: var(--primary); }

.room-card .title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.room-card .meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.room-card .status-open { color: var(--success); }
.room-card .status-closed { color: var(--danger); }

/* 未读消息红点 */
.room-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.room-card-header .title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  margin-left: 8px;
  flex-shrink: 0;
  animation: badge-pulse 2s ease-in-out infinite;
}
.unread-badge.expiring {
  background: #f59e0b;
}
@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.countdown-urgent {
  color: #ef4444 !important;
  font-weight: 600;
}
.countdown-warning {
  color: #f59e0b;
}

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  z-index: 9999;
  animation: toast-in 0.2s ease;
  max-width: 90%;
  text-align: center;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}

.empty-state .icon { font-size: 2rem; margin-bottom: 12px; }

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 2% 2%;
}

.login-box {
  width: 100%;
  max-width: none;
}

.login-box.page-wrapper {
  height: auto;
  min-height: 100vh;
  overflow-y: visible;
  margin: 0 2%;
}

/* 聊天页面：大卡片固定不滚动，内容在messageList小卡片内滑动 */
.chat-page-wrapper {
  /* 全面板利用视口高度 */
  height: 100vh !important;
  margin: 0 !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  padding: 1% 2%;
}

/* 聊天页顶部占位：保留约1%给 APP 状态栏，防止遮挡导航栏 */
.chat-page-wrapper .top-spacer {
  height: 1vh;
  min-height: max(8px, env(safe-area-inset-top));
}

/* 群信息卡片 — 压缩为单行紧凑条，让消息区占主体 */
.chat-room-card {
  flex-shrink: 0;
  margin-bottom: 3px;
}

/* 单行紧凑条：群名 · 状态 · 倒计时角标 · 人数 */
.room-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  min-height: 32px;
  line-height: 1.2;
}
.room-strip .room-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}
.room-strip .room-status {
  font-size: 0.72rem;
  flex-shrink: 0;
}
.room-strip .room-spacer { flex: 1; }
.room-strip .room-countdown {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(245,158,11,0.16);
  color: #b45309;
  border: 1px solid rgba(245,158,11,0.38);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.room-strip .room-countdown.urgent {
  background: rgba(239,68,68,0.16);
  color: #dc2626;
  border-color: rgba(239,68,68,0.42);
}
.room-strip .room-people {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* 聊天内容小卡片 — 可上下滑动 */
.chat-messages-card {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.login-box .brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-box .brand h1 {
  font-size: 1.6rem;
  font-weight: 700;
}

.login-box .brand h1 span { color: var(--primary); }

.login-box .brand p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 8px;
}

.chat-input-bar {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.chat-input-bar .input {
  flex: 1;
}

.chat-input-bar .btn {
  flex-shrink: 0;
}

/* 微信风格：按住说话按钮 */
.btn-voice-hold {
  flex: 1;
  min-height: 44px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s;
}

.btn-voice-hold:active {
  background: var(--border);
}

/* 微信风格：发送按钮 */
.btn-send {
  min-width: 56px;
  transition: all 0.15s ease;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: 600;
}

#actionBtn {
  transition: all 0.15s ease;
}

/* 微信风格：+号面板（在卡片内部） */
.plus-panel {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px 16px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.plus-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.plus-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.plus-icon {
  width: 56px;
  height: 56px;
  background: var(--surface2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.plus-item span {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
}


.modal {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: var(--max-width);
  padding: 20px 16px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  max-height: 80vh;
  overflow-y: auto;
}

.modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal .modal-title { font-size: 1.1rem; font-weight: 600; }
.modal .modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

/* ===== 更多操作弹窗：分组卡片列表 ===== */
.menu-group {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.menu-group:last-child { margin-bottom: 0; }

.menu-group-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  padding: 8px 12px 4px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.menu-group-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-top: 1px solid var(--border);
  background: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  font-family: var(--font);
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.menu-group-item:first-of-type { border-top: none; }
.menu-group-item:active { background: var(--border); }
.menu-group-item .menu-icon { font-size: 1.05rem; flex-shrink: 0; }
.menu-group-item .menu-arrow { margin-left: auto; color: var(--text-dim); font-size: 0.8rem; }
.menu-group-item .menu-price { margin-left: auto; font-size: 0.82rem; color: var(--gold); font-weight: 600; }
.menu-group-item.danger { color: var(--danger); }
.menu-group-item.gold { color: var(--gold); }

.muted-banner {
  background: linear-gradient(135deg, rgba(79,124,255,0.08) 0%, rgba(124,92,255,0.07) 100%);
  border: 1px solid rgba(79,124,255,0.28);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 8px;
  backdrop-filter: blur(4px);
}

.invite-link-box {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  word-break: break-all;
  font-size: 0.85rem;
  color: var(--primary);
  cursor: pointer;
  text-align: center;
}

@media (min-width: 768px) {
  :root { --max-width: 720px; }
  .login-box { max-width: none; }
  .modal { border-radius: var(--radius); margin-bottom: 20vh; }
  .modal-overlay { align-items: center; }
}

.online-badge {
  font-size: 0.7rem;
  color: var(--success);
  background: rgba(22, 163, 74, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.typing-indicator {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 4px 14px;
  font-style: italic;
  animation: typing-pulse 1.5s ease-in-out infinite;
}

@keyframes typing-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.toast.info { border-color: var(--primary); }

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.3rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.msg-image {
  max-width: 220px;
  max-height: 220px;
  border-radius: 8px;
  cursor: pointer;
  display: block;
}

.message-item.image-msg .bubble { padding: 4px 4px; }
.message-item.image-msg .bubble .content { margin-top: 4px; }

.message-item.recalled {
  background: transparent;
  border: none;
  text-align: center;
  padding: 4px 0;
  justify-content: center;
}

.message-item.recalled .recalled-text {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
  background: var(--surface2);
  padding: 2px 10px;
  border-radius: 10px;
}

/* @全体公告：顶部紧凑滚动横幅 */
.announcement-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(79,124,255,0.08);
  border: 1px solid rgba(79,124,255,0.28);
  border-radius: 8px;
  margin: 6px 0;
  padding: 6px 10px;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}
.announcement-banner:active {
  background: rgba(79,124,255,0.16);
}
.announce-badge-sm {
  display: inline-block;
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary, #3b82f6);
  padding: 2px 8px;
  border-radius: 10px;
}
.announcement-text {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.announcement-text::-webkit-scrollbar {
  height: 4px;
}
.announcement-text::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.announcement-text::-webkit-scrollbar-track {
  background: transparent;
}

.msg-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  min-width: 200px;
  max-width: 280px;
}

.message-item.own .msg-file {
  background: rgba(255,255,255,0.15);
}

.msg-file:hover {
  background: var(--border);
}

.msg-file .file-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.msg-file .file-info {
  flex: 1;
  min-width: 0;
}

.msg-file .file-name {
  font-size: 0.9rem;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.msg-file .file-size {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.message-item.own .msg-file .file-size {
  color: rgba(255,255,255,0.6);
}

/* ===== 语音消息 ===== */
.msg-voice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: 20px;
  cursor: pointer;
  min-width: 120px;
}

.message-item.own .msg-voice {
  background: rgba(255,255,255,0.15);
}

.msg-voice .voice-icon { font-size: 1.2rem; }
.msg-voice .voice-duration { font-size: 0.9rem; min-width: 30px; }
.msg-voice .voice-play { font-size: 0.8rem; color: var(--primary); }
.message-item.own .msg-voice .voice-play { color: rgba(255,255,255,0.8); }
.message-item.voice-msg .bubble { padding: 4px 8px; }

/* ===== 视频消息 ===== */
.msg-video {
  max-width: 240px;
  max-height: 240px;
  border-radius: 8px;
  display: block;
}
.message-item.video-msg .bubble { padding: 4px 4px; }

/* ===== 音乐/音频消息 ===== */
.msg-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: 20px;
  cursor: pointer;
  min-width: 160px;
  max-width: 260px;
}
.message-item.own .msg-audio {
  background: rgba(255,255,255,0.15);
}
.msg-audio .msg-audio-info {
  flex: 1;
  min-width: 0;
}
.msg-audio .msg-audio-name {
  font-size: 0.88rem;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-audio .file-size {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.message-item.own .msg-audio .file-size { color: rgba(255,255,255,0.6); }
.msg-audio .voice-play { font-size: 0.8rem; color: var(--primary); flex-shrink: 0; }
.message-item.own .msg-audio .voice-play { color: rgba(255,255,255,0.8); }
.message-item.audio-msg .bubble { padding: 4px 8px; }

/* file download icon */
.msg-file .file-download {
  font-size: 1.2rem;
  flex-shrink: 0;
  color: var(--primary);
}
.message-item.own .msg-file .file-download { color: rgba(255,255,255,0.8); }
.message-item.file-msg .bubble { padding: 4px 6px; }

/* ===== 回复引用 ===== */
.reply-quote {
  font-size: 0.8rem;
  color: var(--text-dim);
  background: rgba(31,42,68,0.05);
  border-left: 3px solid var(--primary);
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.message-item.own .reply-quote {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  border-left-color: rgba(255,255,255,0.5);
}

.reply-quote .reply-name { font-weight: 600; }

/* ===== 回复预览条（输入栏内部、紧贴输入框上方）===== */
.reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface2, rgba(120,130,150,0.08));
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  width: 100%;
}

.reply-preview-content {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-preview-label { color: var(--primary); font-weight: 600; }
.reply-preview-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 8px;
}

/* ===== 回到底部浮动按钮 ===== */
.scroll-to-bottom {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 6px 16px rgba(79,124,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
  animation: fadeInUp 0.3s ease;
}
.scroll-to-bottom:active {
  transform: scale(0.9);
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 表情面板 ===== */
.emoji-panel {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  max-height: 40vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.emoji-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  font-size: 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}
.emoji-cell:active { background: var(--surface2); }
.emoji-item-container { display: none; }

/* ===== @提及下拉 ===== */
.mention-dropdown {
  position: fixed;
  bottom: 60px;
  left: 8px;
  right: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  z-index: 99;
  box-shadow: 0 -4px 12px rgba(31,42,68,0.1);
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mention-item:hover { background: var(--surface2); }
.mention-item .avatar {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
}

/* 消息正文中的 @ 昵称高亮 */
.mention-highlight {
  color: #4f7cff;
  font-weight: 600;
  background: rgba(79,124,255,0.12);
  border-radius: 4px;
  padding: 0 2px;
}

/* ===== 搜索栏 ===== */
.search-bar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  justify-content: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.search-bar .input { flex: 1; max-width: 400px; }

.search-results {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px 12px;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  cursor: pointer;
}

.search-result-item:hover { border: 1px solid var(--primary); }

.search-result-sender {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

.search-result-content {
  font-size: 0.9rem;
  word-break: break-word;
}

.search-result-content mark {
  background: var(--warning);
  color: #fff;
  border-radius: 2px;
  padding: 0 2px;
}

.search-result-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.search-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ===== 录音遮罩 ===== */
.recording-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;   /* 让触摸事件穿透，不拦截 touchend */
}

.recording-indicator {
  background: var(--surface);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.recording-dot {
  width: 12px;
  height: 12px;
  background: var(--danger);
  border-radius: 50%;
  animation: recording-pulse 1s ease-in-out infinite;
}

@keyframes recording-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.recording-indicator span {
  font-size: 1rem;
  color: var(--text);
}

.recording-hint {
  color: var(--text-dim) !important;
  font-size: 0.85rem !important;
}

/* ===== 管理后台 ===== */
:root {
  --max-width-admin: 1200px;
}

/* ===== 后台大卡片 — 固定尺寸，内容滑动 ===== */
#adminPanel {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "header"
    "nav"
    "main";
  max-width: 1200px;
  margin: 0 auto 2%;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  min-height: calc(100vh - 2vw);
  height: auto;
}
#adminPanel > div:first-child {
  grid-area: header;
  width: 100%;
  padding: 0 12px;
}

/* admin-nav — 独立小卡片（手机端横排） */
#adminPanel .admin-nav {
  grid-area: nav;
  width: calc(100% - 24px);
  margin: 0 12px 8px;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 2px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 50;
}

#adminPanel .admin-nav-btn {
  display: inline-block;
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.84rem;
  font-family: var(--font);
  cursor: pointer;
  border-radius: var(--radius-sm);
  border-left: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-align: center;
  transition: all 0.2s;
}

#adminPanel .admin-nav-btn:hover { color: var(--text); background: var(--bg); }
#adminPanel .admin-nav-btn.active {
  color: var(--primary);
  background: var(--bg);
  border-left: none;
  border-bottom: 2px solid var(--primary);
  font-weight: 600;
}

#adminPanel .admin-main {
  grid-area: main;
  min-width: 0;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#adminPanel .admin-main .container {
  max-width: var(--max-width-admin);
  padding: 2%;
}

@media (max-width: 640px) {
  #adminPanel {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto 1fr !important;
    grid-template-areas:
      "header"
      "nav"
      "main" !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    min-height: 100vh !important;
    height: auto !important;
  }
  #adminPanel > div:first-child {
    padding: 0 10px !important;
  }
  #adminPanel .admin-nav {
    width: calc(100% - 20px) !important;
    margin: 0 10px 8px !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    padding: 6px 8px !important;
    gap: 2px !important;
  }
  #adminPanel .admin-nav-btn {
    border-left: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: var(--radius-sm) !important;
    flex-shrink: 0 !important;
    text-align: center !important;
    padding: 8px 12px !important;
    display: inline-block !important;
    width: auto !important;
    white-space: nowrap !important;
    font-size: 0.82rem !important;
  }
  #adminPanel .admin-nav-btn.active {
    border-left: none !important;
    border-bottom-color: var(--primary) !important;
    background: var(--bg) !important;
  }
  #adminPanel .admin-subnav {
    flex-direction: row !important;
    border: none !important;
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  #adminPanel .admin-subnav-btn {
    flex-shrink: 0 !important;
    padding: 8px 12px !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
  }

  /* 手机端：内容区撑满，减少内边距 */
  #adminPanel .admin-main {
    width: 100% !important;
    overflow-y: visible !important;
  }
  #adminPanel .admin-main .container {
    padding: 0 10px 20px !important;
    max-width: 100% !important;
  }

  /* 手机端：统计卡片更紧凑 */
  .admin-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
    padding: 8px 0 !important;
  }
  .stat-card {
    padding: 10px 12px !important;
  }
  .stat-num {
    font-size: 1.4rem !important;
  }

  /* 手机端：工具栏更紧凑 */
  .admin-toolbar {
    padding: 8px 0 !important;
    gap: 6px !important;
  }

  /* 手机端：表格横向滚动，列宽优化 */
  .admin-table {
    max-height: none !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #tab-finance .admin-row {
    grid-template-columns: 1.6fr 2.2fr 0.8fr 0.7fr 0.8fr 1fr 0.8fr !important;
    min-width: 760px !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    font-size: 0.8rem !important;
  }
  .admin-row > span:last-child {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  .admin-row .btn-sm {
    font-size: 0.72rem !important;
    padding: 4px 8px !important;
  }

  /* 手机端：分页更紧凑 */
  .admin-pager {
    padding: 10px 0 !important;
    gap: 4px !important;
  }
  .admin-pager button {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
  }
}

/* 内容子菜单（桌面端纵向） */
#adminPanel .admin-subnav {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding: 0 8px 8px 8px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

#adminPanel .admin-subnav.open {
  display: flex;
  max-height: 300px;
}

#adminPanel .admin-subnav-btn {
  display: block;
  padding: 8px 14px 8px 28px;
  color: var(--text-dim);
  font-size: 0.82rem;
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

#adminPanel .admin-subnav-btn:hover {
  color: var(--text);
  background: var(--bg);
}

#adminPanel .admin-subnav-btn.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--bg);
}

#adminPanel .nav-arrow {
  display: inline-block;
  transition: transform 0.25s ease;
  font-size: 0.8rem;
  margin-left: 2px;
}

#adminPanel .admin-nav-btn.expanded .nav-arrow {
  transform: rotate(90deg);
}

/* 内容页布局 — 固定大卡片，左右底部距屏幕各2%，内容滑动 */
.content-layout {
  display: flex;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  height: 100vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  padding: 2% 3%;
}

/* 内容页内 page-wrapper 透明化（大卡片已由 content-layout 提供） */
.content-layout .page-wrapper {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  height: auto;
  min-height: auto;
  overflow: visible;
}

/* 内容页 page-wrapper 内的 top-spacer 隐藏（content-layout 已有自己的 top-spacer） */
.content-layout .page-wrapper .top-spacer {
  display: none;
}

/* 内容页侧边导航 */
.content-nav {
  width: 130px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 8px 6px;
  position: sticky;
  top: 60px;
  align-self: flex-start;
}

.content-nav-btn {
  display: block;
  padding: 8px 12px;
  color: var(--text-dim);
  font-size: 0.84rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}

.content-nav-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.content-nav-btn.active {
  color: var(--primary);
  background: var(--bg);
  border-left-color: var(--primary);
  font-weight: 600;
}

.content-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.content-main .container {
  padding: 2%;
}

@media (max-width: 640px) {
  .content-layout {
    flex-direction: column;
  }
  .content-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 14px;
  }
  .content-nav-btn {
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    flex-shrink: 0;
  }
  .content-nav-btn.active {
    border-left: none;
    border-bottom-color: var(--primary);
    background: none;
  }
}

/* 统计卡片 */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  padding: 10px 14px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--primary); }

.stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
  opacity: 0.7;
}

/* 工具栏 */
.admin-toolbar {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-toolbar .input,
.admin-toolbar .select {
  flex: 1;
  min-width: 120px;
}

/* 表格 — 外层大卡片，可上下左右滑动 */
.admin-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  max-height: 380px;
}

/* 卡片内文字不换行 */
.card {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  word-break: break-word;
}

.admin-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.8fr 0.6fr 0.8fr 1.6fr;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 0.84rem;
}

/* 用户表8列：昵称|邮箱|角色|VIP|积分|群数|注册时间|操作 */
#tab-users .admin-row {
  grid-template-columns: 0.9fr 1.6fr 0.7fr 0.6fr 0.45fr 0.5fr 0.8fr 460px;
  min-width: 1240px;
  gap: 12px;
  padding: 12px 16px;
}
#tab-users .admin-row > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 用户表操作列：固定宽度，按钮强制单行排列，完整显示不换行 */
#tab-users .admin-row > span:last-child {
  flex-wrap: nowrap !important;
  overflow: visible !important;
}

/* 内容表5列：内容|说明|字数|更新时间|操作 */
#tab-contents .admin-row {
  grid-template-columns: 1fr 1.2fr 0.5fr 1.5fr 0.8fr;
  min-width: 620px;
  gap: 12px;
  padding: 12px 16px;
}
#tab-contents .admin-row > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 财务页交易记录和定价表有7列 */
#tab-finance .admin-row {
  grid-template-columns: 1.8fr 2fr 1fr 0.8fr 0.9fr 1.2fr 0.8fr;
  min-width: 1000px;
  gap: 12px;
  padding: 12px 16px;
}
#tab-finance .admin-row > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-row > span:last-child {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-row:last-child { border-bottom: none; }

/* 表头固定 — 滚动时始终可见 */
.admin-row-header {
  background: var(--surface2);
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 6px 14px;
  position: sticky;
  top: 0;
  z-index: 5;
}

@media (max-width: 640px) {
  /* 手机端统计卡片横版排版：3列 */
  .admin-stats {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    padding: 8px 10px !important;
  }
  .stat-card {
    padding: 10px 6px !important;
    text-align: center;
  }
  .stat-num { font-size: 1.15rem !important; }
  .stat-label { font-size: 0.68rem !important; }
  .stat-sub { font-size: 0.62rem !important; }

  /* 手机端表格：保持单行排列，横向滑动查看右侧操作按钮 */
  .admin-row {
    font-size: 0.76rem;
    padding: 8px 12px;
    min-width: 560px;
  }
  .admin-row-header {
    display: grid !important;
    min-width: 560px;
  }
  /* 操作按钮保持同行 */
  .admin-row > span:last-child {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .admin-row > span:last-child .btn-sm {
    padding: 4px 8px;
    font-size: 0.72rem;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* 手机端群卡片单行排列 */
  .admin-room-card {
    min-width: 560px;
  }

  /* 财务表格：保留全部7列 */
  #tab-finance .admin-row {
    grid-template-columns: 1.8fr 1.6fr 1.2fr 0.6fr 0.7fr 1fr 0.6fr !important;
    min-width: 640px;
  }

  /* 日志表格：保留全部4列 */
  #tab-logs .admin-row {
    grid-template-columns: 1.8fr 0.8fr 1fr 1.5fr !important;
    min-width: 460px;
  }

  /* 用户表格：手机端改为卡片式布局（不依赖横向滚动），所有列完整显示 */
  #tab-users .admin-row {
    grid-template-columns: 0.8fr 1.4fr 0.7fr 0.9fr 0.5fr 0.8fr 420px;
    grid-template-areas:
      "nick nick email email"
      "role mem count time"
      "operation operation operation operation";
    min-width: 0 !important;
    gap: 6px 10px !important;
    padding: 10px 12px !important;
    font-size: 0.78rem !important;
    align-items: start;
  }
  #tab-users .admin-row > span {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
    min-width: 0;
  }
  #tab-users .admin-row > span:nth-child(1) { grid-area: nick; font-weight: 600; }
  #tab-users .admin-row > span:nth-child(2) { grid-area: email; font-size: 0.76rem !important; }
  #tab-users .admin-row > span:nth-child(3) { grid-area: role; }
  #tab-users .admin-row > span:nth-child(4) { grid-area: mem; }
  #tab-users .admin-row > span:nth-child(5) { grid-area: count; }
  #tab-users .admin-row > span:nth-child(6) { grid-area: time; }
  #tab-users .admin-row > span:nth-child(7) { grid-area: operation; }
  #tab-users .admin-row > span:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    overflow-x: visible !important;
    border-top: 1px dashed var(--border);
    padding-top: 8px;
    margin-top: 2px;
  }
  #tab-users .admin-row > span:last-child .btn-sm {
    flex-shrink: 0;
    white-space: nowrap;
  }
  #tab-users .admin-row-header > span {
    white-space: nowrap !important;
    font-weight: 600;
  }
  #tab-users .admin-row-header > span:nth-child(1) { grid-area: nick; }
  #tab-users .admin-row-header > span:nth-child(2) { grid-area: email; }
  #tab-users .admin-row-header > span:nth-child(3) { grid-area: role; }
  #tab-users .admin-row-header > span:nth-child(4) { grid-area: mem; }
  #tab-users .admin-row-header > span:nth-child(5) { grid-area: count; }
  #tab-users .admin-row-header > span:nth-child(6) { grid-area: time; }
  #tab-users .admin-row-header > span:nth-child(7) { grid-area: operation; }
  /* 手机端隐藏用户表表头（卡片字段已足够清晰），避免表头随卡片布局换行错位 */
  #tab-users .admin-row-header {
    display: none !important;
  }

  /* 内容管理表格：5列单行 */
  #tab-contents .admin-row {
    grid-template-columns: 1fr 1.2fr 0.5fr 1.5fr 0.8fr !important;
    min-width: 560px !important;
  }

  /* 手机端大卡片高度适配 */
  .admin-table {
    max-height: 60vh !important;
    max-width: 100% !important;
  }
}

/* 角色标签 */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.role-admin { background: rgba(79,124,255,0.14); color: var(--primary); }
.role-risk { background: rgba(217,119,6,0.14); color: #b45309; }
.role-user { background: rgba(122,134,166,0.14); color: var(--text-dim); }

/* 状态标签 */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-open { background: rgba(22,163,74,0.14); color: var(--success); }
.status-closed { background: rgba(220,38,38,0.14); color: var(--danger); }

/* 交易状态标签 */
.tx-status-paid { background: rgba(22,163,74,0.14); color: var(--success); }
.tx-status-pending { background: rgba(234,179,8,0.16); color: #b78a08; }
.tx-status-failed { background: rgba(220,38,38,0.14); color: var(--danger); }
.tx-status-refunded { background: rgba(124,92,255,0.14); color: #7c5cff; }
.tx-status-rejected { background: rgba(100,116,139,0.16); color: #64748b; }

/* 举报卡片 */
.admin-report-card {
  margin: 0 0 8px;
}

.admin-report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.report-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.report-status-pending { background: rgba(217,119,6,0.14); color: #b45309; }
.report-status-resolved { background: rgba(22,163,74,0.14); color: var(--success); }
.report-status-dismissed { background: rgba(139,145,156,0.2); color: var(--text-dim); }

.admin-report-body {
  font-size: 0.84rem;
  line-height: 1.5;
}

.admin-report-body p { margin-bottom: 3px; }

.admin-report-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* 分页 */
.admin-pager {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.pager-info {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-right: 8px;
}

.pager-active {
  pointer-events: none;
}

/* 日志表格列宽 */
#tab-logs .admin-row {
  grid-template-columns: 1.8fr 0.8fr 1fr 1.5fr;
}

@media (max-width: 640px) {
  #tab-logs .admin-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== 个人资料页 ===== */
.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin: 12px 0;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  display: block;
}

.profile-avatar-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--font);
}

.profile-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.profile-info-row:last-child { border-bottom: none; }

.profile-info-label {
  color: var(--text-dim);
  flex-shrink: 0;
  width: 80px;
}

.profile-info-value {
  flex: 1;
  text-align: right;
  margin-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 密码强度条 */
.password-strength-bar {
  width: 100%;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  margin: 4px 0;
}

.strength-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s, background 0.3s;
  border-radius: 2px;
}

.strength-1 { background: var(--danger); }
.strength-2 { background: var(--warning); }
.strength-3 { background: #eab308; }
.strength-4 { background: #84cc16; }
.strength-5 { background: var(--success); }

.strength-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  min-height: 1em;
}

.strength-label.strength-1 { color: var(--danger); }
.strength-label.strength-2 { color: var(--warning); }
.strength-label.strength-3 { color: #eab308; }
.strength-label.strength-4 { color: #84cc16; }
.strength-label.strength-5 { color: var(--success); }

/* ===== 后台 + 内容页统一字号 ===== */
#adminPanel,
#adminPanel *,
.content-layout,
.content-layout * {
  font-size: 0.84rem !important;
}

/* 仅看板大数字保留视觉层次 */
#adminPanel .stat-num {
  font-size: 1.4rem !important;
}

/* 标题稍粗但不放大 */
#adminPanel .card-title,
.content-layout .card-title {
  font-size: 0.84rem !important;
  font-weight: 700;
}

/* ===== 电脑端响应式布局 ===== */
@media (min-width: 768px) {
  :root {
    --max-width: 720px;
  }

  body {
    background: #eef1f8;
    background-image:
      radial-gradient(ellipse at 15% 0%, rgba(79,124,255,0.12) 0%, transparent 55%),
      radial-gradient(ellipse at 85% 100%, rgba(124,92,255,0.10) 0%, transparent 55%);
    background-attachment: fixed;
    min-height: 100vh;
  }

  /* 大卡片：桌面端居中，上下贴边不留空，固定尺寸 */
  .page-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100vh;
    box-shadow: 0 4px 24px rgba(31,42,68,0.10);
  }

  /* 后台大卡片 — #adminPanel 本身已是大卡片 */
  .admin-main > .container {
    max-width: var(--max-width-admin);
  }

  /* 主容器 */
  .container {
    padding: 2%;
  }

  /* 内容页桌面端 — 固定高度 */
  .content-layout {
    margin: 0 2% 2%;
    height: calc(100vh - 2vw);
  }

  /* 卡片：增强阴影和悬停效果 */
  .card {
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(31,42,68,0.08);
    transition: box-shadow 0.25s, transform 0.25s;
  }

  .card:hover {
    box-shadow: 0 8px 32px rgba(79,124,255,0.16);
  }

  .card-title {
    font-size: 1rem;
    padding-bottom: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
  }

  /* 卡片头部：电脑端更大 */
  .card-head {
    margin-bottom: 18px;
    padding-bottom: 12px;
  }
  .card-head .card-head-icon { font-size: 1.3rem; }
  .card-head .card-head-title { font-size: 1.05rem; }

  /* 品牌横幅卡片：电脑端更大气 */
  .hero-card {
    padding: 36px 28px;
    margin-bottom: 18px;
  }
  .hero-card .hero-icon { font-size: 3rem; }
  .hero-card .hero-title { font-size: 1.8rem; }
  .hero-card .hero-subtitle { font-size: 0.95rem; }

  /* 子卡片：电脑端间距更大 */
  .sub-card { padding: 16px; }

  /* 数据网格：电脑端更宽 */
  .data-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
  }
  .data-item { padding: 14px 8px; }
  .data-item .data-value { font-size: 1.2rem; }
  .data-item .data-label { font-size: 0.78rem; }

  /* 功能网格：电脑端更宽 */
  .func-grid { gap: 14px; }
  .func-item { padding: 16px 8px; }
  .func-item .func-icon { font-size: 1.6rem; }
  .func-item .func-label { font-size: 0.78rem; }

  .btn {
    padding: 12px 20px;
    font-size: 1rem;
  }

  .input, .textarea, .select {
    padding: 14px 16px;
    font-size: 1rem;
  }

  /* 表单行并排显示 */
  .form-row { gap: 16px; }

  /* 弹窗居中且更宽 */
  .modal {
    max-width: 500px;
    margin: 0 auto;
    border-radius: var(--radius);
  }

  /* 群卡片：电脑端带阴影 */
  .room-card {
    padding: 18px 22px;
    box-shadow: 0 2px 12px rgba(31,42,68,0.08);
  }
  .room-card:hover {
    box-shadow: 0 6px 24px rgba(79,124,255,0.18);
    transform: translateY(-1px);
  }

  /* 聊天页面布局 */
  .chat-container {
    max-width: var(--max-width);
    margin: 0 auto;
  }

  /* 聊天输入栏：已在卡片内部，无需额外定位 */
  .chat-input-bar {
    /* 输入栏在 page-wrapper 内部，由父容器 flex 控制，无需额外样式 */
  }

  /* +号面板：已在卡片内部 */
  .plus-panel {
    /* 面板在 page-wrapper 内部，由父容器 flex 控制 */
  }

  /* 回复预览条：随大卡片宽度，无需偏移（已在输入栏内部） */
  .reply-preview {
    max-width: var(--max-width);
    margin: 0 auto;
  }

  /* 后台管理布局 — 桌面端：左侧边栏 + 右侧内容 */
  #adminPanel {
    max-width: 1200px;
    margin: 0 auto 2%;
    padding: 0;
    min-height: calc(100vh - 2vw);
    height: auto;
    overflow: visible;
    display: grid;
    grid-template-columns: 160px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "header header"
      "nav main";
  }

  /* 桌面端：admin-nav 竖向侧边栏卡片 */
  #adminPanel .admin-nav {
    width: auto;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 1px;
    margin: 0 0 12px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-self: start;
    position: sticky;
    top: 12px;
  }
  #adminPanel .admin-nav-btn {
    display: block;
    padding: 10px 14px;
    border-left: 3px solid transparent;
    border-bottom: none;
    text-align: left;
    font-size: 0.88rem;
  }
  #adminPanel .admin-nav-btn.active {
    border-left-color: var(--primary);
    border-bottom: none;
  }
  #adminPanel .admin-main {
    width: auto;
    overflow-y: visible;
    min-width: 0;
  }
  #adminPanel .admin-main .container {
    max-width: 100%;
    padding: 0 20px 20px 16px;
  }

  #adminPanel .card-title {
    font-size: 1rem !important;
  }

  /* 按钮组横排 */
  .btn-row-desktop {
    display: flex;
    gap: 12px;
  }
  .btn-row-desktop .btn { flex: 1; }

  /* 禁言横幅：居中 */
  .muted-banner {
    max-width: var(--max-width);
    margin: 0 auto;
  }

  /* 成员列表等弹窗内内容间距 */
  .member-item { padding: 12px 16px; }

  /* 下载页面 hero 区域 */
  .download-hero {
    max-width: var(--max-width);
    margin: 0 auto 24px;
    border-radius: var(--radius);
  }

  /* 登录/注册页面：电脑端 */
  .login-page {
    padding: 0 2% 2%;
  }
  .login-box {
    max-width: 480px;
  }

  /* 标签徽章：电脑端稍大 */
  .tag-badge { font-size: 0.78rem; padding: 4px 12px; }

  /* 统计卡片：电脑端 hover 效果 */
  .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(79,124,255,0.22);
  }
  .stat-card { transition: transform 0.2s, box-shadow 0.2s; }
}

@media (min-width: 1024px) {
  :root {
    --max-width: 880px;
  }

  .container {
    padding: 28px 32px 64px;
  }

  .card {
    padding: 26px;
    margin-bottom: 20px;
  }

  /* 品牌横幅：大屏更气派 */
  .hero-card {
    padding: 44px 32px;
  }
  .hero-card .hero-icon { font-size: 3.5rem; }
  .hero-card .hero-title { font-size: 2rem; }

  /* 下载页面：三栏布局 */
  .feature-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* 登录页：更宽 */
  .login-box { max-width: 480px; }

  /* 后台：更宽 + 居中 */
  #adminPanel {
    max-width: 1440px;
    margin: 0 auto 2%;
    min-height: calc(100vh - 2vw);
    height: auto;
    overflow: visible;
    display: grid;
    grid-template-columns: 180px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "header header"
      "nav main";
  }
  #adminPanel .admin-main .container {
    max-width: 100%;
    padding: 0 24px 24px 20px;
  }
  #adminPanel .admin-nav {
    width: auto;
  }
  /* 电脑端表格高度自适应，内容显示完整 */
  .admin-table {
    max-height: none;
  }
  /* 电脑端admin-main不限制高度，随内容展开 */
  #adminPanel .admin-main {
    overflow-y: visible;
  }
  /* 用户表8列：昵称|邮箱|角色|VIP|积分|群数|注册时间|操作(不换行) */
  #tab-users .admin-row {
    grid-template-columns: 0.9fr 1.6fr 0.7fr 0.6fr 0.45fr 0.5fr 0.8fr 460px;
    min-width: 1240px;
  }
  /* 财务表列宽调整 */
  #tab-finance .admin-row {
    grid-template-columns: 2fr 2.2fr 1fr 0.8fr 1fr 1.5fr 0.8fr;
    min-width: 100%;
  }
  /* 操作列按钮不换行 */
  .admin-row > span:last-child {
    flex-wrap: nowrap;
    overflow: visible;
  }
}

@media (min-width: 1440px) {
  :root {
    --max-width: 920px;
  }
  .login-box { max-width: 500px; }

  /* 后台：更大屏幕更宽 */
  #adminPanel {
    max-width: 1680px;
    margin: 0 auto 2%;
    min-height: calc(100vh - 2vw);
    height: auto;
    overflow: visible;
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "header header"
      "nav main";
  }
  #adminPanel .admin-nav {
    width: auto;
  }
  #adminPanel .admin-main .container {
    padding: 0 28px 28px 24px;
  }
  #tab-users .admin-row {
    grid-template-columns: 0.9fr 1.6fr 0.7fr 0.6fr 0.45fr 0.5fr 0.8fr 460px;
    min-width: 1240px;
  }
  #tab-finance .admin-row {
    grid-template-columns: 2fr 2.5fr 1fr 0.8fr 1fr 1.5fr 0.8fr;
    min-width: 100%;
  }
}

/* ===== 会员中心（我的）微信式分组列表 ===== */
/* 暗灰背景 + 白色圆角分组卡片，模仿微信「我」页布局 */
.wx-page {
  padding: 0 0 20px;
}
/* 分组标题（小灰字） */
.wx-group-title {
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 16px 16px 6px;
}
/* 白色圆角分组卡片 */
.wx-group {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(31,42,68,0.04);
}
/* 列表行项 */
.wx-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--surface);
  position: relative;
  font-size: 0.92rem;
  color: var(--text);
  gap: 12px;
}
.wx-item + .wx-item::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--border);
}
.wx-item:active { background: var(--surface2); }
.wx-item:last-child { border-bottom: none; }
/* 左侧图标 */
.wx-ico {
  font-size: 1.05rem;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  line-height: 1;
}
/* 中间文字（可变长，右侧箭头固定） */
.wx-label {
  flex: 1;
  min-width: 0;
}
/* 右侧箭头 */
.wx-arrow {
  color: var(--text-dim);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1;
  font-family: system-ui, sans-serif;
  flex-shrink: 0;
}
/* 红色危险项（注销账号） */
.wx-item.wx-danger .wx-label,
.wx-item.wx-danger .wx-ico { color: var(--danger); }
.wx-item.wx-danger .wx-label { font-weight: 600; }

/* 顶部资料卡（微信「我」顶部头像+昵称卡片） */
.wx-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(31,42,68,0.04);
}
.wx-profile-card:active { background: var(--surface2); }
.wx-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--primary);
}
.wx-profile-main { flex: 1; min-width: 0; }
.wx-profile-name {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wx-profile-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* 财务中心包裹卡片 */
.wx-finance-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(31,42,68,0.04);
}

/* ===== 统一弹窗（微信风格）===== */
.modal {
  animation: modalSlideUp 0.2s ease-out;
  border-radius: 16px 16px 0 0;
}
@keyframes modalSlideUp {
  from { transform: translateY(24px); opacity: 0.5; }
  to   { transform: none;           opacity: 1;   }
}
@media (min-width: 768px) {
  .modal { border-radius: 16px; }
}
/* 弹窗内按钮统一：主=品牌蓝 / 危险=红 / 次=灰 */
.modal .btn-primary { background: var(--primary); }
.modal .btn-primary:hover { background: var(--primary-hover); }
.modal .btn-primary:active { transform: scale(0.97); }
.modal .btn-danger { background: #FA5151; }
.modal .btn-danger:hover { background: #E03C3C; }
/* 统一警示提示条 */
.modal-tip {
  padding: 12px 14px;
  background: rgba(250, 173, 20, 0.08);
  border: 1px solid rgba(250, 173, 20, 0.28);
  border-radius: 10px;
  margin-bottom: 12px;
}
.modal-tip-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #E6A23C;
  margin-bottom: 6px;
}
.modal-tip ol {
  margin: 0;
  padding-left: 18px;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.7;
}
.modal-tip strong { color: var(--text); }
.modal-tip .hl { color: #E6A23C; }
/* 统一弹窗：正文与按钮行 */
.modal-body {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.7;
  white-space: pre-line;
  word-break: break-word;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.modal-actions .btn { flex: 1; }
