/* ============================================================
   谷100挑战赛 · 全局样式
   风格：明亮活泼 + 金融元素 + 趣味小贴士
   ============================================================ */

/* ---- CSS 变量 ---- */
:root {
  --primary: #00C896;
  --primary-dark: #00A87E;
  --primary-light: #E8FDF5;
  --accent: #FFD23F;
  --accent-dark: #F5A623;
  --bg: #F7F9FC;
  --bg-card: #FFFFFF;
  --bg-header: linear-gradient(135deg, #1A2A3A 0%, #0F4C75 100%);
  --text: #1A2A3A;
  --text-secondary: #5A6A7A;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --positive: #00C896;
  --negative: #FF5757;
  --gold: #FFD700;
  --silver: #C0C0C0;
  --bronze: #CD7F32;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-display: 'Noto Serif SC', 'Songti SC', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', sans-serif;
  --nav-height: 70px;
  --header-height: 80px;
  --tips-height: 44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- 重置 & 基础 ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

img { max-width: 100%; display: block; }

/* ---- 粒子画布背景 ---- */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* ---- 页面切换动画 ---- */
.page { display: none; position: relative; z-index: 1; }
.page.active { display: block; animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   顶部标题栏
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  color: #fff;
  height: var(--header-height);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.logo-text { display: flex; flex-direction: column; gap: 2px; }

.site-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.site-subtitle {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.5px;
}

.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.trade-day-badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
}

.badge-num { font-size: 1.1rem; font-weight: 900; color: var(--accent); }

.market-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
}

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #888;
  animation: pulse 2s infinite;
}
.dot.open { background: var(--primary); }
.dot.closed { background: var(--negative); animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ============================================================
   小贴士栏
   ============================================================ */
.tips-bar {
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, #FFF9E6, #FFF3D0);
  border-bottom: 2px solid var(--accent);
  height: var(--tips-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  font-size: 0.82rem;
  color: #7A5C00;
  overflow: hidden;
}

.tips-icon { font-size: 1rem; flex-shrink: 0; }
.tips-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tips-refresh {
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 6px;
  color: #7A5C00;
  transition: background 0.2s;
}
.tips-refresh:hover { background: rgba(0,0,0,0.06); }

/* ============================================================
   登录页
   ============================================================ */
.login-container {
  min-height: calc(100vh - var(--header-height) - var(--tips-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  gap: 24px;
}

.login-hero { text-align: center; animation: heroReveal 0.8s ease; }

@keyframes heroReveal {
  from { opacity: 0; transform: scale(0.9) translateY(-20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-trophy { font-size: 4rem; margin-bottom: 12px; }
.login-headline {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}
.login-desc { font-size: 0.85rem; color: var(--text-secondary); }

.login-form-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  overflow: visible;
  animation: cardRise 0.6s ease 0.2s both;
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-tabs {
  display: flex;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
}

.form-tab {
  flex: 1;
  padding: 16px 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.25s;
  min-height: 52px;
}
.form-tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
  background: var(--bg-card);
}

.login-form-panel { padding: 28px 24px; }

.form-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  text-align: center;
}

.key-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.key-input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
  text-transform: uppercase;
  border: 2.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.25s, box-shadow 0.25s;
  outline: none;
  box-sizing: border-box;
}
.key-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0,200,150,0.12);
}
.key-input::placeholder { letter-spacing: 1px; font-weight: 400; color: var(--text-muted); }

.key-submit-btn {
  flex-shrink: 0;
  min-width: 100px;
  padding: 14px 20px;
  background: var(--primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  white-space: nowrap;
  box-sizing: border-box;
}
.key-submit-btn:hover { background: var(--primary-dark); transform: translateX(2px); }
.key-submit-btn:active { transform: scale(0.97); }

.login-tip {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.login-footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.8;
  animation: cardRise 0.6s ease 0.4s both;
}

/* ============================================================
   首次注册页（Onboard）
   ============================================================ */
.onboard-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: calc(100vh - var(--header-height) - var(--tips-height));
  justify-content: center;
}

.onboard-header { text-align: center; }
.onboard-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #FFA500);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.onboard-header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.onboard-key-display {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.onboard-key-display strong {
  color: var(--primary-dark);
  font-size: 1.1rem;
  letter-spacing: 3px;
  font-family: monospace;
}

.onboard-form-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section { display: flex; flex-direction: column; gap: 10px; }

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.form-sublabel { font-weight: 400; color: var(--text-muted); font-size: 0.78rem; }

/* 头像上传 */
.avatar-upload-area {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px dashed var(--border);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
  margin: 0 auto;
}
.avatar-upload-area:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 5px rgba(0,200,150,0.12);
}

