/* ==========================================
   主题变量配置区
   ========================================== */
:root {
  --primary: #38bdf8;
  --primary-gradient: linear-gradient(135deg, #38bdf8, #818cf8);
  --safe-top: 44px;
  
  /* 🟢 默认：夜间模式 */
  --bg-color: #020617;
  --text: #ffffff;
  --text-light: rgba(255, 255, 255, 0.6);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: rgba(0, 0, 0, 0.3);
  --card-bg: rgba(0, 0, 0, 0.2);
}

/* 🟢 白天模式配色 */
[data-theme="light"] {
  --bg-color: #f0f4f8;
  --text: #1e293b;
  --text-light: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: rgba(0, 0, 0, 0.05);
  --card-bg: rgba(255, 255, 255, 0.5);
}

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

html, body { 
  height: 100%; 
  background-color: var(--bg-color); 
  transition: background-color 0.4s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-color);
  color: var(--text);
  font-size: 15px;
  overflow: hidden;
  width: 100%; height: 100%;
}

/* 动态光晕背景 */
.bg-layer { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: -1; overflow: hidden; width: 100%; height: 100%; transition: opacity 0.4s; }
[data-theme="light"] .bg-layer { opacity: 0.3; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.6; animation: floatBlob 10s infinite alternate ease-in-out; }
.blob-1 { width: 300px; height: 300px; background: #0284c7; top: -10%; left: -10%; }
.blob-2 { width: 250px; height: 250px; background: #6d28d9; bottom: 10%; right: -10%; animation-delay: -3s; }
.blob-3 { width: 200px; height: 200px; background: #0ea5e9; top: 40%; left: 40%; animation-delay: -6s; }
@keyframes floatBlob { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(30px, 50px) scale(1.2); } }

/* 玻璃拟态通用类 */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 var(--glass-shadow);
  transition: background 0.4s, border 0.4s;
}

/* 页面基础 */
.page { display: none; height: 100%; flex-direction: column; overflow: hidden; }
.page.active { display: flex; }

/* 登录/注册 */
#page-login, #page-register { justify-content: center; align-items: center; padding: 24px; padding-top: 60px; overflow-y: auto; }
.auth-box { width: 100%; max-width: 360px; border-radius: 24px; padding: 36px 24px; flex-shrink: 0; }
.dynamic-logo { background: linear-gradient(90deg, #38bdf8, #a78bfa, #38bdf8); background-size: 200% 100%; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: flowLight 3s linear infinite; }
@keyframes flowLight { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.logo { font-size: 28px; text-align: center; margin-bottom: 8px; font-weight: bold; letter-spacing: 2px; }
.subtitle { text-align: center; color: var(--text-light); font-size: 13px; margin-bottom: 32px; }
.field { margin-bottom: 16px; }
.field input { width: 100%; padding: 14px 16px; border: 1px solid var(--glass-border); background: var(--card-bg); color: var(--text); border-radius: 12px; font-size: 15px; outline: none; transition: all .3s; }
.field input::placeholder { color: var(--text-light); }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 10px rgba(56, 189, 248, 0.2); }

/* 🟢 按钮样式 */
.btn-primary { width: 100%; padding: 14px; background: var(--primary-gradient); color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 8px; box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4); transition: transform 0.2s; }
.btn-primary:active { transform: scale(0.96); }

.btn-outline { 
  width: 100%; padding: 14px; 
  background: var(--glass-bg); color: var(--text); 
  border: 1px solid var(--glass-border); border-radius: 12px; font-size: 16px; cursor: pointer; transition: all 0.2s; 
}
.btn-outline:active { background: var(--card-bg); }

/* 🟢 解决白天模式白底白字的问题 */
.btn-outline.glass {
  background: rgba(255, 255, 255, 0.85);
  color: #1e293b !important; 
  border: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
[data-theme="dark"] .btn-outline.glass {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff !important; 
  border: 1px solid rgba(255,255,255,0.2) !important;
}

.switch { text-align: center; color: var(--text-light); font-size: 13px; margin-top: 20px; }
.switch a { color: var(--primary); text-decoration: none; font-weight: 500; }

/* 顶栏 */
.topbar { 
  position: absolute; top: 0; left: 0; right: 0; 
  height: calc(var(--safe-top) + 56px); padding-top: var(--safe-top); 
  display: flex; align-items: center; justify-content: space-between; 
  padding-left: 15px; padding-right: 15px; 
  font-weight: 600; font-size: 17px; z-index: 100;
  background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: none; box-shadow: none; transition: background 0.4s;
}
.icon-btn { width: 36px; height: 36px; border: none; background: var(--card-bg); border-radius: 50%; color: var(--text); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; transition: background 0.2s; }
.icon-btn:active { background: var(--glass-border); }
@keyframes spinIcon { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.icon-btn.loading svg { animation: spinIcon 0.6s linear infinite; }

/* ==========================================
   🟢 主页专属炫酷 Logo 进阶特效
   ========================================== */
.home-brand-logo {
  display: inline-flex;
  align-items: center;
  font-size: 23px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 20%, #c084fc 40%, #f472b6 60%, #ffffff 80%, #00f2fe 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: cyberFlow 4s linear infinite;
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.4));
}
@keyframes cyberFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
.wave-icon {
  display: inline-block;
  margin-right: 6px;
  -webkit-text-fill-color: initial;
  animation: waveShake 2.5s ease-in-out infinite;
}
@keyframes waveShake {
  0% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(10deg) translateY(-2px); }
  50% { transform: rotate(0deg) translateY(0); }
  75% { transform: rotate(-10deg) translateY(2px); }
  100% { transform: rotate(0deg) translateY(0); }
}
[data-theme="dark"] .home-brand-logo {
  filter: drop-shadow(0 0 10px rgba(192, 132, 252, 0.7)) drop-shadow(0 0 3px rgba(0, 242, 254, 0.6));
}

/* ==========================================
   主页横向滚动公告
   ========================================== */
.notice-bar {
  position: absolute;
  top: calc(var(--safe-top) + 56px); left: 0; right: 0; height: 34px; 
  display: flex; align-items: center; padding: 0 20px; z-index: 99;
  background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  border: none !important; box-shadow: none !important; border-radius: 0; overflow: hidden;
  transition: opacity 0.5s ease;
}
.notice-icon { font-size: 14px; margin-right: 8px; flex-shrink: 0; animation: pulseIcon 2s infinite; }
@keyframes pulseIcon { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }
.notice-content-wrapper { flex: 1; overflow: hidden; position: relative; height: 100%; display: flex; align-items: center; }
.notice-content { white-space: nowrap; font-size: 13px; font-weight: 600; color: #ef4444; position: absolute; cursor: default; }
[data-theme="dark"] .notice-content { color: #f87171; }
@keyframes marqueeOnce {
  0% { transform: translateX(var(--start-x, 100vw)); opacity: 1; }
  92% { transform: translateX(var(--end-x, -100%)); opacity: 1; }
  100% { transform: translateX(var(--end-x, -100%)); opacity: 0; }
}

/* ==========================================
   内容区与首页高度调整
   ========================================== */
.content { flex: 1; overflow-y: auto; padding: 110px 20px 100px 20px; }

#page-home .content { padding-top: 145px; padding-bottom: 140px; transition: padding-top 0.5s ease; }
#page-home .content.no-notice { padding-top: 120px; }

/* 🟢 全局卡片质感 */
.card { border-radius: 20px; padding: 24px; margin-bottom: 20px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03); }
.card h3 { font-size: 16px; margin-bottom: 16px; font-weight: 600; }

.card textarea { 
  width: 100%; height: 100px; padding: 16px; 
  border: 1px solid rgba(150, 150, 150, 0.1); 
  background: rgba(0, 0, 0, 0.02); 
  border-radius: 16px; font-size: 15px; 
  line-height: 1.5; resize: none; outline: none; 
  color: var(--text); font-family: inherit; margin-bottom: 8px;
  transition: all 0.3s;
}
.card textarea::placeholder { color: var(--text-light); }
.card textarea:focus { 
  background: transparent; border-color: var(--primary); 
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15); 
}
.hint { color: var(--text-light); font-size: 13px; margin-bottom: 14px; }

/* 标签选择 */
.tag-select-group { display: flex; gap: 12px; margin-bottom: 14px; }
.mini-select { padding: 8px 12px; border-radius: 10px; font-size: 13px; color: var(--text); outline: none; appearance: none; background: var(--glass-bg); border: 1px solid var(--glass-border); }
.mini-select option { background: var(--bg-color); color: var(--text); }

/* 捡到的瓶子 */
.bottle-item { background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.15)); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: 16px; padding: 20px; margin-top: 16px; animation: fadeUp .4s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.bottle-header { display: flex; align-items: center; margin-bottom: 14px; }
.bottle-avatar { width: 44px; height: 44px; border-radius: 50%; margin-right: 12px; object-fit: cover; border: 2px solid var(--glass-border); }
.nickname { font-weight: 600; font-size: 15px; }
.time { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.bottle-text { font-size: 15px; line-height: 1.6; word-break: break-word; margin-top: 8px; }
.bottle-tags { display: flex; gap: 8px; margin-bottom: 8px; }
.bottle-tags span { font-size: 12px; background: var(--glass-bg); padding: 4px 10px; border-radius: 20px; }
.empty { text-align: center; color: var(--text-light); padding: 30px; font-size: 14px; }

/* ==========================================
   🟢 首页三大功能图标强化版
   ========================================== */
.card-title { display: flex; align-items: center; margin-bottom: 16px; }
.card-title h3 { margin-bottom: 0 !important; font-size: 17px; color: var(--text); }
.icon-box { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-right: 14px; color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); }
.icon-box svg { width: 24px; height: 24px; }
.icon-throw { background: linear-gradient(135deg, #38bdf8, #3b82f6); box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4); }
.icon-pick { background: linear-gradient(135deg, #2dd4bf, #0ea5e9); box-shadow: 0 4px 15px rgba(45, 212, 191, 0.4); }
.icon-my { background: linear-gradient(135deg, #a78bfa, #8b5cf6); box-shadow: 0 4px 15px rgba(167, 139, 250, 0.4); }
[data-theme="dark"] .icon-box { border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.3), 0 4px 15px rgba(0, 0, 0, 0.4); }

/* ==========================================
   🟢 自定义选择器 (天气/心情)
   ========================================== */
.custom-select-btn { padding: 10px 18px; border-radius: 14px; font-size: 14px; color: var(--text); background: rgba(150, 150, 150, 0.1); border: none; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.custom-select-btn:active { transform: scale(0.95); background: rgba(56, 189, 248, 0.15); color: var(--primary); }

/* ==========================================
   🟢 专属捡瓶子按钮样式
   ========================================== */
#btnPick, .btn-pick {
  width: 100%; padding: 14px; background: rgba(45, 212, 191, 0.1);
  color: #0ea5e9; border: 1px dashed rgba(45, 212, 191, 0.5); border-radius: 14px;
  font-size: 16px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; box-shadow: 0 4px 12px rgba(45, 212, 191, 0.05); margin-top: 10px;
}
[data-theme="light"] #btnPick, [data-theme="light"] .btn-pick {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.1), rgba(14, 165, 233, 0.1));
  color: #0284c7;
}
#btnPick:active, .btn-pick:active {
  transform: scale(0.97); background: linear-gradient(135deg, rgba(45, 212, 191, 0.25), rgba(14, 165, 233, 0.25));
  box-shadow: 0 2px 6px rgba(45, 212, 191, 0.1);
}
#btnThrow { box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3); margin-top: 12px; }

/* ==========================================
   弹窗遮罩与选项
   ========================================== */
.picker-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 1000; display: flex; flex-direction: column; justify-content: flex-end; opacity: 0; transition: opacity 0.3s ease; }
.picker-modal-content { background: var(--bg-color); border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); box-shadow: 0 -8px 32px rgba(0,0,0,0.2); padding-bottom: env(safe-area-inset-bottom); }
[data-theme="dark"] .picker-modal-content { background: #0f172a; }
.picker-modal-overlay.active { opacity: 1; }
.picker-modal-overlay.active .picker-modal-content { transform: translateY(0); }
.picker-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 10px; font-size: 16px; font-weight: 600; color: var(--text); }
.picker-close { cursor: pointer; color: var(--text-light); font-size: 18px; padding: 5px; }
.picker-list { max-height: 50vh; overflow-y: auto; padding: 10px 16px; }
.picker-item { display: flex; align-items: center; padding: 16px; font-size: 16px; color: var(--text); border-radius: 12px; cursor: pointer; transition: background 0.2s; margin-bottom: 4px; }
.picker-item:active { background: rgba(150, 150, 150, 0.1); }
.picker-item.selected { background: rgba(56, 189, 248, 0.15); color: var(--primary); font-weight: 600; }

/* ==========================================
   🟢 捞漂流瓶、资料卡、举报弹窗公用样式
   ========================================== */
.pick-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity 0.3s ease; }
.pick-modal-overlay.active { opacity: 1; }
.pick-modal-content { width: 100%; max-width: 340px; border-radius: 24px; padding: 20px; transform: scale(0.8) translateY(20px); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); background: var(--bg-color); box-shadow: 0 10px 40px rgba(0,0,0,0.3); position: relative; }
[data-theme="dark"] .pick-modal-content { background: #0f172a; }
.pick-modal-overlay.active .pick-modal-content { transform: scale(1) translateY(0); }
.pick-modal-header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 16px; margin-bottom: 16px; color: var(--primary); }
.pick-result-body .bottle-item { margin-top: 0; border: none; background: transparent; padding: 0; box-shadow: none; }

