/* =========================================================
   AI 外语课堂助教系统 — 设计系统
   ========================================================= */
:root {
  --brand: #2f6bff;
  --brand-dark: #1f4fd8;
  --brand-soft: #eaf0ff;
  --teal: #12b3a0;
  --teal-soft: #e6f8f5;
  --amber: #f59e0b;
  --red: #ef4444;
  --red-soft: #feecec;
  --green: #16a34a;
  --green-soft: #e9f9ef;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --line: #e7ecf5;
  --line-strong: #d6dfee;
  --text: #16233a;
  --text-2: #4a5b74;
  --muted: #8494ab;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(22, 35, 58, .05);
  --shadow: 0 6px 24px rgba(22, 35, 58, .07);
  --shadow-lg: 0 18px 48px rgba(22, 35, 58, .14);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

/* ---------------- 登录页 ---------------- */
/* 浅色画布 + 两块圆角面板浮在上面：比"左右硬切一块高饱和蓝"清爽得多 */
.auth-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(920px 620px at 6% -10%, rgba(47,107,255,.10), transparent 60%),
    radial-gradient(760px 540px at 102% 108%, rgba(18,179,160,.07), transparent 58%),
    #f6f8fd;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 48px;
  border-radius: 24px;
  color: var(--text);
  background: linear-gradient(150deg, #f2f6ff 0%, #edf1fe 55%, #f5f2ff 100%);
  background: linear-gradient(150deg in oklch, #f2f6ff 0%, #edf1fe 55%, #f5f2ff 100%);
  box-shadow:
    0 0 0 1px rgba(22, 35, 58, .04),
    0 1px 2px -1px rgba(22, 35, 58, .05),
    0 18px 40px -26px rgba(22, 35, 58, .22);
}
/* 水面：缓慢漂移的光团 + 涟漪（只动 transform / opacity，可被 reduced-motion 关掉） */
.auth-water {
  position: absolute; inset: 0;
  overflow: hidden; pointer-events: none; z-index: 0;
}
.auth-water .w {
  position: absolute; border-radius: 50%;
  filter: blur(44px);
  will-change: transform;
}
.w-a {
  width: 58%; aspect-ratio: 1; left: -16%; top: -22%;
  background: radial-gradient(circle at 50% 50%, rgba(47,107,255,.22), rgba(47,107,255,0) 68%);
  animation: waterDriftA 20s ease-in-out infinite alternate;
}
.w-b {
  width: 52%; aspect-ratio: 1; right: -18%; bottom: -24%;
  background: radial-gradient(circle at 50% 50%, rgba(107,63,208,.18), rgba(107,63,208,0) 68%);
  animation: waterDriftB 26s ease-in-out infinite alternate;
}
.w-c {
  width: 40%; aspect-ratio: 1; left: 26%; top: 32%;
  background: radial-gradient(circle at 50% 50%, rgba(18,179,160,.16), rgba(18,179,160,0) 70%);
  animation: waterDriftC 32s ease-in-out infinite alternate;
}
/* 一道横着的"涌浪"，从左到右慢慢过 */
.w-d {
  width: 130%; height: 34%; left: -15%; top: 46%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(47,107,255,.10), rgba(47,107,255,0) 70%);
  animation: waterSwell 24s ease-in-out infinite alternate;
}
@keyframes waterDriftA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(7%, 9%, 0) scale(1.12); }
}
@keyframes waterDriftB {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(-8%, -6%, 0) scale(1); }
}
@keyframes waterDriftC {
  from { transform: translate3d(0, 0, 0) scale(.92); }
  to   { transform: translate3d(9%, -7%, 0) scale(1.1); }
}
@keyframes waterSwell {
  from { transform: translate3d(-6%, 0, 0) scaleX(1); }
  to   { transform: translate3d(6%, 0, 0) scaleX(1.06); }
}