.avatar-preview {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}

.avatar-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
}
.avatar-icon { font-size: 2rem; }
.upload-hint { font-size: 0.65rem !important; color: #B0BEC5; }

/* 投资类型多选 */
.investment-types {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.type-chip {
  cursor: pointer;
  display: inline-block;
}

.type-chip input[type="checkbox"] { display: none; }

.chip-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
  background: var(--bg-card);
}

.type-chip input:checked + .chip-inner {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
}

.chip-icon { font-size: 1rem; }

/* 提交按钮 */
.submit-btn {
  padding: 15px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  transition: all 0.25s;
  text-align: center;
}
.submit-btn:hover { background: var(--primary-dark); box-shadow: 0 4px 15px rgba(0,200,150,0.35); }
.submit-btn:active { transform: scale(0.98); }
.submit-btn.primary {
  background: linear-gradient(135deg, var(--primary), #00A87E);
  box-shadow: 0 4px 20px rgba(0,200,150,0.3);
}

/* 错误提示 */
.form-error {
  font-size: 0.8rem;
  color: var(--negative);
  min-height: 20px;
  text-align: center;
}

/* ============================================================
   用户主页
   ============================================================ */
#page-user-home {
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
}

.user-home-header {
  background: linear-gradient(135deg, #1A2A3A 0%, #0F4C75 100%);
  color: #fff;
  padding: 20px 20px 24px;
}

.user-info-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 600px;
  margin: 0 auto;
}

.home-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.4);
  object-fit: cover;
  flex-shrink: 0;
}

.home-user-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.home-nickname {
  font-size: 1.1rem;
  font-weight: 700;
}

.home-key {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.55);
}

.logout-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  transition: all 0.2s;
  flex-shrink: 0;
}
.logout-btn:hover { background: rgba(255,255,255,0.2); }