/* 🟢 资料卡标签专用样式 */
.info-tag {
  font-size: 13px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  gap: 4px;
}
.info-tag.pink {
  background: rgba(244, 114, 182, 0.12);
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.2);
}

/* ==========================================
   聊天室 & 私信
   ========================================== */
#page-chat .content, #page-dm .content { flex: 1; overflow-y: auto; padding: 115px 16px 16px 16px; }
.chat-msg { display: flex; margin-bottom: 14px; align-items: flex-start; width: 100%; }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; margin-right: 10px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--glass-border); }
.chat-content-wrapper { display: flex; flex-direction: column; align-items: flex-start; max-width: calc(100% - 70px); }
.chat-name { font-size: 11px; color: var(--text-light); margin-bottom: 2px; }

/* 🟢 核心修改：加入 white-space: pre-wrap; 让聊天气泡支持换行 */
.chat-text { 
  background: var(--glass-bg); 
  backdrop-filter: blur(5px); 
  border: 1px solid var(--glass-border); 
  padding: 8px 12px; 
  border-radius: 14px; 
  border-top-left-radius: 4px; 
  word-break: break-word; 
  font-size: 14px; 
  line-height: 1.4; 
  color: var(--text); 
  white-space: pre-wrap; /* 🟢 关键属性：保留输入时的换行符 */
}

