/* ==========================================================================
   课堂抬头率 · 教学看板  —— 设计系统
   风格：清爽教学风（蓝主色 + 青绿点缀），大圆角卡片，轻阴影
   ========================================================================== */
:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff4ff;
  --teal: #0d9488;
  --teal-soft: #ecfdf5;
  --amber: #f59e0b;
  --rose: #e11d48;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e6ebf3;
  --bg: #f4f7fc;
  --card: #ffffff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 10px rgba(15, 23, 42, .05), 0 12px 32px -18px rgba(15, 23, 42, .18);
  --shadow-lg: 0 8px 28px rgba(37, 99, 235, .16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- 布局 --- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.brand-logo {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #4f8cff);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px;
  box-shadow: var(--shadow-lg);
}
.brand-text strong { display: block; font-size: 15px; letter-spacing: .2px; }
.brand-text span { font-size: 12px; color: var(--ink-3); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 500;
}
.nav-item:hover { background: #f6f8fd; text-decoration: none; color: var(--brand); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav-item .ico { width: 20px; text-align: center; font-size: 16px; }
.nav-sep { margin: 12px 12px 6px; font-size: 11.5px; color: var(--ink-3); letter-spacing: 1px; }
.sidebar-foot { margin-top: auto; padding: 10px 12px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.main-narrow { max-width: 780px; margin: 0 auto; }

/* 右上角工具条 */
.topbar {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  margin: -6px 0 14px;
}
.topbar .btn { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
@media (max-width: 760px) {
  .topbar { margin: 0 0 12px; }
  .topbar .btn { padding: 7px 11px; font-size: 12.5px; }
}

/* ------------------------------------------------------------ 顶部标题 --- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.3px; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 13.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 卡片 --- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(230, 235, 243, .9);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.card-sub { font-size: 12.5px; color: var(--ink-3); margin: -8px 0 14px; }

/* -------------------------------------------------------------- 数据块 --- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); border: 1px solid rgba(230, 235, 243, .9);
  position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -24px; top: -24px;
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--brand-soft); opacity: .8;
}
.stat .k { font-size: 12.5px; color: var(--ink-3); }
.stat .v { font-size: 27px; font-weight: 800; letter-spacing: -.6px; margin-top: 2px; position: relative; }
.stat .v small { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.stat.teal::after { background: var(--teal-soft); }
.stat.teal .v { color: var(--teal); }
.stat.brand .v { color: var(--brand); }

/* ---------------------------------------------------------------- 表格 --- */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12.5px; color: var(--ink-3); font-weight: 600; background: #fbfcfe; }
tbody tr:hover { background: #f9fbff; }
tbody tr:last-child td { border-bottom: none; }
.num { font-variant-numeric: tabular-nums; }

.rate { font-weight: 700; font-variant-numeric: tabular-nums; }
.rate.good { color: var(--teal); }
.rate.mid { color: var(--amber); }
.rate.low { color: var(--rose); }

/* ---------------------------------------------------------------- 表单 --- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; font-size: 14.5px; color: var(--ink);
  background: #fbfcfe; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}
textarea { min-height: 132px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: -6px; margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 11px; border: 1.5px solid transparent;
  font-size: 14.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  background: var(--brand); color: #fff; transition: transform .06s, box-shadow .15s, background .15s;
  text-decoration: none;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; box-shadow: var(--shadow-lg); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: #f7f9fd; color: var(--brand); box-shadow: none; }
.btn.teal { background: var(--teal); }
.btn.teal:hover { background: #0b7a70; }
.btn.danger { background: #fff; color: var(--rose); border-color: #fecdd3; }
.btn.danger:hover { background: #fff1f3; box-shadow: none; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.toolbar .field { margin: 0; min-width: 150px; }

/* ---------------------------------------------------------------- 提示 --- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert.ok { background: var(--teal-soft); color: #0b6b62; border: 1px solid #c7f0e6; }
.alert.err { background: #fff1f3; color: #a3123a; border: 1px solid #fecdd3; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--brand-soft); color: var(--brand-dark);
}
.badge.gray { background: #f1f5f9; color: var(--ink-2); }
.badge.teal { background: var(--teal-soft); color: #0b6b62; }

.empty { text-align: center; padding: 38px 12px; color: var(--ink-3); font-size: 14px; }
.empty .big { font-size: 34px; display: block; margin-bottom: 8px; opacity: .5; }

/* -------------------------------------------------------------- 班级卡 --- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.class-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative;
}
.class-card .cno { font-size: 12px; color: var(--ink-3); font-family: ui-monospace, Consolas, monospace; }
.class-card .cname { font-size: 16px; font-weight: 700; margin: 3px 0 10px; }
.class-card .meta { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); }
.class-card .meta b { color: var(--brand); }

/* -------------------------------------------------------------- 学生端 --- */
.stu-hero {
  background: linear-gradient(135deg, #2563eb, #4f8cff 60%, #22b8a6);
  border-radius: 22px; color: #fff; padding: 24px 22px;
  box-shadow: 0 14px 34px -12px rgba(37, 99, 235, .55);
  margin-bottom: 18px;
}
.stu-hero .hi { font-size: 13px; opacity: .85; }
.stu-hero .nm { font-size: 25px; font-weight: 800; letter-spacing: -.5px; margin: 2px 0 10px; }
.stu-hero .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.stu-hero .meta span { background: rgba(255, 255, 255, .18); padding: 3px 11px; border-radius: 999px; }
.stu-hero .btn { background: #fff; color: var(--brand-dark); margin-top: 16px; }
.stu-hero .btn.done { background: rgba(255, 255, 255, .22); color: #fff; }

.timeline { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px;
  background: var(--teal-soft); color: #0b6b62; font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- 登录 --- */
.entry-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 28px 18px;
  background:
    radial-gradient(1000px 520px at 6% -12%, #e3edff 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 112%, #dcf7f1 0%, transparent 55%),
    var(--bg);
}
.entry-card {
  width: 100%; max-width: 430px; background: #fff; border-radius: 24px;
  padding: 28px 26px 22px; box-shadow: 0 26px 64px -26px rgba(15, 23, 42, .32);
  border: 1px solid rgba(255, 255, 255, .8);
}
.entry-head { text-align: center; margin-bottom: 20px; }
.entry-logo {
  width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 12px;
  display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 800;
  background: linear-gradient(135deg, var(--brand), #4f8cff 60%, #22b8a6);
  box-shadow: var(--shadow-lg);
}
.entry-head h1 { font-size: 20px; margin: 0; letter-spacing: -.3px; }
.entry-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); }

/* 分段切换 + 滑块 */
.seg {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  background: #eff2f8; border-radius: 14px; padding: 4px; margin-bottom: 4px;
}
.seg-pill {
  position: absolute; top: 4px; left: 4px; width: calc(50% - 4px); height: calc(100% - 8px);
  background: #fff; border-radius: 11px; box-shadow: 0 2px 8px rgba(15, 23, 42, .10);
  transition: transform .32s cubic-bezier(.22, .61, .36, 1);
}
.seg-btn {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  padding: 10px 8px; font-size: 14px; font-weight: 600; color: var(--ink-3);
  font-family: inherit; transition: color .22s; display: flex; align-items: center;
  justify-content: center; gap: 5px;
}
.seg-btn .ico { font-size: 15px; }
.seg-btn.on { color: var(--brand-dark); }

/* 左右滑动：外层 .slides-vp 负责裁剪，内层 .slides 负责位移 */
.slides-vp { overflow: hidden; margin-top: 16px; }
.slides {
  display: flex; width: 100%;
  transition: transform .38s cubic-bezier(.22, .61, .36, 1);
}
.slide { flex: 0 0 100%; width: 100%; padding: 0 1px; }
.slide-lead {
  font-size: 13px; color: var(--ink-3); margin: 0 0 16px; line-height: 1.65;
}
.slide-foot {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 12.8px; color: var(--ink-3); text-align: center;
}
.entry-foot {
  margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line);
  text-align: center; font-size: 13px; color: var(--ink-3);
}
.entry-foot a { color: var(--ink-2); }
.entry-foot a:hover { color: var(--brand); }
.entry-foot span { margin: 0 8px; color: var(--line); }

@media (max-width: 760px) {
  .entry-card { padding: 22px 18px 18px; border-radius: 20px; }
  .entry-head h1 { font-size: 18.5px; }
}

.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1000px 500px at 8% -10%, #e3edff 0%, transparent 60%),
    radial-gradient(900px 480px at 100% 110%, #dcf7f1 0%, transparent 55%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 404px; background: #fff; border-radius: 22px;
  padding: 32px 30px; box-shadow: 0 24px 60px -24px rgba(15, 23, 42, .3);
  border: 1px solid rgba(255, 255, 255, .7);
}
.auth-card .logo {
  width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #4f8cff);
  color: #fff; font-size: 22px; font-weight: 800; margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.3px; }
.auth-card .sub { color: var(--ink-3); font-size: 13.5px; margin: 0 0 22px; }
.auth-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); text-align: center; }
.auth-foot a { font-weight: 600; }

/* ------------------------------------------------------------ 手机导航 --- */
.mobile-nav { display: none; }

/* ---------------------------------------------------------------- 响应式 --- */
@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 16px 14px 92px; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 20px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 13px 14px; border-radius: 15px; }
  .stat .v { font-size: 22px; }
  .card { padding: 16px; border-radius: 16px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .toolbar .field { min-width: 100%; }
  .btn { padding: 11px 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 8px; }
  th, td { padding: 10px 8px; font-size: 13.5px; }
  .class-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .class-card { padding: 13px; }
  .class-card .cname { font-size: 14.5px; }

  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .mobile-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 11.5px; color: var(--ink-3); padding: 3px 0; text-decoration: none;
  }
  .mobile-nav a .ico { font-size: 19px; line-height: 1; }
  .mobile-nav a.active { color: var(--brand); font-weight: 600; }

  .auth-card { padding: 26px 22px; border-radius: 18px; }
  .stu-hero { border-radius: 18px; padding: 20px 18px; }
}

@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
  .class-grid { grid-template-columns: 1fr; }
}
