/* ═══════════════════════════════════════════════════
   QT聊天室 V3 — 微信风格重构版
   ═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: #EDEDED; color: #1A1A1A; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }
img { max-width: 100%; display: block; }

/* ─── 微信风格变量 ──────────────────────────────── */
:root {
  /* 微信绿主题 */
  --wechat-green: #07C160;
  --wechat-green-dark: #06AD56;
  --wechat-green-light: #E8F8EE;
  --primary: var(--wechat-green);
  --primary-dark: var(--wechat-green-dark);
  --primary-light: var(--wechat-green-light);
  
  /* 辅助色 */
  --secondary: #576B95;
  --accent: #F5A623;
  --success: #07C160;
  --error: #FA5151;
  --warn: #F5A623;
  --info: #1296DB;
  
  /* 背景色 */
  --bg: #EDEDED;
  --bg-light: #F5F5F5;
  --card: #FFFFFF;
  --border: #B2B2B2;
  --border-light: #E5E5E5;
  
  /* 文字色 */
  --text: #1A1A1A;
  --text-sub: #576B95;
  --text-muted: #B2B2B2;
  --text-light: #FFFFFF;
  
  /* 尺寸 */
  --header-h: 56px;
  --bottom-nav-h: 56px;
  --radius: 8px;
  --radius-sm: 6px;
  
  /* 阴影 */
  --shadow: 0 1px 2px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

/* ─── 滚动条 ───────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 5px; height: 5px; background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── Toast ─────────────────────────────── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.8); color: #fff; padding: 10px 20px; border-radius: 24px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 9999; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: rgba(34,197,94,.9); }
.toast.error   { background: rgba(239,68,68,.9); }
.toast.info    { background: rgba(6,182,212,.9); }

/* ─── 通用 Modal ─────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-box {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}
.modal-box.compact { max-width: 340px; }
.modal-box.post-box { max-width: 560px; }
@keyframes modalIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; color: var(--text-muted); font-size: 18px; padding: 4px 8px; border-radius: 6px; transition: background .2s; }
.modal-close:hover { background: var(--bg); }
.modal-close-abs { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,.2); color: #fff; width: 28px; height: 28px; border-radius: 50%; font-size: 14px; }

/* ─── 表单 ──────────────────────────────── */
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; font-weight: 500; }
.form-control {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: #fff; transition: border .2s;
}
.form-control:focus { border-color: var(--primary); }
.btn-save {
  width: 100%; padding: 12px; background: var(--primary); color: #fff;
  border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; transition: background .2s;
}
.btn-save:hover { background: var(--primary-dark); }
.btn-xs {
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; transition: all .2s;
}
.btn-outline { border: 1.5px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary-light); }
.btn-warn { border: 1.5px solid var(--warn); color: var(--warn); background: transparent; }
.btn-success { border: 1.5px solid var(--success); color: var(--success); background: transparent; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-sm { padding: 6px 14px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 13px; }
.btn-action {
  display: inline-block; padding: 8px 16px; border-radius: 20px;
  background: var(--primary-light); color: var(--primary); font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all .2s; border: none;
}
.btn-action:hover { background: var(--primary); color: #fff; }
.btn-action.btn-warn { background: #fff3e0; color: var(--warn); }
.btn-edit-profile {
  padding: 8px 18px; border-radius: 20px; border: 1.5px solid var(--primary);
  color: var(--primary); font-size: 13px; font-weight: 600; background: transparent;
  margin-top: 8px; cursor: pointer; transition: all .2s;
}
.btn-edit-profile:hover { background: var(--primary); color: #fff; }

/* ─── 导航 Header ─────────────────────────── */
.nav-header {
  position: sticky; top: 0; z-index: 100; background: #fff;
  height: var(--header-h); display: flex; align-items: center;
  justify-content: space-between; padding: 0 16px;
  border-bottom: 1px solid var(--border); box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.nav-header h2 { font-size: 17px; font-weight: 700; flex: 1; text-align: center; }
.nav-back { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--text-sub); }
.nav-back:hover { background: var(--bg); }
.hd-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--text-sub); background: none; }
.hd-btn:hover { background: var(--bg); color: var(--primary); }

/* ─── 移动端底部导航 ─────────────────────── */
.mobile-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  height: var(--bottom-nav-h); background: #fff;
  border-top: 1px solid var(--border); display: flex;
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}
.mobile-bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; color: var(--text-muted);
  font-size: 11px; transition: color .2s;
}
.mobile-bottom-nav a i { font-size: 20px; }
.mobile-bottom-nav a.active { color: var(--primary); }
.mobile-bottom-nav a:hover { color: var(--primary); }
body.app-page { padding-bottom: var(--bottom-nav-h); }

/* ─── 通用空状态 ─────────────────────────── */
.empty-hint { text-align: center; color: var(--text-muted); padding: 32px 16px; font-size: 14px; }
.hidden { display: none !important; }

