/* ============================================================
   校园智能服务 · 移动端设计系统 v2
   设计语言：校园星蓝 2.0（靛蓝→天蓝渐变）+ 轻盈卡片 + 圆角动效
   对标市面主流校园App（完美校园/辅导猫）的信息密度与交互习惯，
   保留自有品牌渐变与图标语言，不照搬任何一款。
   ============================================================ */
:root {
  /* 品牌色 */
  --brand-1: #1e5eff;
  --brand-2: #38b6ff;
  --brand-3: #6c5ce7;
  --brand-grad: linear-gradient(135deg, #1e5eff 0%, #38b6ff 100%);
  --brand-grad-deep: linear-gradient(135deg, #14339e 0%, #1e5eff 55%, #38b6ff 100%);

  /* 功能色 */
  --ok: #10b981; --ok-bg: #d1fae5;
  --warn: #f59e0b; --warn-bg: #fef3c7;
  --danger: #ef4444; --danger-bg: #fee2e2;
  --info: #0ea5e9; --info-bg: #e0f2fe;

  /* 中性色 */
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #172033;
  --text-2: #5b6478;
  --text-3: #9aa3b5;
  --line: #eef1f7;

  /* 几何 */
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 4px 18px rgba(30, 94, 255, 0.07);
  --shadow-lg: 0 12px 34px rgba(30, 94, 255, 0.14);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ================= 顶部应用栏（渐变Header） ================= */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--brand-grad-deep);
  color: #fff;
  padding: 14px 16px 20px;
  border-radius: 0 0 26px 26px;
  box-shadow: 0 8px 28px rgba(30, 94, 255, 0.30);
}
.nav::after { /* 顶部高光 */
  content: ""; position: absolute; left: 12%; right: 12%; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  border-radius: 2px;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 520px; margin: 0 auto;
}
.brand {
  font-size: 17px; font-weight: 800; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 8px;
}
.brand::before { content: "🎓"; font-size: 20px; }
.nav-links { display: none; }
.nav-user { display: flex; align-items: center; gap: 10px; font-size: 12px; opacity: 0.97; }
.nav-user .btn.ghost { padding: 5px 12px; font-size: 12px; border-radius: 999px; }
.nav-user .btn.ghost:active { background: rgba(255,255,255,0.18); }

/* 消息铃铛 + 角标 */
.nav-bell { position: relative; font-size: 20px; cursor: pointer; }
.nav-bell .dot {
  position: absolute; top: -2px; right: -5px; min-width: 15px; height: 15px;
  background: #ff5b5b; border-radius: 999px; font-size: 9px; line-height: 15px;
  text-align: center; padding: 0 4px; font-weight: 700;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.85);
}
/* 用户头像 */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.22); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; border: 2px solid rgba(255,255,255,0.65);
}

/* 问候横幅（登录后首页） */
.hero {
  max-width: 520px; margin: -4px auto 12px; padding: 0 14px;
  color: #475569; font-size: 13px; display: flex; justify-content: space-between; align-items: center;
}

/* ================= 内容容器 ================= */
.container { max-width: 520px; margin: 0 auto; padding: 14px 14px calc(96px + var(--safe-b)); }

