/* ============================================================
   老师端 · 布局与页面样式
   ============================================================ */

/* ---------------- 登录页 ---------------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.06fr 1fr; background: #fff; }
.login-brand {
  position: relative; overflow: hidden; padding: 52px 56px; color: #fff;
  background: linear-gradient(140deg, #1e3a8a 0%, #2d5ae0 42%, #6d4ef0 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-brand::before, .login-brand::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09);
}
.login-brand::before { width: 520px; height: 520px; right: -180px; top: -160px; }
.login-brand::after { width: 320px; height: 320px; left: -120px; bottom: -140px; background: rgba(255,255,255,.07); }
.login-brand .brand-logo { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 600; letter-spacing: .5px; position: relative; }
.login-brand .brand-logo .mark {
  width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.18);
  display: grid; place-items: center; backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.28);
}
.login-brand h1 { font-size: 38px; line-height: 1.28; font-weight: 600; letter-spacing: .5px; position: relative; margin-bottom: 18px; }
.login-brand .desc { font-size: 15px; line-height: 1.9; color: rgba(255,255,255,.82); max-width: 420px; position: relative; }
.login-brand .features { display: flex; flex-direction: column; gap: 18px; margin-top: 34px; position: relative; }
.login-brand .feature { display: flex; gap: 13px; align-items: flex-start; }
.login-brand .feature .fi {
  width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.14);
  display: grid; place-items: center; flex: none; border: 1px solid rgba(255,255,255,.2);
}
.login-brand .feature b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.login-brand .feature span { font-size: 12.5px; color: rgba(255,255,255,.72); }
.login-brand .brand-foot { font-size: 12.5px; color: rgba(255,255,255,.55); position: relative; }

.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-form { width: 100%; max-width: 372px; }
.login-form h2 { font-size: 26px; font-weight: 600; letter-spacing: .3px; }
.login-form .sub { color: var(--muted); font-size: 13.5px; margin: 8px 0 30px; }
.login-form .field { margin-bottom: 18px; }
.login-input { position: relative; }
.login-input .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #a3aec1; }
.login-input .input { height: 46px; padding-left: 40px; border-radius: 11px; font-size: 14px; }
.login-form .btn-lg { margin-top: 8px; height: 46px; font-weight: 500; letter-spacing: 1px; }
.login-tips { margin-top: 22px; padding: 13px 15px; border-radius: 11px; background: var(--surface-2); border: 1px dashed var(--line-2); font-size: 12.5px; color: var(--muted); line-height: 1.9; }
.login-tips b { color: var(--text-2); font-weight: 600; }
.login-error { color: var(--danger); font-size: 13px; margin-top: -4px; margin-bottom: 8px; min-height: 18px; }

/* ---------------- 主框架 ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: #fff; border-right: 1px solid var(--line);
  height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; z-index: 30;
}
.sidebar .logo { height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--line); flex: none; }
.sidebar .logo .mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #4a7bf7, #7c5cf5); box-shadow: 0 4px 10px rgba(74,123,247,.3);
}
.sidebar .logo .txt b { display: block; font-size: 15px; font-weight: 600; letter-spacing: .3px; line-height: 1.3; }
.sidebar .logo .txt span { font-size: 10.5px; color: var(--muted); letter-spacing: 1.4px; }
.sidebar .nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.sidebar .nav-group { margin-top: 14px; }
.sidebar .nav-group:first-child { margin-top: 2px; }
.sidebar .nav-title { font-size: 11px; color: #9aa7ba; letter-spacing: 1px; padding: 6px 12px 8px; font-weight: 500; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px;
  color: var(--text-2); font-size: 13.5px; margin-bottom: 2px; transition: all .15s; position: relative;
}
.sidebar .nav-item:hover { background: #f3f6fc; color: var(--text); }
.sidebar .nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.sidebar .nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--primary);
}
.sidebar .nav-item .ico { color: #8b98ad; }
.sidebar .nav-item.active .ico { color: var(--primary); }
.sidebar .nav-item .badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; font-weight: 500;
}
.sidebar .side-foot { padding: 14px; border-top: 1px solid var(--line); flex: none; }
.sidebar .side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.sidebar .side-user:hover { background: #f5f8fd; }
.sidebar .side-user .info { min-width: 0; flex: 1; }
.sidebar .side-user .info b { display: block; font-size: 13px; font-weight: 500; }
.sidebar .side-user .info span { font-size: 11.5px; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; flex: none; display: flex; align-items: center; gap: 14px;
  padding: 0 24px; background: rgba(255,255,255,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.topbar .crumb b { color: var(--text); font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar .tb-btn {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--text-2); position: relative;
}
.topbar .tb-btn:hover { background: #f1f4fa; color: var(--text); }
.topbar .tb-btn .dot-red { position: absolute; top: 8px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.topbar .today { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.view { padding: 22px 24px 44px; width: 100%; max-width: 1500px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 21px; font-weight: 600; letter-spacing: .2px; }
.page-head .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------------- 工作台 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 19px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); transition: all .2s; }
.stat-card .top { display: flex; align-items: center; justify-content: space-between; }
.stat-card .label { font-size: 12.8px; color: var(--muted); }
.stat-card .val { font-size: 27px; font-weight: 600; letter-spacing: -.5px; margin-top: 8px; line-height: 1.2; }
.stat-card .val small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.stat-card .foot { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 5px; }
.stat-card .foot .up { color: var(--success); font-weight: 500; }
.stat-card .foot .down { color: var(--danger); font-weight: 500; }
.si { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.si.blue { background: var(--primary-soft); color: var(--primary); }
.si.green { background: var(--success-soft); color: #0b9a5b; }
.si.orange { background: var(--warn-soft); color: #c2740a; }
.si.purple { background: #f2eeff; color: #6b46f0; }
.si.cyan { background: #e6f9fd; color: #0891b2; }
.si.red { background: var(--danger-soft); color: #d92d20; }

.dash-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; margin-top: 16px; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: 10px; cursor: pointer; }
.todo-item:hover { background: #f7faff; }
.todo-item .si { width: 34px; height: 34px; border-radius: 10px; }
.todo-item .txt { flex: 1; font-size: 13px; }
.todo-item .num { font-size: 17px; font-weight: 600; }
.todo-item .chev { color: #c3cddd; }
.mini-user { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 10px; }
.mini-user:hover { background: #f7faff; }
.mini-user .info { flex: 1; min-width: 0; }
.mini-user .info b { display: block; font-size: 13px; font-weight: 500; }
.mini-user .info span { font-size: 11.5px; color: var(--muted); }

/* ---------------- 筛选栏 ---------------- */
.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 18px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.filter-bar .input, .filter-bar .select { height: 36px; width: auto; min-width: 140px; }
.filter-bar .search-box { position: relative; }
.filter-bar .search-box .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #a3aec1; }
.filter-bar .search-box .input { padding-left: 34px; min-width: 200px; }
.filter-bar .grow { flex: 1; }
.filter-count { font-size: 12.5px; color: var(--muted); }

