/* 班务助手 · 手机前台（风格参照问诊宝：浅色清爽 / 卡片 / 渐变头图 / 底部导航） */
:root {
  --bg: #f4f5fa;
  --bg-deep: #e9ecf4;
  --surface: #fff;
  --surface-2: #f8f9fd;
  --surface-3: #eef0f7;
  --border: #e7e9f1;
  --border-strong: #d6d9e6;
  --text: #202338;
  --text-2: #5b6076;
  --text-dim: #969bab;
  --accent: #12b8a6;
  --accent-2: #6c6cff;
  --accent-soft: #e5faf6;
  --gold: #f6c453;
  --gold-soft: #fff6e5;
  --red: #e5484d;
  --red-soft: #ffeff0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 18px rgba(30, 36, 80, .06);
  --shadow-lg: 0 14px 40px rgba(30, 36, 80, .14);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-deep); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.phone { width: min(480px, 100%); min-height: 100vh; margin: 0 auto; background: var(--bg); position: relative; box-shadow: 0 0 40px rgba(30, 36, 80, .08); overflow: hidden; }

/* ---------- 登录注册 ---------- */
.auth-view { min-height: 100vh; }
.auth-hero {
  height: 218px; padding: 40px 22px 0; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(125deg, #12b8a6, #5d7bf5 62%, #6c6cff);
}
.auth-hero-inner { position: relative; z-index: 2; }
.auth-logo { width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.4); display: grid; place-items: center; font-size: 24px; font-weight: 800; }
.auth-hero h1 { margin: 12px 0 4px; font-size: 24px; letter-spacing: -.5px; }
.auth-hero p { margin: 0; font-size: 12px; opacity: .92; }
.auth-mini { display: inline-block; margin-top: 14px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.36); padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.auth-deco { position: absolute; right: 6px; bottom: -28px; font-size: 112px; opacity: .22; transform: rotate(-14deg); }
.auth-card { margin: -34px 16px 24px; padding: 20px 18px 22px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); position: relative; z-index: 3; }
.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 11px; margin-bottom: 18px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 0; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.seg button.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.seg.small button { padding: 7px 0; font-size: 12px; margin-bottom: 6px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-field { display: block; }
.auth-field > span { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin: 0 0 6px 2px; }
.auth-field input, .auth-field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface-2); color: var(--text); outline: none; font-size: 14px;
}
.auth-field input:focus, .auth-field select:focus { border-color: var(--accent); background: #fff; }
.field-hint { font-size: 11px; color: var(--text-dim); line-height: 1.6; margin-top: 4px; }
.auth-tip { text-align: center; font-size: 11px; color: var(--text-dim); margin: 16px 0 0; line-height: 1.7; }
.auth-tip a { color: var(--accent); text-decoration: none; font-weight: 700; }

/* ---------- 顶栏 ---------- */
.app-view { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.topbar-inner { height: 56px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand .logo { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; flex: none; }
.brand > div { font-size: 15px; font-weight: 800; line-height: 1.1; }
.brand small { display: block; font-size: 10px; color: var(--text-dim); font-weight: 600; margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-select { max-width: 128px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 700; outline: none; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 16px; position: relative; display: grid; place-items: center; }
.dot { position: absolute; right: 3px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.notice-strip { margin: 0 16px 8px; padding: 7px 11px; border-radius: 10px; background: var(--gold-soft); color: #a87613; font-size: 11px; font-weight: 600; }

/* ---------- 通用块 ---------- */
.main { padding: 12px 14px 20px; }
.panel { display: none; }
.panel.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.hero-banner { border-radius: 18px; padding: 18px; color: #fff; background: linear-gradient(120deg, #12b8a6, #6c6cff); box-shadow: 0 10px 26px rgba(18,184,166,.22); position: relative; overflow: hidden; }
.hero-banner h2 { margin: 0; font-size: 18px; font-weight: 800; }
.hero-banner p { margin: 7px 0 0; font-size: 11px; opacity: .92; line-height: 1.6; }
.hero-banner .mini { display: inline-block; margin-top: 12px; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.35); padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.hero-banner .deco { position: absolute; right: 6px; bottom: -18px; font-size: 76px; opacity: .26; transform: rotate(-12deg); }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 4px; }
.quick { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 12px 3px; text-align: center; box-shadow: var(--shadow); transition: .15s; color: var(--text-2); }
.quick:active { transform: scale(.96); }
.quick .ico { display: block; font-size: 22px; margin-bottom: 5px; }
.quick .txt { font-size: 10px; font-weight: 700; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 9px; }
.section-title h2 { margin: 0; font-size: 14px; font-weight: 800; }
.section-title .more { font-size: 11px; color: var(--accent); text-decoration: none; font-weight: 700; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 10px; }
.card.soft { background: var(--surface-2); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.av { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 20px; font-weight: 800; flex: none; }
.av.purple { background: #eeecff; color: var(--accent-2); }
.av.gold { background: var(--gold-soft); color: #b88414; }
.av.red { background: var(--red-soft); color: var(--red); }
.name { font-size: 13px; font-weight: 800; }
.sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.chip.teal { background: var(--accent-soft); color: var(--accent); }
.chip.gold { background: var(--gold-soft); color: #a87613; }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.purple { background: #eeecff; color: var(--accent-2); }
.empty { text-align: center; color: var(--text-dim); font-size: 12px; padding: 26px 10px; }
.empty .ico { font-size: 34px; display: block; margin-bottom: 8px; opacity: .6; }
.loading { text-align: center; color: var(--text-dim); font-size: 12px; padding: 22px; }

/* ---------- 按钮 ---------- */
.btn { border: 0; border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 800; background: var(--surface-3); color: var(--text-2); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.btn.primary { background: linear-gradient(120deg, var(--accent), #3ad0bd); color: #fff; box-shadow: 0 5px 14px rgba(18,184,166,.25); }
.btn.purple { background: linear-gradient(120deg, var(--accent-2), #8b8bff); color: #fff; }
.btn.gold { background: linear-gradient(120deg, #f6c453, #e8a62a); color: #4a3100; }
.btn.ghost { background: var(--surface); border: 1px solid var(--border); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.sm { padding: 6px 11px; font-size: 11px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 底部导航 ---------- */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(480px, 100%); height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border); z-index: 70; display: flex; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-dim); font-size: 10px; font-weight: 700; background: none; border: 0; }
.nav-item .ico { font-size: 21px; line-height: 1; }
.nav-item.active { color: var(--accent); }
.nav-item { position: relative; }
.nav-dot { position: absolute; top: 4px; left: calc(50% + 10px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,.2); }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 24, 48, .45); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal-box { width: min(480px, 100%); max-height: 88vh; overflow-y: auto; background: var(--surface); border-radius: 20px 20px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: up .2s ease; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-x { border: 0; background: var(--surface-3); color: var(--text-2); width: 28px; height: 28px; border-radius: 50%; font-size: 17px; }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-row > span { font-size: 12px; font-weight: 700; color: var(--text-2); }
.form-row input, .form-row select, .form-row textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); color: var(--text); outline: none; font-size: 14px; }
.form-row textarea { min-height: 80px; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--accent); }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ---------- 列表 / 时间轴 / 成绩 / 聊天 ---------- */
.list-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .meta { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.score-box { background: var(--surface-2); border-radius: 12px; padding: 12px 6px; text-align: center; }
.score-box b { display: block; font-size: 18px; color: var(--accent-2); }
.score-box span { font-size: 10px; color: var(--text-dim); }
.radar-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 11px; }
.radar-row .bar { flex: 1; height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.radar-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.timeline { position: relative; padding-left: 16px; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 16px 8px; }
.tl-item::before { content: ''; position: absolute; left: -15px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.tl-item .date { font-size: 10px; color: var(--text-dim); }
.tl-item .t { font-size: 12px; font-weight: 800; margin-top: 2px; }
.tl-item .d { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.chat-list { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 78%; padding: 9px 12px; border-radius: 13px; font-size: 12px; line-height: 1.6; }
.msg.mine { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 3px; }
.msg.theirs { align-self: flex-start; background: var(--surface-3); color: var(--text); border-bottom-left-radius: 3px; }
.chat-box { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 12px; min-height: 220px; }
.chat-input { display: flex; gap: 8px; }
.chat-input input { flex: 1; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); outline: none; font-size: 13px; }
.member-card { border-radius: 18px; padding: 20px; color: #fff; background: linear-gradient(125deg, #f6c453, #e08b1e); box-shadow: 0 10px 26px rgba(224,139,30,.25); }
.member-card h3 { margin: 0; font-size: 17px; }
.member-card p { margin: 8px 0 0; font-size: 11px; opacity: .92; }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: rgba(32,35,56,.94); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 12px; z-index: 200; box-shadow: var(--shadow-lg); max-width: 86%; text-align: center; }

@media (min-width: 520px) {
  .phone { min-height: 100vh; }
  .modal-mask { align-items: center; }
  .modal-box { border-radius: 20px; max-height: 80vh; }
}