/* ================= 轮播 Banner ================= */
.banner {
  border-radius: var(--radius); overflow: hidden; margin-bottom: 14px;
  box-shadow: var(--shadow-lg); position: relative; min-height: 120px;
  display: flex; align-items: center;
}
.banner .bn-inner { padding: 22px 20px; width: 100%; }
.banner .bn-title { font-size: 18px; font-weight: 800; color: #fff; }
.banner .bn-sub { font-size: 12px; color: rgba(255,255,255,0.85); margin-top: 4px; }
.banner .bn-emoji { position: absolute; right: 18px; font-size: 52px; opacity: 0.9; }
.banner.b1 { background: var(--brand-grad-deep); }
.banner.b2 { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.banner.b3 { background: linear-gradient(135deg, #10b981, #0ea5e9); }

/* ================= 卡片 ================= */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: #172033; margin-bottom: 12px; }
.card-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--brand-grad); }
.card-title h3 { margin: 0; font-size: 15px; }
.card h3 { margin: 0 0 8px; font-size: 15px; }
.card .more { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 400; cursor: pointer; }

/* ================= 网格 ================= */
.grid { display: grid; gap: 10px; margin-bottom: 12px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.hidden { display: none !important; }

/* ================= 服务宫格（首页入口） ================= */
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; padding: 4px 0; }
.service-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: #4b5568; font-weight: 500; cursor: pointer; }
.service-item .si-ico {
  width: 48px; height: 48px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 23px;
  background: linear-gradient(135deg, #e3ecff, #e6f2ff);
  box-shadow: 0 4px 10px rgba(30, 94, 255, 0.10);
  transition: transform 0.12s ease;
}
.service-item:active .si-ico { transform: scale(0.90) translateY(1px); }
.service-item .si-ico.c2 { background: linear-gradient(135deg, #d7f7e9, #ccf6f0); }
.service-item .si-ico.c3 { background: linear-gradient(135deg, #ffedd5, #fef3c7); }
.service-item .si-ico.c4 { background: linear-gradient(135deg, #fce7f3, #ede9fe); }
.service-item .si-ico.c5 { background: linear-gradient(135deg, #e0f2fe, #dbeafe); }

/* ================= 统计卡 ================= */
.stat { background: var(--card); border-radius: 14px; padding: 14px 4px; text-align: center; box-shadow: var(--shadow); }
.stat .num { font-size: 22px; font-weight: 800; color: var(--brand-1); }
.stat .label { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 14px; text-align: center;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-card .sc-ico { font-size: 24px; margin-bottom: 4px; }
.stat-card .sc-num { font-size: 24px; font-weight: 800; color: var(--brand-1); line-height: 1.2; }
.stat-card .sc-label { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* ================= 列表项 ================= */
.list-item {
  background: var(--card); border-radius: 14px; padding: 13px 14px; margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.list-item h4 { margin: 0 0 4px; font-size: 15px; color: #172033; }
.list-item .meta { font-size: 12px; color: var(--text-2); }
.list-item .ops { margin-top: 8px; }
.list-item b { color: #172033; }
.list-item:active { transform: scale(0.99); }

/* 可点击列表（箭头） */
.cell {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius-sm);
  padding: 13px 14px; margin-bottom: 10px; box-shadow: var(--shadow);
  cursor: pointer;
}
.cell .c-ico {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: linear-gradient(135deg, #e3ecff, #e6f2ff);
}
.cell .c-body { flex: 1; min-width: 0; }
.cell .c-title { font-size: 14px; font-weight: 600; color: #172033; }
.cell .c-sub { font-size: 11px; color: var(--text-2); margin-top: 1px; }
.cell .c-arrow { color: #c3c9d6; font-size: 16px; flex-shrink: 0; }
.cell:active { transform: scale(0.99); }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--brand-grad);
  color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(30, 94, 255, 0.25);
  transition: transform 0.08s;
}
.btn:active { transform: scale(0.97); }
.btn.small { padding: 7px 13px; font-size: 12px; border-radius: 10px; box-shadow: 0 2px 8px rgba(30,94,255,0.18); }
.btn.green { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 14px rgba(16,185,129,.25); }
.btn.red { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 4px 14px rgba(239,68,68,.25); }
.btn.orange { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 4px 14px rgba(245,158,11,.25); }
.btn.ghost { background: transparent; box-shadow: none; border: 1.5px solid rgba(255,255,255,0.7); color: #fff; }
.btn.ghost-dark { background: #fff; color: var(--brand-1); box-shadow: 0 2px 10px rgba(30,94,255,0.12); }
.btn.block { width: 100%; }

/* ================= 徽章 / 状态胶囊 ================= */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; vertical-align: middle; }
.badge.green { background: var(--ok-bg); color: #047857; }
.badge.red { background: var(--danger-bg); color: #b91c1c; }
.badge.orange { background: var(--warn-bg); color: #b45309; }
.badge.blue { background: var(--info-bg); color: #0369a1; }
.badge.gray { background: #eef1f7; color: #5b6478; }
.badge.purple { background: #ede9fe; color: #6d28d9; }

/* ================= 表单 ================= */
input, select, textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid #e6eaf2; border-radius: 12px;
  font-size: 15px; background: #fff; color: #172033; margin-bottom: 10px;
  font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(30,94,255,0.08); }

/* 搜索栏 */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: #f2f5fb; border-radius: 999px; padding: 8px 14px; margin-bottom: 12px;
}
.search-bar input { border: none; background: transparent; padding: 0; margin: 0; font-size: 13px; flex: 1; box-shadow: none; }
.search-bar .s-ico { font-size: 15px; color: var(--text-3); }

/* 分段器 */
.seg { display: flex; background: #eef1f7; border-radius: 999px; padding: 3px; margin-bottom: 12px; gap: 3px; }
.seg .seg-item {
  flex: 1; text-align: center; padding: 7px 0; border-radius: 999px;
  font-size: 13px; color: var(--text-2); cursor: pointer; font-weight: 500;
}
.seg .seg-item.active { background: #fff; color: var(--brand-1); font-weight: 700; box-shadow: 0 2px 8px rgba(30,94,255,0.12); }

/* ================= 提示 ================= */
.msg { padding: 10px 12px; border-radius: 12px; font-size: 13px; margin-bottom: 10px; display: none; }
.msg.err { background: var(--danger-bg); color: #b91c1c; display: block; }
.msg.ok { background: var(--ok-bg); color: #047857; display: block; }
.text-muted { color: var(--text-2); font-size: 12px; }
.label { font-size: 12px; color: var(--text-2); }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.ops { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ops input, .ops select { width: auto; margin-bottom: 0; }

/* 空态 */
.empty {
  text-align: center; padding: 36px 16px; color: var(--text-3);
}
.empty .e-emoji { font-size: 46px; margin-bottom: 8px; }
.empty .e-text { font-size: 13px; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 44%; transform: translate(-50%, -50%);
  background: rgba(23, 32, 51, 0.92); color: #fff; padding: 12px 22px;
  border-radius: 999px; font-size: 14px; z-index: 3000;
  animation: toast-in 0.2s ease; max-width: 80%; text-align: center;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* ================= 底部Tab栏 ================= */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(23, 32, 51, 0.06);
  padding-bottom: var(--safe-b);
}
.tabbar-inner { max-width: 520px; margin: 0 auto; display: flex; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0 10px; font-size: 10px; color: #a0a8b8;
  transition: color 0.15s; cursor: pointer; text-decoration: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  position: relative; z-index: 210;
}
.tab .tab-ico { font-size: 21px; line-height: 1.2; }
.tab.active { color: var(--brand-1); font-weight: 700; }
.tab.active .tab-ico { transform: translateY(-1px); }

/* ================= 移动端登录页 ================= */
.login-page {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--brand-grad-deep);
  color: #fff; position: relative; overflow: hidden;
}
.login-page::before { /* 装饰圆 */
  content: ""; position: absolute; top: -90px; right: -70px; width: 260px; height: 260px;
  border-radius: 50%; background: rgba(255,255,255,0.08);
}
.login-page::after {
  content: ""; position: absolute; top: 60px; left: -60px; width: 160px; height: 160px;
  border-radius: 50%; background: rgba(255,255,255,0.05);
}
.login-top { padding: 56px 24px 26px; text-align: center; position: relative; z-index: 1; }
.login-top .logo {
  width: 78px; height: 78px; margin: 0 auto 16px; border-radius: 24px;
  background: rgba(255,255,255,0.20); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.18);
}
.login-top h1 { margin: 0 0 6px; font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.login-top p { margin: 0; font-size: 13px; opacity: 0.85; }
.login-card {
  background: #fff; border-radius: 28px 28px 0 0; margin-top: auto; position: relative; z-index: 1;
  padding: 26px 24px calc(32px + var(--safe-b));
  color: #172033; box-shadow: 0 -12px 40px rgba(20, 51, 158, 0.15);
}
.login-card h2 { margin: 0 0 18px; font-size: 17px; text-align: center; color: #172033; }
.login-card input { padding: 13px 16px; }
.login-card .btn { padding: 13px; font-size: 16px; border-radius: 14px; }
.quick-acc { margin-top: 14px; }
.quick-acc .qa-title { font-size: 12px; color: #9aa3b5; margin-bottom: 8px; text-align: center; }
.qa-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.qa-chip {
  padding: 6px 12px; border-radius: 999px; font-size: 12px;
  background: #f2f5fb; color: #5b6478; border: 1px solid #e6eaf2; cursor: pointer;
}
.qa-chip:active { background: #e3ecff; color: #1e5eff; }
.login-foot { text-align: center; margin-top: 16px; font-size: 13px; color: #5b6478; }
.login-foot .link { color: var(--brand-1); font-weight: 600; cursor: pointer; }

/* ================= 弹窗 ================= */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(23,32,51,0.55); z-index: 1000; justify-content: center; align-items: center; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal-box { background: #fff; border-radius: 22px; padding: 24px 20px; width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto; position: relative; }
.modal-box h3 { margin: 0 0 16px; font-size: 16px; text-align: center; color: #172033; }
.modal-close { position: absolute; top: 10px; right: 14px; font-size: 22px; cursor: pointer; color: #9aa3b5; background: none; border: none; }
.modal-close:active { color: #333; }

/* ================= 其他 ================= */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th, table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table th { color: var(--text-2); font-weight: 600; }
hr { border: none; border-top: 1px solid var(--line); margin: 12px 0; }

/* 分隔线标题 */
.section-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: #172033; margin: 18px 0 10px; }
.section-title::before { content: ""; width: 4px; height: 15px; border-radius: 2px; background: var(--brand-grad); }

/* 数量角标（宫格入口小红点） */
.count-dot {
  position: absolute; top: 6px; right: 18%; min-width: 16px; height: 16px;
  background: var(--danger); color: #fff; border-radius: 999px;
  font-size: 9px; line-height: 16px; text-align: center; padding: 0 4px; font-weight: 700;
}

/* 桌面宽屏下限制阅读宽度 */
@media (min-width: 900px) {
  .container, .nav-inner, .tabbar-inner, .hero { max-width: 620px; }
  body { font-size: 15px; }
}

/* ============ 学习通式个人中心 ============ */
.mine-header {
  margin: 12px 14px 0; padding: 20px 18px; border-radius: 18px;
  background: linear-gradient(135deg, #3a7ef6 0%, #2e77f5 40%, #6ea8ff 100%);
  color: #fff; display: flex; align-items: center; gap: 16px;
  box-shadow: 0 8px 20px rgba(58, 126, 246, 0.25);
}
.mine-avatar {
  width: 62px; height: 62px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.25); border: 2px solid rgba(255, 255, 255, 0.6);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.mine-info { flex: 1; min-width: 0; }
.mine-name { font-size: 20px; font-weight: 700; }
.mine-role {
  display: inline-block; margin-top: 6px; font-size: 11px;
  background: rgba(255, 255, 255, 0.22); padding: 2px 10px; border-radius: 999px;
}
.mine-uid { font-size: 11px; opacity: 0.85; margin-top: 6px; }