/* ═══════════════ INDEX PAGE ═══════════════════════ */
.index-page { background: linear-gradient(135deg, #f5f7fa 0%, #e8ecff 100%); }
.main-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  height: var(--header-h); box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.main-header-inner { max-width: 1100px; margin: 0 auto; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.logo-area { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 18px; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.header-right { display: flex; align-items: center; gap: 12px; }
.hd-link { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--text-sub); }
.hd-link:hover { background: var(--bg); color: var(--primary); }
.coins-chip { background: linear-gradient(135deg,#f59e0b,#fbbf24); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 700; font-size: 14px; padding: 0 4px; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 12px; border-radius: 24px; background: var(--bg); position: relative; user-select: none; }
.chip-avatar, .chip-avatar-placeholder { width: 28px; height: 28px; border-radius: 50%; }
.chip-avatar { object-fit: cover; }
.chip-avatar-placeholder { background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }
.chip-name { font-size: 13px; font-weight: 600; }
.user-menu {
  position: absolute; top: calc(100% + 6px); right: 0; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 6px;
  min-width: 160px; box-shadow: var(--shadow-lg); z-index: 200;
}
.user-menu a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--text); transition: background .15s; }
.user-menu a:hover { background: var(--bg); }
.user-menu .logout-link { color: var(--error); }
.btn-login-top { padding: 8px 18px; background: var(--primary); color: #fff; border-radius: 20px; font-size: 13px; font-weight: 600; }

/* Hero */
.hero-section { text-align: center; padding: 48px 16px 32px; }
.hero-title { font-size: 32px; font-weight: 900; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 8px; }
.hero-sub { color: var(--text-sub); font-size: 16px; margin-bottom: 24px; }
.search-hero-wrap { display: flex; gap: 0; max-width: 440px; margin: 0 auto 16px; border: 1.5px solid var(--border); border-radius: 30px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.search-hero-wrap input { flex: 1; padding: 12px 18px; border: none; font-size: 14px; color: var(--text); }
.search-hero-wrap button { padding: 12px 20px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.btn-create-room { margin-top: 8px; padding: 10px 24px; background: linear-gradient(135deg,var(--primary),var(--secondary)); color: #fff; border-radius: 24px; font-size: 14px; font-weight: 700; box-shadow: 0 4px 16px rgba(102,126,234,.3); transition: transform .2s; }
.btn-create-room:hover { transform: translateY(-2px); }

/* Stats bar */
.stats-bar { display: flex; justify-content: center; gap: 16px; padding: 0 16px 20px; flex-wrap: wrap; }
.stat-chip { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 6px 16px; font-size: 13px; color: var(--text-sub); display: flex; align-items: center; gap: 6px; }

/* Rooms */
.rooms-container { max-width: 1100px; margin: 0 auto; padding: 0 16px 80px; }
.rooms-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.rooms-title { font-size: 20px; font-weight: 800; }
.sort-tabs { display: flex; gap: 8px; }
.sort-tab { padding: 6px 14px; border-radius: 16px; font-size: 13px; font-weight: 500; color: var(--text-sub); background: #fff; border: 1px solid var(--border); transition: all .2s; }
.sort-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.room-card {
  background: #fff; border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); border: 1px solid transparent; cursor: pointer;
  transition: all .25s; display: flex; flex-direction: column; gap: 10px;
}
.room-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.rc-top { display: flex; gap: 12px; align-items: center; }
.rc-avatar { width: 48px; height: 48px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.rc-avatar-placeholder { width: 48px; height: 48px; border-radius: var(--radius-sm); background: linear-gradient(135deg,var(--primary),var(--secondary)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; font-weight: 700; flex-shrink: 0; }
.rc-info { min-width: 0; }
.rc-name { font-size: 15px; font-weight: 700; truncate: overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.rc-number { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rc-desc { font-size: 13px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.rc-arrow { color: var(--primary); }

/* ═══════════════ CHAT PAGE ═══════════════════════ */
.chat-page { background: #f0f2f5; overflow: hidden; height: 100vh; padding: 0; }
.chat-layout { display: flex; height: 100vh; overflow: hidden; }

/* 成员侧边栏 */
.members-sidebar {
  width: 240px; background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto; flex-shrink: 0;
  transition: transform .3s;
}
.sidebar-hd { padding: 12px; border-bottom: 1px solid var(--border); }
.room-info-mini { display: flex; align-items: center; gap: 10px; }
.room-avatar-wrap { width: 38px; height: 38px; flex-shrink: 0; }
.room-avatar { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; }
.room-avatar-placeholder { width: 38px; height: 38px; border-radius: 8px; background: linear-gradient(135deg,var(--primary),var(--secondary)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.room-name-sm { font-size: 14px; font-weight: 700; }
.room-number-sm { font-size: 12px; color: var(--text-muted); }
.sidebar-section { padding: 12px; border-bottom: 1px solid var(--border); }
.sidebar-section-title { font-size: 12px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.room-announcement { font-size: 13px; color: var(--text-sub); line-height: 1.5; }
.member-item { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-radius: 8px; cursor: pointer; position: relative; transition: background .15s; }
.member-item:hover { background: var(--bg); }
.member-name { font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #ccc; flex-shrink: 0; }

/* 主聊天区 */
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.chat-header {
  height: var(--header-h); display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,.06); flex-shrink: 0;
}
.hd-center { flex: 1; min-width: 0; text-align: center; }
.hd-title { font-size: 16px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-sub { font-size: 12px; color: var(--text-muted); }
.hd-right { display: flex; gap: 4px; }

/* 搜索条 */
.search-bar-msg { display: flex; gap: 8px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--border); }
.search-bar-msg input { flex: 1; padding: 7px 12px; border: 1.5px solid var(--border); border-radius: 20px; font-size: 13px; }
.search-bar-msg button { padding: 6px 14px; border-radius: 16px; background: var(--primary); color: #fff; font-size: 13px; }

/* 消息列表 — 微信风格气泡 */
.message-list { flex: 1; overflow-y: auto; padding: 12px 8px; display: flex; flex-direction: column; gap: 8px; background: #EDEDED; }
.message-item { display: flex; gap: 8px; max-width: 75%; animation: msgIn .2s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.message-item.other { align-self: flex-start; flex-direction: row; }
.message-item.self { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar-wrap { flex-shrink: 0; }
.msg-avatar-wrap img, .msg-avatar-wrap div { width: 40px; height: 40px; border-radius: 6px; }
.msg-content { display: flex; flex-direction: column; max-width: 100%; }
.msg-meta { margin-bottom: 4px; padding: 0 4px; }
.msg-name { font-size: 12px; color: #B2B2B2; font-weight: 400; }
.msg-name.name-owner { color: #F5A623 !important; }
.msg-name.name-admin { color: #07C160 !important; }
.msg-bubble-wrap { display: flex; align-items: flex-end; gap: 6px; max-width: 100%; }
.message-item.self .msg-bubble-wrap { flex-direction: row-reverse; }

/* 微信风格气泡 */
.msg-bubble {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.6;
  word-break: break-word;
  max-width: 100%;
  position: relative;
  cursor: default;
  min-width: 60px;
  transition: transform .15s;
}
.msg-bubble:active { transform: scale(0.98); }

/* 对方消息 — 白色气泡 */
.message-item.other .msg-bubble {
  background: #FFFFFF;
  color: #1A1A1A;
  border-top-left-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
/* 自己消息 — 微信绿气泡 */
.message-item.self .msg-bubble {
  background: #95EC69;
  color: #1A1A1A;
  border-top-right-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
/* 撤回消息 */
.msg-bubble.recalled {
  background: transparent !important;
  color: #B2B2B2 !important;
  font-style: italic;
  font-size: 13px;
  box-shadow: none !important;
}
.recalled-msg { font-style: italic; color: #B2B2B2; font-size: 13px; }

/* 时间戳 */
.msg-time { font-size: 11px; color: #B2B2B2; white-space: nowrap; margin: 2px 4px; }

/* 消息内链接 */
.msg-link { color: #576B95; text-decoration: underline; word-break: break-all; }

/* 消息内图片 */
.msg-img { max-width: 200px; max-height: 200px; border-radius: 4px; object-fit: cover; cursor: pointer; }
.msg-video { max-width: 240px; border-radius: 4px; }

/* 语音消息 */
.msg-audio-player { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 100px; }
.msg-audio-player audio { max-width: 140px; height: 36px; }
.msg-voice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 6px;
  background: #FFFFFF;
  color: #1A1A1A;
  cursor: pointer;
  font-size: 14px;
  min-width: 80px;
}
.message-item.self .msg-voice {
  background: #95EC69;
  color: #1A1A1A;
}

/* 红包消息 */
.msg-redpacket { background: linear-gradient(135deg,#d4380d,#ff7a45); color: #fff; border-radius: 12px; padding: 14px 18px; cursor: pointer; min-width: 160px; transition: transform .2s; }
.msg-redpacket:hover { transform: scale(1.02); }
.rp-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rp-icon { font-size: 24px; }
.rp-label { font-size: 14px; font-weight: 700; }
.rp-greeting { font-size: 13px; opacity: .9; }
.rp-foot { font-size: 11px; opacity: .7; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.2); padding-top: 6px; }

/* 右键菜单 */
.msg-ctx-menu {
  position: fixed; background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); z-index: 9000; overflow: hidden; min-width: 120px;
}
.msg-ctx-menu div { padding: 10px 16px; font-size: 14px; cursor: pointer; transition: background .15s; }
.msg-ctx-menu div:hover { background: var(--bg); }

/* @提及面板 */
.at-mention-panel {
  position: absolute; bottom: 80px; left: 12px; right: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); max-height: 200px; overflow-y: auto; z-index: 100;
}
.at-item { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; transition: background .15s; font-size: 14px; }
.at-item:hover { background: var(--bg); }

/* 输入区 */
.chat-input-area { background: #fff; border-top: 1px solid var(--border); flex-shrink: 0; padding: 8px 12px; }
.input-toolbar { display: flex; gap: 2px; align-items: center; padding-bottom: 8px; }
.tool-btn { width: 34px; height: 34px; border-radius: 8px; background: none; color: var(--text-sub); font-size: 18px; display: flex; align-items: center; justify-content: center; transition: background .15s; flex-shrink: 0; }
.tool-btn:hover { background: var(--bg); color: var(--primary); }
.tool-btn.recording { background: var(--error); color: #fff; animation: pulse 1s infinite; }
.rp-btn { font-size: 20px; }
.input-row { display: flex; gap: 8px; align-items: flex-end; }
#msgInput { flex: 1; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 22px; font-size: 14px; resize: none; max-height: 100px; line-height: 1.4; background: var(--bg); transition: border .2s; }
#msgInput:focus { border-color: var(--primary); background: #fff; }
.send-btn { padding: 10px 20px; background: var(--primary); color: #fff; border-radius: 22px; font-size: 14px; font-weight: 700; flex-shrink: 0; transition: background .2s; }
.send-btn:hover { background: var(--primary-dark); }

/* Emoji picker */
.emoji-wrap { position: relative; }
.emoji-picker {
  position: absolute; bottom: 42px; left: 0; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 8px;
  width: 240px; display: flex; flex-wrap: wrap; gap: 2px;
  box-shadow: var(--shadow-lg); z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.emoji-picker.active { opacity: 1; pointer-events: all; }
.emoji-item { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; border-radius: 6px; transition: background .15s; }
.emoji-item:hover { background: var(--bg); }

/* 红包Modal */
.rp-modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 360px; overflow: hidden; animation: modalIn .25s ease; }
.rp-modal-top { background: linear-gradient(135deg,#d4380d,#ff7a45); padding: 24px 20px; text-align: center; position: relative; }
.rp-lantern { font-size: 48px; display: block; }
.rp-modal-title { color: #fff; font-size: 18px; font-weight: 800; margin-top: 6px; }
.rp-modal-body { padding: 20px; }
.rp-form-item { margin-bottom: 14px; }
.rp-form-item label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.rp-form-item input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; }
.rp-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.rp-send-btn { width: 100%; padding: 13px; background: linear-gradient(135deg,#d4380d,#ff7a45); color: #fff; border-radius: 10px; font-size: 15px; font-weight: 700; margin-top: 8px; transition: opacity .2s; }
.rp-send-btn:hover { opacity: .9; }

/* 群设置 */
.room-settings-body { padding: 16px 20px; }
.settings-section-title { font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; margin-top: 4px; }
.member-manage-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--bg); flex-wrap: wrap; }
.member-manage-row > span { flex: 1; font-size: 13px; }
.member-actions { display: flex; gap: 4px; }
.checkbox-item label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

/* 用户信息卡 */
.user-info-card { padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.uic-role { font-size: 12px; color: var(--text-muted); }
.uic-name { font-size: 18px; font-weight: 700; }
.uic-bio { font-size: 13px; color: var(--text-sub); }
.uic-meta { font-size: 12px; color: var(--text-muted); }
.uic-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }

/* PM modal */
.pm-list { max-height: 300px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.pm-msg { display: flex; gap: 6px; }
.pm-self { justify-content: flex-end; }
.pm-other { justify-content: flex-start; }
.pm-bubble { padding: 8px 14px; border-radius: 16px; font-size: 14px; max-width: 200px; word-break: break-word; }
.pm-self .pm-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.pm-other .pm-bubble { background: #f0f2f5; border-bottom-left-radius: 4px; }
.pm-read { font-size: 11px; color: var(--text-muted); align-self: flex-end; }
.pm-input-row { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.pm-input-row input { flex: 1; padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 20px; font-size: 14px; }
.pm-input-row button { padding: 9px 18px; background: var(--primary); color: #fff; border-radius: 20px; font-size: 14px; font-weight: 600; }

/* PM window (friends page) */
.pm-window { display: flex; flex-direction: column; height: 100%; }
.pm-header { padding: 16px; font-size: 16px; font-weight: 700; border-bottom: 1px solid var(--border); }
.pm-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.pm-footer { padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.pm-footer textarea { flex: 1; padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 16px; font-size: 14px; resize: none; }
.pm-send-btn { padding: 9px 18px; background: var(--primary); color: #fff; border-radius: 16px; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.pm-read-status { font-size: 11px; color: var(--text-muted); }

/* 读数 */
.read-count { font-size: 10px; color: var(--text-muted); }

@media (max-width: 640px) {
  .members-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 300; transform: translateX(-100%); }
  .members-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .chat-input-area { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}

/* ═══════════════ FRIENDS PAGE ═══════════════════ */
.friends-layout { display: flex; height: calc(100vh - var(--header-h) - var(--bottom-nav-h)); overflow: hidden; }
.friends-left { width: 260px; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: #fff; flex-shrink: 0; overflow: hidden; }
.friends-right { flex: 1; overflow-y: auto; background: #fafafa; }
.friends-tabs { display: flex; border-bottom: 1px solid var(--border); }
.ftab { flex: 1; padding: 12px 0; font-size: 13px; font-weight: 600; color: var(--text-sub); background: none; border-bottom: 2px solid transparent; transition: all .2s; }
.ftab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { flex: 1; overflow-y: auto; }
.search-input-wrap { padding: 10px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.search-input-wrap i { color: var(--text-muted); font-size: 14px; }
.search-input-wrap input { flex: 1; border: none; font-size: 14px; background: transparent; color: var(--text); }
.friend-group-title { padding: 8px 12px 4px; font-size: 12px; font-weight: 700; color: var(--text-muted); background: var(--bg); }
.friend-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; transition: background .15s; }
.friend-row:hover { background: var(--bg); }
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.friend-bio { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-ops { display: flex; gap: 4px; flex-shrink: 0; }
.icon-btn { width: 28px; height: 28px; border-radius: 50%; background: none; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; transition: background .15s; }
.icon-btn:hover { background: var(--bg); color: var(--primary); }
.icon-btn.danger:hover { color: var(--error); }
.online-badge { width: 8px; height: 8px; border-radius: 50%; }
.online-badge.on { background: var(--success); }
.online-badge.off { background: #ccc; }
.request-row { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); }
.request-info { flex: 1; min-width: 0; }
.request-name { font-size: 14px; font-weight: 600; }
.request-bio { font-size: 12px; color: var(--text-muted); }
.request-ops { display: flex; gap: 6px; flex-shrink: 0; }
.btn-accept { padding: 6px 12px; background: var(--success); color: #fff; border-radius: 16px; font-size: 13px; font-weight: 600; }
.btn-reject { padding: 6px 12px; background: var(--error); color: #fff; border-radius: 16px; font-size: 13px; font-weight: 600; }
.chat-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); gap: 12px; }
@media (max-width: 640px) {
  .friends-left { width: 100%; flex-shrink: 0; }
  .friends-right { display: none; }
}

/* ═══════════════ MOMENTS PAGE ══════════════════ */
.moments-cover { position: relative; height: 180px; overflow: hidden; margin-bottom: -40px; }
.cover-bg { width: 100%; height: 100%; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.cover-profile { position: absolute; bottom: 0; left: 16px; display: flex; align-items: flex-end; gap: 12px; padding-bottom: 0; }
.cover-avatar { width: 80px; height: 80px; border-radius: 50%; border: 3px solid #fff; object-fit: cover; box-shadow: var(--shadow); }
.cover-avatar-placeholder { width: 80px; height: 80px; border-radius: 50%; border: 3px solid #fff; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; font-weight: 700; }
.cover-name { font-size: 16px; font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.3); padding-bottom: 6px; }
.moments-tabs { display: flex; background: #fff; border-bottom: 1px solid var(--border); padding: 0 16px; margin-top: 44px; position: sticky; top: var(--header-h); z-index: 50; }
.mtab { flex: 1; padding: 14px 0; font-size: 14px; font-weight: 600; color: var(--text-sub); background: none; border-bottom: 2px solid transparent; transition: all .2s; }
.mtab.active { color: var(--primary); border-bottom-color: var(--primary); }
.moments-panel { max-width: 640px; margin: 0 auto; padding: 16px; }
.moment-card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.moment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; position: relative; }
.moment-meta { flex: 1; min-width: 0; }
.moment-author { font-size: 14px; font-weight: 700; color: var(--primary); }
.moment-time { display: block; font-size: 12px; color: var(--text-muted); }
.moment-del-btn { color: var(--text-muted); font-size: 16px; background: none; padding: 4px 8px; border-radius: 6px; transition: background .15s; }
.moment-del-btn:hover { background: var(--bg); color: var(--error); }
.moment-text { font-size: 15px; line-height: 1.6; color: var(--text); word-break: break-word; margin-bottom: 10px; }
.moment-images { display: grid; gap: 3px; margin-bottom: 10px; }
.moment-images.grid-1 { grid-template-columns: 1fr; max-width: 300px; }
.moment-images.grid-2 { grid-template-columns: repeat(2, 1fr); }
.moment-images.grid-3, .moment-images { grid-template-columns: repeat(3, 1fr); }
.moment-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; transition: opacity .2s; }
.moment-images img:hover { opacity: .9; }
.moment-actions { display: flex; gap: 16px; padding: 8px 0; border-top: 1px solid var(--bg); border-bottom: 1px solid var(--bg); margin: 6px 0; }
.action-btn { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-sub); background: none; padding: 4px 8px; border-radius: 8px; transition: background .15s; }
.action-btn:hover { background: var(--bg); color: var(--primary); }
.action-btn.liked { color: var(--primary); }
.like-names { font-size: 12px; color: var(--primary); padding: 4px 0; }
.comments-section { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.comment-item { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; }
.cmt-content { flex: 1; line-height: 1.4; }
.cmt-name { font-weight: 600; color: var(--primary); margin-right: 4px; }
.cmt-reply { color: var(--text-muted); font-size: 12px; margin-right: 4px; }
.cmt-text { color: var(--text); }
.cmt-reply-btn { font-size: 12px; color: var(--text-muted); background: none; padding: 2px 6px; }
.comment-input-row { display: flex; gap: 6px; margin-top: 8px; }
.cmt-inp { flex: 1; padding: 7px 12px; border: 1.5px solid var(--border); border-radius: 16px; font-size: 13px; }
.comment-input-row button { padding: 7px 14px; background: var(--primary); color: #fff; border-radius: 16px; font-size: 13px; }
/* 相册 */
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0; }
.album-item { aspect-ratio: 1; overflow: hidden; cursor: pointer; background: var(--bg); border-radius: 4px; }
.album-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.album-item:hover img { transform: scale(1.05); }
/* 说说 */
.diary-item { background: #fff; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.diary-date { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.diary-content { font-size: 15px; line-height: 1.6; color: var(--text); word-break: break-word; }
/* 发布Modal */
.post-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.post-tab { flex: 1; padding: 10px; font-size: 14px; font-weight: 600; color: var(--text-sub); background: none; border-bottom: 2px solid transparent; transition: all .2s; }
.post-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
#postContent { width: 100%; padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 15px; line-height: 1.6; resize: none; margin: 0 16px; width: calc(100% - 32px); }
.post-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 8px; }
.post-foot-left { display: flex; align-items: center; gap: 8px; }
.privacy-select { padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; }
.btn-post { padding: 9px 24px; background: var(--primary); color: #fff; border-radius: 20px; font-size: 14px; font-weight: 700; }
.images-preview { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.load-more-wrap { text-align: center; padding: 12px; }
.load-more-wrap button { padding: 8px 20px; background: var(--bg-light); color: var(--text-sub); border: 1px solid var(--border); border-radius: 20px; font-size: 13px; cursor: pointer; }
.load-more-wrap button:hover { background: var(--primary-light); color: var(--primary); }
.moment-more { color: var(--text-muted); font-size: 16px; background: none; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.moment-more:hover { background: var(--bg); color: var(--error); }
.preview-img-wrap { position: relative; width: 70px; height: 70px; }
.preview-img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }
.preview-del { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; background: var(--error); color: #fff; border-radius: 50%; font-size: 10px; display: flex; align-items: center; justify-content: center; }
/* 图片全屏预览 */
.img-preview-modal { background: rgba(0,0,0,.9); }
.img-preview-modal.active { opacity: 1; pointer-events: all; }
.img-preview-modal img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius-sm); }
.img-close-btn { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; background: rgba(255,255,255,.2); color: #fff; border-radius: 50%; font-size: 18px; display: flex; align-items: center; justify-content: center; z-index: 1; }

/* ═══════════════ PROFILE PAGE ══════════════════ */
.profile-card { position: relative; background: #fff; margin-bottom: 12px; padding-top: 1px; }
.profile-cover { height: 140px; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.profile-info-wrap { padding: 0 16px 20px; margin-top: -40px; display: flex; flex-direction: column; align-items: center; }
.profile-details { text-align: center; width: 100%; }
.profile-big-avatar { width: 80px; height: 80px; border-radius: 50%; border: 3px solid #fff; object-fit: cover; box-shadow: var(--shadow); margin-bottom: 8px; display: inline-block; }
.profile-big-avatar-placeholder { width: 80px; height: 80px; border-radius: 50%; border: 3px solid #fff; background: var(--primary); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.profile-name { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.profile-bio { font-size: 14px; color: var(--text-sub); margin-bottom: 6px; }
.profile-meta-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); margin-bottom: 12px; justify-content: center; }
.profile-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.profile-stats { display: flex; background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.stat-item { flex: 1; text-align: center; padding: 14px 0; }
.stat-num { font-size: 22px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-muted); }

/* ═══════════════ SETTINGS PAGE ════════════════ */
.settings-page { max-width: 600px; margin: 0 auto; padding: 16px; }
.settings-avatar-section { text-align: center; padding: 24px 0 16px; }
.settings-avatar-wrap { display: inline-block; position: relative; cursor: pointer; }
.settings-avatar { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary); }
.settings-avatar-placeholder { width: 90px; height: 90px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 34px; font-weight: 700; border: 3px solid #eee; }
.avatar-edit-badge { position: absolute; bottom: 2px; right: 2px; width: 26px; height: 26px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; border: 2px solid #fff; }
.avatar-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.settings-section { background: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.settings-section-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; }
.settings-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.settings-item label { font-size: 14px; font-weight: 500; flex-shrink: 0; min-width: 80px; }
.settings-input { flex: 1; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; color: var(--text); transition: border .2s; }
.settings-input:focus { border-color: var(--primary); }
.settings-val { font-size: 14px; color: var(--text-sub); }
.btn-save-settings { width: 100%; padding: 12px; background: var(--primary); color: #fff; border-radius: 10px; font-size: 15px; font-weight: 700; margin-top: 4px; transition: background .2s; }
.btn-save-settings:hover { background: var(--primary-dark); }
.settings-link-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; font-size: 14px; color: var(--text); border-bottom: 1px solid var(--bg); cursor: pointer; transition: color .2s; }
.settings-link-row:last-child { border-bottom: none; }
.settings-link-row:hover { color: var(--primary); }
.settings-link-row i { width: 20px; color: var(--text-muted); }
.settings-link-row .settings-val { margin-left: auto; font-size: 13px; color: var(--text-muted); }
.danger-link { color: var(--error) !important; }
.danger-link i { color: var(--error) !important; }

/* ═══════════════ COINS PAGE ════════════════════ */
.coins-hero { background: linear-gradient(135deg, var(--primary), var(--secondary)); padding: 32px 16px 24px; text-align: center; color: #fff; }
.coins-balance-wrap { margin-bottom: 16px; }
.coins-icon { font-size: 40px; margin-bottom: 4px; }
.coins-balance { font-size: 52px; font-weight: 900; line-height: 1; }
.coins-unit { font-size: 16px; opacity: .8; }
.checkin-btn { padding: 12px 28px; background: rgba(255,255,255,.2); color: #fff; border-radius: 24px; font-size: 15px; font-weight: 700; border: 2px solid rgba(255,255,255,.4); transition: all .2s; }
.checkin-btn:hover:not(:disabled) { background: rgba(255,255,255,.35); }
.checkin-btn.checked { opacity: .7; cursor: default; }
.checkin-btn:disabled { cursor: not-allowed; }
.coins-section { background: #fff; margin: 0 0 12px; padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow); }
.coins-section-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.recharge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.pkg-card { border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 12px 8px; text-align: center; cursor: pointer; position: relative; transition: all .2s; }
.pkg-card.selected { border-color: var(--primary); background: var(--primary-light); }
.pkg-card:hover { border-color: var(--primary); }
.pkg-coins { font-size: 22px; font-weight: 900; color: var(--text); }
.pkg-money { font-size: 14px; color: var(--text-sub); font-weight: 600; margin-top: 4px; }
.pkg-tag { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.pay-methods { display: flex; gap: 10px; margin-bottom: 14px; }
.pay-method-btn { flex: 1; padding: 10px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; background: none; color: var(--text-sub); transition: all .2s; }
.pay-method-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-recharge { width: 100%; padding: 13px; background: linear-gradient(135deg,var(--primary),var(--secondary)); color: #fff; border-radius: 12px; font-size: 15px; font-weight: 700; transition: opacity .2s; }
.btn-recharge:hover { opacity: .9; }
.recharge-note { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 8px; }
.coin-log-list { display: flex; flex-direction: column; gap: 8px; }
.coin-log-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bg); }
.log-left { flex: 1; min-width: 0; }
.log-type { font-size: 13px; font-weight: 600; }
.log-desc { font-size: 12px; color: var(--text-muted); }
.log-time { font-size: 11px; color: var(--text-muted); }
.log-amount { font-size: 18px; font-weight: 800; flex-shrink: 0; }
.log-amount.plus { color: var(--success); }
.log-amount.minus { color: var(--error); }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bg); }
.rank-num { font-size: 18px; font-weight: 800; width: 36px; text-align: center; flex-shrink: 0; }
.rank-name { flex: 1; font-size: 14px; font-weight: 600; }
.rank-coins { font-size: 14px; font-weight: 700; color: var(--accent); }
.pay-modal-body { padding: 24px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pay-qr-placeholder { width: 120px; height: 120px; background: var(--bg); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }

/* ═══════════════ LOGIN PAGE ════════════════════ */
.login-page { min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 20px; padding: 36px 28px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo-icon { font-size: 48px; display: block; margin-bottom: 6px; }
.login-logo-title { font-size: 22px; font-weight: 900; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-tabs { display: flex; margin-bottom: 24px; background: var(--bg); border-radius: 10px; padding: 4px; gap: 0; }
.login-tab { flex: 1; padding: 9px; font-size: 14px; font-weight: 600; color: var(--text-sub); background: none; border-radius: 8px; transition: all .2s; }
.login-tab.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .form-control { padding: 12px 16px; border-radius: 12px; border-color: #e0e0e0; }
.login-form .form-control:focus { border-color: var(--primary); }
.btn-login-submit { width: 100%; padding: 14px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border-radius: 12px; font-size: 16px; font-weight: 700; transition: transform .2s; }
.btn-login-submit:hover { transform: translateY(-1px); }
.login-other { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.login-other a { color: var(--primary); font-weight: 600; }

/* ═══════════════ ADMIN ══════════════════════════ */
.admin-body { background: #f0f2f5; margin: 0; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: #1a1a2e; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-logo { display: flex; align-items: center; gap: 10px; padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-logo .logo-icon { font-size: 24px; }
.admin-logo .logo-text { color: #fff; font-size: 15px; font-weight: 700; }
.admin-nav { flex: 1; padding: 12px 0; }
.admin-nav .nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: rgba(255,255,255,.6); font-size: 14px; transition: all .2s; cursor: pointer; }
.admin-nav .nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav .nav-item.active { background: var(--primary); color: #fff; }
.admin-nav .nav-item i { width: 16px; }
.admin-sidebar-foot { padding: 12px 0; border-top: 1px solid rgba(255,255,255,.08); }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.hamburger-btn { background: none; color: var(--text-sub); font-size: 18px; padding: 6px; border-radius: 6px; display: none; }
.admin-page-title { font-size: 18px; font-weight: 700; flex: 1; }
.admin-user-chip { font-size: 13px; color: var(--text-sub); }
.admin-content { flex: 1; padding: 20px; overflow-y: auto; }
.loading-spin { display: flex; justify-content: center; padding: 48px 0; color: var(--text-muted); }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { border-radius: var(--radius); padding: 20px; color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.stat-card.blue { background: linear-gradient(135deg,#667eea,#764ba2); }
.stat-card.green { background: linear-gradient(135deg,#22c55e,#16a34a); }
.stat-card.orange { background: linear-gradient(135deg,#f59e0b,#d97706); }
.stat-card.purple { background: linear-gradient(135deg,#8b5cf6,#7c3aed); }
.sc-num { font-size: 36px; font-weight: 900; line-height: 1; }
.sc-label { font-size: 13px; opacity: .8; margin-top: 4px; }
.sc-icon { position: absolute; right: 16px; top: 16px; font-size: 28px; opacity: .3; }
.chart-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.chart-card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.chart-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--text-sub); }
.admin-table-wrap { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.admin-table th { background: var(--bg); padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--text-sub); text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 10px 14px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }
.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; display: inline-block; }
.badge-admin { background: var(--primary-light); color: var(--primary); }
.badge-user  { background: #f0f0f0; color: #888; }
.badge-ok    { background: #dcfce7; color: #16a34a; }
.badge-banned{ background: #fee2e2; color: #b91c1c; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search-input { padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; min-width: 200px; }
.settings-card { background: #fff; border-radius: var(--radius); padding: 20px; max-width: 560px; box-shadow: var(--shadow); }
.table-title { padding: 14px 16px; font-size: 15px; font-weight: 700; border-bottom: 1px solid var(--border); }
.recalled-row td { color: var(--text-muted); font-style: italic; background: #fafafa; }
@media (max-width: 768px) {
  .admin-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 500; transform: translateX(-100%); transition: transform .3s; }
  .admin-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .hamburger-btn { display: flex; }
  .admin-topbar { padding: 0 12px; }
  .admin-content { padding: 12px; }
  .admin-table-wrap { overflow-x: auto; }
}

/* ═══════ @keyframes ══════════════════════════ */
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }

/* ═══════ 会员系统 ══════════════════════════ */
.vip-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.vip-plan-card { background: #fff; border: 2px solid #E5E5E5; border-radius: 8px; padding: 12px 8px; text-align: center; cursor: pointer; transition: all .2s; }
.vip-plan-card:hover { border-color: #07C160; transform: translateY(-2px); }
.vip-plan-card.selected { border-color: #07C160; background: #E8F8EE; }
.vip-plan-badge { font-size: 24px; margin-bottom: 4px; }
.vip-plan-name { font-size: 13px; font-weight: 700; color: #1A1A1A; margin-bottom: 2px; }
.vip-plan-price { font-size: 15px; font-weight: 800; color: #07C160; margin-bottom: 2px; }
.vip-plan-desc { font-size: 11px; color: #B2B2B2; }
.vip-badge { display: inline-block; background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.user-number { font-size: 12px; color: #B2B2B2; margin-top: 4px; }
.checkin-btn { width: 100%; padding: 12px; background: linear-gradient(135deg, #07C160, #06AD56); color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; transition: all .2s; }
.checkin-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(7,193,96,.3); }
.checkin-btn.checked, .checkin-btn:disabled { background: #B2B2B2; cursor: not-allowed; }
.coins-hero { background: linear-gradient(135deg, #07C160, #06AD56); border-radius: 12px; padding: 24px; text-align: center; color: #fff; margin-bottom: 20px; }
.coins-balance-wrap { margin-bottom: 12px; }
.coins-icon { font-size: 36px; margin-bottom: 8px; }
.coins-balance { font-size: 42px; font-weight: 900; }
.coins-unit { font-size: 14px; opacity: .8; }
