/* ============ 舟山晨夕跑团 管理系统样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #f97316;
  --primary-2: #f43f5e;
  --grad: linear-gradient(135deg, #f97316 0%, #f43f5e 100%);
  --dark: #0f172a;
  --dark-2: #1e293b;
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e7ebf3;
  --text: #1f2937;
  --muted: #8b93a7;
  --teal: #10b981;
  --gold: #f59e0b;
  --silver: #94a3b8;
  --bronze: #d97742;
  --shadow: 0 4px 20px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(244, 63, 94, .15);
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0f172a 0%, #111c37 60%, #1a2342 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; box-shadow: var(--shadow-lg);
}
.brand-name { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.brand-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.nav { margin-top: 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  color: #a9b6cc; text-decoration: none; font-size: 14px; font-weight: 500;
  transition: all .18s ease;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active {
  background: var(--grad); color: #fff; font-weight: 600;
  box-shadow: 0 6px 18px rgba(244,63,94,.35);
}
.nav-ico { font-size: 17px; width: 22px; text-align: center; }
.sidebar-foot { padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.server-info { font-size: 12px; color: #7dd3fc; display: flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }

/* ---------- 主区域 ---------- */
.main { flex: 1; padding: 30px 36px 60px; max-width: 1280px; margin: 0 auto; width: 100%; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 26px; font-weight: 800; color: var(--dark); }
.page-head .sub { color: var(--muted); margin-top: 6px; font-size: 14px; }
.between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: 16px; padding: 22px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  margin-bottom: 22px;
}
.card-title { font-size: 16px; font-weight: 700; color: var(--dark); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* ---------- Hero ---------- */
.hero {
  border-radius: 20px; overflow: hidden; margin-bottom: 24px; position: relative;
  background:
    radial-gradient(1000px 300px at 90% -20%, rgba(249,115,22,.55), transparent 60%),
    radial-gradient(800px 260px at -10% 120%, rgba(16,185,129,.35), transparent 55%),
    linear-gradient(120deg, #0f172a 0%, #1e3a5f 55%, #164e63 100%);
  color: #fff; padding: 36px 40px;
}
.hero h2 { font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.hero p { color: #cbd5e1; margin-top: 8px; font-size: 15px; }
.hero-meta { margin-top: 20px; display: inline-block; background: rgba(255,255,255,.12); padding: 7px 16px; border-radius: 999px; font-size: 13px; backdrop-filter: blur(4px); }
.hero-inner { position: relative; z-index: 1; }

/* ---------- 统计卡 ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 22px; }
.stat { display: flex; align-items: center; gap: 16px; }
.stat-ico { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-num { font-size: 26px; font-weight: 800; color: var(--dark); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ---------- 概览列表 ---------- */
.best-list { display: flex; flex-direction: column; gap: 6px; }
.best-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); }
.best-event { font-weight: 700; font-size: 14px; min-width: 80px; }
.best-val { font-size: 17px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.best-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); }
.recent-name { font-weight: 600; font-size: 14px; }
.recent-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.recent-result { font-size: 15px; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.input {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px;
  font-size: 14px; outline: none; transition: border .15s, box-shadow .15s;
  background: #fff; color: var(--text);
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,.12); }
.select { cursor: pointer; min-width: 130px; }
.toolbar .input { width: 260px; }
.toolbar .select { width: auto; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 12px 14px; color: var(--muted); font-weight: 600;
  font-size: 12.5px; text-transform: none; border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8fafc; }
.table .ops { white-space: nowrap; text-align: right; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--grad);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; margin-right: 9px; vertical-align: middle;
  flex-shrink: 0;
}
td { display: table-cell; }
td .avatar + b, td b { vertical-align: middle; }
.gender { font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.gender.male { background: #e0f2fe; color: #0284c7; }
.gender.female { background: #fce7f3; color: #db2777; }
.chip { background: #fff1e6; color: #c2410c; font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.result { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--teal); }
.result.big { font-size: 16px; color: var(--dark); }

/* ---------- 按钮 ---------- */
.btn {
  border: none; border-radius: 10px; padding: 9px 18px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: all .16s ease; font-family: inherit;
}
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(244,63,94,.3); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(244,63,94,.4); }
.btn.ghost { background: #eef1f6; color: var(--text); }
.btn.ghost:hover { background: #e2e7f0; }
.btn.mini { padding: 5px 12px; font-size: 12.5px; background: #eef2fb; color: #3b5bdb; }
.btn.mini:hover { background: #dfe7fa; }
.btn.mini.danger { background: #fdecec; color: #dc2626; }
.btn.mini.danger:hover { background: #fbdada; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--muted); padding: 46px 20px; font-size: 14px; line-height: 1.9; }
.empty .dim { color: #a5b0c3; font-size: 13px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; animation: fade .15s ease;
}
.modal { background: #fff; border-radius: 18px; width: 520px; max-width: 94vw; padding: 24px; box-shadow: 0 24px 60px rgba(15,23,42,.3); animation: pop .18s ease; max-height: 92vh; overflow: auto; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-size: 18px; font-weight: 800; }
.close { background: #f1f3f8; border: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 14px; }
.close:hover { background: #e6e9f2; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field .input { width: 100%; }
.hint { color: var(--muted); font-size: 12px; margin-top: -6px; margin-bottom: 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 26px; left: 50%; transform: translateX(-50%) translateY(-80px);
  background: var(--dark); color: #fff; padding: 12px 22px; border-radius: 12px;
  font-size: 14px; opacity: 0; transition: all .3s ease; z-index: 200;
  box-shadow: 0 10px 30px rgba(15,23,42,.3); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #dc2626; }

/* ---------- 排名页: 页签 ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 9px 22px; border-radius: 999px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .16s ease; font-family: inherit;
}
.tab:hover { border-color: var(--primary); color: var(--primary); }
.tab.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(244,63,94,.28); }
.year-pick .select { min-width: 110px; font-weight: 600; }

/* ---------- 排名: 标题横幅 ---------- */
.rank-hero {
  border-radius: 18px; padding: 26px 30px; margin-bottom: 30px; color: #fff;
  background:
    radial-gradient(700px 220px at 95% -30%, rgba(251,191,36,.5), transparent 60%),
    radial-gradient(600px 220px at 0% 130%, rgba(16,185,129,.4), transparent 55%),
    var(--grad);
  box-shadow: var(--shadow-lg);
}
.rank-title { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.rank-sub { color: rgba(255,255,255,.9); margin-top: 6px; font-size: 14px; }

/* ---------- 排名: 领奖台 ---------- */
.podium-wrap { margin-bottom: 28px; }
.podium-stage { display: flex; align-items: flex-end; justify-content: center; gap: 26px; }
.podium-slot { display: flex; flex-direction: column; align-items: center; width: 170px; }
.podium-avatar {
  width: 62px; height: 62px; border-radius: 50%; background: #fff; border: 3px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: var(--shadow);
}
.podium-avatar.big { width: 82px; height: 82px; border-color: var(--gold); font-size: 34px; }
.medal { font-size: 24px; line-height: 1; }
.slot-1 .medal { font-size: 32px; }
.crown { font-size: 30px; margin-bottom: 6px; animation: bounce 1.6s ease infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.podium-name { margin-top: 12px; font-size: 16px; font-weight: 700; color: var(--dark); text-align: center; max-width: 170px; }
.podium-time { font-size: 14px; font-weight: 700; color: var(--primary); margin-top: 3px; font-variant-numeric: tabular-nums; }
.block {
  width: 120px; height: 46px; border-radius: 12px 12px 0 0; margin-top: 16px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 800; font-size: 16px; letter-spacing: 1px; text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.b1 { height: 92px; background: linear-gradient(180deg, #fbbf24, #f59e0b); box-shadow: 0 6px 20px rgba(245,158,11,.4); }
.b2 { height: 64px; background: linear-gradient(180deg, #cbd5e1, #94a3b8); }
.b3 { height: 52px; background: linear-gradient(180deg, #e8a276, #d97742); }
.slot-1 .block { width: 140px; }
.slot-2, .slot-3 { padding-top: 26px; }

/* ---------- 排名表 ---------- */
.rank-table td { font-size: 14px; }
.rank-no {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px;
  border-radius: 8px; background: #f1f3f8; color: var(--muted); font-weight: 700; margin-right: 6px;
}
.rank-no.top { background: var(--grad); color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .sidebar { width: 200px; }
  .cards, .grid-2 { grid-template-columns: 1fr; }
  .main { padding: 22px 16px; }
}
@media (max-width: 680px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 12px 16px; }
  .nav { flex-direction: row; margin-top: 0; overflow-x: auto; }
  .brand { border-bottom: none; padding: 0 12px 0 0; }
  .brand-sub { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .podium-stage { gap: 12px; }
  .podium-slot { width: 120px; }
  .toolbar .input { width: 100%; }
}

/* ============ v2 新增样式 ============ */
/* 管理员菜单分组 */
.nav-group { font-size: 11px; color: #64748b; letter-spacing: 1px; padding: 12px 14px 4px; }
/* 侧边栏底部登录/用户区 */
.user-box { padding: 6px 8px 12px; border-top: 1px solid rgba(255,255,255,.08); margin-bottom: 10px; }
.user-name { color: #fff; font-size: 13px; font-weight: 600; }
.role-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #334155; color: #cbd5e1; margin-left: 4px; }
.role-tag.admin { background: var(--grad); color: #fff; }
.role-tag.superadmin { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }
.logout { display: inline-block; margin-top: 6px; color: #7dd3fc; font-size: 12px; text-decoration: none; }
.logout:hover { color: #fff; }
.login-btn { display: inline-block; padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; text-decoration: none; margin-right: 6px; background: var(--grad); color: #fff; }
.login-btn.alt { background: rgba(255,255,255,.12); color: #e2e8f0; }

/* 认证页 */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 120px); }
.auth-card { width: 400px; max-width: 94vw; background: #fff; border-radius: 18px; padding: 36px; box-shadow: var(--shadow); border: 1px solid var(--line); text-align: center; }
.auth-card.wide { width: 460px; }
.auth-logo { width: 62px; height: 62px; border-radius: 16px; background: var(--grad); margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; font-size: 32px; box-shadow: var(--shadow-lg); }
.auth-card h2 { font-size: 22px; font-weight: 800; color: var(--dark); }
.auth-sub { color: var(--muted); font-size: 13px; margin: 8px 0 22px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .input { width: 100%; padding: 12px 14px; font-size: 15px; }
.auth-form .form-row { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 0; }
.btn.block { width: 100%; padding: 12px; font-size: 15px; }
.auth-foot { margin-top: 20px; color: var(--muted); font-size: 13px; }
.auth-foot a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* 状态徽章 */
.status { font-size: 12px; padding: 4px 12px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.s-pending { background: #fef3c7; color: #b45309; }
.s-approved { background: #d1fae5; color: #047857; }
.s-rejected { background: #fee2e2; color: #b91c1c; }
.dim-txt { color: var(--muted); font-size: 12px; }
.rej-why { display: block; color: #b91c1c; font-size: 12px; margin-top: 4px; }
.cert-link { color: #2563eb; font-size: 13px; text-decoration: none; }
.cert-link:hover { text-decoration: underline; }

/* 审核操作 */
.review-ops { min-width: 260px; }
.rev-comment { width: 100%; margin-top: 6px; font-size: 13px; padding: 7px 10px; }
.btn.mini.ok { background: #d1fae5; color: #047857; }
.btn.mini.ok:hover { background: #bbead6; }
.btn.sm { padding: 6px 14px; font-size: 13px; }

/* 提示条 */
.alert { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; padding: 13px 18px; margin-bottom: 22px; font-size: 14px; color: #7c2d12; }
.alert a { text-decoration: none; }

/* 窄卡片 */
.card.narrow { max-width: 560px; }
.input.file { padding: 8px 12px; }

/* ============ 移动端优化 ============ */
/* 证书图片预览(lightbox) */
.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .93); z-index: 300;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .16s ease;
}
.lightbox.show { opacity: 1; pointer-events: auto; }
.lb-img { max-width: 94vw; max-height: 94vh; display: flex; align-items: center; justify-content: center; }
.lb-img img {
  max-width: 94vw; max-height: 94vh; transform-origin: center center;
  user-select: none; -webkit-user-drag: none; touch-action: none;
  cursor: zoom-in; background: #000; object-fit: contain;
}
.lb-close {
  position: fixed; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255, 255, 255, .18); color: #fff; border: none; font-size: 18px;
  cursor: pointer; z-index: 2; line-height: 1;
}
.lb-hint {
  position: fixed; bottom: 14px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.7); font-size: 12px; z-index: 2; pointer-events: none;
}
/* 文件选择框: 更醒目的虚线按钮 */
.input.file {
  padding: 13px 12px; font-size: 13px; color: var(--muted);
  background: #f8fafc; border-style: dashed; cursor: pointer; width: 100%;
}

/* 移动端触控与布局 */
@media (max-width: 768px) {
  .main { padding: 18px 14px 48px; }
  .page-head { margin-bottom: 20px; }
  .page-head h1 { font-size: 21px; }
  .page-head .sub { font-size: 13px; }
  .card { padding: 16px; border-radius: 14px; }
  .hero { padding: 24px 20px; }
  .hero h2 { font-size: 22px; }
  .hero p { font-size: 14px; }
  .cards { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .stat { gap: 10px; }
  .stat-ico { width: 40px; height: 40px; font-size: 19px; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 12px; }
  /* 触控目标 ≥42px, 输入框16px 防止 iOS 聚焦自动缩放 */
  .btn, .input, .select, .tab { min-height: 42px; }
  .btn { font-size: 15px; padding: 10px 18px; }
  .btn.mini { min-height: 38px; padding: 7px 12px; font-size: 13px; }
  .input, .select { font-size: 16px; }
  /* 表格横向滚动, 不挤压列 */
  .table { min-width: 760px; }
  .table td, .table th { padding: 11px 10px; }
  /* 弹窗: 移动端底部弹出 */
  .modal-mask { align-items: flex-end; }
  .modal { width: 100%; max-width: 100vw; border-radius: 16px 16px 0 0; max-height: 92vh; padding: 20px 18px; }
  /* 认证页全宽 */
  .auth-card, .auth-card.wide { width: 100%; max-width: 100vw; border-radius: 0; box-shadow: none; border: none; padding: 30px 22px; }
  .auth-wrap { min-height: calc(100vh - 130px); }
  .close { width: 38px; height: 38px; font-size: 17px; }
  .toolbar .input, .toolbar .select { width: 100%; }
  .alert { flex-wrap: wrap; }
}

@media (max-width: 680px) {
  /* 顶部栏内的账号区 */
  .sidebar-foot { display: flex; align-items: center; }
  .user-box { display: flex; align-items: center; gap: 8px; border-top: none; padding: 0; margin: 0 0 0 auto; }
  .user-name { font-size: 12px; }
  .server-info { display: none; }
  .nav-group { display: none; }
  .brand-name { font-size: 14px; }
}

@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .stat { justify-content: flex-start; }
  .podium-slot { width: 108px; }
}

/* ============ 移动端全功能菜单(顶栏+抽屉) ============ */
.mobile-topbar, .mobile-backdrop, .mobile-nav { display: none; }
.brand-logo.small { width: 34px; height: 34px; font-size: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--grad); box-shadow: var(--shadow-lg); }

@media (max-width: 680px) {
  .sidebar { display: none; }   /* 移动端隐藏桌面侧栏, 改用顶栏+抽屉 */
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: linear-gradient(180deg, #0f172a, #111c37);
    color: #fff; position: sticky; top: 0; z-index: 60;
    box-shadow: 0 2px 10px rgba(15,23,42,.3);
  }
  .m-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; color: #fff; }
  .menu-btn {
    background: rgba(255,255,255,.1); border: none; color: #fff;
    width: 42px; height: 42px; border-radius: 9px; font-size: 20px; cursor: pointer;
  }
  .menu-btn:active { background: rgba(255,255,255,.2); }
  .mobile-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 400;
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .mobile-backdrop.show { opacity: 1; pointer-events: auto; }
  .mobile-nav {
    position: fixed; top: 0; left: 0; bottom: 0; width: 272px; max-width: 84vw;
    background: linear-gradient(180deg, #0f172a, #1a2342); color: #cbd5e1;
    z-index: 500; transform: translateX(-100%); transition: transform .22s ease;
    display: flex; flex-direction: column; padding: 16px 12px; overflow-y: auto;
    box-shadow: 8px 0 30px rgba(0,0,0,.35);
  }
  .mobile-nav.open { transform: translateX(0); }
  .mn-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .mn-title { font-weight: 700; color: #fff; font-size: 15px; }
  .mn-close { background: rgba(255,255,255,.1); border: none; color: #fff; width: 36px; height: 36px; border-radius: 8px; font-size: 15px; cursor: pointer; }
  .mn-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; flex: 1; }
  .mn-nav a { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 10px; color: #cbd5e1; text-decoration: none; font-size: 15px; font-weight: 500; }
  .mn-nav a.active { background: var(--grad); color: #fff; font-weight: 600; }
  .mn-group { font-size: 11px; color: #64748b; letter-spacing: 1px; padding: 12px 14px 4px; }
  .mn-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 8px 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .mn-user { color: #fff; font-size: 14px; font-weight: 600; }
  .mn-logout { color: #7dd3fc; font-size: 13px; text-decoration: none; }
}


/* ===== PWA: 添加到桌面引导 ===== */
.pwa-tip{position:fixed;left:12px;right:12px;top:calc(env(safe-area-inset-top,0px) + 10px);z-index:9999;
  background:rgba(15,23,42,.95);color:#fff;border-radius:12px;padding:12px 40px 12px 14px;font-size:13px;line-height:1.55;
  box-shadow:0 10px 28px rgba(0,0,0,.3);border:1px solid rgba(255,255,255,.08);}
.pwa-tip b{color:#f97316;}
.pwa-tip .pwa-close{position:absolute;right:8px;top:8px;width:26px;height:26px;border:none;background:transparent;
  color:#94a3b8;font-size:16px;line-height:1;cursor:pointer;}
.pwa-install-btn{position:fixed;right:14px;bottom:calc(env(safe-area-inset-bottom,0px) + 16px);z-index:9998;display:none;
  align-items:center;gap:6px;background:linear-gradient(135deg,#f97316,#ea580c);color:#fff;border:none;border-radius:24px;
  padding:12px 18px;font-size:14px;font-weight:700;box-shadow:0 8px 22px rgba(249,115,22,.4);cursor:pointer;}
.pwa-install-btn.show{display:inline-flex;}
@media (max-width:680px){ .pwa-tip{left:10px;right:10px;font-size:12.5px;} }