/* 涟漪：细圈慢慢散开 */
.auth-water .rip {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(47,107,255,.18);
  will-change: transform, opacity;
}
.rip-a { width: 460px; height: 460px; right: -60px;  bottom: -150px; animation: ripple 16s cubic-bezier(.25,.6,.35,1) infinite; }
.rip-b { width: 380px; height: 380px; right: -20px;  bottom: -110px; animation: ripple 16s cubic-bezier(.25,.6,.35,1) 5.3s infinite; }
.rip-c { width: 300px; height: 300px; left: -90px;   top: -70px;     animation: ripple 20s cubic-bezier(.25,.6,.35,1) 2.6s infinite; }
@keyframes ripple {
  0%   { transform: scale(.55); opacity: 0; }
  14%  { opacity: .6; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* 跟随鼠标的光斑（桌面端；触屏与 reduced-motion 不启用） */
.auth-cursor-glow {
  position: absolute; left: 0; top: 0;
  width: 620px; height: 620px; margin: -310px 0 0 -310px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(47,107,255,.18), rgba(47,107,255,0) 62%);
  opacity: 0; transition: opacity .5s ease;
  will-change: transform;
}
.auth-hero:hover .auth-cursor-glow { opacity: 1; }

/* 静态细圆环（保留原来的结构线） */
.auth-hero::after {
  content: "";
  position: absolute;
  width: 300px; height: 300px;
  right: 44px; bottom: -110px;
  border-radius: 50%;
  border: 1px solid rgba(47,107,255,.13);
  z-index: 0;
}

.auth-logo {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 12px;
  font-size: 17px; font-weight: 700; letter-spacing: -.01em;
}
.auth-logo em {
  display: block; font-style: normal;
  font-size: 11px; font-weight: 500; letter-spacing: .02em;
  color: var(--muted);
}
.auth-logo .mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 19px; color: #fff;
  background: linear-gradient(135deg, #3b74ff, #2f6bff 52%, #6b3fd0);
  box-shadow: 0 8px 18px -8px rgba(47,107,255,.65);
}

.auth-story { position: relative; z-index: 1; }
.auth-hero h1 {
  font-size: 32px; line-height: 1.32; font-weight: 700; letter-spacing: -.02em;
  color: #0f1a2d; margin: 0 0 16px;
}
.auth-hero p.lead {
  font-size: 14.5px; line-height: 1.9; color: var(--text-2);
  max-width: 430px; margin: 0 0 28px;
}
.auth-points { display: grid; gap: 12px; }
.auth-point { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }
.auth-point .dot {
  width: 20px; height: 20px; border-radius: 6px; flex: none; margin-top: 2px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(47,107,255,.12), 0 1px 2px rgba(22,35,58,.06);
}
.auth-foot { position: relative; z-index: 1; font-size: 12px; color: var(--muted); }

/* 右侧：白卡片浮在浅色画布上，用多层阴影代替硬边框 */
.auth-panel { display: grid; place-items: center; padding: 8px; min-width: 0; }
.auth-card {
  width: 100%; max-width: 404px; min-width: 0;
  padding: 38px 36px 30px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow:
    0 0 0 1px rgba(22, 35, 58, .04),
    0 1px 2px -1px rgba(22, 35, 58, .06),
    0 12px 28px -14px rgba(22, 35, 58, .16),
    0 32px 64px -34px rgba(22, 35, 58, .18);
}
.auth-card h2 { font-size: 23px; letter-spacing: -.02em; margin-bottom: 5px; }
.auth-card .sub { color: var(--muted); margin-bottom: 24px; font-size: 13px; }

/* 分段控件：白色滑块用 transform 平移（不是换背景色） */
.auth-tabs {
  position: relative; display: flex;
  padding: 4px; margin-bottom: 22px;
  border-radius: 11px; background: #f2f5fa;
}
.auth-tabs-ind {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  border-radius: 8px; background: #fff;
  box-shadow: 0 1px 2px rgba(22,35,58,.06), 0 2px 6px -2px rgba(22,35,58,.12);
  transition: transform .24s cubic-bezier(.22, 1, .36, 1);
}
.auth-tabs.ind-right .auth-tabs-ind { transform: translateX(100%); }
.auth-tabs button {
  position: relative; z-index: 1;
  flex: 1; border: 0; background: transparent; padding: 9px 0; border-radius: 8px;
  color: var(--text-2); cursor: pointer; font-weight: 600;
  transition: color .2s cubic-bezier(.22, 1, .36, 1);
}
.auth-tabs button.active { color: var(--brand); }

/* 表单控件：只在登录页收窄、加高、更圆润 */
.auth-card .field { margin-bottom: 15px; }
.auth-card .field label { font-size: 12.5px; margin-bottom: 6px; }
.auth-card .input {
  height: 44px; padding: 0 14px; border-radius: 11px;
  border-color: #e3e9f3; background: #fcfdff;
  transition: border-color .18s cubic-bezier(.22,1,.36,1), box-shadow .18s cubic-bezier(.22,1,.36,1), background .18s;
}
.auth-card .input::placeholder { color: #a8b5c9; }
.auth-card .input:hover { border-color: #cdd8e8; }
.auth-card .input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }

.auth-card .role-pick { margin-bottom: 16px; }
.auth-card .role-pick label { border-radius: 11px; background: #fcfdff; }

/* 主按钮：渐变 + 分层投影 + 按下轻微回弹 */
.auth-card .btn-primary {
  height: 46px; border-radius: 12px; font-size: 14.5px; letter-spacing: .06em;
  background: linear-gradient(135deg, #3b74ff, #2f6bff 55%, #2a5ce8);
  box-shadow: 0 10px 22px -10px rgba(47,107,255,.6);
  transition: transform .16s cubic-bezier(.22,1,.36,1), box-shadow .22s, filter .22s;
}
.auth-card .btn-primary:hover { filter: brightness(1.05); box-shadow: 0 12px 26px -10px rgba(47,107,255,.66); }
.auth-card .btn-primary:active { transform: scale(.985); }

.auth-card .divider { background: #f0f3f9; margin: 20px 0 15px; }
.auth-card .btn-sm {
  height: 34px; padding: 0 13px; border-radius: 9px;
  background: #f8fafd; border-color: #e6ecf5; font-size: 12.5px;
}
.auth-card .btn-sm:hover { background: #fff; border-color: rgba(47,107,255,.45); color: var(--brand); }

/* 入场：每次打开只跑一次（低频场景），opacity + translateY + blur；放慢到 1s，能看见 */
@keyframes authRise {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
.auth-hero .auth-logo,
.auth-hero h1,
.auth-hero p.lead,
.auth-hero .auth-points,
.auth-hero .auth-foot,
.auth-card {
  animation: authRise 1s cubic-bezier(.16, 1, .3, 1) both;
}
.auth-hero .auth-logo { animation-delay: .05s; }
.auth-hero h1 { animation-delay: .18s; }
.auth-hero p.lead { animation-delay: .32s; }
.auth-hero .auth-points { animation-delay: .46s; }
.auth-hero .auth-foot { animation-delay: .60s; }
.auth-card { animation-delay: .26s; }

/* 切登录/注册时，新出现的字段和标题轻微上浮 */
@keyframes authFieldIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.field.enter,
.auth-card h2.swap,
.auth-card .sub.swap { animation: authFieldIn .34s cubic-bezier(.16, 1, .3, 1) both; }

/* 小屏：单列，品牌区收成一条横条，表单直接可见 */
@media (max-width: 1024px) {
  .auth-wrap { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 16px; align-content: start; }
  .auth-hero {
    padding: 16px 20px; border-radius: 18px;
    flex-direction: row; align-items: center; justify-content: flex-start;
  }
  .auth-hero .auth-story, .auth-hero .auth-foot { display: none; }
  .auth-hero::after, .auth-water { display: none; }
  .auth-logo { font-size: 15.5px; }
  .auth-logo .mark { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
  .auth-panel { padding: 0; }
  .auth-card { max-width: none; padding: 26px 22px 22px; border-radius: 20px; }
}
@media (max-width: 420px) {
  .auth-card { padding: 22px 18px 18px; }
  .auth-card h2 { font-size: 21px; }
}

/* 无障碍：系统开了"减少动态"就全部关掉，布局不受影响 */
@media (prefers-reduced-motion: reduce) {
  .auth-water .w,
  .auth-water .rip,
  .auth-cursor-glow,
  .auth-hero .auth-logo,
  .auth-hero h1,
  .auth-hero p.lead,
  .auth-hero .auth-points,
  .auth-hero .auth-foot,
  .auth-card,
  .field.enter,
  .auth-card h2.swap,
  .auth-card .sub.swap {
    animation: none !important;
  }
  .auth-cursor-glow { display: none; }
  .auth-water .w, .auth-water .rip { translate: none !important; }
  .auth-card { transform: none !important; }
  .auth-tabs-ind, .auth-tabs button,
  .auth-card .input, .auth-card .btn-primary, .auth-cursor-glow {
    transition-duration: .01ms !important;
  }
  .auth-card .btn-primary:active { transform: none; }
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); outline: none; transition: .16s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,107,255,.13);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.7; }

.role-pick { display: flex; gap: 10px; margin-bottom: 18px; }
.role-pick label {
  flex: 1; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px;
  cursor: pointer; text-align: center; transition: .16s; font-size: 13.5px; color: var(--text-2);
}
.role-pick input { display: none; }
.role-pick input:checked + span { color: var(--brand); font-weight: 650; }
.role-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: #eef2f9; color: var(--text-2); cursor: pointer; font-weight: 600;
  transition: .16s; white-space: nowrap;
}
.btn:hover { background: #e6ecf6; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(47,107,255,.24); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; border-color: var(--line-strong); color: var(--text-2); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); background: #fff; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #eef2f9; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #ffe1e1; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font-weight: 600; }

/* ---------------- 应用外壳 ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--surface);
  border-right: 1px solid var(--line); padding: 20px 14px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sb-logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.sb-logo .mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #6b3fd0); color: #fff; font-size: 16px; font-weight: 700;
}
.sb-logo b { font-size: 14.5px; letter-spacing: -.2px; }
.sb-logo em { display: block; font-style: normal; font-size: 11px; color: var(--muted); font-weight: 500; }

.sb-nav { display: grid; gap: 3px; margin-top: 6px; }
.sb-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); cursor: pointer; font-weight: 550; transition: .14s; border: 0; background: none; text-align: left; width: 100%;
}
.sb-item:hover { background: #f2f5fb; color: var(--text); }
.sb-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.sb-item .ico { width: 18px; text-align: center; font-size: 15px; }
.sb-item .tag-soon {
  margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 20px;
  background: #f1f4fa; color: var(--muted); font-weight: 600;
}

.sb-user {
  margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px;
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; flex: none; font-size: 13px;
}
.sb-user .who { flex: 1; min-width: 0; }
.sb-user .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .who span { font-size: 11.5px; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; display: flex; align-items: center; gap: 14px;
  padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.86);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; }
.topbar .crumb { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }

.content { padding: 24px 28px 56px; max-width: 1280px; width: 100%; }

/* ---------------- 卡片 / 栅格 ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 15px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 16px; }
}

.stat { padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; line-height: 1.2; }
.stat .value small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------------- 列表 / 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap;
  padding: 11px 16px; background: #fafbfe; border-bottom: 1px solid var(--line);
}
.table td { padding: 13px 16px; border-bottom: 1px solid #f0f3f9; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: .12s; }
.table tbody tr:hover { background: #fafbff; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 650; }

.list-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border-bottom: 1px solid #f0f3f9; cursor: pointer; transition: .12s;
}
.list-row:hover { background: #fafbff; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row b { font-size: 14px; }
.list-row .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; background: #f1f4fa; color: var(--text-2); white-space: nowrap;
}
.badge-blue { background: var(--brand-soft); color: var(--brand); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: #fff6e5; color: #b8730b; }
.badge-teal { background: var(--teal-soft); color: #0d8b7d; }
.badge-gray { background: #f1f4fa; color: var(--muted); }

.chip {
  display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px;
  background: #f3f6fc; color: var(--text-2); margin: 2px 4px 2px 0;
}

/* ---------------- 标签页 ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 4px; }
.tabs button {
  border: 0; background: none; padding: 11px 14px; cursor: pointer; color: var(--text-2);
  font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .14s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------------- 空态 / 骨架 ---------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ico { font-size: 30px; opacity: .5; margin-bottom: 10px; }
.empty h4 { color: var(--text-2); font-size: 14.5px; margin-bottom: 6px; }
.empty p { font-size: 13px; margin: 0 0 16px; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(18, 28, 46, .42); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 200; padding: 20px; animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg);
  max-height: 88vh; display: flex; flex-direction: column; animation: rise .2s ease;
}
@keyframes rise { from { transform: translateY(10px); opacity: .6 } to { transform: none; opacity: 1 } }
.modal.wide { max-width: 780px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h3 { font-size: 16px; }
.modal-head .x { margin-left: auto; border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 400; display: grid; gap: 10px; }
.toast {
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: 10px; padding: 11px 16px; box-shadow: var(--shadow); font-size: 13.5px;
  min-width: 220px; max-width: 380px; animation: slideIn .2s ease;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------------- 进度条 ---------------- */
.bar { height: 8px; border-radius: 20px; background: #eef2f9; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 20px; background: var(--brand); transition: width .5s ease; }
.bar.green > i { background: var(--green); }
.bar.amber > i { background: var(--amber); }
.bar.red > i { background: var(--red); }

/* ---------------- 题目卡 ---------------- */
.q-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.q-card + .q-card { margin-top: 14px; }
.q-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: #fbfcff; border-bottom: 1px solid var(--line); }
.q-head .no {
  width: 24px; height: 24px; border-radius: 7px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.q-head .spacer { flex: 1; }
.q-body { padding: 16px 18px; }
.q-content { font-size: 14.5px; line-height: 1.85; white-space: pre-wrap; }
.q-answer { margin-top: 14px; }
.q-ref {
  margin-top: 12px; padding: 12px 14px; background: var(--teal-soft); border-radius: 10px;
  font-size: 13.5px; color: #0b6b60; line-height: 1.75;
}
.q-feedback {
  margin-top: 12px; padding: 12px 14px; background: #f7f9fd; border-radius: 10px;
  font-size: 13.5px; color: var(--text-2); line-height: 1.75; border-left: 3px solid var(--brand);
}
.score-pill { font-variant-numeric: tabular-nums; font-weight: 700; }
.score-hi { color: var(--green); }
.score-mid { color: var(--amber); }
.score-lo { color: var(--red); }

/* ---------------- 聊天 ---------------- */
.chat { display: flex; flex-direction: column; height: 460px; }
.chat-body { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: #fbfcff; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-input .input { flex: 1; }

/* ---------------- 其他 ---------------- */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px } .mt-12 { margin-top: 12px } .mt-16 { margin-top: 16px } .mt-24 { margin-top: 24px }
.mb-8 { margin-bottom: 8px } .mb-12 { margin-bottom: 12px } .mb-16 { margin-bottom: 16px }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.kv { display: flex; gap: 10px; font-size: 13.5px; padding: 6px 0; }
.kv .k { color: var(--muted); width: 78px; flex: none; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.notice {
  padding: 11px 14px; border-radius: 10px; font-size: 13px; line-height: 1.7;
  background: #fff8e8; border: 1px solid #fbe6bd; color: #8a5a06;
}
.notice.info { background: var(--brand-soft); border-color: #d5e2ff; color: #1e46b5; }
.notice.danger { background: var(--red-soft); border-color: #fbd5d5; color: #b42424; }

.code-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 9px;
  background: #0f1c33; color: #d6e4ff; font-family: ui-monospace, Consolas, monospace;
  font-size: 17px; letter-spacing: 3px; font-weight: 700;
}

.hero-panel {
  background: linear-gradient(120deg, #2f6bff, #6b3fd0);
  border-radius: var(--radius); color: #fff; padding: 26px 28px; position: relative; overflow: hidden;
}
.hero-panel::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px;
  border-radius: 50%; background: rgba(255,255,255,.13);
}
.hero-panel h2 { font-size: 21px; margin-bottom: 8px; }
.hero-panel p { margin: 0; color: rgba(255,255,255,.85); font-size: 13.5px; max-width: 620px; }
.hero-panel .actions { margin-top: 18px; display: flex; gap: 10px; position: relative; z-index: 1; }
.hero-panel .btn-outline { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.35); color: #fff; }
.hero-panel .btn-outline:hover { background: rgba(255,255,255,.24); color: #fff; }
.hero-panel .btn-primary { background: #fff; color: var(--brand); box-shadow: none; }
.hero-panel .btn-primary:hover { background: #f0f4ff; }

.loading-inline { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.spinner {
  width: 14px; height: 14px; border: 2px solid #dbe3f2; border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

.chart-wrap { width: 100%; }
svg text { font-family: inherit; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d5deee; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #c2cfe4; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 知识点目录（教材目录样式） ---------- */
.toc-unit { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.toc-unit:last-child { margin-bottom: 0; }
.toc-unit-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; background: #f7f9fd; border-bottom: 1px solid var(--line);
}
.toc-unit-head b { font-size: 14.5px; }
.toc-lesson { padding: 4px 16px 8px; }
.toc-lesson:first-of-type { padding-top: 10px; }
.toc-lesson-row { display: flex; align-items: center; gap: 10px; padding: 8px 0 6px; }
.toc-lesson-name { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.toc-lesson-line { flex: 1; height: 1px; background: linear-gradient(90deg, #e6ecf6, transparent); }
.toc-point { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 6px; border-radius: 9px; }
.toc-point:hover { background: #f7f9fd; }
.toc-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.toc-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s ease; }
.toc-point:hover .toc-actions, .toc-actions:focus-within { opacity: 1; }

/* 目录内的辅助按钮：默认淡化，悬停行时出现 */
.toc-unit-head .btn-ghost, .toc-lesson-row .btn-ghost { opacity: 0; transition: opacity .15s ease; }
.toc-unit-head:hover .btn-ghost, .toc-lesson-row:hover .btn-ghost { opacity: .85; }

/* ---------- 侧边栏未读角标 ---------- */
.nav-dot {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center;
}
.sb-item { position: relative; }

/* ---------- 通知列表 ---------- */
.notif-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 20px; border-bottom: 1px solid #f0f3f9; cursor: pointer;
  transition: background .15s ease;
}
.notif-row:last-child { border-bottom: 0; }
.notif-row:hover { background: #f8fafe; }
.notif-row.unread { background: #f5f8ff; }
.notif-row.unread b::after {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); margin-left: 6px; vertical-align: middle;
}
.notif-ico {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.notif-ico.blue { background: var(--brand-soft); color: var(--brand); }
.notif-ico.amber { background: #fff6e5; color: #b8730b; }
.notif-ico.gray { background: #f1f4fa; color: var(--muted); }

/* ---------- 可选中标签 ---------- */
.chip.on, .chip[aria-pressed="true"] {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
}
.chip.on::before { content: '✓ '; }
.chip-pick { cursor: pointer; user-select: none; }

/* ---------- 答题页：倒计时 / 草稿状态 ---------- */
.countdown {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: #f1f4fa; color: var(--muted);
}
.countdown.warn { background: #fff6e5; color: #b8730b; }
.countdown.danger { background: var(--red-soft); color: var(--red); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.draft-tip { font-size: 12px; color: var(--muted); }
.draft-tip.saved { color: var(--green); }

/* ---------- 附件（录音 / 图片） ---------- */
.media-box {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  border: 1px dashed #d8e0ee; border-radius: 10px; padding: 10px 12px; background: #fbfcff;
}
.media-box.recording { border-color: var(--red); background: #fff8f8; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: pulse 1s infinite; }
.media-thumb { max-height: 84px; border-radius: 8px; border: 1px solid var(--line); }
audio { height: 34px; }

/* ---------- 批量导入：图片框选 ---------- */
.crop-wrap { position: relative; display: inline-block; max-width: 100%; user-select: none; }
.crop-wrap img { max-width: 100%; display: block; border-radius: 8px; }
.crop-layer { position: absolute; inset: 0; cursor: crosshair; }
.crop-box {
  position: absolute; border: 2px solid var(--brand); background: rgba(47,107,255,.12);
  border-radius: 4px; font-size: 11px; color: var(--brand);
}
.crop-box.ref { border-color: var(--green); background: rgba(16,185,129,.12); color: #0d8b7d; }
.crop-box b {
  position: absolute; top: -9px; left: -2px; background: inherit; color: #fff;
  padding: 1px 6px; border-radius: 4px; font-size: 10.5px;
}
.crop-box.que b { background: var(--brand); }
.crop-box.ref b { background: var(--green); }
.import-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.import-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.import-thumb { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.import-thumb img { width: 100%; height: 92px; object-fit: cover; display: block; }

/* ---------- 申诉状态 ---------- */
.flag-item { border-left: 3px solid var(--amber); background: #fffdf7; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.flag-item.resolved { border-left-color: var(--green); background: #f7fdfa; }
.flag-item.rejected { border-left-color: #cbd5e1; background: #fafbfe; }

/* ---------- 排序工具条 ---------- */
.sort-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 18px; background: #fafcff; border-bottom: 1px solid var(--line);
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.seg button {
  border: 0; background: transparent; padding: 6px 13px; font-size: 12.5px; cursor: pointer;
  color: var(--text-2); font-family: inherit; border-right: 1px solid var(--line);
  transition: background .15s, color .15s;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: #f1f5ff; }
.seg button.on { background: var(--brand); color: #fff; font-weight: 600; }
tr.row-returned td { background: #fff8f8; }
tr.row-returned:hover td { background: #fff2f2; }

/* ---------- 我的作业：待完成清单 ---------- */
.homework-todo { border-left: 3px solid var(--amber); }
.homework-todo.returned { border-left-color: var(--red); background: #fffafa; }

/* ---------- 口语四维评分 ---------- */
.dim-block { margin-top: 10px; display: grid; gap: 8px; }
.dim-row { display: grid; grid-template-columns: 76px 1fr 34px; align-items: center; gap: 10px; }
.dim-name { font-size: 12.5px; color: var(--text-2); }
.dim-track { display: block; height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.dim-fill { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }
.dim-val { font-size: 12.5px; font-weight: 600; text-align: right; color: var(--text-1); }
.word-chip {
  display: inline-block; margin: 4px 6px 0 0; padding: 1px 8px; border-radius: 999px;
  background: #fdecec; color: #b42318; font-size: 12px;
}