/* 收益率填写区 */
.return-rate-section {
  max-width: 600px;
  margin: 16px auto 0;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rr-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.today-date {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.today-weekday {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

.upload-deadline {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.dl-icon { font-size: 0.85rem; }

.return-inputs { display: flex; flex-direction: column; gap: 12px; }

.return-input-group {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border);
  transition: border-color 0.2s;
}
.return-input-group:focus-within { border-color: var(--primary); }

.return-type-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  min-width: 60px;
  flex-shrink: 0;
}
.return-type-icon { font-size: 1.1rem; }

.return-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: right;
  color: var(--text);
  background: transparent;
}
.return-input::placeholder { color: var(--text-muted); font-weight: 400; font-size: 1rem; }

.return-pct-sign {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.combined-result {
  background: linear-gradient(135deg, #E8FDF5, #D0F5EB);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.combined-label { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.combined-value { font-size: 1.5rem; font-weight: 900; color: var(--primary-dark); }

.last-upload-info {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px;
}

/* 非交易日提示 */
.market-closed-notice {
  text-align: center;
  padding: 60px 20px;
  max-width: 500px;
  margin: 0 auto;
}
.mc-icon { font-size: 4rem; margin-bottom: 16px; }
.market-closed-notice h3 { font-size: 1.3rem; margin-bottom: 8px; }
.market-closed-notice p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6; }
.mc-next { margin-top: 12px; color: var(--text) !important; font-weight: 600 !important; }

/* Tab 内容面板 */
.tab-panels { max-width: 600px; margin: 16px auto 0; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

.panel-inner { padding: 0 16px 20px; }

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.upload-hint-box {
  background: linear-gradient(135deg, #FFF9E6, #FFF3D0);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 0.82rem;
  color: #7A5C00;
  line-height: 1.8;
}
.upload-hint-box p { margin-bottom: 2px; }
.upload-hint-box p:last-child { margin-bottom: 0; }
.upload-hint-box code {
  background: rgba(0,0,0,0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9rem;
}
.upload-multi-note { color: var(--primary-dark) !important; font-weight: 600 !important; margin-top: 6px !important; }

/* 历史数据 */
.history-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.summary-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.summary-num {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--primary-dark);
}
.summary-label { font-size: 0.65rem; color: var(--text-muted); text-align: center; }

.history-list { display: flex; flex-direction: column; gap: 8px; }

.history-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.2s;
}
.history-item:hover { transform: translateX(4px); }

.history-item-left { display: flex; flex-direction: column; gap: 2px; }
.history-date { font-size: 0.88rem; font-weight: 600; }
.history-weekday {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.history-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.history-single-return { font-size: 0.9rem; font-weight: 700; }
.history-total { font-size: 0.7rem; color: var(--text-muted); }

/* 榜单通用 */
.leaderboard { display: flex; flex-direction: column; gap: 8px; }

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

.war-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.war-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #888;
  animation: pulse 2s infinite;
}
.war-status-dot.live { background: var(--positive); }
.war-status-dot.ended { background: var(--negative); animation: none; }

.total-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 榜单条目 */
.rank-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.rank-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.rank-item.top-1 {
  background: linear-gradient(135deg, #FFFDE7, #FFF8B0);
  border: 2px solid var(--gold);
  box-shadow: 0 4px 20px rgba(255,215,0,0.25);
}
.rank-item.top-2 {
  background: linear-gradient(135deg, #F5F5F5, #E8E8E8);
  border: 2px solid var(--silver);
  box-shadow: 0 4px 15px rgba(192,192,192,0.25);
}
.rank-item.top-3 {
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  border: 2px solid var(--bronze);
  box-shadow: 0 4px 15px rgba(205,127,50,0.2);
}

.rank-position {
  font-size: 1.3rem;
  font-weight: 900;
  min-width: 36px;
  text-align: center;
}
.top-1 .rank-position { color: var(--gold); font-size: 1.5rem; }
.top-2 .rank-position { color: var(--silver); }
.top-3 .rank-position { color: var(--bronze); }

.rank-trophy { font-size: 1.4rem; }
.rank-trophy-1 { filter: drop-shadow(0 2px 4px rgba(255,215,0,0.5)); }

.rank-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.rank-info { flex: 1; min-width: 0; }
.rank-nickname {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-types {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.rank-return {
  font-size: 1.15rem;
  font-weight: 900;
  white-space: nowrap;
}
.rank-return.positive { color: var(--positive); }
.rank-return.negative { color: var(--negative); }
.rank-return.neutral { color: var(--text-muted); }

.rank-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ============================================================
   底部导航
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  z-index: 100;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  padding-bottom: var(--safe-bottom);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  color: var(--text-muted);
  font-size: 0.65rem;
  border-top: 3px solid transparent;
  transition: all 0.2s;
}
.nav-btn.active {
  color: var(--primary-dark);
  border-top-color: var(--primary);
}
.nav-btn:active { transform: scale(0.95); }

.nav-icon { font-size: 1.25rem; }

/* ============================================================
   管理员后台
   ============================================================ */
.admin-home-header {
  background: linear-gradient(135deg, #2D1B69, #4A1B9D);
  color: #fff;
  padding: 20px 16px;
}

.admin-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.admin-stat-card {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255,255,255,0.1);
}
.asc-num { font-size: 1.5rem; font-weight: 900; color: var(--accent); }
.asc-label { font-size: 0.65rem; color: rgba(255,255,255,0.6); text-align: center; }

.admin-tabs {
  display: flex;
  gap: 0;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
  border-bottom: 2px solid var(--border);
}
.admin-tab-btn {
  flex: 1;
  padding: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.admin-tab-btn.active {
  color: #4A1B9D;
  border-bottom-color: #4A1B9D;
}

.admin-tab-content { display: none; max-width: 600px; margin: 0 auto; padding: 16px; }
.admin-tab-content.active { display: block; animation: fadeIn 0.3s ease; }

.admin-panel-header { margin-bottom: 16px; }
.admin-panel-header h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.admin-panel-desc { font-size: 0.75rem; color: var(--text-muted); }

.admin-user-list { display: flex; flex-direction: column; gap: 10px; }
.admin-user-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-user-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-key {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
  letter-spacing: 2px;
}
.admin-user-nick {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 2px 0;
}
.admin-user-types { font-size: 0.65rem; color: var(--text-muted); }
.admin-user-edit-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: #F0EEFF;
  color: #4A1B9D;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.2s;
}
.admin-user-edit-btn:hover { background: #4A1B9D; color: #fff; }

.admin-data-list { display: flex; flex-direction: column; gap: 10px; }
.admin-data-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.admin-data-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.admin-data-name { font-size: 0.95rem; font-weight: 700; }
.admin-data-key { font-size: 0.7rem; color: var(--text-muted); font-family: monospace; }
.admin-data-records { display: flex; flex-direction: column; gap: 6px; }
.admin-record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.admin-record-date { color: var(--text-secondary); }
.admin-record-return { font-weight: 700; }
.admin-record-total { color: var(--text-muted); font-size: 0.7rem; }
.admin-no-record { font-size: 0.78rem; color: var(--text-muted); text-align: center; padding: 10px; }

.logout-btn-bottom {
  display: block;
  width: calc(100% - 32px);
  max-width: 568px;
  margin: 20px auto 0;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.2s;
  text-align: center;
}
.logout-btn-bottom:hover { background: rgba(255,255,255,0.2); }

/* 管理员昵称编辑弹窗 */
.edit-nick-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.edit-nick-modal.active { display: flex; animation: fadeIn 0.2s ease; }

.edit-nick-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 90%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-lg);
}
.edit-nick-box h3 { font-size: 1rem; font-weight: 700; }
.edit-nick-box input {
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.edit-nick-box input:focus { border-color: #4A1B9D; }
.edit-nick-actions { display: flex; gap: 10px; }
.edit-nick-cancel {
  flex: 1; padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.edit-nick-cancel:hover { background: var(--border); }
.edit-nick-confirm {
  flex: 1; padding: 12px;
  border-radius: var(--radius-md);
  background: #4A1B9D;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.edit-nick-confirm:hover { background: #3A0F7D; }

/* ============================================================
   Toast 提示
   ============================================================ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1A2A3A;
  color: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 300;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: #1A6B4A; }
.toast.error { background: #C0392B; }
.toast.info { background: #1A2A3A; }

/* ============================================================
   全局 Loading
   ============================================================ */
.global-loading {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(247,249,252,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  backdrop-filter: blur(6px);
  transition: opacity 0.3s;
}
.global-loading.hidden { display: none !important; }

.loading-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 480px) {
  .site-title { font-size: 1.1rem; }
  .site-subtitle { font-size: 0.62rem; }
  .header-inner { padding: 0 14px; }
  .login-headline { font-size: 1.6rem; }
  .login-trophy { font-size: 3rem; }
  .history-summary { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .summary-num { font-size: 1.1rem; }
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
  .asc-num { font-size: 1.2rem; }
  .rank-avatar { width: 36px; height: 36px; }
  .rank-position { font-size: 1.1rem; }
  .rank-return { font-size: 1rem; }
}

@media (max-width: 360px) {
  .chip-inner { padding: 6px 10px; font-size: 0.78rem; }
  .nav-label { font-size: 0.6rem; }
}

/* ============================================================
   数字跳动动画
   ============================================================ */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.count-animate { animation: countUp 0.4s ease; }

/* ============================================================
   榜单闪烁入场
   ============================================================ */
.rank-item {
  animation: rankReveal 0.4s ease both;
}
@keyframes rankReveal {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---- 服务器连接状态 ---- */
.server-status-bar {
 text-align: center;
 font-size: 0.78rem;
 padding: 8px 16px;
 margin: 12px 0 4px;
 border-radius: var(--radius-sm);
 line-height: 1.6;
}
.server-status-bar.connecting {
 background: #FFF8E1;
 color: #F5A623;
}
.server-status-bar.connected {
 background: #E8FDF5;
 color: var(--primary-dark);
}
.server-status-bar.disconnected {
 background: #FFF0F0;
 color: var(--negative);
}