.chat-msg.msg-self { flex-direction: row-reverse; }
.chat-msg.msg-self .chat-avatar { margin-right: 0; margin-left: 10px; }
.chat-msg.msg-self .chat-content-wrapper { align-items: flex-end; }
.chat-msg.msg-self .chat-text { background: var(--primary-gradient); border-color: transparent; border-top-left-radius: 14px; border-top-right-radius: 4px; color: #fff; }

/* 🟢 聊天输入栏支持 textarea */
.chat-bar { position: relative; margin: 0 16px; margin-bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; padding: 8px; border-radius: 24px; gap: 8px; flex-shrink: 0; align-items: flex-end; }
.chat-bar textarea { 
  flex: 1; 
  padding: 10px 16px; 
  border: none; 
  border-radius: 20px; 
  outline: none; 
  font-size: 14px; 
  background: var(--card-bg); 
  color: var(--text); 
  resize: none; 
  max-height: 100px; 
  line-height: 1.4; 
  font-family: inherit; 
  box-sizing: border-box; 
  min-height: 40px; 
  margin: 0;
  overflow-y: hidden; /* 隐藏滚动条，由JS控制高度 */
}
.chat-bar textarea::placeholder { color: var(--text-light); }
.chat-bar button { padding: 12px 20px; background: var(--primary-gradient); color: #fff; border: none; border-radius: 20px; font-size: 14px; font-weight: 600; margin-bottom: 0; flex-shrink: 0; height: 40px; }

/* ==========================================
   我的页面
   ========================================== */
.profile-card { border-radius: 20px; padding: 32px 20px; text-align: center; position: relative; overflow: hidden; }
.profile-name { font-size: 20px; font-weight: 600; margin-bottom: 24px; }
.profile-item { display: flex; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--glass-border); font-size: 14px; }
.profile-item span { color: var(--text-light); }
.logout { margin-top: 30px; color: #f87171 !important; border-color: rgba(248, 113, 113, 0.3) !important; }
.profile-card .theme-switch-wrapper { position: relative; transition: background 0.2s; border-radius: 8px; padding: 16px 10px; margin: 0 -10px; }
.profile-card .theme-switch-wrapper:active { background: rgba(150, 150, 150, 0.1); }
.profile-card .theme-switch-wrapper span:first-child { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.profile-card .theme-switch-wrapper:not(:last-child)::after { content: ""; position: absolute; bottom: 0; left: 10px; right: 10px; height: 1px; background: var(--glass-border); }
.profile-card[style*="linear-gradient"]::before { content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%); animation: rotateBlob 10s linear infinite; pointer-events: none; }
@keyframes rotateBlob { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ==========================================
   时间分割线 & 我的漂流瓶
   ========================================== */
.time-divider { text-align: center; font-size: 12px; color: var(--text-light); margin: 16px 0 10px 0; width: 100%; }
.my-bottle-item { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 16px; padding: 18px; margin-bottom: 16px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02); }
.my-bottle-item .time { font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.my-bottle-item .bottle-tags { display: inline-flex; gap: 8px; margin-bottom: 12px; }
.my-bottle-item .bottle-tags span { font-size: 12px; background: rgba(56, 189, 248, 0.15); color: var(--primary); padding: 4px 10px; border-radius: 20px; font-weight: 500; }
.my-bottle-item .content-text { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.5; margin-bottom: 16px; word-break: break-word; }
.my-bottle-item .stats-row { display: flex; gap: 20px; font-size: 13px; color: var(--text-light); border-top: 1px dashed var(--glass-border); padding-top: 12px; }
.my-bottle-item .stats-row span { display: flex; align-items: center; gap: 4px; }
.my-bottle-item .comments-box { background: var(--card-bg); border: 1px solid var(--glass-border); padding: 12px 14px; border-radius: 12px; margin-top: 14px; }
.my-bottle-item .comments-title { font-size: 13px; font-weight: 600; color: var(--text-light); margin-bottom: 8px; }
.my-bottle-item .comment-item { font-size: 13px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--glass-border); line-height: 1.4; }
.my-bottle-item .comment-name { color: var(--primary); font-weight: 600; }
.my-bottle-item .comment-text { color: var(--text); }
#myBottlesList { padding-bottom: 40px; }

/* ==========================================
   白天模式强化输入框质感
   ========================================== */
[data-theme="light"] .field input,
[data-theme="light"] .mini-select,
[data-theme="light"] .chat-bar textarea {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .field input:focus,
[data-theme="light"] .chat-bar textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}
[data-theme="light"] .card textarea { background: #f8fafc !important; border: 1px solid #e2e8f0 !important; }
[data-theme="light"] .card textarea:focus { border-color: var(--primary) !important; background: #ffffff !important; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important; }
[data-theme="light"] .custom-select-btn { background: #f1f5f9; border: none; }

/* ==========================================
   底部导航：极致通透的毛玻璃效果
   ========================================== */
.tabbar { 
  position: fixed; bottom: 20px; left: 20px; right: 20px; height: 64px; 
  border-radius: 32px; display: none; z-index: 100; border: none !important; padding: 6px; box-sizing: border-box;
  background: rgba(255, 255, 255, 0.03) !important; 
  backdrop-filter: blur(30px) !important; -webkit-backdrop-filter: blur(30px) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important; 
  transform: translateZ(0); will-change: transform; -webkit-transform: translateZ(0);
}
[data-theme="dark"] .tabbar { background: rgba(0, 0, 0, 0.25) !important; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important; }
.tabbar.active { display: flex; } 
.tab-indicator { position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 4); background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(129, 140, 248, 0.2)); border-radius: 28px; box-shadow: 0 4px 12px rgba(56, 189, 248, 0.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); z-index: 1; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--text-light); cursor: pointer; transition: color .3s; z-index: 2; position: relative; }
.tab .icon { width: 24px; height: 24px; margin-bottom: 4px; transition: transform .3s; display: flex; align-items: center; justify-content: center; position: relative; }
.tab-badge { position: absolute; top: -4px; right: -6px; background: #ef4444; color: #fff; font-size: 10px; font-weight: bold; height: 16px; min-width: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; box-sizing: border-box; border: 1.5px solid var(--bg-color); transform: scale(0.9); }
.tab .icon svg { width: 100%; height: 100%; }
.tab .icon-active { display: none; }
.tab .icon-inactive { display: block; }
.tab.active { color: var(--primary) !important; font-weight: bold; }
.tab.active .icon-active { display: block; }
.tab.active .icon-inactive { display: none; }
.tab.active .icon { transform: translateY(-2px) scale(1.1); }

/* Toast */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); background: rgba(0, 0, 0, 0.85); color: #fff; padding: 14px 24px; border-radius: 16px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 9999; max-width: 80%; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ==========================================
   专属动态启动页样式
   ========================================== */
#splash-screen { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-color); z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1); }
.splash-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: 1; }
.splash-blob { position: absolute; border-radius: 50%; filter: blur(60px); animation: pulseBlob 3s infinite alternate ease-in-out; }
.blob-a { width: 250px; height: 250px; background: #0284c7; top: 20%; left: 10%; opacity: 0.5; }
.blob-b { width: 200px; height: 200px; background: #6d28d9; bottom: 20%; right: 10%; opacity: 0.5; animation-delay: -1s; }
@keyframes pulseBlob { 0% { transform: scale(1) translate(0, 0); opacity: 0.3; } 100% { transform: scale(1.3) translate(20px, 30px); opacity: 0.7; } }
.splash-content { position: relative; z-index: 2; text-align: center; }
.splash-title { font-size: 36px; font-weight: bold; letter-spacing: 4px; margin-bottom: 12px; background: linear-gradient(90deg, #38bdf8, #a78bfa, #38bdf8); background-size: 200% 100%; -webkit-background-clip: text; -webkit-text-fill-color: transparent; opacity: 0; transform: translateY(20px); animation: fadeInUp 1s ease forwards, flowLight 2s linear infinite; }
.splash-sub { color: var(--text-light); font-size: 14px; letter-spacing: 1px; margin-bottom: 30px; opacity: 0; animation: fadeInUp 1s ease 0.3s forwards; }
.splash-loader { display: flex; justify-content: center; gap: 8px; opacity: 0; animation: fadeIn 1s ease 0.6s forwards; }
.splash-dot { width: 8px; height: 8px; background: #38bdf8; border-radius: 50%; animation: bounceDot 1.4s infinite ease-in-out both; }
.splash-dot:nth-child(1) { animation-delay: -0.32s; }
.splash-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes bounceDot { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* 主题切换滑动开关样式 */
.theme-switch-wrapper { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; font-size: 15px; color: var(--text); }
.theme-switch { position: relative; display: inline-block; width: 50px; height: 26px; flex-shrink: 0; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background: var(--primary-gradient); }
input:checked + .slider:before { transform: translateX(24px); }

/* ==========================================
   私信列表排版
   ========================================== */
.dm-list-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--glass-border); cursor: pointer; transition: background 0.2s; width: 100%; }
.dm-list-item:last-child { border-bottom: none; }
.dm-list-item:active { background: rgba(150, 150, 150, 0.1); }
.dm-avatar-wrapper { position: relative; margin-right: 14px; flex-shrink: 0; }
.dm-list-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 1px solid var(--glass-border); display: block; }
.dm-list-info { flex: 1; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; text-align: left; gap: 4px; }
.dm-list-info b { font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.dm-last-msg { font-size: 13px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.dm-list-time { font-size: 12px; color: var(--text-light); flex-shrink: 0; margin-left: 10px; }
.unread-badge { position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; font-size: 10px; font-weight: bold; height: 18px; min-width: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid var(--bg-color); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* ==========================================
   通知设置底部弹窗
   ========================================== */
#notifySettingsModal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 1001; display: flex; flex-direction: column; justify-content: flex-end; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
#notifySettingsModal.active { opacity: 1; pointer-events: auto; }
.notify-drawer-content { background: var(--bg-color); border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); max-height: 85vh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -8px 32px rgba(0,0,0,0.2); }
[data-theme="dark"] .notify-drawer-content { background: #0f172a; box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6); }
#notifySettingsModal.active .notify-drawer-content { transform: translateY(0); }

/* ==========================================
   聊天图片与发送按钮美化
   ========================================== */
.btn-chat-img { background: var(--card-bg) !important; border: 1px solid var(--glass-border) !important; border-radius: 50% !important; width: 40px !important; height: 40px !important; display: flex !important; align-items: center !important; justify-content: center !important; color: var(--text-light) !important; cursor: pointer; flex-shrink: 0; padding: 0 !important; transition: all 0.2s; margin-right: 4px; }
.btn-chat-img:active { transform: scale(0.9); background: var(--glass-bg) !important; }
.btn-chat-img svg { width: 22px !important; height: 22px !important; display: block !important; }
.chat-image-bubble { max-width: 160px; border-radius: 12px; overflow: hidden; cursor: pointer; border: none; background: transparent; display: flex; }
.chat-image-bubble img { width: 100%; height: auto; object-fit: cover; display: block; border-radius: 12px; }
.chat-msg.msg-self .chat-image-bubble { align-self: flex-end; }

/* ==========================================
   聊天室/私信 侧滑动画
   ========================================== */
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideOutRight { from { transform: translateX(0); } to { transform: translateX(100%); } }
#page-chat.active, #page-dm.active { display: flex; flex-direction: column; height: 100%; padding-bottom: 0; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--bg-color); animation: slideInRight 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
#page-chat.slide-out, #page-dm.slide-out { display: flex; flex-direction: column; height: 100%; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--bg-color); animation: slideOutRight 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; }
.page.active { animation: none; }

/* ==========================================
   🟢 灵魂配对专属动效样式
   ========================================== */
.match-content { display: flex; flex-direction: column; align-items: center; padding-top: 120px; }
#matchRadarArea { position: relative; width: 320px; height: 320px; display: flex; align-items: center; justify-content: center; margin-bottom: 40px; }
.radar-wave { position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid rgba(56, 189, 248, 0.3); animation: radarScale 3s ease-out infinite; opacity: 0; }
.radar-wave.wave2 { animation-delay: 1s; border-color: rgba(129, 140, 248, 0.3); }
.radar-wave.wave3 { animation-delay: 2s; }
@keyframes radarScale { 0% { transform: scale(0.2); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.match-center-avatar { position: relative; width: 100px; height: 100px; border-radius: 50%; padding: 4px; background: linear-gradient(135deg, #38bdf8, #818cf8); box-shadow: 0 0 25px rgba(56, 189, 248, 0.4); z-index: 10; }
.match-center-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg-color); }
.match-orbit { position: absolute; width: 100%; height: 100%; }
.orbit-avatar { position: absolute; top: 50%; left: 50%; width: 50px; height: 50px; margin-top: -25px; margin-left: -25px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255,255,255,0.9); box-shadow: 0 4px 15px rgba(0,0,0,0.15); transform: rotate(var(--angle)) translateY(-140px) rotate(calc(-1 * var(--angle))); animation: floatAvatar 3s ease-in-out infinite alternate; animation-delay: var(--delay); }
.orbit-avatar img { width: 100%; height: 100%; object-fit: cover; }
@keyframes floatAvatar { 0% { transform: rotate(var(--angle)) translateY(-140px) rotate(calc(-1 * var(--angle))) scale(1); } 100% { transform: rotate(var(--angle)) translateY(-150px) rotate(calc(-1 * var(--angle))) scale(1.05); } }
.btn-match-start { width: 220px; padding: 16px 0; background: linear-gradient(135deg, #38bdf8, #818cf8); color: #fff; border: none; border-radius: 30px; font-size: 18px; font-weight: bold; cursor: pointer; box-shadow: 0 8px 24px rgba(56, 189, 248, 0.5); transition: all 0.3s; animation: pulseBtn 2s infinite; }
.btn-match-start:active { transform: scale(0.95); }
.btn-match-start:disabled { background: #94a3b8; animation: none; box-shadow: none; cursor: not-allowed; }
@keyframes pulseBtn { 0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6); } 70% { box-shadow: 0 0 0 15px rgba(56, 189, 248, 0); } 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); } }
.match-result-card { width: 100%; max-width: 300px; padding: 30px 20px; border-radius: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; margin-top: 20px; z-index: 10; }
@keyframes popIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.matched-avatar-wrapper { width: 100px; height: 100px; border-radius: 50%; padding: 3px; background: linear-gradient(135deg, #38bdf8, #818cf8); margin-bottom: 15px; }
.matched-avatar-wrapper img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg-color); }
.matched-name { font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.matched-desc { font-size: 13px; color: var(--text-light); }