/* ========== 旅游管理2班 · 霓虹渐变主题 ========== */
:root {
  --bg: #0b1020;
  --bg2: #111a33;
  --panel: rgba(20, 30, 58, 0.72);
  --line: rgba(94, 234, 212, 0.35);
  --cyan: #22d3ee;
  --teal: #2dd4bf;
  --purple: #a78bfa;
  --pink: #f472b6;
  --amber: #fbbf24;
  --green: #34d399;
  --red: #fb7185;
  --text: #e5ecff;
  --muted: #8b98c9;
  --grad: linear-gradient(135deg, #22d3ee 0%, #a78bfa 55%, #f472b6 100%);
  --radius: 16px;
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  min-height: 100vh;
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(167, 139, 250, .18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(34, 211, 238, .15), transparent 60%);
  background-attachment: fixed;
}
.hidden { display: none !important; }
.glass {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  box-shadow: 0 0 24px rgba(34, 211, 238, .08), inset 0 0 40px rgba(167, 139, 250, .04);
}
.neon-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(34, 211, 238, .45));
}
.btn {
  border: 1.5px dashed var(--line);
  background: rgba(34, 211, 238, .08);
  color: var(--text);
  padding: 8px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: .95rem;
  transition: all .25s;
}
.btn:hover { box-shadow: 0 0 16px rgba(34, 211, 238, .45); transform: translateY(-1px); }
.btn-primary { background: var(--grad); border: none; color: #0b1020; font-weight: 700; }
.btn-block { width: 100%; padding: 12px; font-size: 1.05rem; }
.btn-sm { padding: 4px 12px; font-size: .82rem; border-radius: 9px; }
.btn-danger { border-color: rgba(251, 113, 133, .5); background: rgba(251, 113, 133, .1); }

input, select, textarea {
  width: 100%;
  background: rgba(11, 16, 32, .7);
  border: 1.5px dashed rgba(139, 152, 201, .4);
  border-radius: 10px;
  color: var(--text);
  padding: 9px 12px;
  font-size: .95rem;
  outline: none;
  transition: border .25s, box-shadow .25s;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 12px rgba(34, 211, 238, .3); }
select option { background: var(--bg2); }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 20px; }
.login-bg-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.orb1 { width: 420px; height: 420px; background: #22d3ee55; top: -120px; right: -80px; animation: float 9s ease-in-out infinite; }
.orb2 { width: 380px; height: 380px; background: #a78bfa55; bottom: -120px; left: -60px; animation: float 11s ease-in-out infinite reverse; }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(30px) } }
.login-card { width: 400px; max-width: 94vw; padding: 40px 34px; text-align: center; position: relative; z-index: 2; }
.login-logo { position: relative; width: 92px; height: 92px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; }
.logo-emoji { font-size: 44px; z-index: 1; }
.logo-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed var(--cyan); animation: spin 12s linear infinite; box-shadow: 0 0 22px rgba(34, 211, 238, .35); }
@keyframes spin { to { transform: rotate(360deg) } }
.login-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.login-sub { color: var(--muted); font-size: .88rem; margin-bottom: 26px; }
.field { text-align: left; margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.login-err { color: var(--red); font-size: .85rem; margin-top: 10px; min-height: 20px; }
.login-hint { margin-top: 20px; font-size: .74rem; color: var(--muted); line-height: 1.7; border-top: 1px dashed rgba(139,152,201,.3); padding-top: 14px; }

/* ---------- 主框架 ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px; margin: 14px 18px 0;
  position: sticky; top: 12px; z-index: 50;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-icon { font-size: 26px; filter: drop-shadow(0 0 8px rgba(34,211,238,.6)); }
.brand-name { font-weight: 800; font-size: 1.1rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-tag { font-size: .72rem; color: var(--muted); border: 1px dashed var(--line); padding: 2px 8px; border-radius: 20px; }
.nav-tabs { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.nav-tab {
  padding: 7px 15px; border-radius: 11px; cursor: pointer; font-size: .9rem;
  color: var(--muted); border: 1.5px dashed transparent; transition: all .25s; white-space: nowrap;
}
.nav-tab:hover { color: var(--text); border-color: rgba(94,234,212,.25); }
.nav-tab.active {
  color: #0b1020; font-weight: 700; background: var(--grad); border-color: transparent;
  box-shadow: 0 0 18px rgba(167, 139, 250, .5);
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 700; }
.role-badge {
  font-size: .72rem; padding: 3px 10px; border-radius: 20px;
  background: rgba(167,139,250,.16); border: 1px dashed var(--purple); color: var(--purple);
}
.role-badge.admin { background: rgba(251,191,36,.14); border-color: var(--amber); color: var(--amber); }
.logout-btn { font-size: .8rem; color: var(--muted); cursor: pointer; border-bottom: 1px dashed var(--muted); }
.logout-btn:hover { color: var(--red); border-color: var(--red); }

.main { flex: 1; padding: 20px 18px 40px; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-title { font-size: 1.3rem; font-weight: 800; margin: 8px 4px 18px; display: flex; align-items: center; gap: 10px; }
.page-title::before { content: ""; width: 5px; height: 22px; border-radius: 4px; background: var(--grad); box-shadow: 0 0 10px rgba(34,211,238,.5); }

/* ---------- 看板 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 18px 20px; position: relative; overflow: hidden; transition: transform .25s, box-shadow .25s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(34, 211, 238, .18); }
.stat-card .stat-label { font-size: .8rem; color: var(--muted); }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; margin-top: 6px; }
.stat-card .stat-foot { font-size: .74rem; color: var(--muted); margin-top: 6px; }
.stat-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--grad); opacity: .12; }
.v-cyan { color: var(--cyan); text-shadow: 0 0 14px rgba(34,211,238,.6); }
.v-purple { color: var(--purple); text-shadow: 0 0 14px rgba(167,139,250,.6); }
.v-green { color: var(--green); text-shadow: 0 0 14px rgba(52,211,153,.6); }
.v-amber { color: var(--amber); text-shadow: 0 0 14px rgba(251,191,36,.6); }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.chart-card { padding: 16px; }
.chart-card h3 { font-size: .95rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.chart-box { height: 280px; }
.chart-tall { height: 320px; }
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar .seg { display: flex; border: 1.5px dashed var(--line); border-radius: 12px; overflow: hidden; }
.filter-bar .seg button { background: transparent; border: none; color: var(--muted); padding: 7px 16px; cursor: pointer; font-size: .85rem; }
.filter-bar .seg button.active { background: var(--grad); color: #0b1020; font-weight: 700; }

/* ---------- 表格与表单 ---------- */
.panel { padding: 18px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.panel-head h3 { font-size: 1rem; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1.5px dashed var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px dashed rgba(139,152,201,.18); }
.tbl tr:hover td { background: rgba(34,211,238,.05); }
.tbl-wrap { overflow-x: auto; }

/* ---------- 移动端适配（学生主要用手机访问） ---------- */
@media (max-width: 768px) {
  #navTabs { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  #navTabs::-webkit-scrollbar { display: none; }
  .nav-tab { flex-shrink: 0; padding: 10px 11px; font-size: .84rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .stat-card .stat-value { font-size: 1.45rem; }
  .chart-grid { grid-template-columns: 1fr !important; }
  .dorm-grid { grid-template-columns: 1fr !important; }
  .dorm-summary { grid-template-columns: repeat(2, 1fr) !important; }
  .form-grid { grid-template-columns: 1fr !important; }
  .chart-box { height: 240px !important; }
  .modal-mask { padding: 10px; align-items: flex-start; overflow-y: auto; }
}
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .76rem; border: 1px dashed; white-space: nowrap; }
.tag-green { color: var(--green); border-color: var(--green); background: rgba(52,211,153,.1); }
/* 寝室管理子页签 */
.dorm-subtabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.dorm-subtab { padding: 8px 18px; border-radius: 10px; border: 1.5px solid var(--line); color: var(--muted); cursor: pointer; font-size: .92rem; transition: all .15s; }
.dorm-subtab.on { color: var(--cyan); border-color: var(--cyan); background: rgba(34,211,238,.1); font-weight: 600; }
.dorm-subtab:hover { border-color: var(--cyan); }
.ext-leader { font-size: .95rem; }
.ext-leader small { color: var(--muted); font-weight: 400; }
.dorm-mixed { font-size: .8rem; color: var(--muted); background: rgba(167,139,250,.08); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
.dorm-stat-cell { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(34,211,238,.04); }
.dorm-stat-cell b { font-size: .95rem; }
.dorm-stat-cell small { color: var(--muted); font-size: .72rem; }
.tag-red { color: var(--red); border-color: var(--red); background: rgba(251,113,133,.1); }
.tag-amber { color: var(--amber); border-color: var(--amber); background: rgba(251,191,36,.1); }
.tag-cyan { color: var(--cyan); border-color: var(--cyan); background: rgba(34,211,238,.1); }
.tag-purple { color: var(--purple); border-color: var(--purple); background: rgba(167,139,250,.1); }
.tag-muted { color: var(--muted); border-color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.progress-track { height: 8px; border-radius: 6px; background: rgba(139,152,201,.2); overflow: hidden; min-width: 80px; }
.progress-fill { height: 100%; background: var(--grad); border-radius: 6px; box-shadow: 0 0 8px rgba(34,211,238,.5); transition: width .4s; }
.empty { color: var(--muted); text-align: center; padding: 34px 0; font-size: .9rem; }
.att-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.att-quick .btn-sm.on { background: var(--grad); color: #0b1020; font-weight: 700; border-color: transparent; }

/* ---------- 通知 ---------- */
.notice-item { padding: 16px 18px; margin-bottom: 12px; position: relative; }
.notice-item .n-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.notice-item .n-title { font-weight: 700; font-size: 1.02rem; }
.notice-item .n-meta { font-size: .76rem; color: var(--muted); margin-top: 10px; }
.notice-item .n-content { color: #c6d0f2; line-height: 1.75; font-size: .92rem; white-space: pre-wrap; }

/* ---------- AI 数字人 ---------- */
.ai-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.avatar-stage { padding: 26px 18px; text-align: center; position: sticky; top: 96px; }
.avatar-svg { width: 220px; max-width: 70vw; filter: drop-shadow(0 0 26px rgba(34, 211, 238, .35)); transition: filter .3s; }
.avatar-name { margin-top: 14px; font-size: 1.15rem; font-weight: 800; }
.avatar-role { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.avatar-status { margin-top: 12px; font-size: .8rem; color: var(--teal); min-height: 22px; }
.speaking-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); margin-right: 6px; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
.avatar-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.ring-anim { transform-origin: center; animation: spin 14s linear infinite; }
.ring-anim2 { transform-origin: center; animation: spin 22s linear infinite reverse; }

/* 口型改由 JS（LipSync）驱动 —— 旧版用 CSS `talk` 动画，与真实语音完全脱节，已移除。
   眨眼：独立装饰，不影响口型。 */
.avatar-svg .eye-l, .avatar-svg .eye-r { transform-box: fill-box; transform-origin: center; transition: transform .06s linear; }
.avatar-svg.blink .eye-l, .avatar-svg.blink .eye-r { transform: scaleY(.1); }
/* 说话时的头部/肩部微动：与语音同起同止（由 speak() 增删 .speaking 控制） */
.avatar-svg #avatarHead { transform-box: fill-box; transform-origin: 50% 92%; }
.avatar-svg.speaking #avatarHead { animation: nod 2.4s ease-in-out infinite; }
@keyframes nod {
  0%,100% { transform: rotate(0deg) translateY(0) }
  25% { transform: rotate(-1.1deg) translateY(-1.2px) }
  50% { transform: rotate(.9deg) translateY(.6px) }
  75% { transform: rotate(-.6deg) translateY(-.8px) }
}
.avatar-svg #avatarBody { transform-box: fill-box; transform-origin: 50% 0%; }
.avatar-svg.speaking #avatarBody { animation: breathe 3.1s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scaleY(1) } 50% { transform: scaleY(1.014) } }
.avatar-svg.speaking { filter: drop-shadow(0 0 36px rgba(34, 211, 238, .55)); }

.chat-panel { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 480px; }
/* 对话工具栏：字号调节 + 最大化 */
.chat-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1.5px dashed var(--line); flex-wrap: wrap; }
.chat-toolbar-title { font-size: .84rem; font-weight: 700; color: var(--cyan); letter-spacing: .5px; }
.chat-tools { display: flex; align-items: center; gap: 10px; }
.fs-group { display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px 3px 10px; border: 1px dashed var(--line); border-radius: 20px; }
.fs-label { font-size: .72rem; color: var(--muted); margin-right: 2px; }
.fs-btn { background: transparent; border: 1px solid transparent; color: var(--muted); font-size: .74rem; font-weight: 700; line-height: 1; padding: 5px 7px; border-radius: 12px; cursor: pointer; transition: all .18s; }
.fs-btn:hover { color: var(--cyan); border-color: rgba(34,211,238,.4); }
.fs-btn.on { color: #06121f; background: linear-gradient(135deg, var(--cyan), var(--purple)); border-color: transparent; box-shadow: 0 0 10px rgba(34,211,238,.45); }
.icon-btn { background: transparent; border: 1px dashed var(--line); color: var(--cyan); width: 32px; height: 30px; border-radius: 9px; cursor: pointer; font-size: .95rem; line-height: 1; transition: all .18s; }
.icon-btn:hover { background: rgba(34,211,238,.12); box-shadow: 0 0 12px rgba(34,211,238,.35); }
/* 最大化：对话面板铺满视口，但**必须为数字人形象栏留出左侧空间**。
   ⚠️ 早期实现用 `inset: 14px` 铺满整个视口，把左列形象栏整个盖住 —— 静态看不出问题，
   但「口型与语音同步」在最大化态就完全失效（脸被面板挡住）。故改为左边界避让形象栏。
   窄屏（≤900px）横排摆不下，由文件末尾的「顶部紧凑横条」方案接管。 */
.chat-panel.maximized {
  position: fixed; top: 14px; right: 14px; bottom: 14px; left: 250px;
  z-index: 220; height: auto; min-height: 0; border-radius: 16px;
  box-shadow: 0 0 60px rgba(34,211,238,.28);
}
body.chat-max-on { overflow: hidden; }
/* 最大化态的形象栏：脱离文档流固定在左栏（页面被 overflow:hidden 锁住，sticky 不可靠），
   垂直居中，矮屏可内部滚动，保证脸始终在视口内 → 口型始终可见 */
body.chat-max-on .avatar-stage {
  position: fixed; top: 14px; left: 14px; bottom: 14px; width: 224px; margin: 0;
  z-index: 221; display: flex; flex-direction: column; justify-content: center;
  overflow: hidden auto;
}
body.chat-max-on .avatar-svg { width: 172px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; font-size: var(--chat-fs, .92rem); }
.msg { max-width: 82%; padding: 12px 16px; border-radius: 14px; line-height: 1.7; animation: fadeUp .3s; white-space: normal; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.msg.ai { align-self: flex-start; background: rgba(34,211,238,.09); border: 1.5px dashed var(--line); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: rgba(167,139,250,.14); border: 1.5px dashed rgba(167,139,250,.45); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg .src { display: block; margin-top: 8px; font-size: .72rem; color: var(--muted); border-top: 1px dashed rgba(139,152,201,.3); padding-top: 6px; }
.quick-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 12px; }
.chip { font-size: .78rem; padding: 5px 13px; border-radius: 20px; border: 1px dashed var(--line); color: var(--cyan); cursor: pointer; transition: all .2s; }
.chip:hover { background: rgba(34,211,238,.12); box-shadow: 0 0 10px rgba(34,211,238,.3); }
.chat-input-row { display: flex; gap: 10px; padding: 14px 18px; border-top: 1.5px dashed var(--line); }
.chat-input-row input { flex: 1; }
.voice-btn.on { background: rgba(251,113,133,.15); border-color: var(--red); color: var(--red); }

/* ---------- Markdown 渲染（AI 回复） ---------- */
.md-body { word-break: break-word; }
.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }
.md-p { margin: 0 0 8px; }
.md-h { margin: 12px 0 8px; font-weight: 800; color: #e8f4ff; line-height: 1.4; }
.md-body h3.md-h { font-size: 1.08em; }
.md-body h4.md-h { font-size: 1em; }
.md-body h5.md-h, .md-body h6.md-h { font-size: .94em; color: var(--cyan); }
.md-list { margin: 6px 0 10px; padding-left: 1.35em; }
.md-list li { margin: 3px 0; }
.md-list li::marker { color: var(--cyan); }
.md-body code { background: rgba(34,211,238,.14); border: 1px solid rgba(34,211,238,.25); border-radius: 5px; padding: 1px 5px; font-size: .88em; font-family: ui-monospace, Menlo, Consolas, monospace; color: #a5f3fc; }
.md-pre { background: rgba(8,14,30,.75); border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; margin: 8px 0; }
.md-pre code { background: none; border: none; padding: 0; color: #cfe6ff; font-size: .86em; line-height: 1.6; }
.md-quote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--purple); background: rgba(167,139,250,.1); border-radius: 0 8px 8px 0; color: #c6d0f2; }
.md-hr { border: none; border-top: 1px dashed var(--line); margin: 12px 0; }
.md-body a { color: var(--cyan); text-decoration: underline dotted; }
.md-body strong { color: #ffffff; font-weight: 800; }
.md-body em { color: #d8c9ff; }
.md-body del { opacity: .6; }
/* 表格：外层可横向滚动，窄屏不挤压错位 */
.md-table-wrap { margin: 10px 0; overflow-x: auto; border-radius: 10px; }
.md-table { width: 100%; border-collapse: collapse; font-size: .96em; min-width: 260px; }
.md-table th, .md-table td { border: 1px solid rgba(34,211,238,.22); padding: 7px 10px; text-align: left; vertical-align: top; line-height: 1.55; }
.md-table thead th { background: rgba(34,211,238,.14); color: #eaf6ff; font-weight: 800; white-space: nowrap; }
.md-table tbody tr:nth-child(even) { background: rgba(255,255,255,.028); }
.md-table tbody tr:hover { background: rgba(34,211,238,.08); }
.page-sub { font-size: .72rem; font-weight: 600; color: var(--muted); border: 1px dashed var(--line); border-radius: 20px; padding: 2px 10px; margin-left: 8px; vertical-align: middle; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(5, 8, 18, .7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 18px; }
.modal { width: 520px; max-width: 96vw; max-height: 88vh; overflow-y: auto; padding: 26px; }
.modal h3 { margin-bottom: 18px; }
.modal .form-grid { grid-template-columns: 1fr 1fr; }
.modal .form-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* 使用说明书弹窗 */
.modal.manual-modal { width: 920px; max-width: 96vw; height: 86vh; max-height: 86vh; overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.manual-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px dashed rgba(139, 152, 201, .35); flex-shrink: 0; }
.manual-title { font-weight: 700; font-size: 16px; background: linear-gradient(90deg, #22d3ee, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.manual-frame { flex: 1; width: 100%; border: none; background: #fff; border-radius: 0 0 14px 14px; }

/* 后台管理 — 行内操作按钮 */
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.link-btn { color: var(--cyan); cursor: pointer; font-size: 13px; user-select: none; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

/* ---------- 寝室管理 ---------- */
.dorm-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.dorm-summary > div { padding: 14px 16px; border: 1.5px dashed rgba(34,211,238,.3); border-radius: 12px; background: rgba(34,211,238,.05); display: flex; align-items: baseline; gap: 8px; }
.dorm-summary b { font-size: 1.55rem; color: var(--cyan); }
.dorm-summary span { color: var(--muted); font-size: .82rem; }
.dorm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); gap: 14px; }
.dorm-card { padding: 16px; }
.dorm-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding-bottom: 11px; border-bottom: 1px dashed rgba(139,152,201,.25); }
.dorm-head > div { display: flex; flex-direction: column; gap: 3px; }
.dorm-head strong { font-size: 1.08rem; }
.dorm-building { color: var(--muted); font-size: .75rem; }
.dorm-leader { display: flex; align-items: center; gap: 9px; margin: 12px 0; padding: 9px 10px; border-radius: 9px; background: linear-gradient(90deg, rgba(251,191,36,.11), rgba(167,139,250,.08)); }
.dorm-leader span { color: var(--muted); font-size: .78rem; }
.dorm-leader b { color: var(--amber); flex: 1; }
.dorm-members { display: grid; gap: 7px; }
.dorm-member { display: grid; grid-template-columns: 42px 1fr auto; gap: 8px; align-items: center; padding: 7px 9px; border-radius: 8px; background: rgba(255,255,255,.025); font-size: .86rem; }
.dorm-member.leader { outline: 1px dashed rgba(251,191,36,.55); background: rgba(251,191,36,.07); }
.dorm-member small { color: var(--muted); font-size: .7rem; }
.bed-no { color: var(--cyan); font-variant-numeric: tabular-nums; font-size: .76rem; }
.dorm-pending { margin-top: 16px; padding: 16px; }
.dorm-pending-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.loading-panel { padding: 30px; text-align: center; color: var(--muted); }

.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--bg2); border: 1.5px dashed var(--line); color: var(--text);
  padding: 12px 26px; border-radius: 14px; z-index: 200; box-shadow: 0 0 24px rgba(34,211,238,.3);
  animation: fadeUp .3s;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .ai-layout { grid-template-columns: 1fr; }
  .avatar-stage { position: static; }
  .chat-panel { height: 60vh; }
}
@media (max-width: 640px) {
  .topbar { margin: 8px 8px 0; padding: 10px 14px; gap: 10px; }
  .brand-tag { display: none; }
  .main { padding: 14px 10px 30px; }
  .nav-tab { padding: 6px 11px; font-size: .82rem; }
  .chart-grid { grid-template-columns: 1fr; }
  .modal .form-grid { grid-template-columns: 1fr; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .dorm-summary { grid-template-columns: 1fr 1fr; }
  .dorm-member { grid-template-columns: 38px 1fr; }
  .dorm-member small { grid-column: 2; }
}

/* ================= 班费管理 ================= */
.fund-subtabs { display: flex; gap: 8px; margin: 12px 0 18px; flex-wrap: wrap; }
.fund-subtab { padding: 8px 16px; border: 1.5px dashed var(--border, rgba(34,211,238,.3)); border-radius: 10px; cursor: pointer; color: var(--text-dim, #94a3b8); background: rgba(255,255,255,.02); transition: all .2s; font-size: .9rem; }
.fund-subtab:hover { color: var(--cyan); border-color: var(--cyan); transform: translateY(-1px); }
.fund-subtab.active { background: linear-gradient(135deg, rgba(34,211,238,.2), rgba(168,85,247,.2)); border-color: var(--cyan); color: #fff; box-shadow: 0 0 12px rgba(34,211,238,.35); }
.fund-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.fund-card { padding: 18px 16px; border-radius: 14px; border: 1.5px dashed; position: relative; overflow: hidden; backdrop-filter: blur(8px); transition: transform .25s; }
.fund-card:hover { transform: translateY(-3px) scale(1.01); }
.fund-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, currentColor 0%, transparent 60%); opacity: .15; pointer-events: none; }
.fc-cyan { border-color: rgba(34,211,238,.5); color: #22d3ee; background: linear-gradient(135deg, rgba(34,211,238,.08), rgba(34,211,238,.02)); box-shadow: 0 0 18px rgba(34,211,238,.15); }
.fc-pink { border-color: rgba(244,114,182,.5); color: #f472b6; background: linear-gradient(135deg, rgba(244,114,182,.08), rgba(244,114,182,.02)); box-shadow: 0 0 18px rgba(244,114,182,.15); }
.fc-green { border-color: rgba(74,222,128,.5); color: #4ade80; background: linear-gradient(135deg, rgba(74,222,128,.08), rgba(74,222,128,.02)); box-shadow: 0 0 18px rgba(74,222,128,.15); }
.fc-amber { border-color: rgba(251,191,36,.5); color: #fbbf24; background: linear-gradient(135deg, rgba(251,191,36,.08), rgba(251,191,36,.02)); box-shadow: 0 0 18px rgba(251,191,36,.15); }
.fc-label { font-size: .82rem; opacity: .8; margin-bottom: 6px; }
.fc-value { font-size: 1.7rem; font-weight: 700; text-shadow: 0 0 10px currentColor; }
.fc-sub { font-size: .72rem; opacity: .7; margin-top: 4px; color: #94a3b8; }
.fund-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.fund-panel { padding: 16px; border: 1.5px dashed rgba(34,211,238,.25); border-radius: 14px; background: linear-gradient(135deg, rgba(255,255,255,.025), rgba(255,255,255,.01)); backdrop-filter: blur(6px); }
.panel-title { font-size: 1rem; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #e2e8f0; }
.panel-sub { font-size: .78rem; color: #94a3b8; font-weight: 400; flex: 1; }
.cat-tag { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: .78rem; background: rgba(34,211,238,.12); border: 1px solid rgba(34,211,238,.3); color: #22d3ee; }
.verify-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .76rem; font-weight: 600; }
.verify-tag.ok { background: rgba(74,222,128,.15); border: 1px solid rgba(74,222,128,.4); color: #4ade80; }
.verify-tag.err { background: rgba(248,113,113,.15); border: 1px solid rgba(248,113,113,.4); color: #f87171; }
.verify-tag.pending { background: rgba(251,191,36,.15); border: 1px solid rgba(251,191,36,.4); color: #fbbf24; }
.empty-tip { padding: 28px; text-align: center; color: #64748b; font-size: .88rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.advisor-note { max-width: 260px; font-size: .8rem; color: #cbd5e1; line-height: 1.4; }
.summary-row { background: rgba(34,211,238,.06); border-top: 1.5px solid rgba(34,211,238,.3); }
.budget-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 14px; }
.budget-summary > div { display: flex; justify-content: space-between; padding: 6px 10px; background: rgba(255,255,255,.03); border-radius: 6px; font-size: .85rem; }
.budget-summary b { color: #22d3ee; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.bar-label { width: 50px; font-size: .82rem; color: #94a3b8; }
.bar-track { flex: 1; height: 12px; background: rgba(255,255,255,.05); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width .6s; }
.bar-cyan { background: linear-gradient(90deg, #22d3ee, #06b6d4); box-shadow: 0 0 8px rgba(34,211,238,.5); }
.bar-pink { background: linear-gradient(90deg, #f472b6, #ec4899); box-shadow: 0 0 8px rgba(244,114,182,.5); }
.verify-info { padding: 10px 14px; background: rgba(34,211,238,.06); border: 1px dashed rgba(34,211,238,.3); border-radius: 8px; margin-bottom: 12px; font-size: .88rem; }
.verify-info p { margin: 4px 0; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.form-row-2 label { margin-bottom: 0; }
@media (max-width: 768px) {
  .fund-cards { grid-template-columns: 1fr 1fr; }
  .fund-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .fund-cards { grid-template-columns: 1fr; }
}

/* ---- 班费 · 生活委员动态维护 ---- */
.fund-quickbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(34,211,238,.10), rgba(244,114,182,.08));
  border: 1px dashed rgba(34,211,238,.4); border-radius: 12px; }
.fund-quickbar .btn-primary { box-shadow: 0 0 14px rgba(34,211,238,.35); }
.fund-batchbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px;
  background: rgba(255,255,255,.03); border: 1px dashed rgba(148,163,184,.3); border-radius: 10px; }
.fund-batchbar input[type="date"], .fund-batchbar input[type="text"], .fund-batchbar input:not([type]) {
  padding: 6px 10px; background: rgba(0,0,0,.25); border: 1px solid rgba(148,163,184,.3); border-radius: 6px; color: #e2e8f0; }
.muted { color: #94a3b8; font-size: .82rem; }
.chk-col { width: 38px; text-align: center; }
.chk-col input { width: 15px; height: 15px; accent-color: #22d3ee; cursor: pointer; }
.audit-trail { font-size: .78rem; color: #cbd5e1; line-height: 1.5; }
.audit-trail .muted { font-size: .72rem; }
.file-input { padding: 6px 0; font-size: .85rem; color: #cbd5e1; }
.file-input::file-selector-button { margin-right: 10px; padding: 5px 12px; background: rgba(34,211,238,.15);
  border: 1px solid rgba(34,211,238,.4); border-radius: 6px; color: #22d3ee; cursor: pointer; }
.receipt-preview { margin-top: 8px; min-height: 4px; }
.receipt-thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(34,211,238,.35); transition: transform .2s, box-shadow .2s; }
.receipt-thumb:hover { transform: scale(1.08); box-shadow: 0 0 12px rgba(34,211,238,.5); }
.receipt-thumb.sm { width: 40px; height: 30px; }
.receipt-full { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; background: rgba(0,0,0,.4); }
@media (max-width: 480px) {
  .fund-quickbar { flex-direction: column; align-items: stretch; }
  .fund-batchbar { flex-direction: column; align-items: stretch; }
  .fund-batchbar input { max-width: none !important; }
}

/* ================= 值日管理：责任区与分组 ================= */
.duty-subtabs { display: flex; gap: 8px; margin: 12px 0 18px; flex-wrap: wrap; }
.duty-subtab {
  padding: 8px 18px; border-radius: 10px; border: 1.5px dashed var(--line);
  color: var(--muted); cursor: pointer; font-size: .92rem; transition: all .2s;
}
.duty-subtab:hover { border-color: var(--cyan); color: var(--text); }
.duty-subtab.on { background: var(--grad); border-color: transparent; color: #0b1020; font-weight: 700; box-shadow: 0 0 16px rgba(167, 139, 250, .45); }

.duty-summary { grid-template-columns: repeat(4, 1fr); }

.duty-area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.duty-area-card {
  padding: 15px 17px; border-radius: 13px; border: 1.5px dashed rgba(34, 211, 238, .45);
  background: linear-gradient(135deg, rgba(34, 211, 238, .10), rgba(167, 139, 250, .06));
  position: relative; overflow: hidden; transition: transform .25s, box-shadow .25s;
}
.duty-area-card:hover { transform: translateY(-3px); box-shadow: 0 8px 26px rgba(34, 211, 238, .18); }
.duty-area-card::after { content: ""; position: absolute; right: -28px; top: -28px; width: 90px; height: 90px; border-radius: 50%; background: var(--grad); opacity: .12; }
.da-name { font-weight: 800; font-size: 1.08rem; color: var(--cyan); text-shadow: 0 0 12px rgba(34, 211, 238, .5); }
.da-meta { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.da-note { font-size: .78rem; color: #c6d0f2; margin-top: 6px; line-height: 1.55; }

.duty-rotation {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 16px; border-radius: 13px;
  border: 1.5px dashed rgba(251, 191, 36, .45);
  background: linear-gradient(135deg, rgba(251, 191, 36, .10), rgba(167, 139, 250, .07));
}
.duty-rotation strong { font-size: 1.06rem; color: var(--amber); text-shadow: 0 0 12px rgba(251, 191, 36, .45); }
.duty-rotation .dr-areas { font-size: .86rem; color: #c6d0f2; }
.duty-rotation .dr-spacer { flex: 1; min-width: 8px; }
.duty-rotation input[type="date"] { width: auto; padding: 6px 10px; }

.duty-members { max-width: 480px; line-height: 2; }
.duty-members .dm {
  display: inline-block; padding: 1px 9px; margin: 2px 5px 2px 0; border-radius: 12px;
  font-size: .8rem; border: 1px dashed rgba(139, 152, 201, .4); background: rgba(255, 255, 255, .03);
}
.duty-members .dm-m { color: var(--cyan); border-color: rgba(34, 211, 238, .45); background: rgba(34, 211, 238, .07); }
.duty-members .dm-f { color: var(--pink); border-color: rgba(244, 114, 182, .45); background: rgba(244, 114, 182, .07); }
.duty-members .dm-x { color: var(--muted); }
.duty-members .dm-l { font-weight: 700; color: var(--amber); border-color: rgba(251, 191, 36, .55); background: rgba(251, 191, 36, .12); }
.dm-l-text { color: var(--amber); }
.duty-title { font-size: .72rem; color: var(--muted); }

.duty-chk-list {
  max-height: 46vh; overflow-y: auto; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 4px;
  padding: 8px; border: 1.5px dashed rgba(139, 152, 201, .3); border-radius: 10px;
}
.duty-chk { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 8px; font-size: .86rem; cursor: pointer; }
.duty-chk:hover { background: rgba(34, 211, 238, .07); }
.duty-chk input { width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--cyan); cursor: pointer; }
.duty-chk small { color: var(--muted); font-size: .72rem; }
.duty-chk.used { color: var(--muted); }

/* ---- 值日拍照打卡（每组每日 3 张） ---- */
.dp-cell {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px; min-width: 76px;
  padding: 3px 10px; border-radius: 10px; cursor: pointer; user-select: none;
  border: 1.5px dashed rgba(139, 152, 201, .38); background: rgba(255, 255, 255, .03);
  transition: border-color .18s, background .18s, transform .18s;
}
.dp-cell:hover { border-color: rgba(34, 211, 238, .6); background: rgba(34, 211, 238, .08); transform: translateY(-1px); }
.dp-count { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.dp-hint { font-size: .66rem; color: var(--muted); }
.dp-cell.part { border-color: rgba(251, 191, 36, .55); background: rgba(251, 191, 36, .1); }
.dp-cell.part .dp-count { color: var(--amber); }
.dp-cell.ok { border-style: solid; border-color: rgba(52, 211, 153, .55); background: rgba(52, 211, 153, .1); }
.dp-cell.ok .dp-count { color: var(--green); }
.dp-cell.ok .dp-hint { color: rgba(52, 211, 153, .85); }

.dp-meta { font-size: .9rem; line-height: 1.8; margin: 2px 0 10px; }
.dp-note {
  font-size: .78rem; color: var(--muted); line-height: 1.7; margin-bottom: 14px; padding: 8px 12px;
  border-left: 2px solid rgba(34, 211, 238, .55); background: rgba(34, 211, 238, .05); border-radius: 0 8px 8px 0;
}
.dp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dp-slot {
  display: flex; flex-direction: column; min-height: 172px; border-radius: 12px; overflow: hidden;
  border: 1.5px dashed rgba(139, 152, 201, .38); background: rgba(255, 255, 255, .03);
}
.dp-slot.filled { border-style: solid; border-color: rgba(34, 211, 238, .3); background: rgba(34, 211, 238, .04); }
.dp-slot.empty { align-items: center; justify-content: center; gap: 7px; padding: 16px 10px; }
.dp-thumb { display: block; width: 100%; height: 120px; object-fit: cover; cursor: zoom-in; background: rgba(0, 0, 0, .25); }
.dp-plus { font-size: 2rem; line-height: 1; color: rgba(139, 152, 201, .7); }
.dp-slot-tip { font-size: .74rem; color: var(--muted); }
.dp-slot-bar { padding: 6px 9px 0; }
.dp-slot-label { font-size: .7rem; color: var(--muted); }
.dp-slot-who { padding: 1px 9px 0; font-size: .68rem; color: var(--muted); }
.dp-slot-btns { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px 9px 10px; margin-top: auto; }
.dp-slot-btns .btn { padding: 4px 9px; font-size: .74rem; }

.dp-lightbox {
  position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; cursor: zoom-out; background: rgba(3, 7, 18, .9); backdrop-filter: blur(3px);
}
.dp-lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .65); }
.dp-lb-tip { font-size: .8rem; color: #cbd5e1; }
.receipt-loading { padding: 28px 0; text-align: center; }
/* 打卡弹窗里的 file input 由「📷 拍照 / 🖼 选图」按钮触发，不直接展示 */
.dp-file-input { display: none; }

@media (max-width: 768px) {
  .duty-summary { grid-template-columns: repeat(2, 1fr); }
  .duty-members { max-width: none; }
  .duty-chk-list { grid-template-columns: 1fr 1fr; max-height: 42vh; }
  /* 打卡：手机竖屏排成单列，缩略图放大到可辨认 */
  .dp-grid { grid-template-columns: 1fr; }
  .dp-slot { min-height: 0; }
  .dp-thumb { height: 186px; }
  .dp-slot-btns .btn { flex: 1 1 auto; }
}

/* ---------- AI 数字人：窄屏适配 ---------- */
@media (max-width: 900px) {
  .ai-layout { grid-template-columns: 1fr; }
  .avatar-stage { position: static; }
}
@media (max-width: 768px) {
  .chat-panel { height: 74vh; min-height: 400px; }
  .chat-panel.maximized { inset: 8px; border-radius: 12px; }
  .chat-toolbar { padding: 9px 12px; }
  .chat-toolbar-title { font-size: .78rem; }
  .fs-btn { padding: 5px 6px; font-size: .7rem; }
  .fs-label { display: none; }
  .msg { max-width: 94%; }
  .md-table { min-width: 420px; }
}

/* 最大化 + 窄屏：形象栏改「顶部紧凑横条」。
   ≤900px 时 .ai-layout 已是单列，横向留不出侧栏 → 改纵向：
   形象栏压成一条 84px 小头像 + 名字 + 状态的横条固定在顶部，对话面板接在它下面。
   脸仍然可见 → 最大化态同样能看到口型。
   ⚠️ 本块必须排在文件靠后位置：前面的 `inset: 8px` 会覆盖 left/right，靠顺序取胜。 */
@media (max-width: 900px) {
  body.chat-max-on .avatar-stage {
    top: 8px; left: 8px; right: 8px; bottom: auto; width: auto; height: 112px; margin: 0;
    display: grid; grid-template-columns: 84px 1fr; grid-template-rows: auto auto;
    align-items: center; gap: 2px 12px; padding: 8px 12px; text-align: left;
    overflow: hidden;
  }
  body.chat-max-on .avatar-svg { width: 84px; grid-row: 1 / span 2; }
  body.chat-max-on .avatar-name { margin: 0; font-size: .95rem; }
  body.chat-max-on .avatar-role,
  body.chat-max-on .avatar-actions { display: none; }
  body.chat-max-on .avatar-status { margin: 0; font-size: .76rem; }
  /* 横条固定高 112（含 padding，全局 box-sizing:border-box）→ 底边 8+112=120，
     面板从 128 起，留 8px 间隙。若用 auto 高度，头像按 220:240 比例折算出的实际高度
     会略大于预估值，导致横条与面板出现 2px 重叠（曾实测到 bottom=118 / top=116）。 */
  .chat-panel.maximized { top: 128px; right: 8px; bottom: 8px; left: 8px; border-radius: 12px; }
}

/* ================= 夜跑管理（组队 / 打卡 / 积分 / 称号徽章） =================
 * 命名约定：run-* 页面级容器 · rt-* 队伍卡 · rh-* 本期概览与历史行
 *          rk-* 排行榜 · tl-* 称号墙 · rb / rb-svg / rb-name 徽章
 * 徽章 SVG 由 app.js runBadge() 内联生成（虚线外环 + 渐变圆底 + 图标），
 * 此处只负责尺寸、发光与锁定/已获得的视觉状态。
 */

/* ---- 通用：加载态 / 工具栏 / 区块标题 ---- */
.run-loading { padding: 24px; text-align: center; color: var(--muted); font-size: .86rem; }
.run-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.run-sec-title {
  display: flex; align-items: center; gap: 8px;
  margin: 22px 0 11px; font-size: .95rem; font-weight: 700; color: var(--text);
}
.run-sec-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 3px;
  background: var(--grad); box-shadow: 0 0 9px rgba(34, 211, 238, .5);
}
.run-empty { padding: 34px 20px; text-align: center; }
.run-empty-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 10px; filter: drop-shadow(0 0 14px rgba(34, 211, 238, .5)); }
.run-empty-title { font-weight: 700; margin-bottom: 7px; }

/* ---- 本期概览卡（run-hero） ---- */
.run-hero {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 18px; padding: 16px 18px;
}
.rh-main { flex: 1 1 300px; min-width: 0; }
.rh-title {
  font-size: 1.16rem; font-weight: 800; line-height: 1.35;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px rgba(34, 211, 238, .4));
}
.rh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; font-size: .82rem; color: var(--muted); }
.rh-note {
  margin-top: 10px; padding: 8px 12px; font-size: .8rem; color: var(--muted); line-height: 1.7;
  border-left: 2px solid rgba(167, 139, 250, .55); background: rgba(167, 139, 250, .06); border-radius: 0 8px 8px 0;
}
.rh-do { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; flex: 0 0 auto; }
.rh-done {
  font-size: .88rem; padding: 8px 13px; border-radius: 11px; line-height: 1.6;
  border: 1px dashed rgba(52, 211, 153, .5); background: rgba(52, 211, 153, .1); color: var(--green);
}
.rh-done b { color: var(--text); }
.rh-pts { display: inline-block; margin-left: 7px; padding: 1px 9px; border-radius: 20px; font-weight: 700; color: var(--amber); border: 1px dashed rgba(251, 191, 36, .55); background: rgba(251, 191, 36, .12); }
.rh-btn { padding: 11px 26px; font-size: 1rem; }
.rh-tip { text-align: right; }

/* ---- 队伍卡（run-team / rt-*） ---- */
.run-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(286px, 1fr)); gap: 12px; }
.run-team { padding: 13px 15px; display: flex; flex-direction: column; }
.run-team.mine {
  border-style: solid; border-color: rgba(34, 211, 238, .6);
  background: rgba(34, 211, 238, .07);
  box-shadow: 0 0 22px rgba(34, 211, 238, .22), inset 0 0 32px rgba(34, 211, 238, .05);
}
.rt-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.rt-name { font-weight: 700; font-size: .96rem; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rt-mine {
  font-style: normal; font-size: .68rem; font-weight: 700; padding: 1px 8px; border-radius: 20px;
  color: var(--cyan); border: 1px dashed rgba(34, 211, 238, .6); background: rgba(34, 211, 238, .13);
}
.rt-meta { font-size: .76rem; color: var(--muted); }
.rt-meta b { color: var(--amber); font-size: .88rem; }
.rt-members { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.rt-m {
  font-size: .74rem; padding: 2px 9px; border-radius: 12px; color: var(--muted);
  border: 1px dashed rgba(139, 152, 201, .4); background: rgba(255, 255, 255, .03);
}
.rt-m em { font-style: normal; color: var(--cyan); }
.rt-m.ok { color: var(--green); border-color: rgba(52, 211, 153, .5); background: rgba(52, 211, 153, .1); }
.rt-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.rt-actions .btn { padding: 7px 15px; font-size: .86rem; }

/* ---- 历史夜跑（run-hist-wrap / rh-*） ---- */
.run-hist-wrap { padding: 6px 9px; }
.run-hist {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  cursor: pointer; transition: background .18s, transform .18s;
  border-bottom: 1px dashed rgba(139, 152, 201, .2);
}
.run-hist:last-child { border-bottom: none; }
.run-hist:hover { background: rgba(34, 211, 238, .09); transform: translateX(2px); }
.rh-date { flex: 0 0 auto; min-width: 88px; font-size: .78rem; color: var(--muted); }
.rh-t { flex: 1 1 auto; min-width: 0; font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-s { flex: 0 0 auto; font-size: .76rem; color: var(--muted); }

/* ---- 排行榜（rk-*） ---- */
.rk-scopes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip.on {
  background: var(--grad); border-color: transparent; color: #0b1020; font-weight: 700;
  box-shadow: 0 0 14px rgba(167, 139, 250, .5);
}
.rk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(264px, 1fr)); gap: 12px; }
.rk-card { padding: 13px 15px; }
.rk-title { font-weight: 700; font-size: .9rem; margin-bottom: 9px; }
.rk-row {
  display: flex; align-items: center; gap: 9px; padding: 6px 9px; border-radius: 9px;
  font-size: .86rem; border-bottom: 1px dashed rgba(139, 152, 201, .18);
}
.rk-row:last-child { border-bottom: none; }
.rk-row.top1 { background: rgba(251, 191, 36, .12); box-shadow: inset 0 0 18px rgba(251, 191, 36, .1); }
.rk-row.top2 { background: rgba(203, 213, 225, .1); }
.rk-row.top3 { background: rgba(251, 146, 60, .1); }
.rk-no { flex: 0 0 auto; width: 28px; text-align: center; font-weight: 700; font-size: .86rem; }
.rk-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-val { flex: 0 0 auto; font-weight: 700; color: var(--cyan); }
.rk-val em { font-style: normal; font-size: .72rem; font-weight: 600; color: var(--muted); margin-left: 2px; }
.rk-empty { padding: 14px 4px; }

/* ---- 称号墙（tl-*） ---- */
.tl-sec { padding: 15px 17px; margin-bottom: 14px; }
.tl-title { font-weight: 700; font-size: .92rem; margin-bottom: 13px; }
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(106px, 1fr)); gap: 12px; }
.tl-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 11px 8px; border-radius: 13px; border: 1px dashed transparent; transition: all .22s;
}
.tl-item.got {
  border-color: rgba(251, 191, 36, .5); background: rgba(251, 191, 36, .08);
  box-shadow: 0 0 18px rgba(251, 191, 36, .16);
}
.tl-item.lock { opacity: .34; filter: grayscale(.9); }
.tl-meta { font-size: .7rem; color: var(--muted); text-align: center; line-height: 1.55; }
.tl-rank { display: flex; flex-direction: column; }
.tl-rank-row {
  display: flex; align-items: center; gap: 9px; padding: 6px 9px; font-size: .86rem;
  border-bottom: 1px dashed rgba(139, 152, 201, .18);
}
.tl-rank-row:last-child { border-bottom: none; }

/* ---- 称号徽章（rb） ---- */
.rb {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: default; transition: transform .22s;
}
.rb:hover { transform: translateY(-2px) scale(1.05); }
.rb-svg {
  width: 56px; height: 56px; display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .45)) drop-shadow(0 0 10px rgba(167, 139, 250, .28));
}
.rb-name { font-size: .72rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.tl-all .rb-svg { width: 48px; height: 48px; }
.tl-all .rb-name { font-size: .68rem; }

/* ---- 夜跑：窄屏适配 ---- */
@media (max-width: 900px) {
  .run-teams { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
}
@media (max-width: 768px) {
  /* 概览卡：横排改竖排，打卡按钮撑满，避免顶部按钮被挤压 */
  .run-hero { flex-direction: column; padding: 14px; }
  .rh-main { flex: 1 1 auto; }
  .rh-do { align-items: stretch; width: 100%; }
  .rh-do .btn { width: 100%; }
  .rh-btn { padding: 12px; }
  .rh-tip { text-align: center; }
  .run-teams { grid-template-columns: 1fr; }
  .run-tools .btn { flex: 1 1 auto; }
  /* 历史行：日期与统计换行显示，标题不再被挤成省略号 */
  .run-hist { flex-wrap: wrap; gap: 4px 10px; }
  .rh-date { min-width: 0; }
  .rh-t { flex: 1 1 100%; white-space: normal; }
  .rk-grid { grid-template-columns: 1fr; }
  .tl-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 9px; }
  .rb-svg, .tl-all .rb-svg { width: 46px; height: 46px; }
  .rb-name, .tl-all .rb-name { font-size: .66rem; }
  .tl-sec { padding: 13px 12px; }
}

/* ---- 班级课表（sched-*，2026-09-18 新增）----
 * 周课表用 CSS Grid：首列节次 + 5 个星期列；窄屏靠横向滚动保持表格语义，
 * 不改成卡片堆叠——课表的价值在"一眼看到某天某节"。
 */
.sched-tabs { margin-bottom: 14px; }
.sched-hero {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 13px;
  padding: 16px 18px; margin-bottom: 14px;
}
.sched-hero .sh-block {
  flex: 1 1 152px; min-width: 142px; padding: 10px 14px;
  border: 1.5px dashed var(--line); border-radius: 12px;
  background: linear-gradient(160deg, rgba(34, 211, 238, .08), rgba(167, 139, 250, .05));
}
.sh-k { font-size: .74rem; color: var(--muted); margin-bottom: 4px; }
.sh-v { font-size: 1.02rem; font-weight: 800; line-height: 1.3; }
.sh-foot { font-size: .72rem; color: var(--muted); margin-top: 3px; }
.sh-do { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.sh-do .btn { white-space: nowrap; }
.sched-note {
  font-size: .8rem; color: var(--amber); border: 1px dashed var(--amber); border-radius: 10px;
  padding: 8px 12px; margin-bottom: 14px; background: rgba(251, 191, 36, .07);
}
.sched-hint { font-size: .74rem; }
.sched-wrap { overflow-x: auto; padding-bottom: 4px; }
.sched-grid {
  display: grid; grid-template-columns: 74px repeat(5, minmax(146px, 1fr));
  gap: 6px; min-width: 840px;
}
.sc-cell {
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px;
  background: rgba(34, 211, 238, .035); min-height: 58px; transition: all .2s;
}
.sc-head {
  text-align: center; font-weight: 700; font-size: .84rem; border-style: dashed;
  background: rgba(167, 139, 250, .09); min-height: 0; padding: 8px 6px;
}
.sc-head small { display: block; color: var(--muted); font-weight: 400; font-size: .68rem; margin-top: 2px; }
.sc-head.sc-today {
  color: var(--cyan); border-color: var(--cyan);
  box-shadow: inset 0 0 16px rgba(34, 211, 238, .28), 0 0 10px rgba(34, 211, 238, .18);
}
.sc-head.sc-today small { color: var(--cyan); }
.sc-today-col { background: rgba(34, 211, 238, .085); border-color: rgba(34, 211, 238, .42); }
.sc-period {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-style: dashed; background: rgba(167, 139, 250, .08); font-size: .82rem;
}
.sc-period small { color: var(--muted); font-size: .66rem; }
.sc-period-head { display: flex; align-items: center; justify-content: center; font-size: .78rem; }
.sc-empty { background: transparent; border-style: dashed; border-color: rgba(139, 152, 201, .16); }
.sc-course {
  position: relative; border: 1px dashed var(--line); border-radius: 9px;
  padding: 6px 8px; margin-bottom: 5px;
  background: linear-gradient(155deg, rgba(20, 30, 58, .92), rgba(17, 26, 51, .74));
  box-shadow: 0 2px 10px rgba(0, 0, 0, .22);
  transition: transform .2s, box-shadow .2s;
}
.sc-course:last-child { margin-bottom: 0; }
.sc-course:hover { transform: translateY(-1px); box-shadow: 0 0 16px rgba(34, 211, 238, .2); }
.sc-name { font-weight: 700; font-size: .84rem; line-height: 1.35; padding-right: 12px; }
.sc-line { font-size: .71rem; color: var(--muted); line-height: 1.5; }
.sc-room { font-size: .7rem; color: var(--cyan); margin-top: 2px; }
.sc-badge {
  position: absolute; top: 5px; right: 6px; font-size: .6rem; color: var(--amber);
  border: 1px dashed var(--amber); border-radius: 6px; padding: 0 4px;
  background: rgba(11, 16, 32, .85);
}
.sc-off { opacity: .42; }
.sc-editable { cursor: pointer; }
.sc-editable:hover { border-color: var(--cyan); }
.sc-del { position: absolute; bottom: 3px; right: 7px; font-size: .7rem; color: var(--muted); cursor: pointer; }
.sc-del:hover { color: var(--red); }
.sched-today { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px; }
.st-item {
  display: flex; gap: 12px; align-items: center; padding: 11px 13px;
  border: 1px dashed var(--line); border-radius: 11px; background: rgba(34, 211, 238, .05);
}
.st-slot {
  flex: 0 0 auto; font-size: .78rem; font-weight: 700; color: var(--cyan);
  border: 1px dashed var(--cyan); border-radius: 8px; padding: 4px 8px; white-space: nowrap;
}
.st-name { font-weight: 700; font-size: .9rem; }
.st-meta { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.sc-slot {
  display: inline-block; font-size: .72rem; color: var(--purple); border: 1px dashed var(--purple);
  border-radius: 6px; padding: 1px 6px; margin: 1px 3px 1px 0; white-space: nowrap;
}
@media (max-width: 900px) {
  .sched-hero .sh-block { flex: 1 1 44%; min-width: 0; }
  .sh-do { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
  .sh-do .btn { flex: 1 1 auto; }
}
@media (max-width: 768px) {
  .sched-grid { grid-template-columns: 58px repeat(5, minmax(124px, 1fr)); min-width: 700px; gap: 5px; }
  .sc-cell { padding: 6px; min-height: 54px; }
  .sched-hero { padding: 13px; gap: 10px; }
  .sh-v { font-size: .95rem; }
  .sched-today { grid-template-columns: 1fr; }
  /* 顶部按钮：窄屏下横排撑满，避免换行错位 */
  .sched-hero .sh-block { flex: 1 1 100%; }
}