/* ---------------- 课程卡片 ---------------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; }
.course-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: all .2s; display: flex; flex-direction: column; }
.course-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.course-cover { height: 118px; position: relative; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; }
.course-cover::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 82% 8%, rgba(255,255,255,.28), transparent 55%); }
.course-cover .cat { font-size: 11.5px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.24); padding: 2px 8px; border-radius: 5px; align-self: flex-start; position: relative; }
.course-cover .name { font-size: 16px; font-weight: 600; line-height: 1.45; position: relative; text-shadow: 0 1px 4px rgba(0,0,0,.12); }
.course-body { padding: 13px 16px 15px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.course-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.course-meta span { display: inline-flex; align-items: center; gap: 4px; }
.course-price { font-size: 16px; font-weight: 600; color: #e0453a; }
.course-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px dashed var(--line); margin-top: auto; }

/* ---------------- 课程详情 / 章节课时 ---------------- */
.course-hero { display: flex; gap: 18px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.course-hero .cover { width: 168px; height: 106px; border-radius: 12px; flex: none; color: #fff; padding: 12px 14px; display: flex; align-items: flex-end; font-weight: 600; font-size: 14px; line-height: 1.5; }
.chapter { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; background: #fff; }
.chapter-head { display: flex; align-items: center; gap: 10px; padding: 12px 15px; background: var(--surface-2); cursor: pointer; }
.chapter-head .idx { width: 24px; height: 24px; border-radius: 7px; background: #fff; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 12px; color: var(--text-2); flex: none; }
.chapter-head .title { font-size: 13.8px; font-weight: 500; flex: 1; }
.chapter-body { padding: 4px 0; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 10px 15px 10px 18px; border-top: 1px solid #f4f7fb; }
.lesson-row:hover { background: #fafcff; }
.lesson-row .ltype { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.lesson-row .ltype.video { background: var(--primary-soft); color: var(--primary); }
.lesson-row .ltype.live { background: var(--danger-soft); color: var(--danger); }
.lesson-row .ltype.doc { background: var(--warn-soft); color: #c2740a; }
.lesson-row .ltitle { flex: 1; font-size: 13.2px; min-width: 0; }
.lesson-row .lmeta { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------------- 考试 ---------------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { padding: 9px 15px; font-size: 13.5px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-color: var(--primary); font-weight: 500; }
.q-item { border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.q-item .q-head { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 10px; }
.q-item .q-no { width: 22px; height: 22px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-size: 12px; display: grid; place-items: center; flex: none; font-weight: 500; }
.q-item .q-stem { font-size: 13.6px; line-height: 1.7; flex: 1; }
.q-item .q-opts { display: flex; flex-direction: column; gap: 7px; padding-left: 31px; }
.q-opt { display: flex; gap: 8px; font-size: 13px; color: var(--text-2); padding: 6px 10px; border-radius: 8px; }
.q-opt.correct { background: var(--success-soft); color: #0b7a4b; }
.q-opt.wrong { background: var(--danger-soft); color: #b42318; }
.q-answer-line { font-size: 12.8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); margin-left: 31px; margin-top: 8px; color: var(--text-2); }
.q-analysis { font-size: 12.6px; color: var(--muted); margin-left: 31px; margin-top: 7px; line-height: 1.75; padding-left: 9px; border-left: 2px solid var(--line-2); }
.picker-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.picker-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 13px; border-bottom: 1px solid #f4f7fb; cursor: pointer; }
.picker-item:hover { background: #fafcff; }
.picker-item:last-child { border-bottom: none; }
.picker-item .txt { flex: 1; font-size: 13px; line-height: 1.6; }

/* ---------------- 考勤 ---------------- */
.att-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.att-chip { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 11px 16px; min-width: 110px; }
.att-chip .n { font-size: 20px; font-weight: 600; line-height: 1.3; }
.att-chip .l { font-size: 12px; color: var(--muted); }
.att-radio { display: flex; gap: 5px; }
.att-radio button { height: 27px; padding: 0 10px; border-radius: 7px; font-size: 12px; border: 1px solid var(--line-2); color: var(--text-2); background: #fff; }
.att-radio button:hover { border-color: #c2cfe4; }
.att-radio button.on[data-s="出勤"] { background: var(--success-soft); border-color: #9fe3c3; color: #0b7a4b; font-weight: 500; }
.att-radio button.on[data-s="迟到"] { background: var(--warn-soft); border-color: #ffd79a; color: #a86408; font-weight: 500; }
.att-radio button.on[data-s="请假"] { background: #f2eeff; border-color: #d5cbff; color: #6b46f0; font-weight: 500; }
.att-radio button.on[data-s="缺勤"] { background: var(--danger-soft); border-color: #ffc4be; color: #b42318; font-weight: 500; }

/* ---------------- 课表 ---------------- */
.week-grid { display: grid; grid-template-columns: 74px repeat(5, 1fr); gap: 8px; }
.wg-head { text-align: center; font-size: 12.5px; color: var(--muted); padding: 8px 0; background: var(--surface-2); border-radius: 8px; font-weight: 500; }
.wg-row-label { display: grid; place-items: center; font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 8px; }
.wg-cell { min-height: 74px; border: 1px dashed var(--line-2); border-radius: 9px; padding: 5px; display: flex; flex-direction: column; gap: 5px; background: #fdfefe; }
.wg-lesson { background: linear-gradient(135deg,#eef3ff,#f6f2ff); border: 1px solid #dfe7ff; border-left: 3px solid var(--primary); border-radius: 7px; padding: 6px 8px; font-size: 11.5px; line-height: 1.5; }
.wg-lesson b { display: block; font-size: 12px; font-weight: 500; color: #24418f; }
.wg-lesson span { color: #6b7c9c; }

/* ---------------- 通知 ---------------- */
.notice-item { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 13px; }
.notice-item:last-child { border-bottom: none; }
.notice-item:hover { background: #fafcff; }
.notice-item .nt { flex: 1; min-width: 0; }
.notice-item .nt b { font-size: 13.8px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.notice-item .nt p { font-size: 12.8px; color: var(--muted); margin-top: 4px; line-height: 1.7; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notice-item .meta { font-size: 11.8px; color: #a3aec1; white-space: nowrap; text-align: right; }

/* ---------------- 设置 ---------------- */
.setting-row { display: flex; align-items: center; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-row .sl { width: 150px; flex: none; font-size: 13px; color: var(--text-2); }
.setting-row .sv { flex: 1; max-width: 420px; }
.log-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.log-row:last-child { border-bottom: none; }
.log-time { color: var(--muted); font-size: 12.5px; white-space: nowrap; width: 142px; flex: none; }

@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .sidebar { width: 64px; }
  .sidebar .logo .txt, .sidebar .nav-title, .sidebar .nav-item span, .sidebar .side-user .info { display: none; }
  .sidebar .nav-item { justify-content: center; padding: 0; }
  .sidebar .logo { justify-content: center; padding: 0; }
  .stat-grid { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 56px repeat(5, minmax(110px, 1fr)); overflow-x: auto; }
}
