:root {
  --ink: #152238;
  --muted: #5f7084;
  --soft: #f6f8fb;
  --paper: #ffffff;
  --line: #dbe6ee;
  --line-strong: #cbd9e3;
  --green: #118567;
  --green-dark: #0b6c58;
  --blue: #2f6f9f;
  --amber: #d9902f;
  --rose: #b85b5b;
  --canvas: #f2f6f7;
  --panel-border: rgba(194, 210, 221, .86);
  --shadow: 0 18px 54px rgba(31, 52, 74, .09);
  --shadow-soft: 0 12px 30px rgba(35, 59, 82, .055);
  --shadow-card: 0 18px 44px rgba(31, 52, 74, .075);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  color-scheme: only light;
}

[hidden] {
  display: none !important;
}

* { box-sizing: border-box; }
html { color-scheme: only light; background: #f6fbf8; }

/* 固定顶部功能导航：每个页面顺序一致，避免老师切换时找不到模块 */
.top-module-nav { position: sticky; top: 0; z-index: 1000; background: rgba(250,252,252,.9); backdrop-filter: blur(24px) saturate(155%); border-bottom: 1px solid rgba(190, 207, 219, .62); box-shadow: 0 14px 36px rgba(27, 48, 70, .05); }
.top-nav-inner { width: min(1580px, calc(100% - 32px)); margin: 0 auto; min-height: 76px; display: grid; grid-template-columns: auto minmax(520px, 1fr) auto; gap: 18px; align-items: center; }
.top-nav-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 950; text-decoration: none; white-space: nowrap; letter-spacing: 0; font-size: 18px; }
.top-nav-brand::before { content: ""; width: 34px; height: 34px; border-radius: 13px; background: linear-gradient(135deg, #0f8b65, #2b729f 58%, #d5a54a); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 12px 24px rgba(17,133,103,.18); }
.top-nav-brand::after { content: "教师工作台"; color: #748497; font-size: 12px; font-weight: 900; padding-left: 2px; }
.top-nav-links { display: flex; gap: 8px; flex-wrap: nowrap; align-items: center; justify-content: center; min-width: 0; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.top-nav-links::-webkit-scrollbar { display: none; }
.top-nav-links a { text-decoration: none; color: #42566c; background: rgba(255,255,255,.82); border: 1px solid rgba(199,214,224,.8); border-radius: 999px; padding: 9px 13px 9px 11px; font-weight: 900; font-size: 13px; white-space: nowrap; box-shadow: 0 7px 18px rgba(31,52,74,.035); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease; display: inline-flex; align-items: center; gap: 7px; }
.top-nav-links a:hover { transform: translateY(-1px); border-color: rgba(47,111,159,.28); box-shadow: 0 10px 22px rgba(31,52,74,.065); }
.top-nav-links a.active { background: linear-gradient(135deg, #102238, #17364b); border-color: rgba(16,34,56,.9); color: #fff; box-shadow: 0 13px 26px rgba(21,34,56,.18); }
.top-right-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.nav-icon {
  --nav-icon: none;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-block;
  background: currentColor;
  opacity: .92;
  -webkit-mask: var(--nav-icon) center / contain no-repeat;
  mask: var(--nav-icon) center / contain no-repeat;
}
.nav-home { --nav-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 11.2 12 4l8 7.2V20a1 1 0 0 1-1 1h-5v-6h-4v6H5a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.nav-records { --nav-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 3h14a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m3 5h8v2H8zm0 4h8v2H8zm0 4h5v2H8z'/%3E%3C/svg%3E"); }
.nav-queue { --nav-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 4h14a2 2 0 0 1 2 2v5h-2V6H5v12h6v2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m2 4h8v2H7zm0 4h6v2H7zm9.2 1.2 4.6 3.3a1 1 0 0 1 0 1.6l-4.6 3.3A1 1 0 0 1 14.6 20v-6a1 1 0 0 1 1.6-.8'/%3E%3C/svg%3E"); }
.nav-upload { --nav-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 20h14v-8h2v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-9h2zm8-12.2V17h-2V7.8L7.4 11.4 6 10l6-6 6 6-1.4 1.4z'/%3E%3C/svg%3E"); }
.nav-image { --nav-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm3 12h10l-3.2-4-2.3 3-1.7-2.1zm9-8.5A1.5 1.5 0 1 0 16 5a1.5 1.5 0 0 0 0 3.5'/%3E%3C/svg%3E"); }
.nav-ai { --nav-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2h2v3h3v2h-3v2h-2V7H9V5h3zM5 8h14a2 2 0 0 1 2 2v7a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3v-7a2 2 0 0 1 2-2m4 4a2 2 0 1 0 0 4 2 2 0 0 0 0-4m6 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4'/%3E%3C/svg%3E"); }
.nav-shield { --nav-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2 20 5v6c0 5-3.4 9.2-8 11-4.6-1.8-8-6-8-11V5zm-1 14.2 6-6-1.4-1.4L11 13.4l-2.6-2.6L7 12.2z'/%3E%3C/svg%3E"); }
.nav-guide { --nav-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 4.5A2.5 2.5 0 0 1 7.5 2H20v17H7.5A2.5 2.5 0 0 0 5 21.5zm3 3.5h8V6H8zm0 4h8v-2H8z'/%3E%3C/svg%3E"); }
.top-health { width: 156px; max-width: 18vw; min-width: 116px; padding: 8px 12px; border-radius: 999px; font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-health span { display: none; }
.page-actions { align-items: flex-start; }
@media (max-width: 980px) {
  .top-module-nav { position: static; }
  .top-nav-inner { grid-template-columns: auto minmax(0, 1fr); padding: 9px 0; gap: 9px 12px; }
  .top-nav-links { grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .top-right-tools { grid-column: 2; grid-row: 1; width: 100%; justify-content: flex-end; align-items: center; min-width: 0; }
  .top-health { width: min(330px, 100%); max-width: none; min-width: 0; }
}
@media (max-width: 640px) {
  .top-nav-inner { grid-template-columns: 1fr; }
  .top-right-tools { grid-column: auto; grid-row: auto; justify-content: flex-start; flex-wrap: wrap; }
  .top-health { width: 100%; }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background:
    radial-gradient(circle at 8% -2%, rgba(255,255,255,.98) 0, rgba(255,255,255,.64) 24%, transparent 42%),
    radial-gradient(circle at 84% 0%, rgba(218,233,227,.58) 0, transparent 30%),
    linear-gradient(180deg, #edf4f5 0, #f7fafb 360px, #f2f6f7 100%);
  color: var(--ink);
  color-scheme: only light;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
html[data-student-device="mobile"],
html[data-student-device="mobile"] body,
body.student-mobile-device {
  background: #f7fbf8 !important;
  background-color: #f7fbf8 !important;
  color: #152238 !important;
  color-scheme: light dark !important;
}
.page { width: min(1520px, calc(100% - 48px)); margin: 30px auto 64px; }
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  min-height: 254px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.985) 0%, rgba(255,255,255,.95) 36%, rgba(255,255,255,.67) 55%, rgba(255,255,255,.1) 100%),
    url('/static/assets/ui/teacher-hero-v2.jpg') center right / cover no-repeat;
  border: 1px solid rgba(205, 221, 229, .92);
  border-radius: 32px;
  padding: 42px 44px;
  box-shadow: var(--shadow);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: linear-gradient(180deg, var(--green), var(--blue) 55%, var(--amber));
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 24% 20%, rgba(255,255,255,.52), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.18));
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.brand { color: var(--green); font-weight: 950; letter-spacing: 3px; font-size: 12px; text-transform: uppercase; }
h1 { margin: 10px 0 12px; font-size: clamp(38px, 3.5vw, 58px); color: var(--ink); letter-spacing: 0; line-height: 1.08; }
p { line-height: 1.7; }
.hero p { margin: 0; color: #5d6f82; font-weight: 760; max-width: 760px; font-size: 17px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-content: center; }
.page-actions { align-items: flex-start; }
.page-actions .mini-badge { border-radius: 999px; padding: 7px 10px; font-size: 12px; background: rgba(255,255,255,.86); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(31,52,74,.04); }
.page-actions .mini-badge.ok { color: var(--green-dark); background: #effaf5; border-color: #ccebdd; }
.health { min-width: 220px; padding: 16px 18px; border-radius: var(--radius-md); background: rgba(255,255,255,.9); border: 1px solid #e6edf2; color: #526273; line-height: 1.7; box-shadow: var(--shadow-soft); }
.health span { font-size: 13px; color: #8492a0; }
.top-health.health { min-width: 0; padding: 7px 10px; border-radius: 999px; line-height: 1.25; }
.top-health.health span { font-size: 11px; }
.layout { display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); gap: 24px; margin-top: 24px; align-items: start; }
.panel { background: rgba(255,255,255,.94); border: 1px solid var(--panel-border); border-radius: 26px; padding: 24px; box-shadow: var(--shadow-soft); backdrop-filter: blur(10px); }
.setup-panel, .result-panel, .report-panel { grid-column: 1; }
.test-panel { grid-column: 2; grid-row: 1 / span 3; }
.setup-panel,
.test-panel {
  position: relative;
  overflow: hidden;
}
.setup-panel::after {
  content: "";
  position: absolute;
  right: -54px;
  top: -54px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(17,133,103,.11), transparent 68%);
  pointer-events: none;
}
h2 { margin: 0 0 16px; font-size: 22px; color: #1b2a3b; letter-spacing: 0; }
.panel > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel > h2::before {
  content: "";
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,.88), transparent 32%),
    linear-gradient(135deg, rgba(17,133,103,.95), rgba(47,111,159,.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.58), 0 10px 20px rgba(17,133,103,.13);
}
label { display: block; font-size: 13px; color: #5d6b7a; margin: 14px 0 8px; font-weight: 820; }
input, select { width: 100%; height: 46px; border: 1px solid #c7d6df; background: linear-gradient(180deg, #ffffff, #f9fcfd); color: var(--ink); color-scheme: light; border-radius: 15px; padding: 0 14px; font-size: 15px; outline: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2354667a' d='M4 6h8l-4 4z'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #ffffff, #f9fcfd);
  background-repeat: no-repeat, no-repeat;
  background-position: right 14px center, 0 0;
  background-size: 13px 13px, 100% 100%;
}
input:focus, select:focus { border-color: #15915f; box-shadow: 0 0 0 4px rgba(21,145,95,.11); }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.button-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.button-row.center { justify-content: center; }
button, .download { border: 0; border-radius: 15px; padding: 11px 17px; background: linear-gradient(135deg, #108564, #0d745f); color: white; font-weight: 900; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; box-shadow: 0 12px 24px rgba(17,133,103,.14); transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease; }
button:hover:not(:disabled), .download:hover { transform: translateY(-1px); }
button.secondary, .download { background: linear-gradient(180deg, #f4f8fb, #e9f1f6); color: #285171; border: 1px solid #d8e5ed; box-shadow: 0 8px 18px rgba(31,52,74,.035); }
button.ai-action { background: linear-gradient(135deg, #195f8c, #12966f); color: #fff; box-shadow: 0 10px 22px rgba(25,95,140,.15); }
button.danger { background: linear-gradient(135deg, #d94848, #b72d3a); color: #fff; box-shadow: 0 12px 24px rgba(183,45,58,.18); }
button.record { background: linear-gradient(135deg, #169b72, #0f7f78); font-size: 17px; padding: 14px 28px; box-shadow: 0 14px 28px rgba(15,127,120,.24); }
button:disabled { opacity: .45; cursor: not-allowed; }
#startBtn::before,
#refreshReportBtn::before,
#refreshReportsBtn::before,
#replayQuestionBtn::before,
#showQuestionTextBtn::before,
#downloadFilteredBtn::before,
#searchBtn::before,
#resetBtn::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  opacity: .9;
  -webkit-mask: var(--button-icon) center / contain no-repeat;
  mask: var(--button-icon) center / contain no-repeat;
}
#startBtn { min-height: 48px; padding-inline: 20px; }
#startBtn::before { --button-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M8 5v14l11-7z'/%3E%3C/svg%3E"); }
#refreshReportBtn::before,
#refreshReportsBtn::before { --button-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 4h14v16H5zm3 12h2v-5H8zm3 0h2V8h-2zm3 0h2v-3h-2z'/%3E%3C/svg%3E"); }
#replayQuestionBtn::before { --button-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 9v6h4l5 4V5L8 9zm12.5 3a4.5 4.5 0 0 0-2-3.7v7.4a4.5 4.5 0 0 0 2-3.7M14.5 3.5v2.1a7 7 0 0 1 0 12.8v2.1a9 9 0 0 0 0-17'/%3E%3C/svg%3E"); }
#showQuestionTextBtn::before { --button-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 4h14v2H5zm0 4h14v2H5zm0 4h10v2H5zm0 4h14v2H5z'/%3E%3C/svg%3E"); }
#downloadFilteredBtn::before { --button-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M11 3h2v10l3.5-3.5 1.4 1.4-5.9 5.9-5.9-5.9 1.4-1.4L11 13zM5 19h14v2H5z'/%3E%3C/svg%3E"); }
#searchBtn::before { --button-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M10 4a6 6 0 0 1 4.7 9.7l4.3 4.3-1.4 1.4-4.3-4.3A6 6 0 1 1 10 4m0 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8'/%3E%3C/svg%3E"); }
#resetBtn::before { --button-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 5a7 7 0 1 1-6.3 4H3l4-4 4 4H7.9A5 5 0 1 0 12 7z'/%3E%3C/svg%3E"); }
#prevBtn::before { content: "‹"; font-size: 24px; line-height: 0; margin-top: -2px; }
#nextBtn::after { content: "›"; font-size: 24px; line-height: 0; margin-top: -2px; }
.question-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #d6e5ec;
  border-radius: 26px;
  padding: 26px 30px 28px;
  background:
    radial-gradient(circle at 96% 0%, rgba(21,145,95,.13), transparent 34%),
    radial-gradient(circle at 88% 95%, rgba(47,111,159,.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.question-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 5px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #15915f, #2776b8);
}
.question-card-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.question-label { margin-top: 16px; color: #7892a8; font-weight: 900; font-size: 13px; }
.question-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 12px; border-radius: 999px; background: #ecf7f2; color: #15915f; font-size: 13px; font-weight: 800; }
#qTitle { margin: 6px 0 0; font-size: clamp(28px, 2.2vw, 40px); line-height: 1.32; color: #142335; }
.question-text-reveal { margin-top: 10px; border: 1px solid #dfe8ee; background: #f8fbfd; color: #415267; border-radius: 12px; padding: 10px 12px; line-height: 1.65; font-weight: 700; }
.question-voice-panel {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid #c8e3d8;
  background: linear-gradient(135deg, #f1fbf7, #f7fbff);
  color: #24553d;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.question-voice-panel::before {
  content: "";
  display: none;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 14px;
  background:
    linear-gradient(90deg, transparent 6px, #15915f 6px 10px, transparent 10px 15px, #67b894 15px 20px, transparent 20px 25px, #15915f 25px 30px, transparent 30px),
    #e4f5ee;
  opacity: .9;
}
.voice-orb {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 17px;
  color: #13936e;
  background: linear-gradient(145deg, #e8faf2, #f4fbff);
  border: 1px solid rgba(34, 154, 121, .18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 10px 22px rgba(28, 90, 74, .08);
}
.voice-orb svg {
  width: 30px;
  height: 30px;
  display: block;
  fill: currentColor;
}
.question-voice-panel strong { display: block; color: #137f55; font-size: 16px; margin-bottom: 2px; }
.question-voice-panel span { color: #557163; font-size: 13px; line-height: 1.5; }
.question-voice-panel .button-row { margin-top: 0; }
.progress { color: #7d8b9a; font-weight: 800; background: #f2f6f9; border-radius: 14px; padding: 10px 14px; white-space: nowrap; }
.image-wrap { margin-top: 18px; border-radius: 18px; overflow: hidden; border: 1px solid #dbe6ee; background: #f7fafc; text-align: center; }
.image-wrap img { max-width: 100%; max-height: 420px; display: block; margin: auto; }
.hidden { display: none !important; }
.rubric-card { margin-top: 18px; background: #fff8e7; border: 1px solid #f1dca3; color: #5e4c24; border-radius: 14px; padding: 14px 16px; line-height: 1.7; }
.recorder { margin-top: 22px; background: radial-gradient(circle at 50% 0%, rgba(47,111,159,.08), transparent 36%), linear-gradient(180deg, #ffffff, #f3f8fb); border: 1px solid #d5e4ec; border-radius: 28px; padding: 28px; text-align: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 12px 30px rgba(31,52,74,.045); }
#timer { font-size: 48px; font-weight: 900; letter-spacing: 2px; color: #16263a; font-variant-numeric: tabular-nums; }
#status { margin-top: 8px; color: #5d6f82; font-weight: 800; }
.record-hint { max-width: 640px; margin: 8px auto 0; line-height: 1.6; color: #667789; }
.record-hint.warn { border: 1px solid #f4dfad; background: #fff8e7; color: #765613; border-radius: 12px; padding: 10px 12px; font-weight: 700; }
.audio-check-panel {
  max-width: 760px;
  margin: 16px auto 0;
  padding: 14px 16px;
  border: 1px solid #d7e8eb;
  border-radius: 18px;
  background: #f8fcfb;
  text-align: left;
  color: #31485a;
}
.audio-check-panel.hidden { display: none !important; }
.audio-check-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.audio-check-head strong { color: #142338; font-size: 16px; }
.audio-check-panel p { margin: 0; color: #5c6f82; line-height: 1.55; }
.audio-check-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.audio-check-actions button { min-height: 42px; border-radius: 13px; }
.audio-check-panel.good { border-color: #b8e3d2; background: #f3fbf7; }
.audio-check-panel.ok { border-color: #c9e5eb; background: #f7fcfd; }
.audio-check-panel.warn { border-color: #eedba7; background: #fffaf0; }
.audio-check-panel.bad { border-color: #f0c4bd; background: #fff7f3; }
.audio-check-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 92px;
}
.audio-check-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #cfe3ec;
  background: #f5fbfd;
  color: #315870;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}
.audio-check-badge.good {
  border-color: #b8e3d2;
  background: #e9f8f0;
  color: #0b7f58;
}
.audio-check-badge.ok {
  border-color: #c9e5eb;
  background: #eef9fb;
  color: #22627a;
}
.audio-check-badge.warn {
  border-color: #efd99a;
  background: #fff3d6;
  color: #865c0a;
}
.audio-check-badge.bad {
  border-color: #efc1ba;
  background: #fff1ed;
  color: #9d3829;
}
.record-actions {
  display: grid;
  grid-template-columns: minmax(104px, 128px) minmax(188px, 240px) minmax(104px, 128px);
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}
.record-actions button { min-height: 58px; border-radius: 18px; }
.record-actions .nav-step {
  color: #285171;
  background: linear-gradient(180deg, #f2f8fb, #e6f1f7);
  border: 1px solid #d5e5ee;
}
.primary-record {
  position: relative;
  gap: 10px;
  min-width: 210px;
  overflow: hidden;
}
.primary-record .record-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 5px rgba(255,255,255,.18);
}
.primary-record .record-icon::before {
  content: "";
  width: 10px;
  height: 16px;
  border-radius: 8px;
  background: #15915f;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.08);
}
.primary-record[data-mode="recording"] {
  background: linear-gradient(135deg, #ef5f54, #d93863);
  box-shadow: 0 16px 34px rgba(217,56,99,.27);
}
.primary-record[data-mode="recording"] .record-icon::before {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #d93863;
}
.primary-record[data-mode="saving"] {
  background: linear-gradient(135deg, #6b7f92, #52677d);
  box-shadow: 0 12px 24px rgba(82,103,125,.18);
}
.primary-record[data-mode="saving"] .record-icon::before {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #52677d;
  border-top-color: transparent;
  background: transparent;
  animation: spin .8s linear infinite;
}
.primary-record[data-mode="saved"] {
  background: linear-gradient(135deg, #2776b8, #245e96);
  box-shadow: 0 14px 28px rgba(39,118,184,.22);
}
.primary-record[data-mode="saved"] .record-icon::before {
  width: 15px;
  height: 9px;
  border-radius: 0;
  border-left: 4px solid #2776b8;
  border-bottom: 4px solid #2776b8;
  background: transparent;
  transform: rotate(-45deg) translate(1px, -1px);
}
@keyframes spin { to { transform: rotate(360deg); } }
.encouragement-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1200;
  width: min(440px, calc(100% - 32px));
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(196, 219, 221, .82);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(242,250,247,.92));
  box-shadow: 0 18px 46px rgba(21, 34, 56, .14);
  padding: 11px 13px;
  color: var(--ink);
  transform: translate(-50%, 18px) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.encouragement-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.encouragement-toast strong { display: block; font-size: 17px; margin-bottom: 2px; }
.encouragement-toast p { margin: 0; color: var(--muted); font-weight: 750; line-height: 1.45; font-size: 14px; }
.encouragement-mark {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 17px;
  background: linear-gradient(145deg, #ecfff7, #edf7ff);
  border: 1px solid rgba(45, 165, 132, .18);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}
.encouragement-mark::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 21px;
  height: 13px;
  border-left: 5px solid var(--green);
  border-bottom: 5px solid var(--green);
  transform: rotate(-45deg);
  border-radius: 2px;
}
.encouragement-mark span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--amber);
  animation: floatMark 1.35s ease-in-out infinite;
}
.encouragement-mark span:nth-child(1) { left: 8px; top: 9px; animation-delay: 0s; }
.encouragement-mark span:nth-child(2) { right: 9px; top: 11px; background: var(--blue); animation-delay: .16s; }
.encouragement-mark span:nth-child(3) { right: 13px; bottom: 9px; background: var(--green); animation-delay: .32s; }
@keyframes floatMark {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: .72; }
  50% { transform: translateY(-5px) rotate(12deg); opacity: 1; }
}
.completion-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.46), transparent 28%),
    linear-gradient(135deg, rgba(15, 28, 44, .44), rgba(33, 71, 91, .32));
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.completion-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.completion-card {
  position: relative;
  overflow: hidden;
  width: min(760px, 100%);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(220px, .78fr) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 30px;
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(247,252,249,.96) 58%, rgba(242,248,255,.97)),
    repeating-linear-gradient(135deg, rgba(47,111,159,.055) 0 1px, transparent 1px 18px);
  box-shadow: 0 34px 110px rgba(14, 29, 47, .32);
  transform: translateY(18px) scale(.985);
  transition: transform .34s cubic-bezier(.2,.85,.25,1);
}
.completion-overlay.show .completion-card { transform: translateY(0) scale(1); }
.completion-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 24px;
  border: 1px solid rgba(207,229,220,.68);
  pointer-events: none;
}
.completion-stage {
  position: relative;
  min-height: 280px;
  display: grid;
  place-items: center;
}
.completion-art {
  position: relative;
  z-index: 3;
  width: min(260px, 100%);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 34px;
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 24px 58px rgba(31, 52, 74, .18);
}
.completion-rings {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,.9) 0 38%, transparent 39%),
    conic-gradient(from 20deg, #15915f, #2f6f9f, #f0b84b, #15915f);
  filter: drop-shadow(0 18px 32px rgba(31,52,74,.16));
  animation: completionSpin 10s linear infinite;
}
.completion-rings span {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px solid rgba(21,145,95,.26);
  animation: completionPulse 2.6s ease-in-out infinite;
}
.completion-rings span:nth-child(2) { inset: -34px; border-color: rgba(47,111,159,.22); animation-delay: .35s; }
.completion-rings span:nth-child(3) { inset: -52px; border-color: rgba(240,184,75,.22); animation-delay: .7s; }
.completion-medal {
  position: relative;
  z-index: 2;
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  border-radius: 42px;
  background:
    linear-gradient(135deg, #ffffff, #f2fbf6),
    radial-gradient(circle at 35% 22%, rgba(255,255,255,.75), transparent 35%);
  border: 1px solid #d1e7df;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 24px 48px rgba(31,52,74,.16);
  animation: medalPop .72s cubic-bezier(.2,.88,.26,1.24) both;
}
.completion-art ~ .completion-rings,
.completion-art ~ .completion-medal { display: none; }
.completion-medal::before,
.completion-medal::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 78px;
  top: -45px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2f6f9f, #15915f);
  transform-origin: bottom center;
  z-index: -1;
}
.completion-medal::before { left: 40px; transform: rotate(-18deg); }
.completion-medal::after { right: 40px; transform: rotate(18deg); background: linear-gradient(180deg, #f0b84b, #15915f); }
.completion-check {
  width: 66px;
  height: 38px;
  border-left: 12px solid #15915f;
  border-bottom: 12px solid #15915f;
  border-radius: 6px;
  transform: rotate(-45deg) translate(4px, -4px);
  animation: checkDraw .58s ease .2s both;
}
.completion-copy { position: relative; z-index: 2; }
.completion-copy h2 {
  margin: 12px 0 10px;
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.12;
  color: #142335;
}
.completion-copy p {
  margin: 0;
  color: #52677d;
  font-weight: 750;
  line-height: 1.8;
  font-size: 17px;
}
.completion-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}
.completion-stats div {
  min-height: 82px;
  border: 1px solid #dbe8ee;
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  padding: 12px;
  box-shadow: 0 10px 28px rgba(31,52,74,.06);
}
.completion-stats b {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #15915f;
  font-size: 22px;
  line-height: 1.25;
}
.completion-stats span {
  display: block;
  margin-top: 5px;
  color: #6b7d8f;
  font-weight: 850;
  font-size: 12px;
}
.completion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.completion-actions button,
.completion-actions .download {
  min-height: 48px;
  border-radius: 16px;
}
.completion-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.completion-confetti span {
  position: absolute;
  left: var(--x);
  top: -20px;
  width: var(--size);
  height: calc(var(--size) * 1.5);
  border-radius: 4px;
  background: var(--color);
  opacity: .9;
  transform: rotate(var(--rot));
  animation: confettiDrop var(--dur) cubic-bezier(.2,.72,.36,1) var(--delay) both;
}
body.celebrating .student-mode .test-panel {
  box-shadow: 0 22px 60px rgba(21,145,95,.18);
}
@keyframes completionSpin { to { transform: rotate(360deg); } }
@keyframes completionPulse {
  0%, 100% { transform: scale(.96); opacity: .32; }
  50% { transform: scale(1.04); opacity: .72; }
}
@keyframes medalPop {
  from { transform: scale(.62) translateY(24px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes checkDraw {
  from { clip-path: inset(100% 0 0 0); opacity: 0; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}
@keyframes confettiDrop {
  0% { transform: translateY(-24px) rotate(var(--rot)); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(620px) rotate(calc(var(--rot) + 460deg)); opacity: 0; }
}
@media (max-width: 760px) {
  .completion-overlay { padding: 16px; align-items: start; overflow: auto; }
  .completion-card { grid-template-columns: 1fr; min-height: 0; padding: 24px; gap: 10px; }
  .completion-stage { min-height: 210px; }
  .completion-rings { width: 170px; height: 170px; }
  .completion-medal { width: 118px; height: 118px; border-radius: 34px; }
  .completion-check { width: 52px; height: 30px; border-left-width: 10px; border-bottom-width: 10px; }
  .completion-stats { grid-template-columns: 1fr; }
  .completion-actions > * { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .completion-rings,
  .completion-rings span,
  .completion-medal,
  .completion-check,
  .completion-confetti span {
    animation: none !important;
  }
}

html[data-theme="dark"] .inline-org-form input,
html[data-theme="dark"] .inline-org-form select {
  background: #07131d;
  border-color: rgba(126, 158, 178, .35);
  color: #eff8ff;
}

html[data-theme="dark"] .org-list-row {
  border-color: rgba(126, 158, 178, .28);
  background:
    linear-gradient(135deg, rgba(13, 30, 42, .94), rgba(8, 21, 32, .9));
}

html[data-theme="dark"] .org-list-row b {
  color: #f4fbff;
}

html[data-theme="dark"] .org-list-row span,
html[data-theme="dark"] .org-list-empty {
  color: #91a5b7;
}

html[data-theme="dark"] .org-list-empty {
  border-color: rgba(126, 158, 178, .3);
  background: rgba(6, 18, 28, .5);
}

html[data-theme="dark"] .danger-lite {
  background: rgba(160, 45, 58, .2);
  color: #ffb5bd;
}

@media (max-width: 980px) {
  .org-maintenance-grid {
    grid-template-columns: 1fr;
  }

  .inline-org-form {
    grid-template-columns: 1fr;
  }
}
audio { width: 100%; max-width: 760px; margin-top: 16px; }
.empty { color: #7b8998; background: #f7fafc; border-radius: 14px; padding: 16px; line-height: 1.8; }
.result, .report { background: #fbfdff; border: 1px solid #e1ebf2; border-radius: 14px; padding: 16px; }
.result.error { border-color: #ffc4c4; background: #fff7f7; color: #8b1f1f; }
.score-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #edf7f3; color: #15915f; border-radius: 12px; margin-bottom: 12px; }
.score-line strong { font-size: 28px; }
.score-line span { color: #315f4d; font-weight: 800; }
@media (max-width: 1100px) {
  .hero, .layout, .two-cols { grid-template-columns: 1fr; display: block; }
  .test-panel, .setup-panel, .result-panel, .report-panel { grid-column: auto; grid-row: auto; margin-top: 18px; }
  .hero { display: block; }
  .health { margin-top: 18px; min-width: 0; }
  .question-voice-panel { display: block; }
  .question-voice-panel::before { display: none; }
  .question-voice-panel .button-row { margin-top: 12px; }
  .record-actions { grid-template-columns: 1fr; }
  .record-actions .nav-step, .primary-record { width: 100%; min-width: 0; }
}
.pending { border-color: #f4dfad; background: #fffdf5; }
.pending-line { background: #fff5d6; color: #8a6200; }
.pending-line span { color: #8a6200; }
.error-line { background: #ffecec; color: #9a2b2b; }
.error-line span { color: #9a2b2b; }

.student-mode {
  width: min(1240px, calc(100% - 34px));
  max-width: 1240px;
  margin-top: 22px;
  position: relative;
}
.student-mode::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 82% 8%, rgba(255,255,255,.94), transparent 24%),
    radial-gradient(circle at 12% 10%, rgba(255,231,172,.32), transparent 28%),
    radial-gradient(circle at 90% 86%, rgba(174,219,241,.28), transparent 32%),
    linear-gradient(180deg, rgba(242,250,249,.98), rgba(249,251,247,.98));
}
.student-mode .hero {
  min-height: 270px;
  align-items: center;
  border-radius: 34px;
  padding: 40px 44px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.93) 40%, rgba(255,255,255,.62) 62%, rgba(255,255,255,.08) 100%),
    url('/static/assets/ui/student-hero-v2.jpg') center right / cover no-repeat;
  border-color: #cfe4e5;
  box-shadow: 0 28px 72px rgba(34, 83, 96, .14);
}
.student-mode .hero::after {
  content: none;
}
.student-mode .hero h1 { font-size: clamp(38px, 5vw, 62px); letter-spacing: 0; }
.student-mode .hero p { font-size: 17px; color: #536678; }
.student-mode .layout { grid-template-columns: 310px minmax(0, 1fr); gap: 22px; align-items: start; }
.student-mode .setup-panel {
  position: sticky;
  top: 22px;
  border-color: #d4e5e5;
  border-radius: 26px;
  padding: 20px;
  background: rgba(255,255,255,.94);
}
.student-mode .setup-panel h2 { font-size: 22px; }
.student-mode .two-cols,
.student-mode .three-cols { grid-template-columns: 1fr; gap: 8px; }
.student-mode .manual-student-details {
  margin-top: 12px;
  border: 1px solid #dbe9f0;
  border-radius: 16px;
  background: #f8fbfd;
  overflow: hidden;
}
.student-mode .manual-student-details summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  color: #52677d;
  font-weight: 900;
}
.student-mode .manual-student-details summary::-webkit-details-marker { display: none; }
.student-mode .manual-student-details summary::after {
  content: "展开";
  float: right;
  color: #8b98a6;
  font-size: 12px;
}
.student-mode .manual-student-details[open] summary::after { content: "收起"; }
.student-mode .manual-identity-fields { padding: 0 14px 14px; }
.student-mode .student-roster-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f5faf7;
  border: 1px solid #d9eadf;
  color: #587065;
  font-size: 13px;
  line-height: 1.6;
}
.student-mode label { color: #607083; margin: 11px 0 7px; }
.student-mode input,
.student-mode select { height: 44px; border-radius: 14px; background: #ffffff; }
.student-mode .test-panel {
  border-color: #cfe5dc;
  border-radius: 30px;
  padding: 28px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 20px 52px rgba(28,70,83,.10);
}
.student-mode .question-card {
  border-radius: 30px;
  padding: 32px 34px;
  background:
    radial-gradient(circle at 88% 12%, rgba(255,205,93,.14), transparent 26%),
    linear-gradient(135deg, #ffffff 0%, #f6fcf9 50%, #f3f8ff 100%);
  border-color: #cfe5dc;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 16px 34px rgba(34, 73, 92, .06);
}
.student-mode .question-card::before { top: 24px; bottom: 24px; width: 6px; }
.student-mode .question-label { margin-top: 18px; color: #6e8193; }
.student-mode #qTitle { font-size: clamp(30px, 3.1vw, 44px); line-height: 1.28; letter-spacing: 0; }
.student-mode .progress {
  background: #eef6fb;
  color: #547087;
  border: 1px solid #dbe9f0;
  border-radius: 999px;
}
.student-mode .badge {
  min-height: 32px;
  padding: 5px 14px;
  background: #e6f8ef;
  color: #118567;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.student-mode .question-voice-panel {
  border-radius: 22px;
  border-color: #c8e3d8;
  background: linear-gradient(135deg, #f2fbf6, #f5f9ff);
}
.student-mode .rubric-card {
  background: #f7fbef;
  border-color: #dbe8bf;
  color: #50602d;
  border-radius: 18px;
}
.student-mode .recorder {
  padding: 30px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% -20%, rgba(21,145,95,.13), transparent 38%),
    radial-gradient(circle at 16% 100%, rgba(255,205,93,.12), transparent 32%),
    linear-gradient(180deg, #ffffff, #f5fbfc);
  border-color: #d2e5ec;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88), 0 18px 44px rgba(31, 76, 92, .08);
}
.student-mode #timer {
  width: fit-content;
  margin: 0 auto;
  padding: 6px 22px;
  border-radius: 999px;
  background: #f1f6fa;
  border: 1px solid #dbe9f0;
  font-size: clamp(48px, 5.8vw, 72px);
  letter-spacing: 1px;
}
.student-mode #status { font-size: 17px; color: #52677d; }
.student-mode .record-actions {
  grid-template-columns: minmax(112px, 136px) minmax(220px, 300px) minmax(112px, 136px);
  gap: 16px;
}
.student-mode .record-actions button {
  min-height: 64px;
  border-radius: 22px;
  font-size: 16px;
}
.student-mode button.record {
  min-width: 240px;
  font-size: 19px;
  background: linear-gradient(135deg, #13966f, #2378a7);
}
.student-mode .image-wrap {
  border-radius: 24px;
  background: #fff;
}
.student-mode .image-wrap img { max-height: 500px; }

@media (max-width: 900px) {
  .student-mode .layout { display: block; }
  .student-mode .hero {
    min-height: 250px;
    padding: 26px 24px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.86) 54%, rgba(255,255,255,.18) 100%),
      url('/static/assets/ui/student-hero-v2.jpg') center bottom / cover no-repeat;
  }
  .student-mode #qTitle { font-size: 26px; }
  .student-mode #timer { font-size: 46px; }
  .student-mode .setup-panel { position: static; }
  .student-mode .hero::after { display: none; }
  .student-mode .record-actions { grid-template-columns: 1fr; }
}

/* 学生端：同一链接自动切换电脑/手机体验。手机优先保留题目、图片和录音操作。 */
.student-mode.student-desktop .setup-panel {
  min-height: 0;
}
.student-mode.student-desktop .test-panel {
  min-height: 560px;
}
.student-mode.student-mobile {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 12px max(18px, env(safe-area-inset-bottom));
  color-scheme: light dark;
  isolation: isolate;
}
.student-mode.student-mobile::before {
  display: none;
}
.student-mode.student-mobile .hero {
  min-height: 132px;
  border-radius: 22px;
  padding: 20px 18px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.94) 55%, rgba(255,255,255,.68) 100%),
    url('/static/assets/ui/student-hero-v2.jpg') right center / auto 100% no-repeat;
  box-shadow: 0 10px 24px rgba(34, 83, 96, .08);
  transform: translateZ(0);
}
.student-mode.student-mobile .brand {
  font-size: 10px;
  letter-spacing: 2px;
}
.student-mode.student-mobile .hero h1 {
  margin: 8px 0 8px;
  max-width: 64%;
  font-size: clamp(32px, 9vw, 44px);
  line-height: 1.05;
}
.student-mode.student-mobile .hero p {
  max-width: 66%;
  font-size: 14px;
  line-height: 1.55;
}
.student-mode.student-mobile.assessment-started .hero {
  display: none;
}
.student-mode.student-mobile .layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.student-mode.student-mobile.assessment-started .layout {
  margin-top: 0;
}
.student-mode.student-mobile .setup-panel,
.student-mode.student-mobile .test-panel {
  width: 100%;
  margin-top: 0;
  border-radius: 22px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.student-mode.student-mobile .setup-panel {
  position: static;
  order: 1;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(31, 76, 92, .08);
}
.student-mode.student-mobile.assessment-started .setup-panel {
  display: none;
}
.student-mode.student-mobile .setup-panel h2 {
  margin-bottom: 14px;
  font-size: 24px;
}
.student-mode.student-mobile label {
  margin: 12px 0 7px;
  font-size: 13px;
}
.student-mode.student-mobile input,
.student-mode.student-mobile select {
  height: 50px;
  border-radius: 17px;
  font-size: 16px;
}
.student-mode.student-mobile .student-roster-note {
  font-size: 13px;
  padding: 11px 12px;
}
.student-mode.student-mobile .button-row {
  gap: 8px;
}
.student-mode.student-mobile #startBtn {
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  font-size: 17px;
}
.student-mode.student-mobile .test-panel {
  order: 2;
  padding: 10px;
  background: #ffffff;
  border-color: #d3e4e2;
  box-shadow: 0 8px 22px rgba(28,70,83,.07);
}
.student-mode.student-mobile:not(.assessment-started) .test-panel {
  display: none;
}
.student-mode.student-mobile .question-card {
  border-radius: 18px;
  padding: 13px 14px 15px;
  background:
    linear-gradient(135deg, #ffffff, #f8fcfa 68%, #f6f9fc);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.student-mode.student-mobile .question-card::before {
  top: 18px;
  bottom: 18px;
  width: 5px;
}
.student-mode.student-mobile .question-card-head {
  align-items: flex-start;
}
.student-mode.student-mobile .badge {
  min-height: 28px;
  padding: 4px 11px;
  font-size: 12px;
}
.student-mode.student-mobile .progress {
  min-width: 64px;
  padding: 8px 11px;
  border-radius: 999px;
  text-align: center;
  font-size: 14px;
}
.student-mode.student-mobile .question-label {
  margin-top: 14px;
  font-size: 12px;
}
.student-mode.student-mobile #qTitle {
  margin-top: 6px;
  font-size: clamp(25px, 7.6vw, 36px);
  line-height: 1.24;
  word-break: break-word;
}
.student-mode.student-mobile .question-text-reveal {
  max-height: 34vh;
  overflow: auto;
  font-size: 14px;
}
.student-mode.student-mobile .question-voice-panel {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px 12px;
  margin-top: 12px;
  padding: 13px;
  border-radius: 18px;
}
.student-mode.student-mobile .question-voice-panel::before {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 14px;
}
.student-mode.student-mobile .question-voice-panel .button-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 2px;
}
.student-mode.student-mobile .voice-speed-control {
  grid-column: 1 / -1;
}
.student-mode.student-mobile .question-voice-panel button {
  min-height: 44px;
  border-radius: 15px;
  padding: 8px 10px;
}
.student-mode.student-mobile .image-wrap {
  margin-top: 10px;
  padding: 6px;
  border-radius: 16px;
  background: #ffffff;
}
.student-mode.student-mobile .image-wrap img {
  max-height: min(32vh, 280px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.student-mode.student-mobile .rubric-card {
  margin-top: 12px;
  padding: 12px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.student-mode.student-mobile .recorder {
  margin-top: 14px;
  padding: 16px 14px;
  border-radius: 24px;
}
.student-mode.student-mobile.assessment-started .recorder {
  position: static;
  bottom: auto;
  z-index: 40;
  box-shadow: 0 8px 22px rgba(21, 52, 70, .08);
}
.student-mode.student-mobile #timer {
  padding: 4px 18px;
  font-size: clamp(38px, 11vw, 50px);
  letter-spacing: 0;
}
.student-mode.student-mobile #status {
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.45;
}
.student-mode.student-mobile .record-hint {
  margin-top: 6px;
  max-height: 58px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
}
.student-mode.student-mobile .record-actions {
  grid-template-columns: 74px minmax(0, 1fr) 74px;
  gap: 8px;
  margin-top: 12px;
}
.student-mode.student-mobile .record-actions button {
  min-height: 56px;
  border-radius: 18px;
  padding: 8px 9px;
  font-size: 13px;
}
.student-mode.student-mobile .record-actions .nav-step {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}
.student-mode.student-mobile button.record {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  font-size: 16px;
}
.student-mode.student-mobile .primary-record .record-icon {
  width: 24px;
  height: 24px;
  box-shadow: 0 0 0 4px rgba(255,255,255,.18);
}
.student-mode.student-mobile audio {
  margin-top: 10px;
}
.student-mode.student-mobile .encouragement-toast {
  top: max(12px, env(safe-area-inset-top));
  bottom: auto;
  width: calc(100% - 28px);
  max-width: 430px;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 18px;
  transform: translate(-50%, -12px) scale(.98);
}
.student-mode.student-mobile .encouragement-toast.show {
  transform: translate(-50%, 0) scale(1);
}
.student-mode.student-mobile .encouragement-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}
.student-mode.student-mobile .encouragement-mark::before {
  left: 12px;
  top: 12px;
  width: 17px;
  height: 10px;
  border-left-width: 4px;
  border-bottom-width: 4px;
}
.student-mode.student-mobile .encouragement-mark span {
  width: 6px;
  height: 6px;
}
.student-mode.student-mobile .encouragement-toast strong {
  font-size: 15px;
  line-height: 1.25;
}
.student-mode.student-mobile .encouragement-toast p {
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 390px) {
  .student-mode.student-mobile {
    padding: 10px 8px max(14px, env(safe-area-inset-bottom));
  }
  .student-mode.student-mobile .hero h1,
  .student-mode.student-mobile .hero p {
    max-width: 72%;
  }
  .student-mode.student-mobile .record-actions {
    grid-template-columns: 62px minmax(0, 1fr) 62px;
    gap: 6px;
  }
  .student-mode.student-mobile .record-actions button {
    min-height: 52px;
    padding-inline: 6px;
    font-size: 12px;
  }
  .student-mode.student-mobile button.record {
    font-size: 15px;
  }
}

/* 手机学生端精修：轻表单、浅色锁定、信息确认后压缩为摘要。 */
.student-mobile-summary {
  display: none;
}
.student-mode.student-mobile {
  background: #f7fbf8;
  color: var(--ink);
  min-height: 100svh;
}
.student-mode.student-mobile .hero,
.student-mode.student-mobile .setup-panel,
.student-mode.student-mobile .test-panel,
.student-mode.student-mobile .question-card,
.student-mode.student-mobile .recorder,
.student-mode.student-mobile .rubric-card,
.student-mode.student-mobile select,
.student-mode.student-mobile input {
  color-scheme: light dark;
}
.student-mode.student-mobile .hero {
  min-height: 112px;
  margin-bottom: 8px;
  padding: 16px;
  border-radius: 18px;
}
.student-mode.student-mobile .hero h1 {
  max-width: 64%;
  font-size: clamp(24px, 7.2vw, 32px);
}
.student-mode.student-mobile .hero p {
  max-width: 66%;
  font-size: 12px;
  font-weight: 820;
}
.student-mode.student-mobile .setup-panel {
  padding: 13px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(31, 76, 92, .06);
}
.student-mode.student-mobile .setup-panel::after {
  display: none;
}
.student-mode.student-mobile .setup-panel h2 {
  margin-bottom: 10px;
  font-size: 20px;
}
.student-mode.student-mobile .setup-panel h2::before,
.student-mode.student-mobile .panel > h2::before {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  border-radius: 9px;
}
.student-mode.student-mobile label {
  margin: 9px 0 5px;
  color: #546577;
  font-size: 11px;
  line-height: 1.25;
}
.student-mode.student-mobile input,
.student-mode.student-mobile select {
  height: 41px;
  border-radius: 14px;
  padding-inline: 12px 34px;
  background-color: #ffffff;
  color: #142335;
  border-color: #d0dee7;
  font-size: 14px;
  font-weight: 760;
}
.student-mode.student-mobile select:disabled {
  color: #9aa6b2;
  opacity: 1;
  background-color: #f7fafb;
}
.student-mode.student-mobile .student-roster-note {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 13px;
  font-size: 12px;
  line-height: 1.55;
}
.student-mode.student-mobile #startBtn {
  min-height: 49px;
  margin-top: 2px;
  border-radius: 16px;
  font-size: 16px;
  box-shadow: 0 12px 26px rgba(17,133,103,.18);
}
.student-mode.student-mobile .test-panel {
  padding: 8px;
  border-radius: 18px;
}
.student-mode.student-mobile .question-card {
  padding: 12px 13px 14px;
  border-radius: 16px;
}
.student-mode.student-mobile #qTitle {
  font-size: clamp(20px, 6.2vw, 29px);
}
.student-mode.student-mobile .rubric-card {
  margin-top: 9px;
  padding: 9px 10px;
  font-size: 12px;
}
.student-mode.student-mobile .recorder {
  margin-top: 10px;
  padding: 12px 10px;
  border-radius: 18px;
}
.student-mode.student-mobile #timer {
  font-size: clamp(30px, 9vw, 40px);
}

.student-mode.student-mobile.identity-ready .student-mobile-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
  padding: 11px 12px;
  border: 1px solid #cfe5dc;
  border-radius: 17px;
  background:
    linear-gradient(135deg, #ffffff, #f4fbf7);
  box-shadow: 0 9px 24px rgba(31,76,92,.06);
}
.student-mode.student-mobile .student-mobile-summary span,
.student-mode.student-mobile .student-mobile-summary small {
  display: block;
  color: #66788b;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
}
.student-mode.student-mobile .student-mobile-summary strong {
  display: block;
  margin: 2px 0;
  color: #16263a;
  font-size: 15px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.student-mode.student-mobile .student-mobile-summary button {
  min-height: 34px;
  border-radius: 12px;
  padding: 7px 11px;
  font-size: 12px;
  box-shadow: none;
}
.student-mode.student-mobile.identity-collapsed .setup-panel {
  padding: 12px;
}
.student-mode.student-mobile.identity-collapsed .setup-panel h2 {
  margin-bottom: 4px;
  font-size: 18px;
}
.student-mode.student-mobile.identity-collapsed .setup-panel > label,
.student-mode.student-mobile.identity-collapsed .setup-panel > select,
.student-mode.student-mobile.identity-collapsed .setup-panel .compact-selects,
.student-mode.student-mobile.identity-collapsed .setup-panel .student-roster-note {
  display: none;
}
.student-mode.student-mobile.identity-collapsed .button-row {
  margin-top: 8px;
}
.student-mode.student-mobile.identity-collapsed #startBtn {
  min-height: 46px;
}

@media (max-width: 390px) {
  .student-mode.student-mobile .hero {
    min-height: 96px;
    padding: 14px;
  }
  .student-mode.student-mobile .hero h1 {
    max-width: 68%;
    font-size: 24px;
  }
  .student-mode.student-mobile .hero p {
    max-width: 72%;
    font-size: 11px;
  }
  .student-mode.student-mobile input,
  .student-mode.student-mobile select {
    height: 39px;
    font-size: 13px;
  }
}

/* 学生手机端最终视觉层：亮色轻巧，暗色不是“压暗白卡”，而是原生深色界面。 */
.student-mode.student-mobile.assessment-started {
  padding: 10px 10px max(14px, env(safe-area-inset-bottom));
}
.student-mode.student-mobile.assessment-started .test-panel {
  border-radius: 22px;
  overflow: visible;
}
.student-mode.student-mobile.assessment-started .question-card {
  margin: 0;
}
.student-mode.student-mobile .question-voice-panel strong {
  font-size: 15px;
}
.student-mode.student-mobile .question-voice-panel span {
  font-size: 12px;
}
.student-mode.student-mobile .question-voice-panel .button-row {
  gap: 8px;
}
.student-mode.student-mobile .question-voice-panel button {
  min-height: 38px;
  border-radius: 13px;
  font-size: 12px;
}
.student-mode.student-mobile .rubric-card strong {
  white-space: nowrap;
}
.student-mode.student-mobile .record-actions {
  grid-template-columns: 68px minmax(0, 1fr) 68px;
}
.student-mode.student-mobile .record-actions button {
  min-height: 50px;
  border-radius: 16px;
}
.student-mode.student-mobile .primary-record {
  min-width: 0;
}

@media (prefers-color-scheme: dark) {
  html[data-student-device="mobile"],
  html[data-student-device="mobile"] body,
  body.student-mobile-device {
    background: #090f15 !important;
    background-color: #090f15 !important;
    color: #edf6ff !important;
    color-scheme: dark !important;
  }
  html[data-student-device="mobile"] * {
    forced-color-adjust: none;
  }
  .student-mode.student-mobile {
    background: transparent !important;
    color: #edf6ff !important;
  }
  .student-mode.student-mobile .hero {
    border-color: rgba(131, 211, 198, .26);
    background:
      linear-gradient(90deg, rgba(9,15,21,.98) 0%, rgba(11,20,28,.95) 50%, rgba(13,23,31,.54) 100%),
      url('/static/assets/ui/student-hero-v2.jpg') right center / auto 104% no-repeat;
    box-shadow: 0 16px 34px rgba(0,0,0,.30);
  }
  .student-mode.student-mobile .brand {
    color: #6fe6c2;
  }
  .student-mode.student-mobile .hero h1,
  .student-mode.student-mobile .setup-panel h2,
  .student-mode.student-mobile #qTitle {
    color: #f3f8ff;
  }
  .student-mode.student-mobile .hero p,
  .student-mode.student-mobile label,
  .student-mode.student-mobile .question-label,
  .student-mode.student-mobile #status,
  .student-mode.student-mobile .record-hint {
    color: #a7b7c6;
  }
  .student-mode.student-mobile .setup-panel,
  .student-mode.student-mobile .test-panel,
  .student-mode.student-mobile .question-card,
  .student-mode.student-mobile .question-voice-panel,
  .student-mode.student-mobile .rubric-card,
  .student-mode.student-mobile .recorder,
  .student-mode.student-mobile .student-mobile-summary {
    filter: none !important;
    mix-blend-mode: normal !important;
  }
  .student-mode.student-mobile .setup-panel {
    background:
      radial-gradient(circle at 100% 0%, rgba(32, 155, 131, .12), transparent 36%),
      linear-gradient(180deg, #101923, #0c131b);
    border-color: rgba(128, 194, 190, .24);
    box-shadow: 0 18px 42px rgba(0,0,0,.32);
  }
  .student-mode.student-mobile input,
  .student-mode.student-mobile select {
    background-color: #0c141d !important;
    background-image: linear-gradient(180deg, #101b25, #0c141d) !important;
    background-repeat: no-repeat !important;
    background-position: 0 0 !important;
    background-size: 100% 100% !important;
    color: #f4f8ff !important;
    border-color: rgba(152, 184, 202, .36) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  }
  .student-mode.student-mobile select {
    background-image:
      url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%238aa0b4' d='M4 6h8l-4 4z'/%3E%3C/svg%3E"),
      linear-gradient(180deg, #101b25, #0c141d) !important;
    background-repeat: no-repeat, no-repeat !important;
    background-position: right 13px center, 0 0 !important;
    background-size: 13px 13px, 100% 100% !important;
  }
  .student-mode.student-mobile input::placeholder {
    color: #718395 !important;
  }
  .student-mode.student-mobile select:disabled {
    color: #697a89 !important;
    background-color: #0a1118 !important;
  }
  .student-mode.student-mobile .student-roster-note,
  .student-mode.student-mobile .start-status {
    background: rgba(30, 72, 59, .34);
    border-color: rgba(96, 207, 163, .22);
    color: #a8dbc9;
  }
  .student-mode.student-mobile #startBtn {
    background: linear-gradient(135deg, #20b886, #257da8);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(20, 138, 116, .24);
  }
  .student-mode.student-mobile .test-panel {
    background:
      radial-gradient(circle at 90% 0%, rgba(42, 125, 160, .13), transparent 32%),
      linear-gradient(180deg, #0f1720, #0b1118);
    border-color: rgba(154, 215, 211, .22);
    box-shadow: 0 18px 46px rgba(0,0,0,.34);
  }
  .student-mode.student-mobile .question-card {
    background:
      radial-gradient(circle at 100% 0%, rgba(38, 169, 134, .13), transparent 34%),
      linear-gradient(135deg, #142231, #0f1923 64%, #0d151e);
    border-color: rgba(138, 215, 203, .28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  }
  .student-mode.student-mobile .question-card::before {
    background: linear-gradient(180deg, #44d7aa, #2f88c8);
    opacity: .92;
  }
  .student-mode.student-mobile .badge {
    background: rgba(33, 214, 153, .12);
    color: #72edc6;
    border: 1px solid rgba(89, 226, 185, .20);
    box-shadow: none;
  }
  .student-mode.student-mobile .progress {
    background: #091018;
    color: #d8e9f9;
    border-color: rgba(144, 181, 207, .20);
  }
  .student-mode.student-mobile .question-voice-panel {
    background:
      linear-gradient(135deg, rgba(24, 95, 78, .62), rgba(18, 45, 65, .92));
    border-color: rgba(121, 224, 199, .32);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  }
  .student-mode.student-mobile .question-voice-panel::before {
    background:
      linear-gradient(90deg, transparent 6px, #76f0c6 6px 10px, transparent 10px 15px, #2f88c8 15px 20px, transparent 20px 25px, #76f0c6 25px 30px, transparent 30px),
      #0b151e;
    box-shadow: 0 0 0 1px rgba(134, 235, 205, .16);
  }
  .student-mode.student-mobile .question-voice-panel strong {
    color: #78efc9;
  }
  .student-mode.student-mobile .question-voice-panel span {
    color: #bfd2dd;
  }
  .student-mode.student-mobile .question-voice-panel button,
  .student-mode.student-mobile button.secondary,
  .student-mode.student-mobile .download {
    background: rgba(14, 24, 34, .72);
    color: #d9ebf8;
    border-color: rgba(142, 184, 205, .26);
    box-shadow: none;
  }
  .student-mode.student-mobile .rubric-card {
    background: rgba(19, 24, 20, .86);
    border-color: rgba(219, 232, 191, .42);
    color: #d9e9c7;
  }
  .student-mode.student-mobile .recorder {
    background:
      radial-gradient(circle at 50% -12%, rgba(52, 124, 184, .18), transparent 42%),
      linear-gradient(180deg, #101923, #0b1118);
    border-color: rgba(155, 202, 217, .26);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  }
  .student-mode.student-mobile #timer {
    background: #071017;
    border-color: rgba(126, 163, 203, .26);
    color: #8eb5ff;
    text-shadow: 0 0 18px rgba(96, 146, 255, .22);
  }
  .student-mode.student-mobile .record-actions .nav-step {
    background: rgba(16, 27, 38, .88);
    color: #9aaec0;
    border-color: rgba(142, 184, 205, .24);
  }
  .student-mode.student-mobile button.record {
    background: linear-gradient(135deg, #139d76, #1d6d96);
    color: #ffffff;
    box-shadow: 0 16px 28px rgba(7, 84, 83, .28);
  }
  .student-mode.student-mobile .primary-record .record-icon {
    background: rgba(240, 255, 250, .94);
    box-shadow: 0 0 0 5px rgba(255,255,255,.10);
  }
  .student-mode.student-mobile .image-wrap {
    background: #0b1118;
    border-color: rgba(142, 184, 205, .22);
  }
  .student-mode.student-mobile .image-wrap img {
    border-radius: 12px;
  }
	  .student-mode.student-mobile audio {
	    filter: none;
	  }
	  .student-mode.student-mobile .encouragement-toast {
	    background:
	      linear-gradient(135deg, rgba(18, 37, 45, .96), rgba(10, 18, 27, .96));
	    border-color: rgba(118, 215, 193, .26);
	    color: #f4fbff;
	    box-shadow: 0 14px 34px rgba(0,0,0,.32);
	  }
	  .student-mode.student-mobile .encouragement-toast p {
	    color: #b9ccd8;
	  }
	  .student-mode.student-mobile .encouragement-mark {
	    background:
	      linear-gradient(145deg, rgba(111, 242, 203, .20), rgba(92, 151, 225, .14));
	    border-color: rgba(118, 215, 193, .22);
	  }
	  .student-mode.student-mobile .encouragement-mark::before {
	    border-color: #80f0cf;
	  }
	}

/* 学生手机端视觉 v6：扁平矢量图标 + 克制暗色层次。 */
.student-mode.student-mobile .question-voice-panel::before {
  display: none !important;
}
.student-mode.student-mobile .question-voice-panel {
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  border-radius: 21px;
}
.student-mode.student-mobile .voice-orb {
  grid-column: 1;
  grid-row: 1;
  width: 44px;
  height: 44px;
  border-radius: 18px;
  color: #0e9a74;
  background:
    linear-gradient(145deg, rgba(255,255,255,.96), rgba(235,250,244,.95));
  border: 1px solid rgba(45, 165, 132, .20);
  box-shadow: 0 10px 26px rgba(20, 120, 96, .10);
}
.student-mode.student-mobile .voice-orb svg {
  width: 28px;
  height: 28px;
}
.student-mode.student-mobile .voice-copy {
  min-width: 0;
}
.student-mode.student-mobile .question-voice-panel .compact-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.student-mode.student-mobile .question-voice-panel button {
  letter-spacing: 0;
  box-shadow: none;
}
.student-mode.student-mobile .record-hint.warn {
  max-height: none;
  overflow: visible;
  border-radius: 16px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.55;
}
.student-mode.student-mobile .primary-record .record-icon {
  width: 25px;
  height: 25px;
  border-radius: 10px;
  color: #128a70;
  background: rgba(255,255,255,.92);
  box-shadow: none;
}
.student-mode.student-mobile .primary-record .record-icon::before {
  width: 17px;
  height: 17px;
  border: 0;
  border-radius: 0;
  background: currentColor;
  box-shadow: none;
  transform: none;
  animation: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 3a4 4 0 0 0-4 4v5a4 4 0 0 0 8 0V7a4 4 0 0 0-4-4Zm-2 4a2 2 0 1 1 4 0v5a2 2 0 1 1-4 0V7Zm-4 4h2a4 4 0 0 0 8 0h2a6 6 0 0 1-5 5.9V20h3v2H8v-2h3v-3.1A6 6 0 0 1 6 11Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 3a4 4 0 0 0-4 4v5a4 4 0 0 0 8 0V7a4 4 0 0 0-4-4Zm-2 4a2 2 0 1 1 4 0v5a2 2 0 1 1-4 0V7Zm-4 4h2a4 4 0 0 0 8 0h2a6 6 0 0 1-5 5.9V20h3v2H8v-2h3v-3.1A6 6 0 0 1 6 11Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.student-mode.student-mobile .primary-record[data-mode="recording"] .record-icon {
  color: #d93863;
}
.student-mode.student-mobile .primary-record[data-mode="recording"] .record-icon::before {
  width: 15px;
  height: 15px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='6' y='6' width='12' height='12' rx='3' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='6' y='6' width='12' height='12' rx='3' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
}
.student-mode.student-mobile .primary-record[data-mode="saving"] .record-icon {
  color: #52677d;
}
.student-mode.student-mobile .primary-record[data-mode="saving"] .record-icon::before {
  width: 17px;
  height: 17px;
  border: 3px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  background: transparent;
  -webkit-mask: none;
  mask: none;
  animation: spin .8s linear infinite;
}
.student-mode.student-mobile .primary-record[data-mode="saved"] .record-icon {
  color: #2776b8;
}
.student-mode.student-mobile .primary-record[data-mode="saved"] .record-icon::before {
  width: 16px;
  height: 16px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='m9.2 16.6-4-4 1.4-1.4 2.6 2.6 8.2-8.2 1.4 1.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='m9.2 16.6-4-4 1.4-1.4 2.6 2.6 8.2-8.2 1.4 1.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (prefers-color-scheme: dark) {
  .student-mode.student-mobile.assessment-started {
    background:
      radial-gradient(circle at 20% -12%, rgba(39, 118, 184, .18), transparent 34%),
      linear-gradient(180deg, #071018, #090f15 46%, #080d13) !important;
  }
  .student-mode.student-mobile.assessment-started .test-panel {
    background:
      linear-gradient(180deg, rgba(14, 24, 34, .96), rgba(8, 14, 21, .98));
    border-color: rgba(132, 178, 190, .18);
    box-shadow: 0 18px 44px rgba(0,0,0,.32);
  }
  .student-mode.student-mobile.assessment-started .question-card {
    background:
      linear-gradient(135deg, rgba(18, 32, 45, .96), rgba(13, 23, 33, .98));
    border-color: rgba(115, 167, 183, .24);
    box-shadow: none;
  }
  .student-mode.student-mobile.assessment-started #qTitle {
    color: #f5f8ff;
    text-shadow: none;
  }
  .student-mode.student-mobile.assessment-started .question-voice-panel {
    background:
      linear-gradient(135deg, rgba(20, 75, 65, .92), rgba(13, 33, 48, .96));
    border-color: rgba(92, 206, 179, .30);
    box-shadow: none;
  }
  .student-mode.student-mobile.assessment-started .voice-orb {
    color: #7cf0ca;
    background:
      linear-gradient(145deg, rgba(10, 19, 28, .94), rgba(15, 35, 45, .96));
    border-color: rgba(110, 231, 199, .22);
    box-shadow: none;
  }
  .student-mode.student-mobile.assessment-started .question-voice-panel strong {
    color: #9af4d7;
  }
  .student-mode.student-mobile.assessment-started .question-voice-panel span {
    color: #c2d3de;
  }
  .student-mode.student-mobile.assessment-started .question-voice-panel button,
  .student-mode.student-mobile.assessment-started .record-actions .nav-step {
    background: rgba(9, 17, 25, .74);
    color: #dde9f3;
    border-color: rgba(140, 182, 198, .22);
  }
  .student-mode.student-mobile.assessment-started .rubric-card {
    background: rgba(13, 20, 18, .88);
    border-color: rgba(212, 225, 185, .30);
    color: #d9e6c9;
  }
  .student-mode.student-mobile.assessment-started .recorder {
    background:
      linear-gradient(180deg, rgba(14, 25, 36, .98), rgba(8, 14, 21, .98));
    border-color: rgba(128, 171, 190, .22);
    box-shadow: none;
  }
  .student-mode.student-mobile.assessment-started .record-hint.warn {
    background: rgba(238, 222, 164, .08);
    border-color: rgba(238, 222, 164, .32);
    color: #efe4bc;
  }
  .student-mode.student-mobile.assessment-started .primary-record .record-icon {
    color: #0f7f78;
    background: rgba(244, 255, 251, .96);
  }
}

/* 全局视觉刷新：明暗主题、扁平层级和更克制的工作台质感。 */
html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #edf5f8;
  --muted: #9dafbd;
  --soft: #0c141c;
  --paper: #111b24;
  --line: rgba(142, 166, 184, .22);
  --line-strong: rgba(156, 184, 204, .34);
  --green: #40d6a6;
  --green-dark: #74e8c4;
  --blue: #66aee7;
  --amber: #efc96b;
  --rose: #ef8b8f;
  --canvas: #080f15;
  --panel-border: rgba(140, 172, 190, .24);
  --shadow: 0 22px 58px rgba(0, 0, 0, .36);
  --shadow-soft: 0 16px 42px rgba(0, 0, 0, .26);
  --shadow-card: 0 18px 44px rgba(0, 0, 0, .24);
  color-scheme: dark;
}

html[data-theme="light"] body {
  background:
    linear-gradient(180deg, #f5faf9 0, #f8fbfc 320px, #f3f7f8 100%);
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  background:
    linear-gradient(180deg, #081018 0, #0b141d 330px, #070d13 100%);
  color: var(--ink);
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(237, 245, 248, .82);
  border: 1px solid rgba(199, 214, 224, .84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 8px 18px rgba(31,52,74,.045);
}
.theme-choice {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: #536679;
  box-shadow: none;
  font-size: 12px;
  font-weight: 950;
}
.theme-choice:hover:not(:disabled) { transform: none; }
.theme-choice.active {
  background: #ffffff;
  color: #0f2235;
  box-shadow: 0 8px 20px rgba(31,52,74,.09);
}
.theme-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid currentColor;
}
.light-dot { background: #f5c24d; color: #d99a20; }
.dark-dot { background: #203247; color: #203247; box-shadow: inset -3px -2px 0 rgba(255,255,255,.55); }

html[data-theme="dark"] .theme-switch {
  background: rgba(12, 22, 32, .82);
  border-color: rgba(137, 166, 188, .28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 14px 26px rgba(0,0,0,.22);
}
html[data-theme="dark"] .theme-choice { color: #9fb1c2; }
html[data-theme="dark"] .theme-choice.active {
  background: linear-gradient(135deg, rgba(50, 214, 168, .18), rgba(80, 144, 203, .16));
  color: #edf8ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 22px rgba(0,0,0,.24);
}

.top-module-nav {
  background: rgba(250, 252, 252, .86);
  box-shadow: 0 10px 28px rgba(27, 48, 70, .045);
}
.top-nav-links a,
button.secondary,
.download,
input,
select,
textarea,
.panel,
.question-card,
.recorder,
.table-wrap,
.metric-card {
  transition:
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease,
    box-shadow .18s ease,
    transform .16s ease;
}

html[data-theme="dark"] .top-module-nav {
  background: rgba(8, 15, 22, .86);
  border-bottom-color: rgba(126, 157, 180, .18);
  box-shadow: 0 12px 30px rgba(0,0,0,.24);
}
html[data-theme="dark"] .top-nav-brand,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] .detail-content h3,
html[data-theme="dark"] .paper-detail-head h3,
html[data-theme="dark"] .student-mobile-summary strong {
  color: #f1f7fb;
}
html[data-theme="dark"] .top-nav-brand::after,
html[data-theme="dark"] p,
html[data-theme="dark"] .hero p,
html[data-theme="dark"] label,
html[data-theme="dark"] .small-text,
html[data-theme="dark"] .paper-detail-head p,
html[data-theme="dark"] .question-label,
html[data-theme="dark"] .record-hint,
html[data-theme="dark"] #status,
html[data-theme="dark"] .bar-title,
html[data-theme="dark"] .metric-card div,
html[data-theme="dark"] .metric-card span {
  color: var(--muted);
}
html[data-theme="dark"] .top-nav-links a {
  color: #c4d2de;
  background: rgba(13, 23, 33, .70);
  border-color: rgba(135, 164, 185, .26);
  box-shadow: none;
}
html[data-theme="dark"] .top-nav-links a.active {
  background: linear-gradient(135deg, #f5f8ff, #cfe8ef);
  color: #0b1824;
  border-color: rgba(235, 247, 249, .88);
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
}
html[data-theme="dark"] .top-nav-brand::before {
  background: linear-gradient(135deg, #38d6a3, #65aee8 58%, #efc96b);
  box-shadow: 0 12px 26px rgba(64, 214, 166, .18);
}

.hero,
.paper-upload-page .dashboard-hero {
  border-radius: 26px;
  box-shadow: 0 18px 48px rgba(34, 66, 89, .085);
}
html[data-theme="dark"] .hero {
  background:
    linear-gradient(90deg, rgba(8,15,22,.98) 0%, rgba(9,17,25,.94) 42%, rgba(9,17,25,.66) 62%, rgba(9,17,25,.14) 100%),
    url('/static/assets/ui/teacher-hero-v2.jpg') center right / cover no-repeat;
  border-color: rgba(137, 166, 188, .26);
  box-shadow: 0 24px 64px rgba(0,0,0,.32);
}
html[data-theme="dark"] .paper-upload-page .dashboard-hero {
  background:
    linear-gradient(90deg, rgba(8,15,22,.98) 0%, rgba(9,17,25,.94) 46%, rgba(9,17,25,.64) 68%, rgba(9,17,25,.18) 100%),
    url('/static/assets/ui/upload-center.jpg') center right / cover no-repeat;
}
html[data-theme="dark"] .hero::after {
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.04));
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .chart-panel,
html[data-theme="dark"] .report-center,
html[data-theme="dark"] .safety-card,
html[data-theme="dark"] .ai-provider-card,
html[data-theme="dark"] .ai-setting-card,
html[data-theme="dark"] .upload-center-tab,
html[data-theme="dark"] .question-card,
html[data-theme="dark"] .recorder,
html[data-theme="dark"] .review-box,
html[data-theme="dark"] .paper-detail-meta,
html[data-theme="dark"] .manual-student-details {
  background:
    linear-gradient(180deg, rgba(17, 27, 36, .96), rgba(12, 20, 28, .94));
  border-color: var(--panel-border);
  box-shadow: var(--shadow-soft);
}
html[data-theme="dark"] .panel > h2::before {
  box-shadow: none;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: #0b141d;
  background-image: linear-gradient(180deg, #101b25, #0b141d);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: #f2f7fb;
  border-color: rgba(150, 178, 197, .32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
html[data-theme="dark"] select {
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%239cafbf' d='M4 6h8l-4 4z'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #101b25, #0b141d);
  background-repeat: no-repeat, no-repeat;
  background-position: right 15px center, 0 0;
  background-size: 14px 14px, 100% 100%;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #6f8192;
}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  border-color: rgba(64, 214, 166, .74);
  box-shadow: 0 0 0 4px rgba(64,214,166,.12);
}
html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .download,
html[data-theme="dark"] .record-actions .nav-step,
html[data-theme="dark"] .question-voice-panel button {
  background: linear-gradient(180deg, #132333, #0d1925);
  color: #d5e5ef;
  border-color: rgba(142, 176, 198, .26);
  box-shadow: none;
}
html[data-theme="dark"] button,
html[data-theme="dark"] .download.ai-action {
  box-shadow: 0 14px 30px rgba(0,0,0,.24);
}
html[data-theme="dark"] .question-card {
  background:
    linear-gradient(135deg, rgba(18, 32, 45, .98), rgba(13, 23, 33, .98));
}
html[data-theme="dark"] .question-card::before {
  background: linear-gradient(180deg, #40d6a6, #66aee7);
}
html[data-theme="dark"] #qTitle,
html[data-theme="dark"] #timer,
html[data-theme="dark"] .metric-card strong {
  color: #f5f9fd;
}
html[data-theme="dark"] .progress,
html[data-theme="dark"] .mini-badge {
  background: rgba(125, 152, 174, .14);
  color: #b7c8d8;
}
html[data-theme="dark"] .mini-badge.ok,
html[data-theme="dark"] .badge {
  background: rgba(64, 214, 166, .13);
  color: #7decc9;
}
html[data-theme="dark"] .mini-badge.warn,
html[data-theme="dark"] .pending,
html[data-theme="dark"] .pending-line {
  background: rgba(239, 201, 107, .12);
  color: #efd391;
  border-color: rgba(239, 201, 107, .28);
}
html[data-theme="dark"] .mini-badge.bad,
html[data-theme="dark"] .error-line {
  background: rgba(239, 139, 143, .13);
  color: #ffb1b6;
}
html[data-theme="dark"] .rubric-card {
  background: rgba(43, 36, 20, .56);
  border-color: rgba(239, 201, 107, .26);
  color: #e6d6a8;
}
html[data-theme="dark"] .question-voice-panel {
  background: linear-gradient(135deg, rgba(20, 76, 65, .76), rgba(15, 35, 49, .92));
  border-color: rgba(92, 206, 179, .26);
  color: #d7efe7;
}
html[data-theme="dark"] .question-voice-panel strong {
  color: #95f0d3;
}
html[data-theme="dark"] .question-voice-panel span {
  color: #b8cbd4;
}
html[data-theme="dark"] .voice-orb {
  background: linear-gradient(145deg, rgba(15, 27, 36, .98), rgba(17, 38, 48, .96));
  color: #80efcc;
  border-color: rgba(128, 239, 204, .22);
  box-shadow: none;
}
html[data-theme="dark"] .image-wrap,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] table,
html[data-theme="dark"] .detail-img {
  background: #0a121a;
  border-color: rgba(142, 176, 198, .20);
}
html[data-theme="dark"] th {
  background: linear-gradient(180deg, #111d28, #0c1721);
  color: #b8c8d5;
  border-bottom-color: rgba(142, 176, 198, .18);
}
html[data-theme="dark"] td {
  border-bottom-color: rgba(142, 176, 198, .14);
}
html[data-theme="dark"] tr:hover td {
  background: rgba(80, 122, 153, .08);
}
html[data-theme="dark"] .bar-track,
html[data-theme="dark"] .pill-track {
  background: rgba(125, 152, 174, .16);
}
html[data-theme="dark"] .advanced-details,
html[data-theme="dark"] .danger-details {
  background: rgba(10, 18, 26, .72);
  border-color: rgba(142, 176, 198, .20);
}
html[data-theme="dark"] .danger-details {
  border-color: rgba(239, 139, 143, .32);
}
html[data-theme="dark"] .danger-details > summary,
html[data-theme="dark"] .danger-text {
  color: #ffb3b8;
}

html[data-theme="light"] .student-mode.student-mobile,
html[data-theme="light"] .student-mode.student-mobile.assessment-started {
  background: #f7fbf8 !important;
  color: #152238 !important;
  color-scheme: light !important;
}
html[data-theme="light"] .student-mode.student-mobile .hero,
html[data-theme="light"] .student-mode.student-mobile .setup-panel,
html[data-theme="light"] .student-mode.student-mobile .test-panel,
html[data-theme="light"] .student-mode.student-mobile .question-card,
html[data-theme="light"] .student-mode.student-mobile .question-voice-panel,
html[data-theme="light"] .student-mode.student-mobile .rubric-card,
html[data-theme="light"] .student-mode.student-mobile .recorder {
  filter: none !important;
  color-scheme: light !important;
}

html[data-theme="dark"] .student-mode.student-mobile,
html[data-theme="dark"] html[data-student-device="mobile"],
html[data-theme="dark"] body.student-mobile-device {
  background:
    linear-gradient(180deg, #071018, #090f15 46%, #080d13) !important;
  color: #edf6ff !important;
  color-scheme: dark !important;
}
html[data-theme="dark"] .student-mode.student-mobile .hero {
  background:
    linear-gradient(90deg, rgba(9,15,21,.98) 0%, rgba(11,20,28,.95) 50%, rgba(13,23,31,.54) 100%),
    url('/static/assets/ui/student-hero-v2.jpg') right center / auto 104% no-repeat;
  border-color: rgba(131, 211, 198, .26);
}

@media (max-width: 980px) {
  .theme-switch { width: 100%; justify-content: space-between; }
  .theme-choice { flex: 1 1 0; }
}

/* Dashboard */
.dashboard-hero { align-items: center; }
.paper-upload-page .dashboard-hero {
  min-height: 240px;
  padding: 34px 38px;
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.95) 43%, rgba(255,255,255,.72) 62%, rgba(255,255,255,.12) 100%),
    url('/static/assets/ui/upload-center.jpg') center right / cover no-repeat;
  box-shadow: 0 24px 70px rgba(34, 66, 89, .11);
}
.paper-upload-page .dashboard-hero h1 { font-size: clamp(38px, 4vw, 56px); }
.paper-upload-page .dashboard-hero p { font-size: 17px; max-width: 560px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-content: center; }
.filters-panel { margin-top: 20px; }
.filter-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.filter-grid label { margin: 0; }
.filter-grid .wide { grid-column: span 2; }
.primary-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.advanced-details, .danger-details {
  margin-top: 14px;
  border: 1px solid rgba(216, 229, 238, .92);
  border-radius: 16px;
  background: rgba(250, 253, 255, .74);
  overflow: hidden;
}
.advanced-details > summary, .danger-details > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  color: #415a77;
  font-weight: 900;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.advanced-details > summary::-webkit-details-marker, .danger-details > summary::-webkit-details-marker { display: none; }
.advanced-details > summary::after, .danger-details > summary::after { content: "展开"; color: #8793a0; font-size: 12px; }
.advanced-details[open] > summary::after, .danger-details[open] > summary::after { content: "收起"; }
.advanced-details .filter-grid { padding: 0 14px 14px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.danger-details { border-color: #f0d0d0; background: linear-gradient(180deg, rgba(255,253,253,.96), rgba(255,255,255,.92)); }
.danger-details > summary { color: #873030; }
.panel.danger-details > summary { padding: 0; }
.danger-details-body { margin-top: 14px; }
.summary-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin: 18px 0; }
.metric-card { position: relative; overflow: hidden; background: rgba(255,255,255,.96); border: 1px solid rgba(218, 230, 238, .92); border-radius: 20px; padding: 17px; box-shadow: var(--shadow-soft); }
.metric-card::after { content: ""; position: absolute; right: -18px; top: -20px; width: 74px; height: 74px; border-radius: 999px; background: radial-gradient(circle, rgba(17,133,103,.11), transparent 68%); pointer-events: none; }
.metric-card div { color: #607083; font-weight: 800; font-size: 13px; }
.metric-card strong { display: block; font-size: 28px; color: #1b2a3b; margin: 8px 0 4px; }
.metric-card span { color: #8b98a6; font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.chart-panel { min-height: 260px; background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(249,252,253,.92)); }
.bar-chart, .pill-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; gap: 6px; }
.bar-title { display: flex; justify-content: space-between; gap: 12px; color: #445366; font-size: 13px; }
.bar-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-title b { white-space: nowrap; }
.bar-track, .pill-track { width: 100%; height: 11px; background: #eef4f8; border-radius: 999px; overflow: hidden; }
.bar-fill, .pill-track > div { height: 100%; background: #15915f; border-radius: 999px; }
.pill-row { display: grid; grid-template-columns: auto 40px 1fr; align-items: center; gap: 10px; }
.mini-badge { display: inline-flex; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 850; background: #edf3f7; color: #536375; }
.mini-badge.ok { background: #e9f8f1; color: #15915f; }
.mini-badge.warn { background: #fff3d3; color: #8a6200; }
.mini-badge.bad { background: #ffe8e8; color: #9a2b2b; }
.records-panel { margin-top: 18px; }
.mobile-results-panel { display: none; }
.mobile-results-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.mobile-results-head h2 {
  margin: 6px 0 4px;
  font-size: 24px;
  color: #17263a;
}
.mobile-results-head p {
  margin: 0;
  color: #607184;
  line-height: 1.65;
}
.mobile-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.mobile-kpi {
  border: 1px solid rgba(215, 229, 238, .95);
  border-radius: 16px;
  padding: 12px 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,251,253,.94));
}
.mobile-kpi span {
  display: block;
  color: #738293;
  font-size: 12px;
  font-weight: 850;
}
.mobile-kpi b {
  display: block;
  margin-top: 5px;
  color: #17263a;
  font-size: 22px;
  line-height: 1;
}
.mobile-paper-list {
  display: grid;
  gap: 12px;
}
.mobile-paper-card {
  border: 1px solid rgba(210, 225, 235, .96);
  border-radius: 20px;
  padding: 15px;
  background:
    radial-gradient(circle at 100% 0%, rgba(17,133,103,.09), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(249,252,253,.95));
  box-shadow: 0 12px 28px rgba(31,52,74,.055);
}
.mobile-paper-top,
.mobile-progress-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.mobile-paper-top b {
  display: block;
  font-size: 18px;
  color: #16263b;
}
.mobile-paper-top span {
  display: block;
  margin-top: 3px;
  color: #748397;
  font-size: 12px;
  line-height: 1.45;
}
.mobile-score-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 8px;
}
.mobile-score-row strong {
  color: #102238;
  font-size: 24px;
}
.mobile-score-row em {
  color: #118567;
  font-style: normal;
  font-weight: 950;
  font-size: 18px;
}
.mobile-progress-line {
  color: #607184;
  font-size: 13px;
  font-weight: 800;
}
.mobile-paper-card p {
  margin: 10px 0 12px;
  color: #607184;
  line-height: 1.65;
}
.report-center { margin-top: 18px; }
.report-center h2 { margin-bottom: 4px; }
.report-filter-grid { grid-template-columns: 220px 200px minmax(260px, 1fr); margin: 14px 0 10px; }
.report-filter-grid label { margin: 0; }
.report-table { width: 100%; table-layout: fixed; min-width: 0; }
.report-table th:nth-child(1) { width: 26%; }
.report-table th:nth-child(2) { width: 8%; }
.report-table th:nth-child(3) { width: 24%; }
.report-table th:nth-child(4) { width: 14%; }
.report-table th:nth-child(5) { width: 8%; }
.report-table th:nth-child(6) { width: 20%; }
.report-table .paper-badges { gap: 4px; }
.report-table .small-text { font-size: 12px; }
.report-preview {
  margin: 12px 0 14px;
  padding: 18px;
  border: 1px solid rgba(204, 220, 230, .95);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(244,250,248,.94)),
    radial-gradient(circle at 92% 8%, rgba(21,145,95,.12), transparent 30%);
  box-shadow: var(--shadow-soft);
}
.report-preview.empty {
  color: #748397;
  background: rgba(247,250,252,.78);
  box-shadow: none;
}
.report-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.report-preview-head h3 {
  margin: 4px 0 6px;
  color: #152438;
  font-size: 22px;
}
.report-preview-head p {
  margin: 0;
  max-width: 920px;
  color: #5f6f81;
  line-height: 1.7;
}
.section-kicker {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e9f8f1;
  color: #118567;
  font-size: 12px;
  font-weight: 900;
}
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.report-kpi {
  border: 1px solid #e0ebf2;
  border-radius: 16px;
  padding: 13px 14px;
  background: rgba(255,255,255,.82);
}
.report-kpi span,
.report-kpi small {
  display: block;
  color: #7b8b9c;
  font-size: 12px;
  font-weight: 800;
}
.report-kpi b {
  display: block;
  margin: 6px 0 4px;
  color: #142338;
  font-size: 24px;
}
.report-preview-grid {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(260px, 1.1fr) minmax(360px, 1.4fr);
  gap: 12px;
}
.report-card {
  border: 1px solid #e0ebf2;
  border-radius: 18px;
  padding: 15px;
  background: rgba(255,255,255,.86);
  min-height: 150px;
}
.report-card-wide { grid-column: span 1; }
.report-card h4 {
  margin: 0 0 12px;
  color: #1a2b3f;
  font-size: 15px;
}
.report-card .sub-h4 { margin-top: 14px; }
.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(225,235,242,.7);
}
.report-row:last-child { border-bottom: 0; }
.report-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-bottom: 11px;
}
.report-bar-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #44576a;
}
.report-bar-row span {
  color: #7a8797;
  font-size: 12px;
  white-space: nowrap;
}
.report-mini-bar {
  height: 9px;
  background: #eef4f7;
  border-radius: 999px;
  overflow: hidden;
}
.report-mini-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #118567, #5aa9d8);
  border-radius: inherit;
}
.priority-student {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(225,235,242,.7);
}
.priority-student:last-child { border-bottom: 0; }
.priority-student > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.priority-student strong {
  color: #152438;
  font-size: 16px;
}
.priority-student p {
  grid-column: 1 / -1;
  margin: 0;
  color: #607184;
  line-height: 1.6;
}
.action-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}
.action-step span {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  background: #e9f8f1;
  color: #118567;
  font-weight: 900;
}
.action-step p,
.low-question p {
  margin: 0;
  color: #607184;
  line-height: 1.65;
}
.low-question {
  padding: 9px 0;
  border-top: 1px solid rgba(225,235,242,.8);
}
.low-question span {
  float: right;
  color: #9a2b2b;
  font-weight: 900;
}
.compact-actions { gap: 6px; flex-wrap: wrap; }
.compact-actions button { white-space: nowrap; }
.records-header { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
#recordsHint { color: #738293; font-size: 13px; }
.records-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  color: #607083;
  font-size: 12px;
  font-weight: 850;
}
.records-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}
.records-pagination select {
  width: auto;
  min-width: 92px;
  height: 36px;
  padding: 0 30px 0 12px;
  border-radius: 999px;
  font-size: 12px;
}
#paperPageInfo {
  min-width: 130px;
  text-align: center;
  color: #415a77;
}
.dashboard-action-status { min-height: 20px; margin-top: 10px; font-weight: 700; }
.dashboard-action-status.ok { color: #15915f; }
.dashboard-action-status.warn { color: #8a6200; }
.table-wrap { overflow: auto; border: 1px solid rgba(218, 230, 238, .95); border-radius: 18px; background: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.85); }
.records-table-wrap {
  height: clamp(360px, 54vh, 620px);
  max-height: 620px;
}
.records-table-wrap .paper-table {
  min-width: 1280px;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; background: #fff; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid #edf2f6; vertical-align: top; }
th { background: linear-gradient(180deg, #f8fbfd, #f2f6f9); color: #526273; position: sticky; top: 0; z-index: 1; font-weight: 900; }
tr:hover td { background: #fbfdff; }
.small-text { color: #8793a0; font-size: 12px; margin-top: 4px; }
.danger-text { color: #9a2b2b; }
.success-text { color: var(--primary); }
.start-status { min-height: 20px; font-weight: 850; }
.clip-text { max-width: 260px; max-height: 42px; overflow: hidden; line-height: 1.6; }
.audio-cell audio { width: 180px; margin: 0; }
button.tiny { padding: 7px 10px; min-height: 0; border-radius: 8px; font-size: 12px; }
button.tiny.danger { background: #fff4f4; color: #9a2b2b; border-color: #f1c5c5; box-shadow: none; }
button.tiny.danger:hover { background: #ffe8e8; }
.empty-cell { text-align: center; color: #8793a0; padding: 28px !important; }
.detail-panel { margin-top: 18px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-content h3 { margin: 8px 0 10px; color: #1b2a3b; }
.detail-content p { margin: 8px 0; }
.detail-img { width: 100%; max-height: 360px; object-fit: contain; background: #f7fafc; border: 1px solid #e1ebf2; border-radius: 16px; }
.review-box { margin-top: 14px; background: #f7fafc; border: 1px solid #e1ebf2; border-radius: 16px; padding: 14px; }
.paper-table th:nth-child(1) { min-width: 90px; }
.paper-table th:nth-child(2) { min-width: 180px; }
.paper-table th:nth-child(3) { min-width: 120px; }
.paper-table th:nth-child(4) { min-width: 140px; }
.paper-table th:nth-child(8) { min-width: 240px; }
.paper-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.paper-detail-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
.paper-detail-head h3 { margin: 0 0 8px; color: #1b2a3b; }
.paper-detail-head p { margin: 0; color: #526273; line-height: 1.7; }
.paper-detail-meta { flex: 0 0 auto; border-radius: 12px; background: #f7fafc; border: 1px solid #e1ebf2; padding: 10px 12px; color: #415a77; font-weight: 800; }
.paper-question-wrap { margin-top: 10px; }
.question-detail-table th:nth-child(2) { min-width: 300px; }
.question-detail-table th:nth-child(5) { min-width: 240px; }
.question-text-wide { max-width: 420px; max-height: 58px; }
textarea { width: 100%; min-height: 86px; resize: vertical; border: 1px solid #ccd8e2; background: #fbfdff; border-radius: 12px; padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none; }
textarea:focus { border-color: #15915f; box-shadow: 0 0 0 3px rgba(21,145,95,.12); }
@media (max-width: 1200px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .report-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .report-preview-grid { grid-template-columns: 1fr; }
  .filter-grid, .primary-filter-grid, .advanced-details .filter-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1400px) {
  .report-table { min-width: 0; }
  .report-table thead { display: none; }
  .report-table tr {
    display: block;
    padding: 14px;
    border-bottom: 1px solid #e7eef4;
  }
  .report-table td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border: 0;
    padding: 7px 0;
  }
  .report-table td::before {
    color: #77879a;
    font-size: 12px;
    font-weight: 900;
  }
  .report-table td:nth-child(1)::before { content: "范围"; }
  .report-table td:nth-child(2)::before { content: "状态"; }
  .report-table td:nth-child(3)::before { content: "成绩"; }
  .report-table td:nth-child(4)::before { content: "生成"; }
  .report-table td:nth-child(5)::before { content: "文件"; }
  .report-table td:nth-child(6)::before { content: "操作"; }
  .report-table .compact-actions { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .summary-grid, .dashboard-grid, .filter-grid, .primary-filter-grid, .advanced-details .filter-grid, .detail-grid { grid-template-columns: 1fr; }
  .report-kpi-grid { grid-template-columns: 1fr; }
  .report-preview-head { flex-direction: column; }
  .filter-grid .wide { grid-column: auto; }
  .hero-actions { justify-content: flex-start; margin-top: 14px; }
  .paper-detail-head { flex-direction: column; }
  .dashboard-page {
    width: min(100% - 20px, 520px);
    margin: 14px auto 34px;
  }
  .dashboard-page .dashboard-hero {
    min-height: 132px;
    padding: 22px 20px;
    border-radius: 24px;
  }
  .dashboard-page .dashboard-hero h1 {
    font-size: 34px;
    margin: 6px 0;
  }
  .dashboard-page .dashboard-hero p {
    font-size: 13px;
    max-width: 270px;
  }
  .dashboard-page .filters-panel {
    margin-top: 12px;
    padding: 16px;
    border-radius: 22px;
  }
  .dashboard-page .filters-panel h2 {
    font-size: 22px;
    margin-bottom: 12px;
  }
  .dashboard-page .filter-grid {
    gap: 10px;
  }
  .dashboard-page label {
    font-size: 12px;
  }
  .dashboard-page select,
  .dashboard-page input {
    min-height: 48px;
    border-radius: 15px;
    font-size: 15px;
  }
  .dashboard-page .button-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .dashboard-page .button-row button {
    width: 100%;
    min-height: 48px;
    border-radius: 15px;
  }
  .dashboard-page #downloadFilteredBtn {
    display: none;
  }
  .dashboard-page .advanced-details {
    display: none;
  }
  .dashboard-page .records-delete-panel,
  .dashboard-page .report-center,
  .dashboard-page .summary-grid,
  .dashboard-page .dashboard-grid,
  .dashboard-page .records-panel {
    display: none;
  }
  .mobile-results-panel {
    display: block;
    margin-top: 12px;
    padding: 16px;
    border-radius: 22px;
  }
  .mobile-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mobile-paper-top,
  .mobile-progress-line {
    align-items: flex-start;
  }
  .mobile-progress-line {
    display: grid;
  }
  .mobile-paper-card button {
    width: 100%;
    min-height: 44px;
    border-radius: 14px;
  }
  .dashboard-page .detail-panel {
    display: none;
    margin-top: 12px;
    padding: 16px;
    border-radius: 22px;
  }
  .dashboard-page .detail-panel.has-detail {
    display: block;
  }
  .dashboard-page .detail-panel h2 {
    font-size: 22px;
  }
  .paper-question-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
    box-shadow: none;
  }
  .question-detail-table,
  .question-detail-table tbody,
  .question-detail-table tr,
  .question-detail-table td {
    display: block;
    width: 100%;
  }
  .question-detail-table thead {
    display: none;
  }
  .question-detail-table tr {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid rgba(215, 229, 238, .95);
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 10px 24px rgba(31,52,74,.045);
  }
  .question-detail-table td {
    border: 0;
    padding: 6px 0;
  }
  .question-detail-table td::before {
    display: block;
    margin-bottom: 3px;
    color: #7a8a9a;
    font-size: 11px;
    font-weight: 900;
  }
  .question-detail-table td:nth-child(1)::before { content: "题号"; }
  .question-detail-table td:nth-child(2)::before { content: "题目"; }
  .question-detail-table td:nth-child(3)::before { content: "得分"; }
  .question-detail-table td:nth-child(4)::before { content: "状态"; }
  .question-detail-table td:nth-child(5)::before { content: "识别/错因"; }
  .question-detail-table td:nth-child(6)::before { content: "录音"; }
  .question-detail-table td:nth-child(7)::before { content: "操作"; }
  .question-detail-table .clip-text,
  .question-text-wide {
    max-width: none;
    max-height: none;
  }
  .audio-cell audio {
    width: 100%;
  }
  .detail-grid {
    display: grid;
    gap: 14px;
  }
}

@media (max-width: 760px) {
  html[data-theme="dark"] .mobile-results-panel,
  html[data-theme="dark"] .dashboard-page .filters-panel,
  html[data-theme="dark"] .dashboard-page .detail-panel {
    background: rgba(8, 18, 29, .96);
    border-color: rgba(125, 170, 188, .24);
    box-shadow: 0 18px 44px rgba(0,0,0,.28);
  }
  html[data-theme="dark"] .mobile-results-head h2,
  html[data-theme="dark"] .mobile-paper-top b,
  html[data-theme="dark"] .mobile-score-row strong,
  html[data-theme="dark"] .mobile-kpi b,
  html[data-theme="dark"] .dashboard-page .detail-panel h2 {
    color: #f4f9ff;
  }
  html[data-theme="dark"] .mobile-results-head p,
  html[data-theme="dark"] .mobile-paper-top span,
  html[data-theme="dark"] .mobile-paper-card p,
  html[data-theme="dark"] .mobile-progress-line,
  html[data-theme="dark"] .mobile-kpi span {
    color: #aabac9;
  }
  html[data-theme="dark"] .mobile-kpi,
  html[data-theme="dark"] .mobile-paper-card,
  html[data-theme="dark"] .question-detail-table tr {
    background: linear-gradient(180deg, rgba(11, 24, 37, .98), rgba(9, 19, 31, .96));
    border-color: rgba(125, 170, 188, .22);
  }
  html[data-theme="dark"] .mobile-score-row em {
    color: #8cf1d5;
  }
}

/* Question image manager */
.manager-filters { grid-template-columns: 220px minmax(260px, 1fr); }
.manager-summary { grid-template-columns: repeat(5, 1fr); }
.manager-inline-tip { margin-top: 10px; color: #607086; font-size: 13px; font-weight: 760; }
.manager-table th:nth-child(1) { min-width: 150px; }
.manager-table th:nth-child(2) { min-width: 260px; }
.manager-table th:nth-child(3) { min-width: 220px; }
.manager-table th:nth-child(4) { min-width: 220px; }
.manager-table th:nth-child(5) { min-width: 240px; }
.manager-question-text { max-width: 360px; max-height: 66px; }
.manager-thumb { width: 180px; max-height: 120px; object-fit: contain; border: 1px solid #e1ebf2; border-radius: 12px; background: #f7fafc; display: block; margin-bottom: 8px; }
.button-row.compact { margin-top: 8px; }
.manager-table input[type="file"] { height: auto; padding: 9px; margin-bottom: 8px; }
.manager-table select { min-width: 200px; margin-bottom: 8px; }
.danger-panel { border-color: #efd1d1; background: linear-gradient(180deg, rgba(255,253,253,.96), rgba(255,255,255,.92)); }
.danger-panel h2 { color: #873030; }
.delete-test-box { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 12px; align-items: end; margin-top: 14px; }
.paper-delete-select-box { grid-template-columns: minmax(150px, .5fr) minmax(240px, .8fr) minmax(260px, 1fr) auto; }
.delete-test-box label { margin: 0; }
.delete-test-box input, .delete-test-box select { border-color: #e6b8b8; background: #fffdfd; }
.delete-test-box input:focus, .delete-test-box select:focus { border-color: #c43c3c; box-shadow: 0 0 0 3px rgba(196,60,60,.12); }
.student-roster-manager { margin-top: 20px; padding-top: 20px; border-top: 1px solid #e4edf2; }
.student-management-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 16px; align-items: start; }
.student-management-card {
  border: 1px solid rgba(220,232,239,.96);
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(249,252,253,.96));
  box-shadow: var(--shadow-soft);
}
.student-management-card h3 { margin: 8px 0 6px; font-size: 22px; color: #1b2d3f; }
.student-management-card p { margin: 0 0 14px; color: #657587; line-height: 1.7; }
.student-management-card .small-text { margin-top: 12px; }
.student-management-card.danger-card { border-color: #efd5d5; background: linear-gradient(180deg, #fffefe, #fffafa); }
.danger-label { background: #fce7e7; color: #8b2323; }
.student-add-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; margin-top: 12px; }
.student-add-form label,
.student-delete-form label { margin: 0; }
.student-add-form button { grid-column: 1 / -1; }
.student-delete-form { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: end; margin-top: 12px; }
.student-delete-form select { border-color: #e8c4c4; background: #fffdfd; }
.student-delete-form select:focus { border-color: #c43c3c; box-shadow: 0 0 0 3px rgba(196,60,60,.12); }
.compact-btn { padding: 8px 12px; min-height: 36px; }
.delete-records-box { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 12px; align-items: end; margin-top: 14px; }
.delete-records-box label { margin: 0; }
.delete-records-box select { border-color: #e6b8b8; background: #fffdfd; }
.delete-records-box select:focus { border-color: #c43c3c; box-shadow: 0 0 0 3px rgba(196,60,60,.12); }
.image-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.image-card { border: 1px solid #e1ebf2; border-radius: 18px; padding: 12px; background: linear-gradient(180deg, #fff, #fbfdff); line-height: 1.6; box-shadow: 0 10px 24px rgba(31,52,74,.035); }
.image-card img { width: 100%; height: 120px; object-fit: contain; border: 1px solid #eef2f6; border-radius: 12px; background: white; margin-bottom: 10px; }
.image-card b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .manager-summary { grid-template-columns: repeat(2, 1fr); }
  .manager-filters { grid-template-columns: 1fr; }
  .delete-test-box { grid-template-columns: 1fr; }
  .student-management-grid,
  .student-add-form,
  .student-delete-form { grid-template-columns: 1fr; }
  .student-add-form button { grid-column: auto; }
  .delete-records-box { grid-template-columns: 1fr; }
}

/* Import center */
.import-summary { grid-template-columns: repeat(6, 1fr); }
.import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.import-card { min-height: 420px; }
.import-card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.import-card-head h2 { margin-bottom: 6px; }
.import-card-head p { margin: 0; color: #607083; }
.step-dot { width: 38px; height: 38px; border-radius: 14px; background: #15915f; color: white; display: inline-flex; justify-content: center; align-items: center; font-weight: 900; flex: 0 0 auto; }
.import-result { margin-top: 16px; }
.import-result.warn { border-color: #f4dfad; background: #fff8e7; color: #725300; }
.import-wide { grid-column: 1 / -1; min-height: 0; }
.import-flow { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 8px; }
.primary-link { background: #15915f !important; color: white !important; }
.import-help { margin-top: 18px; }
.import-help .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.guide-table { width: 100%; border-collapse: collapse; }
.guide-table th, .guide-table td { border-bottom: 1px solid #eef1f6; text-align: left; padding: 10px; vertical-align: top; }
.guide-table th { color: #415a77; background: #f8fafc; width: 120px; }
@media (max-width: 1000px) {
  .import-summary { grid-template-columns: repeat(2, 1fr); }
  .import-grid, .import-help .two-col { grid-template-columns: 1fr; }
  .import-flow { grid-template-columns: 1fr 1fr; }
}
.three-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.notice-box { background: #f8fbfd; border: 1px solid #e1ebf2; border-radius: 16px; padding: 14px; margin: 14px 0 18px; }
.notice-box > b { display: block; color: #1b2a3b; margin-bottom: 6px; }
.notice-box p { margin: 0 0 12px; color: #607083; font-size: 13px; }
.notice-box .guide-table { font-size: 12px; }
@media (max-width: 900px) { .three-cols { grid-template-columns: 1fr; } }

.compact-selects label { margin-top: 10px; }

/* API Key 自动提醒 */
.health.ok { border-color: #bdebd2; background: #f0fdf4; color: #166534; }
.health.warn { border-color: #f4dfad; background: #fff8e7; color: #8a6200; }
.health.bad { border-color: #ffc4c4; background: #fff4f4; color: #9a2b2b; }
.health.ok span { color: #27764c; }
.health.warn span { color: #8a6200; }
.health.bad span { color: #9a2b2b; }
.api-modal-backdrop { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(12, 22, 34, .45); backdrop-filter: blur(3px); }
.api-modal { width: min(620px, 100%); background: #fff; border-radius: 22px; padding: 26px; box-shadow: 0 30px 90px rgba(14, 29, 47, .28); border: 1px solid #e4edf3; }
.api-modal-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 12px; border-radius: 999px; background: #fff3d3; color: #8a6200; font-size: 13px; font-weight: 800; margin-bottom: 12px; }
.api-modal h2 { margin: 0 0 10px; font-size: 24px; color: #1b2a3b; }
.api-modal p { margin: 0 0 16px; color: #526273; line-height: 1.8; }
.api-modal-steps { background: #f7fafc; border: 1px solid #e1ebf2; border-radius: 16px; padding: 16px; line-height: 1.8; color: #2f3f52; }
.api-modal-steps ol { margin: 8px 0 0 22px; padding: 0; }
.api-modal-note { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #fff8e7; border: 1px solid #f4dfad; color: #6b4b00; line-height: 1.7; }
.api-modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 640px) {
  .api-modal-backdrop { align-items: flex-start; padding: 16px; overflow: auto; }
  .api-modal { padding: 20px; }
  .api-modal-actions { justify-content: stretch; }
  .api-modal-actions > * { width: 100%; }
}

/* AI接口设置页 */
.ai-settings-page .dashboard-hero { align-items: flex-start; }
.section-title-row { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.section-title-row p { margin: 4px 0 0; color:#607083; }
.ai-status-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:12px; margin-top:14px; }
.ai-provider-card { position: relative; overflow: hidden; border-radius:14px; border:1px solid #e1ebf2; background:#fbfdff; padding:14px; line-height:1.55; }
.ai-provider-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: #91a3b4; }
.ai-provider-card h3 { margin:4px 0 5px; color:#1b2a3b; }
.ai-provider-card p { margin:6px 0; color:#526273; }
.ai-provider-card.ok { background:#f6fcf8; border-color:#caead9; }
.ai-provider-card.ok::before { background: var(--green); }
.ai-provider-card.warn { background:#fffaf0; border-color:#efd69c; }
.ai-provider-card.warn::before { background: var(--amber); }
.ai-provider-card.bad { background:#fff7f7; border-color:#efc8c8; }
.ai-provider-card.bad::before { background: var(--rose); }
.ai-settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:16px; align-items:start; }
.ai-setting-card { min-height:0; }
.recommended-card { grid-column:1 / -1; }
.recommended-card {
  background:
    linear-gradient(135deg, #ffffff 0%, #f6fbf8 54%, #f3f8fb 100%);
}
.ai-role-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.ai-role-strip > div {
  position: relative;
  overflow: hidden;
  min-height: 102px;
  border: 1px solid #dbe7ee;
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  padding: 12px;
  box-shadow: 0 8px 24px rgba(31,52,74,.05);
}
.ai-role-strip > div::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 14px solid rgba(17,133,103,.08);
}
.ai-role-strip span { color: var(--green); font-weight: 950; font-size: 11px; letter-spacing: .6px; }
.ai-role-strip b { display: block; margin: 6px 0 4px; color:#1b2a3b; font-size: 15px; }
.ai-role-strip p { margin: 0; color:#607083; font-size:12px; line-height: 1.5; }
.provider-status { margin:12px 0; }
.provider-status-box { border-radius:12px; padding:12px 14px; line-height:1.7; border:1px solid #e1ebf2; }
.provider-status-box.ok { background:#f6fcf8; border-color:#caead9; color:#166534; }
.provider-status-box.warn { background:#fffaf0; border-color:#efd69c; color:#8a6200; }
.provider-status-box.bad { background:#fff7f7; border-color:#efc8c8; color:#9a2b2b; }
.ai-function-map-panel,
.ai-oss-plan-panel { margin-top:16px; }
.ai-function-map { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; margin-top:14px; }
.ai-function-card { border:1px solid #e1ebf2; border-radius:14px; background:#fbfdff; padding:14px; min-height:196px; line-height:1.55; }
.ai-function-card h3 { margin:8px 0 10px; color:#1b2a3b; font-size:16px; }
.ai-function-card p { margin:6px 0; color:#526273; }
.ai-function-card small { display:block; margin-top:10px; color:#6f8191; }
.ai-function-card.ok { background:#f6fcf8; border-color:#caead9; }
.ai-function-card.warn { background:#fffaf0; border-color:#efd69c; }
.ai-function-card.bad { background:#fff7f7; border-color:#efc8c8; }
.oss-storage-plan {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.oss-plan-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, .8fr);
  gap: 12px;
  align-items: stretch;
}
.oss-plan-summary > div {
  border: 1px solid #d8e7ef;
  border-radius: 14px;
  background: #fbfdff;
  padding: 14px;
}
.oss-plan-summary strong,
.oss-plan-summary b {
  display: block;
  color: #1b2a3b;
  font-size: 17px;
}
.oss-plan-summary p {
  margin: 8px 0;
  color: #526273;
  line-height: 1.6;
}
.oss-plan-summary span,
.oss-plan-summary small {
  display: block;
  color: #6b7d8d;
  font-size: 12px;
  line-height: 1.5;
}
.oss-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.oss-plan-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  border: 1px solid #e1ebf2;
  border-radius: 14px;
  background: #fbfdff;
  padding: 14px;
  line-height: 1.55;
}
.oss-plan-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: #91a3b4;
}
.oss-plan-card.ok {
  background: #f6fcf8;
  border-color: #caead9;
}
.oss-plan-card.ok::before { background: var(--green); }
.oss-plan-card.warn {
  background: #fffaf0;
  border-color: #efd69c;
}
.oss-plan-card.warn::before { background: var(--amber); }
.oss-plan-card.neutral {
  background: #f8fbfd;
  border-color: #d7e5ee;
}
.oss-plan-card h3 {
  margin: 10px 0;
  color: #1b2a3b;
  font-size: 16px;
}
.oss-plan-card p {
  margin: 6px 0;
  color: #526273;
}
.oss-plan-card small {
  display: block;
  margin-top: 10px;
  color: #6f8191;
}
.oss-layer-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.oss-layer-row > div {
  min-height: 118px;
  border: 1px solid #dce8ef;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
}
.oss-layer-row b,
.oss-layer-row span,
.oss-layer-row small {
  display: block;
  line-height: 1.45;
}
.oss-layer-row b { color: #1b2a3b; }
.oss-layer-row span {
  margin: 6px 0;
  color: #087f69;
  font-weight: 850;
}
.oss-layer-row small {
  color: #6b7d8d;
}
.oss-migration-order {
  border: 1px solid #d8e7ef;
  border-radius: 14px;
  background: #fbfdff;
  padding: 14px 18px;
}
.oss-migration-order strong {
  display: block;
  color: #1b2a3b;
  margin-bottom: 8px;
}
.oss-migration-order ol {
  margin: 0 0 0 20px;
  padding: 0;
  color: #526273;
  line-height: 1.75;
}
.checkbox-line { display:flex; gap:8px; align-items:center; font-size:13px; color:#526273; margin-top:10px; }
.checkbox-line input { width:auto; height:auto; margin:0; }
.notice-box.compact { margin-top:16px; }
.ai-save-panel { margin-top:18px; }
.function-choice-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:14px; margin:12px 0 16px; }
.function-choice-grid > div { background:#fbfdff; border:1px solid #e1ebf2; border-radius:14px; padding:12px; }
.compact-checkbox { min-height:42px; background:#f7fafc; border:1px solid #e1ebf2; border-radius:12px; padding:0 12px; }
@media (max-width: 1000px) {
	  .ai-status-grid, .ai-settings-grid, .function-choice-grid, .ai-function-map, .oss-plan-summary, .oss-plan-grid, .oss-layer-row { grid-template-columns:1fr; }
  .recommended-card { grid-column:auto; }
  .ai-role-strip { grid-template-columns:1fr; }
}
/* 图片管理页：按测评进度筛选，并默认只看图片题 */
.manager-filters { grid-template-columns: 240px minmax(280px, 1fr) 180px 180px 190px; align-items: end; }
.checkbox-filter { display: flex; align-items: center; gap: 8px; min-height: 42px; margin: 0; padding: 0 10px; border: 1px solid #e1ebf2; border-radius: 12px; background: #fbfdff; color: #415a77; }
.checkbox-filter input { width: auto; height: auto; margin: 0; }
#progressHint { margin-top: 10px; }
@media (max-width: 1100px) { .manager-filters { grid-template-columns: 1fr 1fr; } .manager-filters .wide { grid-column: auto; } }
@media (max-width: 720px) { .manager-filters { grid-template-columns: 1fr; } }
/* 导入中心：非标准Excel自动分析结果 */
.analysis-box { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: #f8fbff; border: 1px solid #dbeaf5; line-height: 1.65; color: #2f3f52; }
.analysis-box p { margin: 6px 0; }
.analysis-box ol, .analysis-box ul { margin: 6px 0 6px 22px; padding: 0; }
.analysis-box li { margin: 2px 0; }

.image-analysis-box {
  border: 1px solid #c7d9ef;
  background: #f7fbff;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 0;
}
.image-analysis-box p { margin: 6px 0; }
.image-analysis-box .guide-table { margin-top: 8px; }
.import-confirm-panel {
  margin: 16px 0;
  border: 1px solid #cfe0ec;
  background: #fbfdff;
  border-radius: 16px;
  padding: 16px;
}
.import-confirm-panel.warn {
  background: #fffaf0;
  border-color: #f4dfad;
}
.confirm-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.confirm-title-row h3 { margin: 0 0 4px; color: #1b2a3b; }
.confirm-title-row p { margin: 0; color: #607083; line-height: 1.6; }
.confirm-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.confirm-metrics .metric-card { min-height: 86px; }
.confirm-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #edf2f7;
}
.confirm-block > b {
  display: block;
  margin-bottom: 8px;
  color: #1b2a3b;
}
.confirm-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.compact-preview { margin-top: 8px; overflow-x: auto; }
.import-preview-table { min-width: 680px; font-size: 12px; }
.import-preview-table td { max-width: 280px; }
.import-image-thumb {
  width: 108px;
  height: 72px;
  object-fit: contain;
  display: block;
  background: #f7fafc;
  border: 1px solid #dce8f0;
  border-radius: 8px;
}
.import-preview-empty {
  border: 1px dashed #d8e4ee;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
  color: #607083;
}
.import-confirm-line {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
button:disabled {
  opacity: .55;
  cursor: not-allowed;
}
@media (max-width: 900px) {
  .confirm-title-row { flex-direction: column; }
  .confirm-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 上传中心：任务、口语测试与学员名单分区 */
.upload-center-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.upload-center-tab {
  --center-accent: var(--green);
  position: relative;
  overflow: hidden;
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  width: 100%;
  padding: 20px 22px 18px;
  border: 1px solid rgba(207, 224, 235, .95);
  border-radius: 24px;
  background:
    radial-gradient(circle at 96% 12%, rgba(17,133,103,.13), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(247,252,252,.96));
  color: var(--ink);
  text-align: left;
  box-shadow: 0 14px 34px rgba(31, 65, 88, .06);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.upload-center-tab::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--center-accent), var(--blue));
  opacity: .58;
}
.upload-center-tab::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 22px;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(17,133,103,.16), rgba(47,111,159,.12));
}
.upload-center-tab[data-upload-center="task"] { --center-accent: var(--green); }
.upload-center-tab[data-upload-center="oral"] { --center-accent: #177996; }
.upload-center-tab[data-upload-center="student"] { --center-accent: var(--blue); }
.upload-center-tab[data-published-view="task"] { --center-accent: var(--green); }
.upload-center-tab[data-published-view="oral"] { --center-accent: #177996; }
.upload-center-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(31,52,74,.105);
}
.upload-center-tab.active {
  border-color: rgba(17,133,103,.46);
  box-shadow: 0 22px 52px rgba(17, 133, 103, .12);
  background:
    radial-gradient(circle at 96% 12%, rgba(17,133,103,.18), transparent 34%),
    linear-gradient(135deg, #fff, #f4fbf8);
}
.upload-center-tab > * { position: relative; z-index: 1; }
.upload-center-tab strong { display: block; font-size: 24px; line-height: 1.15; letter-spacing: 0; }
.upload-center-tab span:not(.module-eyebrow) { max-width: 560px; color: var(--muted); font-weight: 760; line-height: 1.55; font-size: 14px; }
.upload-center-tab em { font-style: normal; color: #517086; font-size: 12px; font-weight: 900; }
.upload-center-pane[hidden] { display: none !important; }
.published-module-pane {
  display: grid;
  gap: 18px;
}
.published-module-pane[hidden] {
  display: none !important;
}
.published-view-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  align-items: stretch;
  margin: 0 0 22px;
}
.published-view-toggle .published-view-card {
  min-height: 132px;
}
.published-view-toggle .published-view-card.active {
  border-color: rgba(17,133,103,.46);
  box-shadow: 0 22px 52px rgba(17, 133, 103, .12);
  background:
    radial-gradient(circle at 96% 12%, rgba(17,133,103,.18), transparent 34%),
    linear-gradient(135deg, #fff, #f4fbf8);
}
.module-eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef5f8;
  color: #496278;
  font-size: 12px;
  font-weight: 900;
}
.module-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.module-tags span {
  border: 1px solid #dbe7ee;
  background: rgba(255,255,255,.88);
  color: #40566d;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}
.upload-module-panel {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  box-shadow: 0 20px 54px rgba(31, 65, 88, .075);
}
.upload-module-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--amber));
}
.paper-workbench { margin-top: 18px; }
.student-import-panel { margin-top: 18px; }
.paper-step-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.paper-step-head.compact { margin-bottom: 12px; }
.paper-step-head h2 { margin-bottom: 5px; }
.paper-step-head p { margin: 0; color: #607083; line-height: 1.6; }
.paper-save-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.paper-upload-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 14px;
  align-items: start;
  margin-top: 16px;
}
.paper-upload-form label { margin: 0 0 4px; }
.paper-upload-form > div,
.paper-upload-form > label {
  min-width: 0;
}
.paper-upload-form > .wide,
.paper-upload-form > label.wide,
.paper-upload-form > .blueprint-score-panel.wide,
.paper-upload-form > .task-blueprint-toolbar.wide {
  grid-column: 1 / -1;
}
.paper-upload-form > label.wide {
  display: grid;
  gap: 8px;
  color: var(--tt-muted, var(--muted));
  font-weight: 850;
}
.paper-upload-form .small-text { line-height: 1.45; }
.paper-upload-form .button-row { grid-column: 1 / -1; margin-top: 4px; }
.paper-scope-box { grid-column: 1 / -1; border: 1px solid #dbe9ef; border-radius: 18px; background: linear-gradient(180deg, #fbfeff, #f5faf8); padding: 14px; }
.paper-scope-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.paper-scope-option { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; border: 1px solid #d6e6ee; border-radius: 999px; background: #fff; padding: 8px 12px; color: #203448; font-weight: 850; box-shadow: 0 8px 20px rgba(31,52,74,.04); }
.paper-scope-option input { width: auto; height: auto; margin: 0; accent-color: #15915f; }
.paper-scope-option em { font-style: normal; color: #5f7083; font-weight: 760; }
.paper-scope-option span { color: #118567; background: #e7f7ef; border-radius: 999px; padding: 3px 7px; font-size: 12px; }
.upload-center-page #paperModule {
  padding: 32px 34px 30px;
}
.upload-center-page #paperModule .paper-step-head {
  align-items: flex-start;
  margin-bottom: 22px;
}
.upload-center-page #paperModule .paper-step-head h2 {
  margin: 4px 0 6px;
}
.upload-center-page #paperModule .paper-step-head p {
  max-width: 520px;
}
.upload-center-page #paperModule .oral-paper-upload-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 20px;
  align-items: start;
  margin-top: 0;
}
.upload-center-page #paperModule .oral-paper-upload-form > div {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
}
.upload-center-page #paperModule .oral-paper-upload-form label {
  min-height: 20px;
  margin: 0;
  color: #5c7084;
  font-size: 13px;
  line-height: 20px;
}
.upload-center-page #paperModule .oral-paper-upload-form input,
.upload-center-page #paperModule .oral-paper-upload-form select {
  height: 52px;
  min-height: 52px;
}
.upload-center-page #paperModule .oral-paper-upload-form .small-text {
  margin: 0;
  color: #6d7f92;
  line-height: 1.5;
}
.upload-center-page #paperModule .paper-file-field {
  grid-column: span 2;
}
.upload-center-page #paperModule .paper-scope-box {
  margin-top: 2px;
  padding: 18px 20px;
}
.upload-center-page #paperModule .paper-action-row {
  display: flex !important;
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.upload-center-page #paperModule .paper-action-row > button {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 116px;
}
.upload-center-page #paperModule .paper-action-row > button.secondary {
  min-width: 132px;
}
.upload-center-page #paperModule .paper-action-row #savePaperBtn {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 132px;
  margin-left: auto;
}
@media (max-width: 1180px) {
  .upload-center-page #paperModule .oral-paper-upload-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .upload-center-page #paperModule {
    padding: 24px 18px;
  }
  .upload-center-page #paperModule .oral-paper-upload-form {
    grid-template-columns: 1fr;
  }
  .upload-center-page #paperModule .paper-file-field {
    grid-column: 1;
  }
  .upload-center-page #paperModule .paper-action-row #savePaperBtn {
    width: 100%;
    margin-left: 0;
  }
  .upload-center-page #paperModule .paper-action-row > button {
    width: 100%;
  }
}
.paper-voice-prewarm {
  margin-top: 14px;
  border: 1px solid #d9e9ef;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(247,252,251,.96), rgba(244,250,255,.94)),
    #fff;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.paper-voice-prewarm b { display: block; color: #17263a; font-size: 17px; margin-top: 4px; }
.paper-voice-prewarm p { margin: 5px 0 8px; color: #607083; line-height: 1.55; }
.paper-voice-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.voice-prewarm-notice {
  margin: 0 0 8px;
  color: #516274;
  line-height: 1.55;
}
.voice-prewarm-error {
  margin-top: 6px;
  color: #a03636;
  font-weight: 800;
}
.voice-audit-list { grid-column: 1 / -1; display: grid; gap: 8px; }
.voice-audit-empty {
  border: 1px dashed #cddce6;
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  color: #607083;
  padding: 12px 14px;
  font-weight: 800;
}
.voice-audit-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e2edf3;
  border-radius: 16px;
  background: rgba(255,255,255,.82);
  padding: 10px 12px;
}
.voice-audit-row b { font-size: 15px; margin: 0; }
.voice-audit-row span { color: #607083; font-weight: 760; }
.voice-audit-counts { color: #52677d; font-weight: 850; white-space: nowrap; }
.voice-audit-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 900;
}
.voice-audit-state.ready { color: #0b7b54; background: #e7f7ee; }
.voice-audit-state.missing { color: #9a6a05; background: #fff4cf; }
.paper-section-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.student-upload-form { grid-template-columns: minmax(260px, 1.2fr) 220px 260px 220px; }
.paper-draft-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
  scroll-margin-top: 150px;
}
.task-inline-edit-slot .paper-draft-grid {
  grid-template-columns: 250px minmax(0, 1fr);
  margin: 0 0 18px;
}
.task-inline-edit-slot .paper-draft-grid .panel {
  border-radius: 14px !important;
}
.oral-task-draft-panel .question-draft-panel {
  overflow: hidden;
}
.image-tray-panel { position: sticky; top: 84px; }
.paper-image-tray { display: grid; gap: 10px; max-height: calc(100vh - 220px); overflow: auto; padding-right: 4px; }
.paper-image-card {
  border: 1px solid #dce8f0;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-radius: 14px;
  padding: 8px;
  cursor: grab;
  box-shadow: 0 8px 18px rgba(31,52,74,.035);
}
.paper-image-card.selected { border-color: #15915f; box-shadow: 0 0 0 3px rgba(21,145,95,.14); }
.paper-image-card img { width: 100%; height: 120px; object-fit: contain; background: #f7fafc; border: 1px solid #edf2f7; border-radius: 8px; display: block; }
.paper-image-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 6px; font-size: 12px; color: #607083; }
.paper-image-meta b { color: #1b2a3b; }
.paper-section-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.paper-question-wrap {
  max-height: calc(100vh - 220px);
  overflow: auto;
}
.oral-task-draft-panel .paper-question-wrap {
  max-height: min(680px, calc(100vh - 180px));
}
.paper-question-table {
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
}
.paper-question-table th:nth-child(1) { width: 88px; }
.paper-question-table th:nth-child(2) { width: 120px; }
.paper-question-table th:nth-child(4) { width: 146px; }
.paper-question-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(23, 121, 150, .06);
  color: #566a80;
  font-size: 12px;
  font-weight: 900;
}
.paper-question-table td {
  background: rgba(255, 255, 255, .72);
  vertical-align: top;
}
.paper-question-table textarea {
  width: 100%;
  min-height: 66px;
  border: 1px solid #ccd8e2;
  background: #fbfdff;
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--tt-text, #102033);
  font: inherit;
  font-weight: 720;
  line-height: 1.55;
  resize: vertical;
}
.paper-question-table select,
.paper-question-table input {
  height: 38px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 760;
}
.paper-question-table label {
  margin: 0 0 6px;
  color: #5d7084;
  font-size: 12px;
  font-weight: 900;
}
.paper-question-table details {
  margin-top: 8px;
  border: 1px solid #e1ebf2;
  border-radius: 12px;
  padding: 8px 10px;
  background: #f8fafc;
}
.paper-question-table summary { cursor: pointer; font-weight: 900; color: #415a77; }
.draft-answer-cell {
  display: grid;
  gap: 10px;
}
.draft-answer-block {
  display: grid;
  gap: 6px;
}
.draft-answer-block + .draft-answer-block {
  padding-top: 8px;
  border-top: 1px solid rgba(23, 121, 150, .1);
}
.draft-advanced-fields {
  color: #566a80;
}
.draft-advanced-fields textarea {
  min-height: 62px;
}
.paper-order-cell input, .paper-id-score-cell input { width: 84px; display: block; }
.paper-order-cell label, .paper-id-score-cell label {
  display: block;
  color: #6d7b8c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 4px;
}
.score-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.score-input-row input { margin-bottom: 0; }
.score-input-row span {
  color: #526273;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}
.draft-row-actions { display: grid; gap: 6px; margin-top: 4px; }
.draft-row-actions .tiny { width: 100%; justify-content: center; }
.paper-drop-zone {
  min-height: 126px;
  border: 1px dashed #b7cad8;
  border-radius: 14px;
  background: #f8fbfd;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  color: #607083;
  text-align: center;
  padding: 8px;
}
.paper-drop-zone small { color: #8b98a6; }
.paper-drop-zone.has-image { border-style: solid; background: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }
.paper-drop-zone img { width: 100%; height: 92px; object-fit: contain; display: block; }
.paper-drop-zone .tiny { margin-top: 6px; }
.paper-drop-actions {
  display: flex;
  width: 100%;
  gap: 7px;
  justify-content: center;
  align-items: center;
  margin-top: 7px;
}
.paper-drop-actions .tiny {
  flex: 1 1 0;
  margin-top: 0;
}
.paper-drop-zone.drag-over {
  border-color: #0f8b73;
  background: #eefaf6 !important;
  box-shadow: 0 0 0 3px rgba(15, 139, 115, .14);
}
.tiny-empty { padding: 16px 8px; font-size: 12px; }
@media (max-width: 1100px) {
  .paper-upload-form, .paper-draft-grid { grid-template-columns: 1fr; }
  .paper-voice-prewarm { grid-template-columns: 1fr; }
  .paper-voice-actions { justify-content: flex-start; }
  .voice-audit-row { grid-template-columns: 1fr; }
  .voice-audit-counts { white-space: normal; }
  .upload-center-selector { grid-template-columns: 1fr; }
  .published-view-toggle { grid-template-columns: 1fr; }
  .image-tray-panel { position: static; }
  .paper-image-tray { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
}
@media (max-width: 720px) {
  .paper-step-head { flex-direction: column; }
  .paper-image-tray { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .confirm-metrics { grid-template-columns: 1fr; }
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 12%, rgba(21,145,95,.12), transparent 32%),
    radial-gradient(circle at 80% 18%, rgba(47,111,159,.12), transparent 34%),
    linear-gradient(135deg, #f5fbfa, #f7fafc 54%, #eef7f3);
}
.login-card {
  width: min(460px, 100%);
  border: 1px solid #d8e7ef;
  border-radius: 28px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 22px 70px rgba(31,52,74,.12);
  padding: 34px;
}
.login-card h1 { margin: 12px 0 10px; font-size: 34px; color: #132338; letter-spacing: 0; }
.login-card p { margin: 0 0 22px; color: #607083; line-height: 1.7; }
.login-card form { display: grid; gap: 12px; }
.login-card label { margin: 0; color: #42566d; font-weight: 850; }
.login-card input { width: 100%; height: 52px; border-radius: 16px; }
.login-card button { margin-top: 6px; }
.login-error {
  border: 1px solid #f1b8b8;
  background: #fff4f4;
  color: #a52828;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-weight: 800;
}

/* v12 product polish: final visual pass for teacher workspace and student mobile. */
.top-module-nav {
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,251,252,.92));
  box-shadow: 0 10px 34px rgba(31,52,74,.06);
}
.top-nav-links a,
.health.top-health {
  min-height: 38px;
}
.top-nav-links a {
  border-color: rgba(195, 214, 225, .78);
  background: rgba(255,255,255,.88);
}
.top-nav-links a.active {
  background: linear-gradient(135deg, #102336, #16394d);
}
.hero {
  border-radius: 30px;
  box-shadow: 0 24px 70px rgba(31,52,74,.085);
}
.panel {
  border-color: rgba(198,216,226,.86);
  box-shadow: 0 18px 48px rgba(31,52,74,.07);
}
.setup-panel .button-row {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) minmax(128px, 1fr);
  gap: 10px;
}
.setup-panel .button-row button,
.setup-panel .button-row a {
  justify-content: center;
}
.setup-panel #startBtn {
  grid-column: span 2;
}
.student-link-publisher {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(198,216,226,.82);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(247,252,251,.96), rgba(255,255,255,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.link-publisher-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}
.link-publisher-head strong {
  color: var(--ink);
  font-weight: 900;
}
.link-publisher-head span {
  color: #718294;
  font-size: 12px;
  font-weight: 760;
}
.link-publisher-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.student-link-publisher label {
  margin-top: 6px;
}
.student-link-publisher .link-publish-btn {
  width: 100%;
  margin-top: 12px;
  justify-content: center;
}
.batch-student-picker {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed rgba(77, 121, 145, .45);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
}
.batch-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: #607083;
  font-size: 12px;
  font-weight: 780;
}
.batch-picker-toolbar button {
  min-height: 30px;
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}
.batch-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  max-height: 168px;
  overflow: auto;
}
.batch-picker-list label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 11px;
  background: rgba(240,248,249,.9);
  color: var(--ink);
  font-size: 13px;
}
.batch-picker-list input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #10865f;
  box-shadow: none;
}
html[data-theme="dark"] .student-link-publisher {
  background: linear-gradient(135deg, rgba(15, 30, 39, .96), rgba(9, 18, 27, .96));
  border-color: rgba(126, 169, 190, .28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
html[data-theme="dark"] .link-publisher-head strong,
html[data-theme="dark"] .batch-picker-list label {
  color: #eef7fb;
}
html[data-theme="dark"] .link-publisher-head span,
html[data-theme="dark"] .batch-picker-toolbar {
  color: #98abbc;
}
html[data-theme="dark"] .batch-student-picker {
  background: rgba(5, 14, 22, .58);
  border-color: rgba(126, 169, 190, .28);
}
html[data-theme="dark"] .batch-picker-list label {
  background: rgba(21, 38, 50, .88);
  border: 1px solid rgba(126, 169, 190, .18);
}
.student-mode.student-mobile {
  width: min(430px, calc(100% - 20px)) !important;
  margin: 10px auto calc(34px + env(safe-area-inset-bottom, 0px)) !important;
  color: #132338;
}
.student-mode.student-mobile::before,
.student-mode.student-mobile .setup-panel::after,
.student-mode.student-mobile .question-card::after,
.student-mode.student-mobile .test-panel::after {
  display: none !important;
}
.student-mode.student-mobile .hero {
  min-height: 132px !important;
  margin: 0 0 12px !important;
  padding: 22px 22px !important;
  border-radius: 26px !important;
  background:
    linear-gradient(90deg, rgba(255,255,255,.97), rgba(255,255,255,.78) 50%, rgba(255,255,255,.18)),
    url('/static/assets/ui/student-hero-v2.jpg') right center / auto 112% no-repeat !important;
  border: 1px solid rgba(196, 219, 223, .92) !important;
  box-shadow: 0 18px 46px rgba(31,52,74,.08) !important;
}
.student-mode.student-mobile.assessment-started .hero {
  display: none !important;
}
.student-mode.student-mobile .brand {
  font-size: 10px !important;
  letter-spacing: 2.6px !important;
  color: #12866b !important;
}
.student-mode.student-mobile .hero h1 {
  margin: 8px 0 6px !important;
  font-size: clamp(30px, 9vw, 40px) !important;
  line-height: 1.06 !important;
  color: #132238 !important;
}
.student-mode.student-mobile .hero p {
  max-width: 220px !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  color: #516579 !important;
}
.student-mode.student-mobile .layout {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  margin-top: 0 !important;
}
.student-mode.student-mobile .setup-panel,
.student-mode.student-mobile .test-panel {
  grid-column: auto !important;
  border-radius: 26px !important;
  border: 1px solid rgba(198, 218, 226, .92) !important;
  background: rgba(255,255,255,.94) !important;
  box-shadow: 0 18px 46px rgba(31,52,74,.08) !important;
  backdrop-filter: blur(14px);
}
.student-mode.student-mobile .setup-panel {
  padding: 18px !important;
}
.student-mode.student-mobile.assessment-started .setup-panel {
  display: none !important;
}
.student-mode.student-mobile .setup-panel h2 {
  margin-bottom: 14px !important;
  font-size: 23px !important;
  color: #15243a !important;
}
.student-mode.student-mobile label {
  margin: 10px 0 6px !important;
  color: #5a6c7e !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}
.student-mode.student-mobile input,
.student-mode.student-mobile select {
  height: 50px !important;
  border-radius: 17px !important;
  background: #fff !important;
  border: 1px solid #c9dbe6 !important;
  color: #152338 !important;
  font-size: 16px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9) !important;
}
.student-mode.student-mobile .student-roster-note {
  border-radius: 18px !important;
  padding: 12px 13px !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  color: #587064 !important;
  background: #f3faf5 !important;
  border-color: #d5eadb !important;
}
.student-mode.student-mobile #startBtn {
  min-height: 58px !important;
  border-radius: 18px !important;
  font-size: 18px !important;
}
.student-mode.student-mobile .student-mobile-summary {
  border-radius: 18px !important;
  padding: 12px 13px !important;
  background: #f4fbfb !important;
  border: 1px solid #d7e9ee !important;
}
.student-mode.student-mobile.identity-collapsed .setup-panel {
  padding: 14px !important;
}
.student-mode.student-mobile.identity-collapsed .setup-panel > label,
.student-mode.student-mobile.identity-collapsed .setup-panel > select,
.student-mode.student-mobile.identity-collapsed .setup-panel .compact-selects,
.student-mode.student-mobile.identity-collapsed .setup-panel .student-roster-note {
  display: none !important;
}
.student-mode.student-mobile.identity-collapsed .button-row {
  display: grid !important;
  grid-template-columns: 1fr !important;
  margin-top: 12px !important;
}
.student-mode.student-mobile.identity-collapsed #startBtn {
  display: inline-flex !important;
  grid-column: auto !important;
}
.student-mode.student-mobile .test-panel {
  padding: 14px !important;
}
.student-mode.student-mobile .question-card,
.student-mode.student-mobile .question-voice-panel,
.student-mode.student-mobile .rubric-card,
.student-mode.student-mobile .recorder {
  border-radius: 24px !important;
  box-shadow: none !important;
}
.student-mode.student-mobile .question-card {
  padding: 20px 18px !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(244,251,248,.94)) !important;
  border: 1px solid #d8e8ed !important;
}
.student-mode.student-mobile .question-card::before {
  top: 20px !important;
  bottom: 20px !important;
  width: 5px !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #11a27b, #327bb1) !important;
}
.student-mode.student-mobile .question-card-head {
  margin-bottom: 20px !important;
}
.student-mode.student-mobile .badge,
.student-mode.student-mobile .progress {
  height: 38px !important;
  border-radius: 999px !important;
  padding: 0 14px !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
}
.student-mode.student-mobile .badge {
  background: #e8f8f0 !important;
  color: #0b815d !important;
}
.student-mode.student-mobile .progress {
  background: #eef5f8 !important;
  color: #50677d !important;
}
.student-mode.student-mobile .question-label {
  margin: 0 0 8px !important;
  color: #6d7e8c !important;
  font-size: 13px !important;
}
.student-mode.student-mobile #qTitle {
  font-size: clamp(28px, 8.6vw, 38px) !important;
  line-height: 1.18 !important;
  color: #14253a !important;
  text-shadow: none !important;
}
.student-mode.student-mobile.assessment-started #qTitle {
  font-size: clamp(30px, 8.8vw, 40px) !important;
}
.student-mode.student-mobile .question-text-reveal {
  border-radius: 18px !important;
  padding: 12px 14px !important;
  color: #465c70 !important;
  background: #f5fafc !important;
  border-color: #dceaf1 !important;
}
.student-mode.student-mobile .question-voice-panel {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: center !important;
  padding: 16px !important;
  background: linear-gradient(135deg, #edf9f4, #eef7fb) !important;
  border: 1px solid #cae7df !important;
}
.student-mode.student-mobile .question-voice-panel::before {
  display: none !important;
  content: none !important;
}
.student-mode.student-mobile .voice-orb {
  width: 46px !important;
  height: 46px !important;
  border-radius: 18px !important;
  color: #108e71 !important;
  background: #fff !important;
  border: 1px solid rgba(42,154,126,.18) !important;
  box-shadow: 0 10px 24px rgba(19,114,94,.10) !important;
}
.student-mode.student-mobile .voice-copy strong {
  font-size: 18px !important;
  color: #138062 !important;
}
.student-mode.student-mobile .voice-copy span {
  margin-top: 4px !important;
  color: #52697a !important;
  font-size: 13px !important;
}
.student-mode.student-mobile .question-voice-panel .compact-actions {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 9px !important;
  margin-top: 2px !important;
}
.student-mode.student-mobile .question-voice-panel button,
.student-mode.student-mobile .record-actions .nav-step {
  min-height: 46px !important;
  border-radius: 15px !important;
  background: rgba(255,255,255,.84) !important;
  color: #244d68 !important;
  border-color: #d1e3eb !important;
  box-shadow: none !important;
  font-size: 14px !important;
}
.student-mode.student-mobile .image-wrap {
  padding: 10px !important;
  border-radius: 22px !important;
  background: #fff !important;
  border: 1px solid #d8e8ef !important;
}
.student-mode.student-mobile .image-wrap img {
  max-height: 220px !important;
  width: 100% !important;
  object-fit: contain !important;
  border-radius: 16px !important;
}
.student-mode.student-mobile .rubric-card {
  padding: 12px 14px !important;
  color: #445567 !important;
  background: #fbf8ed !important;
  border: 1px solid #eadca9 !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
}
.student-mode.student-mobile .rubric-card strong {
  color: #5b4b20 !important;
}
.student-mode.student-mobile .recorder {
  padding: 16px !important;
  background: linear-gradient(180deg, #ffffff, #f7fbfd) !important;
  border: 1px solid #d8e8ef !important;
}
.student-mode.student-mobile #timer {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 164px !important;
  height: 74px !important;
  margin: 0 auto 12px !important;
  padding: 0 22px !important;
  border-radius: 999px !important;
  background: #eef5fb !important;
  border: 1px solid #d9e7f0 !important;
  color: #14243a !important;
  font-size: clamp(48px, 15vw, 64px) !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}
.student-mode.student-mobile #status {
  max-width: 100% !important;
  margin: 0 auto 8px !important;
  color: #536579 !important;
  font-size: 16px !important;
  line-height: 1.55 !important;
}
.student-mode.student-mobile .record-hint {
  max-height: 84px !important;
  overflow: auto !important;
  color: #718093 !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
}
.student-mode.student-mobile .record-hint.warn {
  color: #765626 !important;
  background: #fff7e0 !important;
  border: 1px solid #ecdba4 !important;
}
.student-mode.student-mobile .record-actions {
  display: grid !important;
  grid-template-columns: 76px minmax(0, 1fr) 76px !important;
  gap: 10px !important;
  align-items: center !important;
  margin-top: 14px !important;
}
.student-mode.student-mobile .record-actions button {
  margin: 0 !important;
}
.student-mode.student-mobile .primary-record {
  min-height: 64px !important;
  border-radius: 20px !important;
  font-size: 20px !important;
  letter-spacing: 0 !important;
  background: linear-gradient(135deg, #18a576, #2d7fb1) !important;
  box-shadow: 0 14px 34px rgba(21,117,115,.22) !important;
}
.student-mode.student-mobile .primary-record[data-mode="recording"] {
  background: linear-gradient(135deg, #e84b65, #d93863) !important;
}
.student-mode.student-mobile .primary-record[data-mode="saving"] {
  background: linear-gradient(135deg, #7892a4, #52677d) !important;
}
.student-mode.student-mobile audio#audioPreview {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
}
.student-mode.student-mobile .encouragement-toast {
  display: none !important;
}
@media (max-width: 370px) {
  .student-mode.student-mobile .record-actions {
    grid-template-columns: 64px minmax(0, 1fr) 64px !important;
    gap: 7px !important;
  }
  .student-mode.student-mobile .record-actions .nav-step {
    font-size: 13px !important;
    padding: 8px !important;
  }
  .student-mode.student-mobile .primary-record {
    font-size: 18px !important;
  }
}
@media (prefers-color-scheme: dark) {
  html[data-student-device="mobile"],
  html[data-student-device="mobile"] body,
  body.student-mobile-device {
    background: #071019 !important;
    color: #eef6fb !important;
    color-scheme: dark !important;
  }
  .student-mode.student-mobile {
    color: #eef6fb !important;
  }
  .student-mode.student-mobile .hero {
    background:
      linear-gradient(90deg, rgba(8,16,25,.94), rgba(8,16,25,.72) 56%, rgba(8,16,25,.28)),
      url('/static/assets/ui/student-hero-v2.jpg') right center / auto 112% no-repeat !important;
    border-color: rgba(116, 171, 188, .22) !important;
    box-shadow: 0 20px 58px rgba(0,0,0,.32) !important;
  }
  .student-mode.student-mobile .brand {
    color: #79dfc5 !important;
  }
  .student-mode.student-mobile .hero h1,
  .student-mode.student-mobile .setup-panel h2,
  .student-mode.student-mobile #qTitle {
    color: #f6fbff !important;
  }
  .student-mode.student-mobile .hero p,
  .student-mode.student-mobile label,
  .student-mode.student-mobile .question-label,
  .student-mode.student-mobile #status,
  .student-mode.student-mobile .record-hint {
    color: #a9bbc8 !important;
  }
  .student-mode.student-mobile .setup-panel,
  .student-mode.student-mobile .test-panel,
  .student-mode.student-mobile .question-card,
  .student-mode.student-mobile .recorder {
    background: rgba(12, 22, 33, .96) !important;
    border-color: rgba(116, 171, 188, .22) !important;
    box-shadow: 0 18px 44px rgba(0,0,0,.34) !important;
  }
  .student-mode.student-mobile input,
  .student-mode.student-mobile select {
    background: #0e1925 !important;
    border-color: rgba(132, 177, 193, .28) !important;
    color: #eef6fb !important;
  }
  .student-mode.student-mobile .student-roster-note,
  .student-mode.student-mobile .student-mobile-summary {
    background: rgba(14, 42, 37, .62) !important;
    border-color: rgba(90, 214, 179, .20) !important;
    color: #b6d8ce !important;
  }
  .student-mode.student-mobile .question-card {
    background: linear-gradient(145deg, #0f1b29, #0b1622) !important;
  }
  .student-mode.student-mobile .badge {
    background: rgba(30, 91, 75, .92) !important;
    color: #98f5d9 !important;
  }
  .student-mode.student-mobile .progress {
    background: rgba(6, 13, 20, .78) !important;
    color: #dde9f4 !important;
  }
  .student-mode.student-mobile .question-voice-panel {
    background: linear-gradient(135deg, #133c37, #102839) !important;
    border-color: rgba(89, 218, 184, .26) !important;
  }
  .student-mode.student-mobile .voice-orb {
    color: #8ef3d4 !important;
    background: #0b1520 !important;
    border-color: rgba(113, 234, 204, .22) !important;
  }
  .student-mode.student-mobile .voice-copy strong {
    color: #9ff4dc !important;
  }
  .student-mode.student-mobile .voice-copy span {
    color: #c1d2dc !important;
  }
  .student-mode.student-mobile .question-voice-panel button,
  .student-mode.student-mobile .record-actions .nav-step {
    background: #0b1520 !important;
    color: #e8f1f7 !important;
    border-color: rgba(132, 177, 193, .24) !important;
  }
  .student-mode.student-mobile .rubric-card {
    background: rgba(18, 25, 20, .96) !important;
    border-color: rgba(228, 218, 173, .25) !important;
    color: #e6dfc0 !important;
  }
  .student-mode.student-mobile .rubric-card strong {
    color: #fff3c6 !important;
  }
  .student-mode.student-mobile .image-wrap {
    background: #0d1824 !important;
    border-color: rgba(132, 177, 193, .22) !important;
  }
  .student-mode.student-mobile #timer {
    background: #08121d !important;
    border-color: rgba(132, 177, 193, .24) !important;
    color: #a9c5ff !important;
  }
  .student-mode.student-mobile .record-hint.warn {
    background: rgba(238, 222, 164, .09) !important;
    border-color: rgba(238, 222, 164, .28) !important;
    color: #efe2b7 !important;
  }
}
@media (max-width: 760px) {
  .completion-overlay {
    padding: 16px !important;
    place-items: end center !important;
    background: linear-gradient(180deg, rgba(9,17,27,.12), rgba(9,17,27,.62)) !important;
  }
  .completion-card {
    width: 100% !important;
    min-height: auto !important;
    display: block !important;
    padding: 22px !important;
    border-radius: 28px 28px 22px 22px !important;
    background:
      linear-gradient(135deg, rgba(255,255,255,.99), rgba(245,252,249,.98)) !important;
    box-shadow: 0 26px 70px rgba(5,16,28,.28) !important;
  }
  .completion-card::before {
    display: none !important;
  }
  .completion-visual {
    min-height: 150px !important;
    margin-bottom: 14px !important;
    border-radius: 24px !important;
  }
  .completion-badge {
    width: 84px !important;
    height: 84px !important;
  }
  .completion-content h2 {
    font-size: 28px !important;
    line-height: 1.16 !important;
  }
  .completion-content p {
    font-size: 15px !important;
    line-height: 1.65 !important;
  }
  .completion-actions {
    grid-template-columns: 1fr !important;
  }
}
@media (prefers-color-scheme: dark) and (max-width: 760px) {
  .completion-card {
    background: linear-gradient(145deg, #0f1a28, #0b1520) !important;
    border-color: rgba(132, 177, 193, .24) !important;
    color: #edf6fb !important;
  }
  .completion-content h2 {
    color: #f6fbff !important;
  }
  .completion-content p,
  .completion-meta span {
    color: #b8c8d5 !important;
  }
}

/* Mobile assessment tightening: no nested frame, single-line primary action. */
.student-mode.student-mobile.assessment-started .test-panel {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
.student-mode.student-mobile.assessment-started .question-card {
  margin-top: 6px !important;
}
.student-mode.student-mobile .record-actions {
  grid-template-columns: 68px minmax(174px, 1fr) 68px !important;
}
.student-mode.student-mobile .primary-record,
.student-mode.student-mobile .primary-record #recordBtnText {
  white-space: nowrap !important;
}
.student-mode.student-mobile .primary-record {
  padding: 0 16px !important;
  font-size: 18px !important;
}
.student-mode.student-mobile .student-mobile-summary strong {
  color: #17324a !important;
}
@media (max-width: 370px) {
  .student-mode.student-mobile .record-actions {
    grid-template-columns: 58px minmax(164px, 1fr) 58px !important;
  }
}
@media (prefers-color-scheme: dark) {
  .student-mode.student-mobile.assessment-started .test-panel {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  .student-mode.student-mobile .student-mobile-summary strong {
    color: #f1f8ff !important;
  }
}

/* Completion dialog uses its own class names; keep it crisp on phones. */
@media (max-width: 760px) {
  .completion-card {
    max-height: calc(100dvh - 32px) !important;
    overflow: auto !important;
  }
  .completion-stage {
    min-height: 180px !important;
    margin-bottom: 14px !important;
  }
  .completion-art {
    width: min(238px, 82%) !important;
    border-radius: 28px !important;
  }
  .completion-copy h2 {
    margin: 10px 0 8px !important;
    font-size: 30px !important;
    line-height: 1.18 !important;
    color: #12243a !important;
  }
  .completion-copy p {
    font-size: 15px !important;
    line-height: 1.65 !important;
    color: #52677d !important;
  }
  .completion-stats {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin: 18px 0 !important;
  }
  .completion-stats div {
    min-height: 72px !important;
    border-radius: 18px !important;
  }
}
@media (prefers-color-scheme: dark) and (max-width: 760px) {
  .completion-copy h2 {
    color: #f7fbff !important;
    text-shadow: 0 2px 14px rgba(0,0,0,.22) !important;
  }
  .completion-copy p {
    color: #c7d5df !important;
  }
  .completion-stats div {
    background: rgba(255,255,255,.08) !important;
    border-color: rgba(162, 197, 211, .24) !important;
  }
  .completion-stats b {
    color: #7ff0cf !important;
  }
  .completion-stats span {
    color: #b8c8d5 !important;
  }
}

/* Final theme pass: the explicit in-app switch wins over browser/system dark mode. */
html[data-theme="light"] {
  --theme-bg: #f5faf9;
  --theme-panel: rgba(255,255,255,.96);
  --theme-panel-soft: rgba(249,253,253,.92);
  --theme-ink: #132237;
  --theme-muted: #5e7183;
  --theme-line: rgba(203, 220, 230, .92);
  --theme-line-soft: rgba(222, 233, 240, .9);
  --theme-accent: #0f8f70;
  --theme-accent-2: #2b7da9;
}
html[data-theme="dark"] {
  --theme-bg: #071018;
  --theme-panel: rgba(15, 25, 35, .96);
  --theme-panel-soft: rgba(10, 18, 27, .92);
  --theme-ink: #edf6fb;
  --theme-muted: #a8bac8;
  --theme-line: rgba(137, 166, 188, .26);
  --theme-line-soft: rgba(137, 166, 188, .16);
  --theme-accent: #55dfb4;
  --theme-accent-2: #73b7ec;
}

html[data-theme="light"] body {
  color-scheme: light;
  background:
    radial-gradient(circle at 8% 10%, rgba(69, 175, 154, .08), transparent 24rem),
    linear-gradient(180deg, #f6fbfa 0, #f8fbfc 42%, #f3f7f8 100%);
  color: var(--theme-ink);
}
html[data-theme="dark"] body {
  color-scheme: dark;
  background:
    radial-gradient(circle at 8% 12%, rgba(80, 224, 181, .11), transparent 26rem),
    radial-gradient(circle at 82% 2%, rgba(93, 161, 216, .12), transparent 28rem),
    linear-gradient(180deg, #081018 0, #0a131c 44%, #070d13 100%);
  color: var(--theme-ink);
}

html[data-theme] .top-module-nav {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
html[data-theme="light"] .top-module-nav {
  background: rgba(252, 254, 254, .88);
  border-bottom-color: rgba(207, 221, 231, .84);
}
html[data-theme="dark"] .top-module-nav {
  background: rgba(8, 15, 22, .88);
  border-bottom-color: rgba(137, 166, 188, .18);
}
html[data-theme="dark"] .top-nav-links a,
html[data-theme="dark"] .theme-switch {
  background: rgba(13, 23, 33, .72);
}

html[data-theme] .hero,
html[data-theme] .panel,
html[data-theme] .metric-card,
html[data-theme] .chart-panel,
html[data-theme] .records-panel,
html[data-theme] .report-center,
html[data-theme] .report-preview,
html[data-theme] .report-card,
html[data-theme] .report-kpi,
html[data-theme] .safety-card,
html[data-theme] .guide-card,
html[data-theme] .guide-section,
html[data-theme] .import-card,
html[data-theme] .upload-center-tab,
html[data-theme] .ai-provider-card,
html[data-theme] .ai-setting-card,
html[data-theme] .question-card,
html[data-theme] .recorder,
html[data-theme] .paper-detail-meta,
html[data-theme] .review-box,
html[data-theme] .manual-student-details,
html[data-theme] .login-card {
  border-color: var(--theme-line);
}
html[data-theme="light"] .panel,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .chart-panel,
html[data-theme="light"] .records-panel,
html[data-theme="light"] .report-center,
html[data-theme="light"] .report-preview,
html[data-theme="light"] .report-card,
html[data-theme="light"] .report-kpi,
html[data-theme="light"] .safety-card,
html[data-theme="light"] .guide-card,
html[data-theme="light"] .guide-section,
html[data-theme="light"] .import-card,
html[data-theme="light"] .ai-provider-card,
html[data-theme="light"] .ai-setting-card,
html[data-theme="light"] .login-card {
  background: linear-gradient(180deg, var(--theme-panel), var(--theme-panel-soft));
  box-shadow: 0 18px 48px rgba(28, 52, 72, .07);
}
html[data-theme="dark"] .panel,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .chart-panel,
html[data-theme="dark"] .records-panel,
html[data-theme="dark"] .report-center,
html[data-theme="dark"] .report-preview,
html[data-theme="dark"] .report-card,
html[data-theme="dark"] .report-kpi,
html[data-theme="dark"] .safety-card,
html[data-theme="dark"] .guide-card,
html[data-theme="dark"] .guide-section,
html[data-theme="dark"] .import-card,
html[data-theme="dark"] .upload-center-tab,
html[data-theme="dark"] .ai-provider-card,
html[data-theme="dark"] .ai-setting-card,
html[data-theme="dark"] .question-card,
html[data-theme="dark"] .recorder,
html[data-theme="dark"] .paper-detail-meta,
html[data-theme="dark"] .review-box,
html[data-theme="dark"] .manual-student-details,
html[data-theme="dark"] .login-card {
  background: linear-gradient(180deg, var(--theme-panel), var(--theme-panel-soft));
  box-shadow: 0 20px 58px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] .top-nav-brand,
html[data-theme="dark"] .metric-card strong,
html[data-theme="dark"] .report-kpi b,
html[data-theme="dark"] .priority-student strong,
html[data-theme="dark"] #qTitle,
html[data-theme="dark"] #timer {
  color: var(--theme-ink);
}
html[data-theme="dark"] p,
html[data-theme="dark"] label,
html[data-theme="dark"] .small-muted,
html[data-theme="dark"] .small-text,
html[data-theme="dark"] .metric-card div,
html[data-theme="dark"] .metric-card span,
html[data-theme="dark"] .paper-detail-head p,
html[data-theme="dark"] .report-preview-head p,
html[data-theme="dark"] .report-kpi span,
html[data-theme="dark"] .report-kpi small,
html[data-theme="dark"] .priority-student p,
html[data-theme="dark"] .action-step p,
html[data-theme="dark"] .low-question p,
html[data-theme="dark"] .guide-hero p,
html[data-theme="dark"] .upload-center-tab span:not(.module-eyebrow) {
  color: var(--theme-muted);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: #0a141e;
  background-image: linear-gradient(180deg, #101b25, #0a141e);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 100% 100%;
  color: #f2f8fc;
  border-color: rgba(150, 178, 197, .32);
}
html[data-theme="dark"] select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 42px;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%239cafbf' d='M4 6h8l-4 4z'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #101b25, #0a141e);
  background-repeat: no-repeat, no-repeat;
  background-position: right 15px center, 0 0;
  background-size: 14px 14px, 100% 100%;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #748797;
}
html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .download,
html[data-theme="dark"] .guide-actions a {
  background: linear-gradient(180deg, #132333, #0d1925);
  color: #d9e8f1;
  border-color: rgba(142, 176, 198, .28);
  box-shadow: none;
}

html[data-theme="dark"] table,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .schema-table,
html[data-theme="dark"] .guide-table,
html[data-theme="dark"] .import-result,
html[data-theme="dark"] .notice-box,
html[data-theme="dark"] .folder-tree,
html[data-theme="dark"] .backup-item,
html[data-theme="dark"] .flow div {
  background: rgba(8, 16, 24, .72);
  border-color: var(--theme-line-soft);
  color: var(--theme-ink);
}
html[data-theme="dark"] th,
html[data-theme="dark"] .schema-table th,
html[data-theme="dark"] .guide-table th {
  background: linear-gradient(180deg, #111d28, #0c1721);
  color: #bed0dc;
}
html[data-theme="dark"] td,
html[data-theme="dark"] .schema-table td,
html[data-theme="dark"] .guide-table td {
  border-bottom-color: rgba(142, 176, 198, .14);
}
html[data-theme="dark"] code {
  background: rgba(120, 154, 178, .16);
  color: #aee8d7;
}

html[data-theme="dark"] .okbox {
  background: rgba(27, 92, 73, .18);
  border-color: rgba(99, 225, 187, .26);
  color: #bcebdc;
}
html[data-theme="dark"] .warning {
  background: rgba(108, 74, 23, .18);
  border-color: rgba(239, 201, 107, .28);
  color: #ecd7a5;
}
html[data-theme="dark"] .notice-strong {
  background: rgba(36, 73, 118, .18);
  border-color: rgba(115, 183, 236, .28);
  color: #c7e2f8;
}

/* Student phone: light mode stays clean even when the phone browser itself is dark. */
@media (max-width: 760px) {
  html[data-theme="light"][data-student-device="mobile"],
  html[data-theme="light"] body.student-mobile-device,
  html[data-theme="light"] .student-mode.student-mobile {
    background:
      radial-gradient(circle at 14% 0, rgba(73, 180, 158, .12), transparent 17rem),
      linear-gradient(180deg, #f8fbf5 0, #f6fbfa 52%, #f2f6f7 100%) !important;
    color: #14243a !important;
    color-scheme: light !important;
  }
  html[data-theme="light"] .student-mode.student-mobile .hero {
    background:
      linear-gradient(90deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.84) 55%, rgba(255,255,255,.18) 100%),
      url('/static/assets/ui/student-hero-v2.jpg') right center / auto 100% no-repeat !important;
    border-color: rgba(196, 216, 226, .92) !important;
    box-shadow: 0 16px 42px rgba(30, 58, 78, .10) !important;
  }
  html[data-theme="light"] .student-mode.student-mobile .setup-panel,
  html[data-theme="light"] .student-mode.student-mobile .test-panel,
  html[data-theme="light"] .student-mode.student-mobile .question-card,
  html[data-theme="light"] .student-mode.student-mobile .question-voice-panel,
  html[data-theme="light"] .student-mode.student-mobile .rubric-card,
  html[data-theme="light"] .student-mode.student-mobile .recorder {
    background: rgba(255,255,255,.96) !important;
    border-color: rgba(196, 216, 226, .92) !important;
    color: #14243a !important;
    box-shadow: 0 14px 34px rgba(30, 58, 78, .07) !important;
  }
  html[data-theme="light"] .student-mode.student-mobile .question-card {
    background: linear-gradient(145deg, #ffffff, #f7fbfc) !important;
  }
  html[data-theme="light"] .student-mode.student-mobile .question-voice-panel {
    background: linear-gradient(135deg, #eefaf5, #eef7fb) !important;
  }
  html[data-theme="light"] .student-mode.student-mobile input,
  html[data-theme="light"] .student-mode.student-mobile select {
    background: #fff !important;
    color: #14243a !important;
    border-color: rgba(196, 216, 226, .92) !important;
  }
  html[data-theme="light"] .student-mode.student-mobile #qTitle,
  html[data-theme="light"] .student-mode.student-mobile h1,
  html[data-theme="light"] .student-mode.student-mobile h2 {
    color: #14243a !important;
  }
  html[data-theme="light"] .student-mode.student-mobile .record-hint,
  html[data-theme="light"] .student-mode.student-mobile label,
  html[data-theme="light"] .student-mode.student-mobile .question-label {
    color: #607387 !important;
  }
  html[data-theme="dark"][data-student-device="mobile"],
  html[data-theme="dark"] body.student-mobile-device,
  html[data-theme="dark"] .student-mode.student-mobile {
    background:
      radial-gradient(circle at 18% 0, rgba(68, 228, 183, .12), transparent 17rem),
      linear-gradient(180deg, #061019 0, #081018 46%, #070c12 100%) !important;
    color: #edf6fb !important;
    color-scheme: dark !important;
  }
}

/* Student theme control: always reachable on phone, but small enough not to steal the task view. */
.student-theme-dock {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 1300;
  gap: 3px;
  padding: 4px;
  border-radius: 999px;
  transform: translateZ(0);
}
.student-theme-dock .theme-choice {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
}
.student-theme-dock .theme-dot {
  width: 10px;
  height: 10px;
}
html[data-theme="light"] .student-theme-dock {
  background: rgba(255,255,255,.82);
  border-color: rgba(197, 216, 226, .78);
  box-shadow: 0 12px 28px rgba(24, 55, 72, .10);
}
html[data-theme="dark"] .student-theme-dock {
  background: rgba(8, 16, 24, .76);
  border-color: rgba(130, 168, 188, .28);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .32);
}

@media (max-width: 760px) {
  .student-theme-dock {
    top: calc(max(8px, env(safe-area-inset-top)) + 2px);
    right: max(8px, env(safe-area-inset-right));
    max-width: calc(100vw - 18px);
  }
  .student-theme-dock .theme-choice {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 11px;
  }
  .student-mode.student-mobile {
    width: min(414px, calc(100% - 18px)) !important;
    margin-top: 8px !important;
  }
  .student-mode.student-mobile.assessment-started {
    padding-top: 44px !important;
  }
  .student-mode.student-mobile .hero {
    min-height: 122px !important;
    padding: 19px 18px !important;
    border-radius: 24px !important;
  }
  .student-mode.student-mobile .hero h1 {
    max-width: 68% !important;
    font-size: clamp(28px, 8.2vw, 38px) !important;
  }
  .student-mode.student-mobile .hero p {
    max-width: 68% !important;
    font-size: 13px !important;
  }
  .student-mode.student-mobile .setup-panel,
  .student-mode.student-mobile .test-panel {
    border-radius: 23px !important;
  }
  .student-mode.student-mobile .question-card,
  .student-mode.student-mobile .question-voice-panel,
  .student-mode.student-mobile .rubric-card,
  .student-mode.student-mobile .recorder {
    border-radius: 21px !important;
  }
  .student-mode.student-mobile .question-card {
    padding: 22px 18px 20px !important;
  }
  .student-mode.student-mobile .recorder {
    padding: 22px 14px !important;
  }
  .student-mode.student-mobile #timer {
    font-size: clamp(42px, 13vw, 58px) !important;
  }
}

@media (max-width: 360px) {
  .student-theme-dock .theme-choice {
    padding: 6px 7px;
  }
  .student-mode.student-mobile .hero h1 {
    max-width: 72% !important;
  }
}

/* Select arrows belong only on dropdowns. These late guards prevent dark/mobile
   input fields from inheriting repeated triangle backgrounds. */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] .student-mode.student-mobile input:not([type="checkbox"]):not([type="radio"]) {
  background-image: linear-gradient(180deg, #101b25, #0a141e) !important;
  background-repeat: no-repeat !important;
  background-position: 0 0 !important;
  background-size: 100% 100% !important;
}
html[data-theme="dark"] input[type="file"] {
  background-image: none !important;
}
html[data-theme="dark"] select,
html[data-theme="dark"] .student-mode.student-mobile select {
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%239cafbf' d='M4 6h8l-4 4z'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #101b25, #0a141e) !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: right 15px center, 0 0 !important;
  background-size: 14px 14px, 100% 100% !important;
}
html[data-theme="light"] .student-mode.student-mobile input:not([type="checkbox"]):not([type="radio"]) {
  background-image: linear-gradient(180deg, #ffffff, #f8fbfc) !important;
}
html[data-theme="light"] .student-mode.student-mobile select {
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%2354667a' d='M4 6h8l-4 4z'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #ffffff, #f8fbfc) !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: right 14px center, 0 0 !important;
  background-size: 13px 13px, 100% 100% !important;
}

/* Grading Center */
.grading-center-page .grading-hero {
  background:
    linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.94) 44%, rgba(255,255,255,.68) 64%, rgba(255,255,255,.12) 100%),
    url('/static/assets/ui/teacher-hero-v2.jpg') center right / cover no-repeat;
}
.grading-summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.grading-control-panel,
.grading-rate-panel,
.grading-records-panel {
  margin-top: 18px;
}
.auto-refresh-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(237, 246, 242, .92);
  border: 1px solid rgba(199, 226, 216, .92);
  color: #1a7152;
  font-size: 13px;
  font-weight: 900;
}
.auto-refresh-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.grading-filter-row {
  margin-top: 12px;
  grid-template-columns: 1.2fr .7fr 2fr;
}
.grading-rate-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.grading-rate-card {
  border: 1px solid rgba(213, 228, 238, .96);
  border-radius: 18px;
  padding: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(17,133,103,.08), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,252,253,.94));
}
.grading-rate-card span {
  display: block;
  color: #66778a;
  font-size: 12px;
  font-weight: 900;
}
.grading-rate-card b {
  display: block;
  margin: 7px 0;
  color: #18283c;
  font-size: 18px;
  line-height: 1.35;
}
.grading-rate-card p {
  margin: 0;
  color: #708095;
  font-size: 13px;
  line-height: 1.6;
}
.grading-rate-card.bad {
  border-color: rgba(237, 164, 164, .75);
  background: linear-gradient(180deg, rgba(255,249,249,.98), rgba(255,245,245,.94));
}
.grading-table th:nth-child(1) { width: 120px; }
.grading-table th:nth-child(2) { width: 220px; }
.grading-table th:nth-child(4) { width: 240px; }
.grading-table th:nth-child(5) { width: 180px; }
.grading-table th:nth-child(7) { width: 120px; }
.grading-table audio {
  width: 180px;
  display: block;
  margin-bottom: 6px;
}
.grading-table .download {
  min-height: 0;
  padding: 6px 10px;
  font-size: 12px;
}

html[data-theme="dark"] .grading-center-page .grading-hero {
  background:
    linear-gradient(90deg, rgba(8,15,22,.98) 0%, rgba(9,17,25,.94) 44%, rgba(9,17,25,.64) 66%, rgba(9,17,25,.18) 100%),
    url('/static/assets/ui/teacher-hero-v2.jpg') center right / cover no-repeat;
}
html[data-theme="dark"] .auto-refresh-toggle {
  background: rgba(28, 75, 63, .42);
  border-color: rgba(71, 214, 166, .28);
  color: #8df0d1;
}
html[data-theme="dark"] .grading-rate-card {
  background: linear-gradient(180deg, rgba(17, 27, 36, .96), rgba(12, 20, 28, .94));
  border-color: rgba(140, 172, 190, .24);
}
html[data-theme="dark"] .grading-rate-card span,
html[data-theme="dark"] .grading-rate-card p {
  color: #9dafbd;
}
html[data-theme="dark"] .grading-rate-card b {
  color: #edf5f8;
}
html[data-theme="dark"] .grading-rate-card.bad {
  background: linear-gradient(180deg, rgba(50, 24, 28, .72), rgba(22, 17, 24, .94));
  border-color: rgba(239, 139, 143, .32);
}

@media (max-width: 1100px) {
  .grading-summary-grid,
  .grading-rate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grading-filter-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .grading-summary-grid,
  .grading-rate-grid {
    grid-template-columns: 1fr 1fr;
  }
  .grading-center-page .primary-filter-grid {
    grid-template-columns: 1fr;
  }
  .grading-records-panel .table-wrap {
    overflow: visible;
  }
  .grading-table,
  .grading-table thead,
  .grading-table tbody,
  .grading-table tr,
  .grading-table td {
    display: block;
    width: 100%;
  }
  .grading-table thead {
    display: none;
  }
  .grading-table tr {
    margin-bottom: 12px;
    border: 1px solid rgba(210,225,235,.92);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255,255,255,.94);
  }
  .grading-table td {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 10px;
    border-bottom: 1px solid rgba(218,230,238,.78);
    padding: 12px;
  }
  .grading-table td::before {
    content: attr(data-label);
    color: #728295;
    font-weight: 900;
  }
  .grading-table td:nth-child(1)::before { content: "队列"; }
  .grading-table td:nth-child(2)::before { content: "学生"; }
  .grading-table td:nth-child(3)::before { content: "题目"; }
  .grading-table td:nth-child(4)::before { content: "录音"; }
  .grading-table td:nth-child(5)::before { content: "时间"; }
  .grading-table td:nth-child(6)::before { content: "错误"; }
  .grading-table td:nth-child(7)::before { content: "操作"; }
  .grading-table audio {
    width: 100%;
  }
  html[data-theme="dark"] .grading-table tr {
    background: rgba(13, 22, 31, .96);
    border-color: rgba(140,172,190,.24);
  }
  html[data-theme="dark"] .grading-table td {
    border-bottom-color: rgba(140,172,190,.16);
  }
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(188, 210, 224, .85);
  border-radius: 999px;
  color: #506376;
  font-weight: 900;
  background: rgba(255, 255, 255, .78);
  text-decoration: none;
  white-space: nowrap;
}

.admin-badge.active,
.admin-badge:hover {
  color: #0b7f64;
  border-color: rgba(17, 147, 113, .36);
  background: rgba(235, 250, 244, .9);
}

.admin-badge-sub {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(224, 236, 244, .9);
  color: #587083;
  font-size: 12px;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(224, 149, 151, .55);
  color: #9c2a30;
  text-decoration: none;
  font-weight: 900;
  background: rgba(255, 246, 246, .8);
}

.compact-hero {
  min-height: 190px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.account-settings-grid {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

.account-profile-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(205, 223, 234, .9);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(249, 253, 252, .98), rgba(238, 248, 249, .92));
}

.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  color: #fff;
  font-size: 24px;
  font-weight: 950;
  background: linear-gradient(135deg, #078b69, #327da6);
  box-shadow: 0 16px 34px rgba(11, 107, 98, .18);
  flex: 0 0 auto;
}

.account-profile-name {
  color: #142236;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 950;
}

.account-profile-meta,
.account-profile-scope {
  margin-top: 6px;
  color: #617589;
  font-weight: 800;
  line-height: 1.6;
}

.account-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.account-logout-button,
.soft-action-link {
  min-height: 44px;
  padding: 0 18px;
}

.soft-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(196, 215, 228, .9);
  background: rgba(241, 248, 251, .94);
  color: #244761;
  text-decoration: none;
  font-weight: 900;
}

.ops-section-nav {
  position: sticky;
  top: 8px;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 18px;
  padding: 8px;
  border: 1px solid rgba(196, 215, 228, .82);
  border-radius: 8px;
  background: rgba(248, 252, 253, .92);
  box-shadow: 0 10px 24px rgba(24, 54, 78, .055);
  backdrop-filter: blur(14px);
}

.ops-section-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  color: #355169;
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
  white-space: nowrap;
}

.ops-section-nav a:hover {
  border-color: rgba(12, 140, 116, .24);
  background: #f2fbf8;
  color: #087b65;
}

.ops-section-block,
.ops-section-card,
.ops-preview-lab {
  margin-bottom: 24px;
}

.ops-section-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 12px;
}

.ops-section-titlebar span {
  display: block;
  margin-bottom: 4px;
  color: #0c8c74;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ops-section-titlebar h2 {
  margin: 0;
  color: #12243a;
  font-size: 22px;
  line-height: 1.18;
  font-weight: 950;
}

.ops-section-titlebar p {
  max-width: 560px;
  margin: 0;
  color: #607387;
  line-height: 1.5;
  text-align: right;
  font-weight: 850;
}

.ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 24px;
  align-items: stretch;
}

.ops-foundation-grid,
.ops-maintenance-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-command-panel {
  display: grid;
  gap: 18px;
  margin: 0 0 24px;
  padding: 22px;
  border: 1px solid rgba(188, 215, 224, .92);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(241, 250, 248, .95)),
    linear-gradient(90deg, rgba(12, 140, 116, .1), rgba(43, 98, 181, .08));
  box-shadow: 0 14px 34px rgba(24, 54, 78, .07);
}

.ops-command-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.ops-command-kicker {
  margin-bottom: 6px;
  color: #0c8c74;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ops-command-header h2 {
  margin: 0;
  color: #12243a;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 950;
}

.ops-command-header p {
  margin: 7px 0 0;
  color: #607387;
  font-weight: 800;
  line-height: 1.55;
}

.ops-command-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 260px;
}

.ops-preview-lab {
  padding: 22px !important;
  border-color: rgba(188, 215, 224, .92) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(246, 251, 248, .96)) !important;
}

.ops-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.ops-preview-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.ops-preview-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(24, 154, 112, .18);
  border-radius: 999px;
  background: #eef8f2;
  color: #167244;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.ops-preview-layout {
  display: grid;
  grid-template-columns: minmax(240px, .46fr) minmax(360px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.ops-preview-controls {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(205, 223, 234, .9);
  border-radius: 8px;
  background: rgba(250, 253, 252, .94);
}

.ops-control-group {
  display: grid;
  gap: 8px;
}

.ops-control-group > strong {
  color: #12243a;
  font-size: 13px;
  font-weight: 950;
}

.ops-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.ops-segmented.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-segmented button {
  min-width: 0;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid rgba(205, 223, 234, .96);
  border-radius: 8px;
  background: #ffffff;
  color: #40596f;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

body.ops-center-page .ops-segmented button {
  border-color: rgba(205, 223, 234, .96) !important;
  background: #ffffff !important;
  color: #40596f !important;
  box-shadow: none !important;
}

.ops-segmented button.active {
  border-color: rgba(12, 140, 116, .32);
  background: #e9f8ef;
  color: #08785f;
  box-shadow: inset 0 0 0 1px rgba(12, 140, 116, .08);
}

body.ops-center-page .ops-segmented button.active {
  border-color: rgba(12, 140, 116, .32) !important;
  background: #e9f8ef !important;
  color: #08785f !important;
  box-shadow: inset 0 0 0 1px rgba(12, 140, 116, .08) !important;
}

.ops-preview-note {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid rgba(67, 112, 146, .18);
  border-radius: 8px;
  background: #f6f9fb;
}

.ops-preview-note strong {
  color: #24394c;
  font-size: 12px;
  font-weight: 950;
}

.ops-preview-note span {
  color: #607387;
  font-size: 12px;
  line-height: 1.55;
  font-weight: 800;
}

.ops-preview-stage {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(205, 223, 234, .9);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(239, 247, 244, .9), rgba(248, 251, 250, .96));
  overflow: auto;
}

.ops-phone-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 460px);
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(205, 223, 234, .85);
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  color: #52677d;
  font-size: 12px;
  font-weight: 950;
}

.ops-phone-toolbar strong {
  color: #0c7a66;
}

.ops-oral-preview-frame {
  width: 390px;
  max-width: 100%;
  height: min(720px, 76vh);
  min-height: 640px;
  border: 1px solid rgba(173, 198, 207, .95);
  border-radius: 26px;
  background: #f7fbf8;
  box-shadow:
    0 20px 44px rgba(20, 45, 63, .14),
    0 0 0 8px rgba(255, 255, 255, .72);
}

.ops-decision-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  max-width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(196, 215, 228, .9);
  border-radius: 999px;
  background: #f7fbfc;
  color: #244761;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.ops-decision-pill.is-ok {
  border-color: rgba(24, 154, 112, .28);
  background: rgba(226, 247, 238, .94);
  color: #05775f;
}

.ops-decision-pill.is-watch,
.ops-decision-pill.is-loading {
  border-color: rgba(69, 130, 196, .28);
  background: rgba(232, 242, 255, .94);
  color: #255f9e;
}

.ops-decision-pill.is-warn {
  border-color: rgba(222, 160, 46, .36);
  background: rgba(255, 246, 220, .95);
  color: #9a6508;
}

.ops-decision-pill.is-bad {
  border-color: rgba(214, 87, 95, .36);
  background: rgba(255, 235, 236, .95);
  color: #af343b;
}

.ops-decision-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ops-decision-card,
.ops-loading-card {
  min-height: 156px;
  padding: 16px;
  border: 1px solid rgba(205, 223, 234, .92);
  border-top: 4px solid #86b7cb;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 24px rgba(24, 54, 78, .055);
}

.ops-loading-card {
  grid-column: 1 / -1;
  min-height: 86px;
  color: #607387;
  font-weight: 900;
}

.ops-decision-card.is-ok {
  border-top-color: #19a878;
  background: linear-gradient(180deg, rgba(249, 255, 252, .98), rgba(241, 251, 247, .92));
}

.ops-decision-card.is-watch {
  border-top-color: #3b82c4;
  background: linear-gradient(180deg, rgba(249, 252, 255, .98), rgba(237, 245, 255, .92));
}

.ops-decision-card.is-warn {
  border-top-color: #d89415;
  background: linear-gradient(180deg, rgba(255, 253, 247, .98), rgba(255, 248, 226, .92));
}

.ops-decision-card.is-bad {
  border-top-color: #d14950;
  background: linear-gradient(180deg, rgba(255, 250, 250, .98), rgba(255, 239, 241, .92));
}

.ops-decision-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #607387;
  font-size: 13px;
  font-weight: 950;
}

.ops-decision-topline strong {
  flex: 0 0 auto;
  color: #244761;
  font-size: 12px;
}

.ops-decision-value {
  margin-top: 12px;
  color: #12243a;
  font-size: 22px;
  line-height: 1.22;
  font-weight: 950;
}

.ops-decision-card p {
  margin: 9px 0 0;
  color: #607387;
  line-height: 1.55;
  font-weight: 800;
}

.ops-decision-action {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(205, 223, 234, .72);
  color: #254258;
  line-height: 1.5;
  font-weight: 900;
}

.ops-readiness-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ops-readiness-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid rgba(205, 223, 234, .88);
  border-radius: 8px;
  background: rgba(250, 253, 253, .9);
}

.ops-readiness-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: #86b7cb;
  box-shadow: 0 0 0 4px rgba(134, 183, 203, .16);
}

.ops-readiness-item.is-ok .ops-readiness-dot {
  background: #18a878;
  box-shadow: 0 0 0 4px rgba(24, 168, 120, .16);
}

.ops-readiness-item.is-watch .ops-readiness-dot {
  background: #3b82c4;
  box-shadow: 0 0 0 4px rgba(59, 130, 196, .16);
}

.ops-readiness-item.is-warn .ops-readiness-dot {
  background: #d89415;
  box-shadow: 0 0 0 4px rgba(216, 148, 21, .18);
}

.ops-readiness-item.is-bad .ops-readiness-dot {
  background: #d14950;
  box-shadow: 0 0 0 4px rgba(209, 73, 80, .16);
}

.ops-readiness-item strong,
.ops-readiness-item small {
  display: block;
  overflow-wrap: anywhere;
}

.ops-readiness-item strong {
  color: #12243a;
  font-size: 13px;
  font-weight: 950;
}

.ops-readiness-item small {
  margin-top: 4px;
  color: #607387;
  line-height: 1.45;
  font-weight: 800;
}

.ops-brief-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.ops-brief-card {
  min-height: 112px;
  padding: 14px;
  border: 1px solid rgba(205, 223, 234, .9);
  border-left: 4px solid #6ca4c6;
  border-radius: 8px;
  background: rgba(250, 253, 253, .94);
  box-shadow: 0 8px 20px rgba(24, 54, 78, .045);
}

.ops-brief-card.is-ok {
  border-left-color: #18a878;
  background: linear-gradient(180deg, rgba(250, 255, 252, .98), rgba(242, 251, 247, .92));
}

.ops-brief-card.is-watch,
.ops-brief-card.is-loading {
  border-left-color: #3b82c4;
  background: linear-gradient(180deg, rgba(250, 253, 255, .98), rgba(239, 246, 255, .92));
}

.ops-brief-card.is-warn {
  border-left-color: #d89415;
  background: linear-gradient(180deg, rgba(255, 253, 247, .98), rgba(255, 248, 226, .92));
}

.ops-brief-card.is-bad {
  border-left-color: #d14950;
  background: linear-gradient(180deg, rgba(255, 250, 250, .98), rgba(255, 240, 241, .92));
}

.ops-brief-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #607387;
  font-size: 12px;
  font-weight: 950;
}

.ops-brief-topline span,
.ops-brief-value,
.ops-brief-card p {
  overflow-wrap: anywhere;
}

.ops-brief-topline strong {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(232, 242, 249, .9);
  color: #315a73;
  font-size: 11px;
  font-weight: 950;
}

.ops-brief-card.is-ok .ops-brief-topline strong {
  background: rgba(221, 247, 234, .94);
  color: #08775d;
}

.ops-brief-card.is-warn .ops-brief-topline strong {
  background: rgba(255, 241, 204, .96);
  color: #976407;
}

.ops-brief-card.is-bad .ops-brief-topline strong {
  background: rgba(255, 228, 231, .96);
  color: #a92f37;
}

.ops-brief-value {
  margin-top: 10px;
  color: #12243a;
  font-size: 18px;
  line-height: 1.24;
  font-weight: 950;
}

.ops-brief-card p {
  margin: 7px 0 0;
  color: #607387;
  line-height: 1.48;
  font-size: 13px;
  font-weight: 820;
}

.ops-table-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 8px;
}

.ops-table-title strong {
  color: #12243a;
  font-size: 15px;
  font-weight: 950;
}

.ops-table-title span {
  color: #607387;
  font-size: 13px;
  font-weight: 820;
  line-height: 1.45;
  text-align: right;
}

.ops-safety-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 14px;
}

.ops-safety-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(24, 154, 112, .18);
  border-radius: 999px;
  background: rgba(236, 249, 243, .94);
  color: #137353;
  font-size: 12px;
  font-weight: 950;
}

.ops-metric {
  padding: 16px;
  border: 1px solid rgba(205, 223, 234, .9);
  border-radius: 18px;
  background: rgba(248, 252, 253, .94);
}

.ops-metric.warn {
  border-color: rgba(233, 183, 78, .7);
  background: rgba(255, 248, 226, .9);
}

.ops-metric.bad {
  border-color: rgba(226, 122, 130, .65);
  background: rgba(255, 238, 240, .92);
}

.ops-metric-title {
  color: #607387;
  font-weight: 900;
}

.ops-metric-value {
  margin-top: 8px;
  color: #132338;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 950;
}

.ops-metric-note {
  margin-top: 6px;
  color: #7c8b99;
  font-weight: 800;
}

.ops-note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.ops-note-grid > div {
  padding: 18px;
  border: 1px solid rgba(205, 223, 234, .9);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(249, 253, 252, .98), rgba(240, 249, 250, .9));
}

.ops-note-grid h3 {
  margin: 0 0 8px;
  color: #132338;
  font-size: 18px;
}

.ops-note-grid p {
  margin: 0;
  color: #64798b;
  line-height: 1.7;
  font-weight: 800;
}

body.ops-center-page .metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

body.ops-center-page .ops-metric {
  min-height: 112px;
  padding: 13px;
  border-radius: 8px;
}

body.ops-center-page .ops-metric-title {
  font-size: 12px;
}

body.ops-center-page .ops-metric-value {
  font-size: clamp(18px, 2.1vw, 24px);
  line-height: 1.18;
}

body.ops-center-page .ops-metric-note {
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body.ops-center-page #aiUsageCards,
body.ops-center-page #workerQueueCards {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.ops-snapshot-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.ops-snapshot-list strong {
  color: #132338;
  font-weight: 950;
}

.ops-snapshot-row {
  border: 1px solid rgba(205, 223, 234, .9);
  border-radius: 8px;
  background: rgba(248, 252, 253, .94);
  padding: 8px 10px;
}

.ops-snapshot-row span,
.ops-snapshot-row small {
  display: block;
  overflow-wrap: anywhere;
}

.ops-snapshot-row span {
  color: #244761;
  font-weight: 900;
}

.ops-snapshot-row small {
  color: #7c8b99;
  font-weight: 800;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label,
.search-field {
  display: grid;
  gap: 7px;
  color: #53687b;
  font-weight: 900;
}

.stack-form input,
.stack-form select,
.search-field input,
.search-field select {
  min-height: 48px;
  border: 1px solid rgba(190, 211, 225, .95);
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .94);
  color: #142236;
  font: inherit;
}

.stack-form .field-note {
  min-height: 18px;
  color: #6d8194;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.stack-form .scope-field-muted {
  color: #7c8b99;
}

.stack-form .scope-field-muted input,
.stack-form .scope-field-muted select {
  background: #f4f8fb;
  color: #7a8998;
}

.account-scope-hint {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(16, 132, 111, .24);
  border-radius: 12px;
  background: rgba(235, 248, 245, .82);
  color: #0d6f61;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
}

html[data-theme="dark"] .stack-form .scope-field-muted input,
html[data-theme="dark"] .stack-form .scope-field-muted select {
  background: rgba(20, 32, 44, .72);
  color: #92a4b6;
}

html[data-theme="dark"] .account-scope-hint {
  border-color: rgba(69, 201, 176, .28);
  background: rgba(22, 73, 67, .28);
  color: #9be6d8;
}

.inline-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.inline-check input {
  min-height: auto;
  width: 18px;
  height: 18px;
}

.primary-action {
  border: 0;
  border-radius: 16px;
  min-height: 50px;
  padding: 0 20px;
  color: #fff;
  background: linear-gradient(135deg, #078b69, #20799f);
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(12, 126, 105, .18);
  cursor: pointer;
}

.inline-message {
  min-height: 24px;
  color: #718294;
  font-weight: 800;
}

.inline-message.success {
  color: #078b69;
}

.inline-message.report-running {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin: 8px 0;
  padding: 7px 12px;
  border: 1px solid rgba(216, 67, 78, .28);
  border-radius: 12px;
  background: rgba(255, 241, 242, .92);
  color: #bd2e37;
  font-size: 14px;
  font-weight: 950;
}

.inline-message.report-running::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #bd2e37;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.org-maintenance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 0 0 24px;
}

.org-card {
  min-height: 360px;
}

.inline-org-form {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(190px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.inline-org-form label {
  display: grid;
  gap: 7px;
  color: #53687b;
  font-weight: 900;
}

.inline-org-form input,
.inline-org-form select {
  min-height: 48px;
  border: 1px solid rgba(190, 211, 225, .95);
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .94);
  color: #142236;
  font: inherit;
}

.inline-org-form.is-disabled {
  opacity: .62;
}

.org-list {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  margin-top: 14px;
  padding-right: 4px;
}

.org-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid rgba(205, 223, 234, .9);
  border-radius: 17px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(244,250,250,.9));
}

.org-list-row b,
.org-list-row span {
  display: block;
}

.org-list-row b {
  color: #142236;
  font-size: 15px;
  line-height: 1.4;
}

.org-list-row span {
  margin-top: 4px;
  color: #718294;
  font-size: 12px;
  font-weight: 850;
}

.org-list-empty {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(179, 205, 219, .9);
  border-radius: 17px;
  color: #718294;
  font-weight: 850;
}

.danger-lite {
  min-width: 72px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: #fff1f1;
  color: #a5272f;
  font-weight: 950;
  cursor: pointer;
}

.inline-message.error {
  color: #bd2e37;
}

.fixed-table-wrap {
  max-height: 620px;
  overflow: auto;
  border: 1px solid rgba(211, 226, 235, .9);
  border-radius: 18px;
}

.fixed-table-wrap.small-table {
  max-height: min(70vh, 740px);
}

.clean-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(255, 255, 255, .82);
}

.clean-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(244, 249, 252, .96);
  color: #4e6175;
  font-weight: 950;
  text-align: left;
}

.clean-table th,
.clean-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(221, 232, 239, .9);
  vertical-align: top;
}

.clean-table button,
.row-actions button,
.button-link {
  border: 1px solid rgba(196, 215, 228, .9);
  border-radius: 12px;
  background: rgba(241, 248, 251, .94);
  color: #244761;
  font-weight: 900;
  padding: 9px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.clean-table button.danger-lite,
.row-actions button.danger-lite {
  border-color: #f1c5c5;
  background: #fff1f1;
  color: #a5272f;
}

.clean-table button.danger-lite:hover,
.row-actions button.danger-lite:hover {
  background: #ffe5e5;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.muted {
  color: #7c8b99;
  font-size: .92em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(226, 236, 243, .88);
  color: #4d6175;
  font-weight: 950;
}

.status-pill.ok {
  background: rgba(222, 248, 235, .9);
  color: #087b59;
}

.status-pill.warn {
  background: rgba(255, 241, 204, .92);
  color: #9a6a00;
}

.status-pill.bad {
  background: rgba(255, 228, 231, .92);
  color: #a92f37;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.toolbar-row .search-field {
  min-width: 280px;
  flex: 1;
}

.progress-line {
  height: 10px;
  width: 180px;
  max-width: 100%;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(218, 230, 237, .95);
  margin-bottom: 8px;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #10a978, #4b9fd4);
}

html[data-theme="dark"] .admin-badge,
html[data-theme="dark"] .stack-form input,
html[data-theme="dark"] .stack-form select,
html[data-theme="dark"] .search-field input,
html[data-theme="dark"] .search-field select,
html[data-theme="dark"] .clean-table,
html[data-theme="dark"] .clean-table th,
html[data-theme="dark"] .clean-table button,
html[data-theme="dark"] .row-actions button,
html[data-theme="dark"] .button-link {
  background: rgba(9, 19, 29, .88);
  border-color: rgba(122, 154, 173, .36);
  color: #eef7fa;
}

html[data-theme="dark"] .clean-table th,
html[data-theme="dark"] .clean-table td {
  border-bottom-color: rgba(122, 154, 173, .22);
}

html[data-theme="dark"] .muted,
html[data-theme="dark"] .inline-message {
  color: #95a9b7;
}

html[data-theme="dark"] .logout-link {
  background: rgba(60, 20, 26, .55);
  border-color: rgba(220, 117, 124, .45);
  color: #ffb9be;
}

html[data-theme="dark"] .admin-badge.active,
html[data-theme="dark"] .admin-badge:hover {
  color: #8df0d3;
  border-color: rgba(108, 219, 195, .42);
  background: rgba(21, 65, 58, .62);
}

html[data-theme="dark"] .admin-badge-sub,
html[data-theme="dark"] .soft-action-link {
  background: rgba(18, 35, 48, .9);
  border-color: rgba(122, 154, 173, .36);
  color: #dcecf3;
}

html[data-theme="dark"] .account-profile-card {
  background: linear-gradient(135deg, rgba(9, 19, 29, .92), rgba(12, 42, 47, .76));
  border-color: rgba(122, 154, 173, .32);
}

html[data-theme="dark"] .account-profile-name {
  color: #f2fbfd;
}

html[data-theme="dark"] .account-profile-meta,
html[data-theme="dark"] .account-profile-scope {
  color: #9eb3c0;
}

html[data-theme="dark"] .ops-metric,
html[data-theme="dark"] .ops-note-grid > div,
html[data-theme="dark"] .ops-snapshot-row {
  background: rgba(9, 19, 29, .88);
  border-color: rgba(122, 154, 173, .32);
}

html[data-theme="dark"] .ops-metric.warn {
  background: rgba(64, 48, 17, .58);
  border-color: rgba(233, 183, 78, .38);
}

html[data-theme="dark"] .ops-metric.bad {
  background: rgba(64, 24, 30, .58);
  border-color: rgba(226, 122, 130, .38);
}

html[data-theme="dark"] .ops-metric-value,
html[data-theme="dark"] .ops-note-grid h3,
html[data-theme="dark"] .ops-snapshot-list strong,
html[data-theme="dark"] .ops-snapshot-row span {
  color: #f2fbfd;
}

html[data-theme="dark"] .ops-metric-title,
html[data-theme="dark"] .ops-metric-note,
html[data-theme="dark"] .ops-note-grid p,
html[data-theme="dark"] .ops-snapshot-row small {
  color: #9eb3c0;
}

html[data-theme="dark"] .ops-command-panel {
  background:
    linear-gradient(135deg, rgba(10, 23, 33, .96), rgba(9, 31, 34, .9)),
    linear-gradient(90deg, rgba(18, 160, 130, .1), rgba(70, 130, 200, .08));
  border-color: rgba(122, 154, 173, .32);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] .ops-command-header h2,
html[data-theme="dark"] .ops-decision-value,
html[data-theme="dark"] .ops-readiness-item strong {
  color: #f2fbfd;
}

html[data-theme="dark"] .ops-command-header p,
html[data-theme="dark"] .ops-decision-card p,
html[data-theme="dark"] .ops-readiness-item small {
  color: #9eb3c0;
}

html[data-theme="dark"] .ops-decision-card,
html[data-theme="dark"] .ops-loading-card,
html[data-theme="dark"] .ops-readiness-item,
html[data-theme="dark"] .ops-brief-card {
  background: rgba(9, 19, 29, .88);
  border-color: rgba(122, 154, 173, .32);
}

html[data-theme="dark"] .ops-decision-card.is-ok {
  background: linear-gradient(180deg, rgba(12, 39, 33, .92), rgba(8, 27, 25, .92));
}

html[data-theme="dark"] .ops-decision-card.is-watch {
  background: linear-gradient(180deg, rgba(16, 35, 56, .92), rgba(9, 22, 35, .92));
}

html[data-theme="dark"] .ops-decision-card.is-warn {
  background: linear-gradient(180deg, rgba(58, 43, 13, .92), rgba(37, 29, 14, .92));
}

html[data-theme="dark"] .ops-decision-card.is-bad {
  background: linear-gradient(180deg, rgba(58, 20, 27, .92), rgba(37, 18, 23, .92));
}

html[data-theme="dark"] .ops-brief-card.is-ok {
  background: linear-gradient(180deg, rgba(12, 39, 33, .92), rgba(8, 27, 25, .92));
}

html[data-theme="dark"] .ops-brief-card.is-watch,
html[data-theme="dark"] .ops-brief-card.is-loading {
  background: linear-gradient(180deg, rgba(16, 35, 56, .92), rgba(9, 22, 35, .92));
}

html[data-theme="dark"] .ops-brief-card.is-warn {
  background: linear-gradient(180deg, rgba(58, 43, 13, .92), rgba(37, 29, 14, .92));
}

html[data-theme="dark"] .ops-brief-card.is-bad {
  background: linear-gradient(180deg, rgba(58, 20, 27, .92), rgba(37, 18, 23, .92));
}

html[data-theme="dark"] .ops-decision-action {
  border-top-color: rgba(122, 154, 173, .28);
  color: #d6e8ee;
}

html[data-theme="dark"] .ops-section-nav,
html[data-theme="dark"] .ops-preview-lab,
html[data-theme="dark"] .ops-preview-controls,
html[data-theme="dark"] .ops-preview-stage,
html[data-theme="dark"] .ops-phone-toolbar,
html[data-theme="dark"] .ops-preview-note {
  background: rgba(9, 19, 29, .88) !important;
  border-color: rgba(122, 154, 173, .32) !important;
}

html[data-theme="dark"] .ops-section-nav a,
html[data-theme="dark"] .ops-segmented button {
  background: #101d2a;
  border-color: rgba(122, 154, 173, .28);
  color: #d6e8ee;
}

html[data-theme="dark"] body.ops-center-page .ops-segmented button {
  background: #101d2a !important;
  border-color: rgba(122, 154, 173, .28) !important;
  color: #d6e8ee !important;
}

html[data-theme="dark"] .ops-section-nav a:hover,
html[data-theme="dark"] .ops-segmented button.active,
html[data-theme="dark"] .ops-preview-tags span {
  background: #102c25;
  border-color: rgba(61, 184, 142, .34);
  color: #9ee4c7;
}

html[data-theme="dark"] body.ops-center-page .ops-segmented button.active {
  background: #102c25 !important;
  border-color: rgba(61, 184, 142, .34) !important;
  color: #9ee4c7 !important;
}

html[data-theme="dark"] .ops-section-titlebar h2,
html[data-theme="dark"] .ops-control-group > strong,
html[data-theme="dark"] .ops-preview-note strong,
html[data-theme="dark"] .ops-brief-value,
html[data-theme="dark"] .ops-table-title strong {
  color: #f2fbfd;
}

html[data-theme="dark"] .ops-section-titlebar p,
html[data-theme="dark"] .ops-preview-note span,
html[data-theme="dark"] .ops-brief-card p,
html[data-theme="dark"] .ops-table-title span {
  color: #9eb3c0;
}

html[data-theme="dark"] .ops-brief-topline {
  color: #9eb3c0;
}

html[data-theme="dark"] .ops-brief-topline strong {
  background: rgba(30, 53, 68, .92);
  color: #d6e8ee;
}

html[data-theme="dark"] .ops-safety-strip span {
  border-color: rgba(61, 184, 142, .3);
  background: rgba(16, 52, 43, .82);
  color: #9ee4c7;
}

html[data-theme="dark"] .ops-phone-toolbar strong {
  color: #9ee4c7;
}

html[data-theme="dark"] .ops-oral-preview-frame {
  border-color: rgba(122, 154, 173, .38);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, .24),
    0 0 0 8px rgba(20, 34, 44, .82);
}

@media (max-width: 900px) {
  .admin-grid,
  .account-settings-grid,
  .ops-grid,
  .ops-note-grid,
  .ops-decision-board,
  .ops-readiness-checklist,
  .ops-brief-grid,
  .ops-preview-layout {
    grid-template-columns: 1fr;
  }
  .ops-section-nav {
    position: static;
  }
  .ops-section-titlebar,
  .ops-preview-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .ops-section-titlebar p {
    text-align: left;
  }
  .ops-command-header {
    flex-direction: column;
  }
  .ops-command-actions {
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
  }
  .ops-decision-pill {
    white-space: normal;
  }
  .ops-preview-tags {
    justify-content: flex-start;
  }
  .ops-table-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .ops-table-title span {
    text-align: left;
  }
  .top-nav-inner {
    gap: 10px;
  }
  .logout-link {
    display: none;
  }
  .admin-badge {
    max-width: 168px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .admin-badge-sub {
    display: none;
  }
}

/* Enterprise UI refinement layer */
:root {
  --tt-bg: #f4f8f9;
  --tt-surface: rgba(255, 255, 255, .94);
  --tt-surface-soft: rgba(247, 251, 252, .9);
  --tt-border: rgba(185, 210, 224, .74);
  --tt-border-strong: rgba(137, 178, 198, .5);
  --tt-text: #142238;
  --tt-muted: #607287;
  --tt-green: #078b69;
  --tt-teal: #0c9584;
  --tt-blue: #2f78a3;
  --tt-danger: #c53643;
  --tt-shadow: 0 18px 48px rgba(26, 56, 82, .08);
  --tt-shadow-soft: 0 10px 28px rgba(26, 56, 82, .055);
}

html[data-theme="dark"] {
  --tt-bg: #071118;
  --tt-surface: rgba(9, 18, 28, .92);
  --tt-surface-soft: rgba(11, 26, 37, .82);
  --tt-border: rgba(126, 158, 178, .28);
  --tt-border-strong: rgba(126, 190, 198, .36);
  --tt-text: #eff7fb;
  --tt-muted: #9fb2c0;
  --tt-green: #44d5ac;
  --tt-teal: #5be2d0;
  --tt-blue: #80b7ef;
  --tt-danger: #ff8b94;
  --tt-shadow: 0 20px 60px rgba(0, 0, 0, .34);
  --tt-shadow-soft: 0 12px 34px rgba(0, 0, 0, .28);
}

body {
  color: var(--tt-text);
  background:
    linear-gradient(180deg, rgba(238, 247, 247, .72), rgba(247, 250, 249, .96) 360px),
    var(--tt-bg);
  letter-spacing: 0;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 8% 4%, rgba(27, 120, 111, .18), transparent 30%),
    linear-gradient(180deg, #071118 0%, #08131b 55%, #071118 100%);
}

.top-module-nav {
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid var(--tt-border);
  box-shadow: 0 8px 30px rgba(24, 58, 82, .06);
  backdrop-filter: blur(16px);
}

html[data-theme="dark"] .top-module-nav {
  background: rgba(5, 13, 20, .86);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .28);
}

.top-nav-brand {
  gap: 12px;
  color: var(--tt-text);
  font-weight: 950;
}

.top-nav-brand::before {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  box-shadow: 0 12px 26px rgba(18, 119, 126, .16);
}

.top-nav-links a,
.admin-badge,
.logout-link,
.theme-switch,
.theme-choice {
  border-radius: 999px;
}

.top-nav-links a {
  min-height: 42px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid var(--tt-border);
  color: #2b4158;
  box-shadow: none;
}

.top-nav-links a.active,
.top-nav-links a:hover {
  background: #0e2436;
  border-color: #0e2436;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(14, 36, 54, .15);
}

html[data-theme="dark"] .top-nav-links a {
  background: rgba(8, 20, 31, .82);
  color: #dcebf3;
  border-color: var(--tt-border);
}

html[data-theme="dark"] .top-nav-links a.active,
html[data-theme="dark"] .top-nav-links a:hover {
  background: #eaf5f6;
  border-color: #eaf5f6;
  color: #07131c;
  box-shadow: 0 14px 30px rgba(104, 220, 205, .12);
}

.admin-badge,
.theme-switch {
  min-height: 42px;
  background: var(--tt-surface);
  border: 1px solid var(--tt-border);
  color: var(--tt-text);
  box-shadow: none;
}

.theme-choice {
  min-width: 76px;
  color: var(--tt-muted);
}

.theme-choice.active {
  background: var(--tt-surface-soft);
  color: var(--tt-text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}

.hero-card,
.compact-hero {
  border: 1px solid var(--tt-border);
  background-color: var(--tt-surface);
  box-shadow: var(--tt-shadow);
  overflow: hidden;
}

.hero-card h1,
.compact-hero h1 {
  letter-spacing: 0;
  color: var(--tt-text);
}

.hero-card p,
.compact-hero p,
.brand {
  color: var(--tt-muted);
}

.panel-card,
.panel,
.filter-panel,
.record-panel,
.queue-panel,
.account-profile-card,
.ops-card,
.student-detail-card,
.chart-card,
.summary-card {
  background: var(--tt-surface);
  border: 1px solid var(--tt-border);
  box-shadow: var(--tt-shadow-soft);
}

.section-orb {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0c8c74, #2f7fa9);
  box-shadow: 0 10px 22px rgba(21, 113, 132, .18);
}

input,
select,
textarea,
.stack-form input,
.stack-form select,
.search-field input {
  min-height: 46px;
  border: 1px solid var(--tt-border);
  border-radius: 14px;
  background-color: rgba(255, 255, 255, .88);
  color: var(--tt-text);
  box-shadow: none;
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, #52667a 50%),
    linear-gradient(135deg, #52667a 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(12, 139, 105, .72);
  outline: 3px solid rgba(12, 139, 105, .12);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .stack-form input,
html[data-theme="dark"] .search-field input {
  background-image: none !important;
  background-color: rgba(6, 18, 28, .78) !important;
  border-color: var(--tt-border) !important;
  color: var(--tt-text) !important;
}

html[data-theme="dark"] select,
html[data-theme="dark"] .stack-form select {
  background-color: rgba(6, 18, 28, .78) !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #9fb2c0 50%),
    linear-gradient(135deg, #9fb2c0 50%, transparent 50%) !important;
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px) !important;
  background-size: 6px 6px, 6px 6px !important;
  background-repeat: no-repeat !important;
  border-color: var(--tt-border) !important;
  color: var(--tt-text) !important;
}

input[type="file"],
html[data-theme="dark"] input[type="file"] {
  background-image: none !important;
  background-repeat: no-repeat !important;
}

input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 12px;
  background: #eef6f8;
  color: #193248;
  padding: 8px 12px;
  margin-right: 10px;
  font-weight: 850;
}

html[data-theme="dark"] input[type="file"]::file-selector-button {
  background: rgba(27, 52, 70, .9);
  color: #eaf5f6;
}

.primary-action,
.action-btn.primary,
.btn-primary,
button.primary,
.start-btn,
.record-button {
  background: linear-gradient(135deg, #087f66, #27799f);
  color: #fff;
  border: 0;
  box-shadow: 0 16px 34px rgba(12, 126, 105, .18);
}

.primary-action:hover,
.action-btn.primary:hover,
.btn-primary:hover,
button.primary:hover,
.start-btn:hover,
.record-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(12, 126, 105, .22);
}

.clean-table {
  background: var(--tt-surface);
}

.clean-table th {
  background: var(--tt-surface-soft);
  color: var(--tt-muted);
}

.clean-table td,
.clean-table th {
  border-bottom-color: rgba(197, 216, 228, .56);
}

html[data-theme="dark"] .clean-table {
  background: rgba(6, 15, 24, .82);
}

html[data-theme="dark"] .clean-table th {
  background: rgba(10, 27, 39, .96);
}

html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .filter-panel,
html[data-theme="dark"] .record-panel,
html[data-theme="dark"] .queue-panel,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .summary-card {
  background: var(--tt-surface);
  border-color: var(--tt-border);
}

html[data-theme="dark"] .hero-card,
html[data-theme="dark"] .compact-hero {
  background-color: rgba(9, 18, 28, .82);
  border-color: var(--tt-border);
}

/* Student mobile: compact, refined, app-like */
@media (max-width: 720px) {
  body.student-mode {
    background:
      linear-gradient(180deg, rgba(239, 248, 246, .88), rgba(247, 250, 248, 1)),
      var(--tt-bg);
  }

  body.student-mode .page,
  body.student-mode .shell-page {
    width: min(100% - 20px, 440px);
    padding: 12px 0 22px;
  }

  body.student-mode .hero-card {
    min-height: 118px;
    border-radius: 22px;
    padding: 22px 20px;
    background-position: right center;
  }

  body.student-mode .hero-card h1 {
    font-size: clamp(30px, 9vw, 42px);
    line-height: 1.05;
  }

  body.student-mode .hero-card p {
    font-size: 15px;
    max-width: 250px;
  }

  body.student-mode .panel-card,
  body.student-mode .question-card,
  body.student-mode .recording-card,
  body.student-mode .student-answer-card {
    border-radius: 22px;
    padding: 18px;
  }

  body.student-mode .question-title,
  body.student-mode .question-text {
    font-size: clamp(24px, 7vw, 34px);
    line-height: 1.18;
    letter-spacing: 0;
  }

  body.student-mode .question-image img {
    max-height: 240px;
    object-fit: contain;
    border-radius: 18px;
  }

  body.student-mode .recording-card .timer,
  body.student-mode .timer-display {
    font-size: clamp(46px, 14vw, 64px);
    line-height: 1;
  }

  body.student-mode .nav-actions,
  body.student-mode .record-actions {
    gap: 10px;
  }

  body.student-mode button {
    min-height: 48px;
  }
}

@media (max-width: 720px) {
  html[data-theme="dark"] body.student-mode {
    background:
      radial-gradient(circle at 80% 0%, rgba(41, 180, 162, .14), transparent 34%),
      linear-gradient(180deg, #071018 0%, #071018 100%);
  }

  html[data-theme="dark"] body.student-mode .hero-card,
  html[data-theme="dark"] body.student-mode .panel-card,
  html[data-theme="dark"] body.student-mode .question-card,
  html[data-theme="dark"] body.student-mode .recording-card,
  html[data-theme="dark"] body.student-mode .student-answer-card {
    background: rgba(8, 18, 29, .88);
    border-color: rgba(126, 158, 178, .3);
    color: #f4fbfd;
  }
}

/* Assignment / homework center */
body [hidden] {
  display: none !important;
}

.assignment-page .assignment-create-card {
  overflow: hidden;
}

.assignment-page .section-heading {
  margin-bottom: 22px;
}

.assignment-page .toolbar-row {
  gap: 12px;
  align-items: flex-end;
}

.assignment-create-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
  align-content: start;
}

.assignment-create-grid label,
.assignment-create-grid .field-block {
  display: grid;
  gap: 8px;
  margin: 0;
  font-weight: 800;
  color: var(--tt-muted);
}

.assignment-create-grid .wide {
  grid-column: span 6;
}

.assignment-create-grid .field-template { grid-column: span 6; }
.assignment-create-grid .field-title { grid-column: span 3; }
.assignment-create-grid .field-campus { grid-column: span 3; }
.assignment-create-grid .field-course,
.assignment-create-grid .field-teacher,
.assignment-create-grid .field-class,
.assignment-create-grid .field-target { grid-column: span 3; }
.assignment-create-grid .field-due { grid-column: span 5; }
.assignment-create-grid .field-score { grid-column: span 2; }
.assignment-create-grid .field-policy { grid-column: span 5; }

.datetime-picker-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(112px, .8fr) minmax(128px, .9fr);
  gap: 8px;
  min-width: 0;
}

.datetime-picker-grid input,
.datetime-picker-grid select {
  min-width: 0;
  min-height: 46px;
  padding-inline: 10px 24px;
}

@media (max-width: 760px) {
  .datetime-picker-grid {
    grid-template-columns: 1fr;
  }
}

.assignment-method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 10px;
}

.assignment-method-grid label {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--tt-border);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(244,250,250,.86));
  color: var(--tt-text) !important;
  font-weight: 900 !important;
  cursor: pointer;
}

.assignment-method-grid input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: #0a8b6a;
}

.assignment-create-grid select[multiple] {
  min-height: 160px;
  padding-block: 10px;
  background-image: none !important;
}

.assignment-create-grid small,
.assignment-submit-form small {
  color: var(--tt-subtle);
  font-weight: 700;
  line-height: 1.6;
}

.assignment-publish-page .assignment-create-grid > label > small,
.assignment-publish-page .assignment-create-grid > .field-block > small {
  display: none;
}

.assignment-publish-page.assignment-page .assignment-create-card {
  padding: clamp(22px, 2vw, 30px);
}

.assignment-publish-page.assignment-page .assignment-create-shortcut {
  margin-bottom: 16px;
}

.assignment-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
  margin: 4px 0 18px;
}

.assignment-insight-card {
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--tt-border);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.96), rgba(241,249,249,.82));
  box-shadow: 0 12px 30px rgba(28, 64, 88, .055);
}

.assignment-insight-card span,
.assignment-insight-card small {
  display: block;
  color: var(--tt-muted);
  font-weight: 850;
}

.assignment-insight-card strong {
  display: block;
  margin: 8px 0 7px;
  color: var(--tt-text);
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1;
}

.assignment-insight-card small {
  font-size: 13px;
  line-height: 1.45;
}

.assignment-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px 16px;
  margin-top: 8px;
}

.assignment-filter-grid .search-field {
  min-width: 0;
}

.assignment-filter-grid button {
  align-self: end;
}

.assignment-page #assignmentTable td:first-child strong,
.assignment-page #assignmentTable td:nth-child(2) strong {
  display: inline-block;
  margin-bottom: 4px;
  line-height: 1.35;
}

.assignment-page #assignmentTable .row-actions {
  min-width: 210px;
}

.assignment-page #assignmentTable {
  table-layout: fixed;
}

.assignment-page #assignmentTable th:nth-child(1) { width: 20%; }
.assignment-page #assignmentTable th:nth-child(2) { width: 25%; }
.assignment-page #assignmentTable th:nth-child(3) { width: 24%; }
.assignment-page #assignmentTable th:nth-child(4) { width: 13%; }
.assignment-page #assignmentTable th:nth-child(5) { width: 18%; }

.assignment-page #assignmentTable td {
  overflow-wrap: anywhere;
}

.assignment-page #assignmentTable .row-actions {
  min-width: 0;
}

.row-action-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.row-action-menu {
  position: relative;
}

.row-action-menu summary {
  min-height: 34px;
  border: 1px solid rgba(196, 215, 228, .9);
  border-radius: 8px;
  padding: 7px 11px;
  background: rgba(241, 248, 251, .94);
  color: #244761;
  font-size: 12px;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.row-action-menu summary::-webkit-details-marker {
  display: none;
}

.row-action-menu summary::after {
  content: "▾";
  margin-left: 6px;
  font-size: 11px;
}

.row-action-menu[open] summary::after {
  content: "▴";
}

.row-action-menu > div {
  display: grid;
  gap: 6px;
  min-width: 148px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid rgba(196, 215, 228, .9);
  border-radius: 10px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 10px 24px rgba(35, 59, 85, .12);
}

.row-action-menu > div button {
  width: 100%;
  justify-content: flex-start;
}

.text-mini-button {
  margin-top: 6px;
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  background: rgba(242, 248, 251, .95) !important;
  color: #31506a !important;
}

.due-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 30, 45, .42);
}

.due-edit-modal[hidden] {
  display: none;
}

.due-edit-dialog {
  width: min(560px, 100%);
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(196, 215, 228, .95);
  border-radius: 14px;
  background: var(--pro-surface, #fff);
  box-shadow: 0 24px 56px rgba(20, 43, 66, .22);
}

.due-edit-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.due-edit-head h3 {
  margin: 0;
  font-size: 20px;
}

.due-edit-head p {
  margin: 4px 0 0;
  color: var(--pro-muted, #64748b);
  font-weight: 800;
}

.due-edit-grid {
  grid-template-columns: minmax(160px, 1fr) minmax(130px, .8fr) minmax(130px, .8fr);
}

.icon-close {
  width: 34px;
  min-height: 34px;
  border-radius: 999px;
  padding: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.assignment-report-box {
  display: grid;
  gap: 14px;
  color: var(--tt-text);
}

.report-ready-note {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(18, 151, 111, .24);
  border-left: 4px solid #078b69;
  border-radius: 14px;
  background: rgba(240, 250, 247, .92);
}

.report-ready-note strong {
  color: #087a5e;
  font-size: 15px;
}

.report-ready-note span {
  color: #607287;
  font-size: 12px;
  font-weight: 850;
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}

.report-kpi-grid > div {
  border: 1px solid var(--tt-border);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(246,251,251,.82));
}

.report-kpi-grid strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  color: var(--tt-text);
}

.report-kpi-grid span {
  color: var(--tt-muted);
  font-weight: 800;
}

.compact-report-grid > div {
  padding: 12px 14px;
}

.compact-report-grid strong {
  font-size: 22px;
}

.report-priority-list {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(232, 181, 62, .35);
  border-left: 4px solid #d9902f;
  border-radius: 14px;
  background: rgba(255, 249, 234, .86);
}

.report-priority-list strong {
  color: #6b5010;
  font-size: 15px;
}

.report-priority-list span {
  color: #425a6f;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.submission-preview {
  max-width: 360px;
  max-height: 96px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.55;
}

.assignment-issue-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.assignment-issue-summary > div {
  min-height: 86px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 12px 14px;
  border: 1px solid #d7e5ec;
  border-radius: 14px;
  background: #f8fcfb;
}

.assignment-issue-summary strong {
  color: #12233a;
  font-size: 17px;
}

.assignment-issue-summary span {
  color: #66798b;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.5;
}

.status-reason {
  display: grid;
  gap: 5px;
  max-width: none;
}

.status-reason small {
  display: -webkit-box;
  overflow: hidden;
  color: #617487;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

#detailTable .status-reason {
  gap: 4px;
}

#detailTable .status-reason small {
  -webkit-line-clamp: 2;
}

.submission-preview-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 174px;
}

.submission-preview-box .submission-preview {
  flex: 1 1 100%;
  max-width: 100%;
  max-height: 74px;
  padding: 8px 10px;
  border: 1px solid #d7e5ec;
  border-radius: 10px;
  background: #fbfefe;
  color: #34495e;
  font-size: 12px;
}

.attachment-chip {
  display: inline-grid;
  gap: 2px;
  align-items: center;
  justify-items: center;
  min-width: 72px;
  max-width: 78px;
  padding: 7px 8px;
  border: 1px solid #cfe1ea;
  border-radius: 10px;
  background: #f7fbfd;
  color: #12324a;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.attachment-chip b {
  color: #12324a;
}

.attachment-chip small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: #6c7e8e;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#detailTable .student-summary-row .attachment-chip {
  min-width: 56px;
  max-width: 64px;
}

#detailTable .student-summary-row .attachment-chip small {
  display: none;
}

.attachment-chip:disabled {
  cursor: not-allowed;
}

.attachment-chip.missing {
  border-style: dashed;
  background: #fbfcfd;
  opacity: .72;
}

.blueprint-field textarea {
  font-family: inherit;
}

.assignment-blueprint-panel {
  display: grid;
  gap: 12px;
  margin: -4px 0 18px;
  padding: 16px;
  border: 1px solid var(--tt-border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(247, 252, 251, .96), rgba(239, 248, 248, .82));
}

.assignment-blueprint-panel[hidden] {
  display: none;
}

.assignment-blueprint-panel strong,
.assignment-blueprint-panel span {
  display: block;
}

.assignment-blueprint-panel strong {
  color: var(--tt-text);
  font-size: 16px;
}

.assignment-blueprint-panel span,
.assignment-blueprint-panel small {
  color: var(--tt-muted);
  font-weight: 800;
}

.blueprint-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.material-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.material-chip-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(23, 121, 150, .08);
  color: var(--tt-muted);
  font-size: 12px;
  font-weight: 850;
}

.material-order-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed rgba(23, 121, 150, .28);
  border-radius: 12px;
  background: rgba(246, 251, 251, .72);
}

.material-order-panel[hidden] {
  display: none;
}

.oral-task-upload-guide {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 139, 116, .22);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(15, 139, 116, .08), rgba(47, 120, 163, .06));
  color: var(--tt-text);
}

.oral-task-upload-guide[hidden] {
  display: none;
}

.oral-task-upload-guide span,
.oral-task-upload-guide small {
  color: var(--tt-muted);
  font-size: 12px;
  font-weight: 800;
}

.oral-task-upload-guide strong {
  font-size: 14px;
  line-height: 1.45;
}

.material-order-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.material-order-head strong {
  color: var(--tt-text);
  font-size: 14px;
}

.material-order-head span {
  color: var(--tt-muted);
  font-size: 12px;
  font-weight: 800;
}

.material-order-list {
  display: grid;
  gap: 8px;
}

.material-order-item {
  display: grid;
  grid-template-columns: auto 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 8px;
  border: 1px solid rgba(23, 121, 150, .18);
  border-radius: 10px;
  background: rgba(255, 255, 255, .9);
  cursor: grab;
}

.material-order-item.dragging {
  opacity: .55;
}

.material-order-item.drag-over {
  border-color: rgba(15, 136, 103, .62);
  box-shadow: 0 0 0 3px rgba(15, 136, 103, .12);
}

.material-order-item-pending {
  cursor: default;
  border-style: dashed;
  background: rgba(241, 248, 251, .72);
}

.material-page-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(15, 136, 103, .11);
  color: #0f745f;
  font-size: 12px;
  font-weight: 900;
}

.material-thumb {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(23, 121, 150, .15);
  background: #f6fbfb;
  color: var(--tt-muted);
  font-size: 11px;
  font-weight: 900;
}

.material-preview-trigger {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
}

.material-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.material-file-icon {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--tt-muted);
  font-size: 11px;
  font-weight: 950;
}

.material-meta {
  min-width: 0;
}

.material-meta strong,
.material-meta small,
.material-name-preview {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-meta strong,
.material-name-preview {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tt-text);
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  cursor: zoom-in;
}

.material-meta small {
  color: var(--tt-muted);
  font-size: 12px;
}

.material-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.material-order-actions button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.blueprint-score-panel {
  display: grid;
  width: 100%;
  max-width: none;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(15, 136, 103, .22);
  border-radius: 16px;
  background: rgba(246, 251, 251, .78);
}

.task-inline-editor {
  margin: 2px 0 16px;
  border-color: rgba(15, 136, 103, .28);
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(247, 252, 250, .92));
  box-shadow: 0 16px 34px rgba(26, 84, 101, .08);
}

.blueprint-score-panel[hidden] {
  display: none;
}

.blueprint-score-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.blueprint-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.task-blueprint-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-filter-form {
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr);
  margin-bottom: 12px;
}

.task-library-list {
  display: grid;
  gap: 10px;
}

.task-library-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(23, 121, 150, .16);
  border-radius: 12px;
  background: rgba(255, 255, 255, .86);
}

.task-library-card.is-editing {
  border-color: rgba(15, 136, 103, .42);
  background: linear-gradient(135deg, rgba(242, 251, 248, .96), rgba(255, 255, 255, .92));
  box-shadow: 0 0 0 3px rgba(15, 136, 103, .08);
}

.task-inline-edit-slot:empty {
  display: none;
}

.task-library-card h3 {
  margin: 0 0 6px;
  color: var(--tt-text, var(--ink));
  font-size: 17px;
  letter-spacing: 0;
}

.task-library-card p,
.task-library-card small {
  display: block;
  margin: 0;
  color: var(--tt-muted, var(--muted));
  font-weight: 760;
}

.task-library-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.task-preview-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(23, 121, 150, .18);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(245, 252, 250, .92));
  box-shadow: 0 12px 28px rgba(16, 67, 86, .08);
}

.task-preview-panel[hidden] {
  display: none;
}

.task-preview-panel h3 {
  margin: 2px 0 6px;
  color: var(--tt-text, var(--ink));
  font-size: 22px;
  letter-spacing: 0;
}

.task-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.task-preview-card {
  padding: 13px;
  border: 1px solid rgba(23, 121, 150, .14);
  border-radius: 10px;
  background: rgba(255, 255, 255, .82);
}

.task-preview-card.wide {
  grid-column: 1 / -1;
}

.task-preview-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--tt-text, var(--ink));
  font-size: 14px;
  font-weight: 900;
}

.task-preview-card p {
  margin: 0;
  color: var(--tt-muted, var(--muted));
  font-weight: 760;
  line-height: 1.65;
  white-space: pre-wrap;
}

.task-preview-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.task-preview-card dl div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
}

.task-preview-card dt,
.task-preview-card dd,
.task-preview-materials {
  margin: 0;
}

.task-preview-card dt {
  color: var(--tt-muted, var(--muted));
  font-size: 12px;
  font-weight: 900;
}

.task-preview-card dd,
.task-preview-materials {
  color: var(--tt-text, var(--ink));
  font-weight: 850;
}

.task-preview-materials {
  display: grid;
  gap: 6px;
  padding-left: 18px;
}

.task-preview-blueprint {
  margin-top: 12px;
}

.task-preview-blueprint p {
  margin: 0 0 10px;
  color: var(--tt-muted, var(--muted));
  font-weight: 760;
}

.task-preview-empty {
  margin-top: 12px;
  padding: 13px;
  border: 1px dashed rgba(23, 121, 150, .24);
  border-radius: 10px;
  color: var(--tt-muted, var(--muted));
  font-weight: 820;
}

.blueprint-score-table.readonly td:nth-child(2) span {
  display: block;
  margin-top: 4px;
  color: var(--tt-muted, var(--muted));
  font-weight: 760;
}

@media (max-width: 760px) {
  .task-preview-grid {
    grid-template-columns: 1fr;
  }
  .task-preview-card dl div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.blueprint-score-head strong {
  color: var(--tt-text);
  font-size: 15px;
}

.blueprint-score-head span,
.blueprint-summary-field {
  color: var(--tt-muted);
  font-size: 12px;
  font-weight: 850;
}

.blueprint-summary-field {
  display: grid;
  gap: 6px;
}

.blueprint-score-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(23, 121, 150, .15);
  border-radius: 10px;
  background: rgba(255, 255, 255, .9);
}

.blueprint-score-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
  border-collapse: collapse;
}

.blueprint-score-table * {
  box-sizing: border-box;
}

.blueprint-score-table th,
.blueprint-score-table td {
  padding: 11px;
  border-bottom: 1px solid rgba(23, 121, 150, .11);
  text-align: left;
  vertical-align: top;
}

.blueprint-score-table th {
  color: var(--tt-muted);
  font-size: 12px;
  font-weight: 900;
  background: rgba(23, 121, 150, .06);
}

.blueprint-score-table input,
.blueprint-score-table textarea,
.blueprint-summary-field input {
  width: 100%;
  border: 1px solid rgba(23, 121, 150, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  color: var(--tt-text);
  font-weight: 760;
}

.blueprint-score-table input {
  min-height: 34px;
  padding: 0 10px;
}

.blueprint-score-table input + input,
.blueprint-score-table textarea + textarea {
  margin-top: 8px;
}

.blueprint-score-table textarea {
  min-height: 78px;
  padding: 8px 10px;
  line-height: 1.58;
  resize: vertical;
}

.blueprint-score-table th:nth-child(1),
.blueprint-score-table td:nth-child(1) {
  width: 66px;
}

.blueprint-score-table th:nth-child(2),
.blueprint-score-table td:nth-child(2) {
  width: 23%;
}

.blueprint-score-table th:nth-child(3),
.blueprint-score-table td:nth-child(3) {
  width: 17%;
}

.blueprint-score-table th:nth-child(4),
.blueprint-score-table td:nth-child(4) {
  width: 128px;
}

.blueprint-score-table th:nth-child(5),
.blueprint-score-table td:nth-child(5) {
  width: 104px;
}

.blueprint-score-table th:nth-child(6),
.blueprint-score-table td:nth-child(6) {
  width: 26%;
}

.blueprint-score-table th:nth-child(7),
.blueprint-score-table td:nth-child(7) {
  width: 86px;
  text-align: center;
}

.bp-count-cell {
  display: grid;
  gap: 8px;
}

.bp-count-cell input + input {
  margin-top: 0;
}

.bp-row-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(15, 136, 103, .1);
  color: #0f745f;
  font-size: 12px;
  font-weight: 950;
}

body.modal-open {
  overflow: hidden;
}

.material-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 44px 24px 24px;
  background: rgba(4, 18, 31, .86);
}

.material-preview-modal[hidden] {
  display: none;
}

.material-preview-stage {
  display: grid;
  gap: 12px;
  width: min(96vw, 1180px);
  max-height: 90vh;
  margin: 0;
}

.material-preview-stage img {
  width: 100%;
  max-height: calc(90vh - 86px);
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.material-preview-modal.loading .material-preview-stage img {
  opacity: .58;
}

.material-preview-modal.load-error .material-preview-stage img {
  min-height: min(58vh, 520px);
  border: 1px solid rgba(255, 194, 160, .68);
}

.material-preview-close {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 3001;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-weight: 900;
}

.material-preview-caption {
  display: grid;
  gap: 6px;
  color: #fff;
  text-align: center;
}

.material-preview-caption strong,
.material-preview-caption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-preview-caption strong {
  font-size: 15px;
}

.material-preview-caption span {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 800;
}

.material-preview-caption a,
.material-preview-caption .material-preview-retry,
.material-preview-caption .material-preview-copy {
  justify-self: center;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.material-preview-caption a[hidden],
.material-preview-caption .material-preview-retry[hidden],
.material-preview-caption .material-preview-copy[hidden] {
  display: none;
}

.blueprint-chip {
  display: inline-grid;
  gap: 2px;
  min-width: 118px;
  padding: 9px 12px;
  border: 1px solid rgba(23, 121, 150, .18);
  border-radius: 14px;
  background: rgba(255, 255, 255, .78);
}

.blueprint-chip b {
  color: var(--tt-text);
  font-size: 13px;
}

.score-grid-mini {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 8px;
  min-width: 260px;
}

.score-chip {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--tt-border);
  border-radius: 14px;
  background: rgba(247, 251, 252, .86);
}

.score-chip span,
.score-chip small {
  color: var(--tt-muted);
  font-weight: 850;
  line-height: 1.35;
}

.score-chip span {
  font-size: 12px;
}

.score-chip b {
  color: var(--tt-text);
  font-size: 16px;
}

.score-chip.ok {
  border-color: rgba(18, 151, 111, .26);
  background: rgba(18, 151, 111, .08);
}

.score-chip.mid {
  border-color: rgba(232, 181, 62, .30);
  background: rgba(232, 181, 62, .10);
}

.score-chip.low {
  border-color: rgba(216, 67, 78, .24);
  background: rgba(216, 67, 78, .08);
}

.class-type-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.class-type-summary > div {
  padding: 14px;
  border: 1px solid var(--tt-border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(244,250,250,.84));
}

.class-type-summary span,
.class-type-summary small {
  display: block;
  color: var(--tt-muted);
  font-weight: 850;
}

.class-type-summary strong {
  display: block;
  margin: 4px 0;
  color: var(--tt-text);
  font-size: 22px;
}

.status-pill.ok { background: rgba(18, 151, 111, .12); color: #087a5e; }
.status-pill.warn { background: rgba(232, 181, 62, .18); color: #8c6815; }
.status-pill.bad { background: rgba(216, 67, 78, .12); color: #9f2630; }

html[data-theme="dark"] .report-kpi-grid > div {
  background: linear-gradient(180deg, rgba(14, 31, 43, .92), rgba(8, 20, 31, .86));
}

html[data-theme="dark"] .assignment-insight-card {
  background:
    linear-gradient(145deg, rgba(13, 31, 43, .94), rgba(7, 20, 31, .88));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
}

html[data-theme="dark"] .assignment-blueprint-panel,
html[data-theme="dark"] .blueprint-chip,
html[data-theme="dark"] .score-chip,
html[data-theme="dark"] .class-type-summary > div {
  background: rgba(8, 23, 34, .82);
  border-color: rgba(126, 158, 178, .32);
}

html[data-theme="dark"] .assignment-method-grid label {
  background: linear-gradient(180deg, rgba(13, 30, 42, .96), rgba(7, 20, 31, .9));
  border-color: rgba(126, 158, 178, .34);
}

html[data-theme="dark"] .assignment-create-grid select[multiple],
html[data-theme="dark"] .assignment-create-grid select[multiple] option {
  background: rgba(6, 18, 28, .9) !important;
  color: var(--tt-text);
}

/* Public homework submit page */
.assignment-public-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 80% 0%, rgba(97, 213, 184, .24), transparent 32%),
    linear-gradient(180deg, #eef8f5 0%, #f8fbfa 100%);
  color: var(--tt-text);
}

.assignment-public-shell {
  width: min(100% - 28px, 760px);
  margin: 0 auto;
  padding: 54px 0 42px;
}

.assignment-public-hero {
  min-height: 180px;
  border-radius: 28px;
  padding: 30px;
  border: 1px solid rgba(194, 220, 226, .9);
  background:
    linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.76) 58%, rgba(255,255,255,.18) 100%),
    url("/static/assets/ui/student-hero-v2.jpg") right center / cover no-repeat;
  box-shadow: 0 24px 60px rgba(24, 75, 91, .12);
  display: grid;
  align-content: end;
}

.assignment-public-hero span {
  color: var(--tt-primary);
  font-weight: 900;
  letter-spacing: .22em;
  font-size: 13px;
}

.assignment-public-hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(34px, 8vw, 56px);
  letter-spacing: 0;
}

.assignment-public-hero p {
  margin: 0;
  color: var(--tt-muted);
  font-weight: 800;
}

.assignment-public-card {
  margin-top: 18px;
  border: 1px solid rgba(194, 220, 226, .92);
  border-radius: 28px;
  padding: 24px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 22px 60px rgba(25, 74, 91, .1);
}

.assignment-public-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.assignment-public-meta span {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(16, 142, 110, .1);
  color: var(--tt-primary);
  font-weight: 900;
}

.assignment-public-block {
  border: 1px solid rgba(211, 226, 234, .86);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 14px;
  background: rgba(248, 252, 251, .78);
}

.assignment-public-block h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.assignment-public-block p {
  margin: 0;
  color: var(--tt-muted);
  line-height: 1.8;
  white-space: pre-wrap;
}

.submission-guide-block {
  background: rgba(241, 249, 247, .92);
}

.submission-guide-common {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(122, 196, 178, .4);
  border-radius: 14px;
  background: rgba(255, 255, 255, .78);
}

.submission-guide-common strong {
  color: var(--tt-text);
  font-size: 14px;
}

.submission-guide-common span {
  color: var(--tt-muted);
  font-weight: 820;
  line-height: 1.6;
}

.submission-guide-list {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.submission-guide-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(122, 196, 178, .38);
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
}

.submission-guide-item span {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(16, 142, 110, .12);
  color: var(--tt-primary);
  font-size: 12px;
  font-weight: 950;
}

.submission-guide-item strong {
  color: var(--tt-text);
  font-size: 14px;
}

.submission-guide-item small,
.submission-guide-item em {
  color: var(--tt-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 820;
  line-height: 1.5;
}

.submission-guide-upload {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f8e6d, #247aa6);
  color: #fff;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(17, 128, 112, .16);
}

.submission-guide-upload[hidden] {
  display: none !important;
}

.assignment-submit-form {
  display: grid;
  gap: 14px;
}

.assignment-submit-form label {
  display: grid;
  gap: 8px;
  color: var(--tt-muted);
  font-weight: 900;
}

.assignment-submit-form .answer-format-hint {
  margin-top: -6px;
  padding: 10px 12px;
  border: 1px solid rgba(17, 128, 112, .2);
  border-radius: 8px;
  background: #f2faf7;
  color: #285b4d;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 850;
}

.assignment-submit-form .answer-format-hint[data-state="filled"] {
  background: #edf8f4;
  color: var(--tt-green);
}

.assignment-submit-form [hidden],
.assignment-public-block[hidden] {
  display: none !important;
}

.assignment-recorder {
  border: 1px solid rgba(122, 196, 178, .42);
  border-radius: 22px;
  padding: 16px;
  background:
    radial-gradient(circle at 8% 18%, rgba(43, 186, 152, .14), transparent 28%),
    linear-gradient(135deg, rgba(240, 250, 247, .96), rgba(248, 252, 255, .9));
  display: grid;
  gap: 14px;
}

.assignment-recorder[hidden] {
  display: none;
}

.assignment-recorder .recorder-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(21, 147, 111, .12);
  color: var(--tt-green);
  font-weight: 950;
}

.assignment-recorder strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(36px, 10vw, 54px);
  letter-spacing: 0;
  line-height: 1;
  color: var(--tt-ink);
}

.assignment-recorder p {
  margin: 8px 0 0;
  color: var(--tt-muted);
  line-height: 1.7;
}

.assignment-recorder-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.assignment-recorder-actions button {
  min-height: 48px;
  border-radius: 16px;
  font-weight: 950;
}

.assignment-recorder-actions button:first-child {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, #0e8e68, #2c91ba);
  box-shadow: 0 16px 30px rgba(18, 132, 114, .18);
}

.assignment-recorder audio {
  width: 100%;
}

.assignment-record-quality {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(122, 196, 178, .4);
  border-radius: 16px;
  background: rgba(255, 255, 255, .8);
  color: var(--tt-muted);
  font-weight: 850;
}
.assignment-record-quality.good {
  border-color: rgba(93, 180, 137, .45);
  background: rgba(242, 251, 247, .92);
}
.assignment-record-quality.warn {
  border-color: rgba(221, 177, 75, .48);
  background: rgba(255, 249, 235, .94);
}
.assignment-record-quality.bad {
  border-color: rgba(229, 132, 116, .48);
  background: rgba(255, 246, 243, .94);
}

.assignment-record-quality[hidden] {
  display: none !important;
}

.assignment-record-quality strong {
  color: var(--tt-text);
  margin: 0;
  font-size: 14px;
}

.assignment-submit-btn {
  min-height: 56px;
  border-radius: 18px;
  font-size: 18px;
}

.assignment-submit-btn:disabled {
  cursor: progress;
  opacity: .78;
}

.assignment-quick-actions {
  display: none;
}

.assignment-public-page .inline-message {
  scroll-margin-bottom: 110px;
}

html[data-theme="dark"] .assignment-public-page {
  background:
    radial-gradient(circle at 86% 0%, rgba(75, 211, 184, .18), transparent 34%),
    linear-gradient(180deg, #071018 0%, #08131d 100%);
}

html[data-theme="dark"] .assignment-public-hero,
html[data-theme="dark"] .assignment-public-card,
html[data-theme="dark"] .assignment-public-block,
html[data-theme="dark"] .assignment-recorder {
  background-color: rgba(9, 21, 32, .9);
  border-color: rgba(137, 166, 188, .28);
}

html[data-theme="dark"] .assignment-recorder {
  background:
    radial-gradient(circle at 8% 18%, rgba(42, 225, 185, .12), transparent 30%),
    linear-gradient(135deg, rgba(8, 20, 31, .96), rgba(10, 25, 36, .9));
}

html[data-theme="dark"] .submission-guide-common,
html[data-theme="dark"] .assignment-record-quality,
html[data-theme="dark"] .audio-check-panel {
  background: rgba(9, 23, 34, .86);
  border-color: rgba(137, 166, 188, .3);
  color: #a9bbc8;
}

html[data-theme="dark"] .submission-guide-common strong,
html[data-theme="dark"] .assignment-record-quality strong,
html[data-theme="dark"] .audio-check-head strong {
  color: #eef6fb;
}

html[data-theme="dark"] .audio-check-panel p,
html[data-theme="dark"] .submission-guide-common span {
  color: #a9bbc8;
}

html[data-theme="dark"] .assignment-submit-form .answer-format-hint {
  border-color: rgba(122, 196, 178, .26);
  background: rgba(26, 62, 57, .72);
  color: #b7d4cc;
}

html[data-theme="dark"] .assignment-submit-form .answer-format-hint[data-state="filled"] {
  color: #8ee0c8;
}

html[data-theme="dark"] .assignment-public-hero {
  background:
    linear-gradient(90deg, rgba(7, 16, 24, .98) 0%, rgba(7, 16, 24, .84) 56%, rgba(7, 16, 24, .35) 100%),
    url("/static/assets/ui/student-hero-v2.jpg") right center / cover no-repeat;
}

html[data-theme="dark"] .assignment-public-meta span {
  background: rgba(82, 224, 182, .14);
  color: #7ff0ca;
}

html[data-theme="dark"] .assignment-quick-actions:not([hidden]) {
  background: rgba(8, 20, 31, .94);
  border-color: rgba(137, 166, 188, .28);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .42);
}

html[data-theme="dark"] .assignment-quick-actions span {
  color: #a9bbc8;
}

html[data-theme="dark"] .assignment-quick-actions button:nth-of-type(1) {
  background: rgba(16, 45, 55, .96);
  border-color: rgba(95, 214, 184, .26);
  color: #7ff0ca;
}

@media (max-width: 1100px) {
  .blueprint-score-table-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }
  .blueprint-score-table,
  .blueprint-score-table tbody,
  .blueprint-score-table tr,
  .blueprint-score-table td {
    display: block;
    width: 100% !important;
    min-width: 0;
  }
  .blueprint-score-table thead {
    display: none;
  }
  .blueprint-score-table tr {
    display: grid;
    gap: 10px;
    min-width: 0;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(23, 121, 150, .15);
    border-radius: 12px;
    background: rgba(255, 255, 255, .9);
  }
  .blueprint-score-table td {
    padding: 0;
    border: 0;
    text-align: left !important;
  }
  .blueprint-score-table td::before {
    content: attr(data-bp-field);
    display: block;
    margin-bottom: 6px;
    color: var(--tt-muted);
    font-size: 12px;
    font-weight: 900;
  }
}

@media (max-width: 900px) {
  .assignment-create-grid,
  .assignment-filter-grid,
  .assignment-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .assignment-create-grid,
  .assignment-filter-grid,
  .assignment-insight-grid,
  .report-kpi-grid {
    grid-template-columns: 1fr;
  }
  .assignment-create-grid .wide {
    grid-column: auto;
  }
  .assignment-method-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .material-order-head,
  .material-order-item {
    align-items: stretch;
  }
  .material-order-head {
    display: grid;
  }
  .material-order-item {
    grid-template-columns: auto 48px minmax(0, 1fr);
  }
  .material-order-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .blueprint-score-head {
    display: grid;
  }
  .assignment-public-shell {
    width: min(100% - 20px, 460px);
    padding-top: calc(46px + env(safe-area-inset-top));
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
  .assignment-public-hero {
    min-height: 150px;
    padding: 22px;
    border-radius: 24px;
  }
  .assignment-public-card {
    border-radius: 24px;
    padding: 18px;
  }
  .assignment-public-meta {
    gap: 8px;
  }
  .assignment-public-meta span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .assignment-public-block,
  .assignment-recorder {
    border-radius: 18px;
    padding: 14px;
  }
  .submission-guide-block {
    padding: 12px;
  }
  .submission-guide-common {
    margin-bottom: 8px;
    padding: 10px 12px;
  }
  .submission-guide-common span,
  #submissionGuideNote {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .submission-guide-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .submission-guide-item {
    padding: 10px;
  }
  .submission-guide-item strong {
    font-size: 13px;
    line-height: 1.35;
  }
  .assignment-recorder-actions {
    grid-template-columns: 1fr;
  }
  .assignment-submit-form {
    gap: 12px;
  }
  .assignment-submit-btn {
    width: 100%;
    margin-top: 6px;
    box-shadow: 0 14px 32px rgba(14, 126, 115, .24);
  }
  .assignment-public-page.has-assignment-quick-actions .submission-guide-upload {
    display: none !important;
  }
  .assignment-public-page.has-assignment-quick-actions .assignment-public-shell {
    padding-bottom: calc(126px + env(safe-area-inset-bottom));
  }
  .assignment-quick-actions:not([hidden]) {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 1090;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(104px, 1fr) minmax(92px, .9fr);
    gap: 8px;
    align-items: center;
    width: min(100% - 20px, 460px);
    margin: 0 auto;
    padding: 8px;
    border: 1px solid rgba(130, 166, 181, .34);
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 44px rgba(17, 51, 72, .22);
    backdrop-filter: blur(18px) saturate(150%);
  }
  .assignment-quick-actions span {
    min-width: 0;
    color: var(--tt-muted);
    font-size: 12px;
    font-weight: 950;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .assignment-quick-actions button {
    min-width: 0;
    min-height: 44px;
    border-radius: 14px;
    font-weight: 950;
    white-space: nowrap;
  }
  .assignment-quick-actions.no-upload:not([hidden]) {
    grid-template-columns: minmax(0, 1fr) minmax(104px, .9fr);
  }
  .assignment-quick-actions button:nth-of-type(1) {
    border-color: rgba(13, 126, 103, .28);
    background: rgba(232, 249, 244, .96);
    color: var(--tt-primary);
  }
  .assignment-quick-actions button:nth-of-type(2) {
    border: 0;
    background: linear-gradient(135deg, #0f8e6d, #247aa6);
    color: #fff;
    box-shadow: 0 12px 24px rgba(17, 128, 112, .18);
  }
  .assignment-quick-actions button[hidden] {
    display: none !important;
  }
  .assignment-quick-actions button:disabled {
    opacity: .68;
    box-shadow: none;
  }
  .student-file-picker-button,
  .app-file-picker-button {
    min-width: 96px;
    padding-inline: 12px;
  }
}

/* v13.2 responsive polish: mobile login/account/management, cleaner flat UI. */
html {
  -webkit-text-size-adjust: 100%;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea {
  background-image: none !important;
}

input[type="file"] {
  background-image: none !important;
  appearance: auto;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px !important;
}

select[multiple] {
  background-image: none !important;
  padding-right: 12px !important;
}

.top-module-nav {
  position: sticky;
  top: 0;
  z-index: 1200;
}

.top-nav-inner {
  width: min(100% - 32px, 1740px);
  margin: 0 auto;
  grid-template-columns: auto minmax(360px, 1fr) auto;
}

.top-nav-links {
  justify-content: flex-start;
}

.top-right-tools {
  min-width: 0;
}

.account-action-row .logout-link,
.account-logout-button {
  display: inline-flex !important;
}

.admin-badge,
.account-profile-name,
.account-profile-meta,
.account-profile-scope {
  min-width: 0;
  overflow-wrap: anywhere;
}

.login-body {
  margin: 0;
  background: #f5faf9;
}

.login-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-template-columns: minmax(0, 510px);
  background:
    linear-gradient(90deg, rgba(247, 251, 251, .96) 0%, rgba(247, 251, 251, .86) 46%, rgba(247, 251, 251, .28) 100%),
    url("/static/assets/ui/teacher-hero-v2.jpg") right center / cover no-repeat,
    linear-gradient(135deg, #f4fbfa, #f7fafc);
}

.login-page::before {
  content: "";
  position: absolute;
  inset: auto auto -160px -120px;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(7, 139, 105, .16), transparent 68%);
  z-index: -1;
}

.login-card {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 38px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(249,252,252,.9));
  box-shadow: 0 26px 80px rgba(24, 58, 82, .16);
}

.login-card::before {
  content: "";
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #09896f, #2f78a3 68%, #e2b466);
  box-shadow: 0 18px 34px rgba(25, 115, 130, .18);
}

.login-card .brand {
  letter-spacing: .22em;
  color: #078b69;
}

.login-card h1 {
  font-size: clamp(34px, 6vw, 48px);
  line-height: 1.04;
}

.login-card input,
.login-card button {
  min-height: 56px;
  border-radius: 18px;
  font-size: 16px;
}

.login-card button {
  background: linear-gradient(135deg, #087f66, #287da5);
  color: #fff;
  border: 0;
  font-weight: 950;
  box-shadow: 0 18px 34px rgba(12, 126, 105, .2);
}

html[data-theme="dark"] .login-body {
  background: #071118;
}

html[data-theme="dark"] .login-page {
  background:
    linear-gradient(90deg, rgba(7, 17, 24, .98) 0%, rgba(7, 17, 24, .88) 52%, rgba(7, 17, 24, .42) 100%),
    url("/static/assets/ui/teacher-hero-v2.jpg") right center / cover no-repeat,
    #071118;
}

html[data-theme="dark"] .login-card {
  background: linear-gradient(180deg, rgba(10, 24, 35, .94), rgba(7, 17, 25, .9));
  border-color: rgba(128, 168, 190, .32);
}

.account-profile-card {
  grid-template-columns: auto minmax(0, 1fr);
}

.account-action-row {
  align-items: center;
  flex-wrap: wrap;
}

#accountTable {
  min-width: 760px;
}

.dashboard-page .records-table-wrap {
  min-height: 360px;
}

@media (max-width: 1180px) {
  .top-nav-inner {
    grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
  }

  .top-right-tools {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 900px) {
  .top-right-tools > .logout-link {
    display: none !important;
  }

  .admin-badge {
    max-width: min(100%, 420px);
  }

  .admin-badge-sub {
    display: inline-flex;
  }
}

@media (max-width: 760px) {
  .top-module-nav {
    position: sticky;
  }

  .top-nav-inner {
    width: min(100% - 18px, 560px);
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
    padding: 10px 0;
  }

  .top-nav-brand {
    min-height: 40px;
    justify-content: center;
  }

  .top-nav-links {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 2px 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  }

  .top-nav-links a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 38px;
    padding: 0 13px;
    font-size: 13px;
  }

  .top-right-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .top-right-tools .theme-switch {
    width: auto;
    justify-self: end;
  }

  .admin-badge {
    min-width: 0;
    max-width: none;
    justify-content: center;
    padding: 0 12px;
    font-size: 12px;
  }

  .theme-choice {
    min-width: 58px;
    font-size: 12px;
  }

  .login-page {
    min-height: 100dvh;
    place-items: end center;
    padding: 18px;
    background:
      linear-gradient(180deg, rgba(246, 251, 250, .28) 0%, rgba(246, 251, 250, .92) 36%, rgba(246, 251, 250, 1) 100%),
      url("/static/assets/ui/teacher-hero-v2.jpg") center top / auto 42vh no-repeat,
      #f6fbfa;
  }

  .login-card {
    width: min(100%, 430px);
    padding: 24px;
    border-radius: 26px;
  }

  .login-card::before {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    margin-bottom: 12px;
  }

  .login-card h1 {
    margin-top: 8px;
  }

  .login-card p {
    margin-bottom: 14px;
    font-size: 14px;
  }

  .login-card input,
  .login-card button {
    min-height: 52px;
  }

  .account-settings-grid,
  .admin-grid {
    gap: 14px;
  }

  .account-settings-grid .panel-card,
  .admin-grid .panel-card {
    padding: 18px;
    border-radius: 24px;
  }

  .account-profile-card {
    align-items: flex-start;
    padding: 14px;
  }

  .account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  .account-action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .account-action-row .logout-link,
  .account-action-row .soft-action-link {
    width: 100%;
    justify-content: center;
  }

  .dashboard-page {
    width: min(100% - 18px, 720px);
  }

  .dashboard-page #downloadFilteredBtn,
  .dashboard-page .advanced-details,
  .dashboard-page .records-delete-panel,
  .dashboard-page .report-center,
  .dashboard-page .summary-grid,
  .dashboard-page .dashboard-grid,
  .dashboard-page .records-panel {
    display: none;
  }

  .dashboard-page .records-header,
  .dashboard-page .records-pagination {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .dashboard-page .records-table-wrap {
    height: min(58vh, 560px);
    max-height: 560px;
  }

  .dashboard-page .report-table,
  .dashboard-page .paper-table,
  .dashboard-page .clean-table {
    min-width: 760px;
  }

  .mobile-results-panel {
    display: block;
  }
}

@media (max-width: 720px) {
  .student-theme-dock {
    width: auto !important;
    display: inline-flex;
  }

  .student-mode.student-mobile {
    width: min(100% - 18px, 430px) !important;
  }

  .student-mode.student-mobile .layout {
    gap: 12px;
  }

  .student-mode.student-mobile .hero {
    min-height: 112px !important;
    background-size: auto 112% !important;
    background-position: right center !important;
  }

  .student-mode.student-mobile.assessment-started .hero {
    display: none !important;
  }

  .student-mode.student-mobile.assessment-started .setup-panel {
    display: none !important;
  }

  .student-mode.student-mobile .question-card {
    min-height: 0 !important;
  }

  .student-mode.student-mobile .question-card-head {
    margin-bottom: 16px;
  }

  .student-mode.student-mobile #qTitle {
    font-size: clamp(30px, 9vw, 42px) !important;
    line-height: 1.12 !important;
  }

  .student-mode.student-mobile .question-voice-panel {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
  }

  .student-mode.student-mobile .question-voice-panel .button-row {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .student-mode.student-mobile .voice-speed-control {
    grid-column: 1 / -1;
  }

  .student-mode.student-mobile .record-actions {
    display: grid !important;
    grid-template-columns: minmax(72px, .72fr) minmax(150px, 1.4fr) minmax(72px, .72fr) !important;
    align-items: center;
    gap: 10px !important;
  }

  .student-mode.student-mobile .record-actions button {
    min-width: 0 !important;
    white-space: nowrap;
  }

  .student-mode.student-mobile .primary-record {
    min-height: 56px !important;
  }

  .student-mode.student-mobile .audio-preview,
  .student-mode.student-mobile audio {
    max-width: 100%;
  }

  .student-mode.student-mobile .encouragement-toast {
    width: calc(100% - 24px);
    left: 12px;
    right: 12px;
    bottom: max(16px, env(safe-area-inset-bottom));
    border-radius: 22px;
  }

  .completion-card {
    width: min(100% - 24px, 520px);
    border-radius: 28px;
  }

  .completion-art {
    max-width: min(58vw, 220px);
  }
}

@media (max-width: 390px) {
  .student-mode.student-mobile .record-actions {
    grid-template-columns: 1fr 1fr !important;
  }

  .student-mode.student-mobile .primary-record {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .student-mode.student-mobile #prevBtn {
    grid-column: 1;
    grid-row: 2;
  }

  .student-mode.student-mobile #nextBtn {
    grid-column: 2;
    grid-row: 2;
  }

  .student-mode.student-mobile #qTitle {
    font-size: clamp(28px, 8.6vw, 36px) !important;
  }
}

@media (max-width: 640px) {
  .assignment-public-shell {
    padding-top: 58px;
  }

  .assignment-public-hero {
    min-height: 132px;
    background:
      linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.88) 62%, rgba(255,255,255,.36) 100%),
      url("/static/assets/ui/student-hero-v2.jpg") right center / auto 118% no-repeat;
  }

  .assignment-recorder-actions {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] input[type="file"] {
  background-image: none !important;
}

/* v13.3 account and secondary-page polish: compact hero should feel designed on mobile too. */
.hero-card.compact-hero {
  min-height: 172px;
  display: flex;
  align-items: center;
  padding: clamp(28px, 4vw, 48px);
  border-radius: 30px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.9) 54%, rgba(255,255,255,.48) 100%),
    url("/static/assets/ui/teacher-hero-v2.jpg") right center / cover no-repeat,
    var(--tt-surface);
}

.hero-card.compact-hero .brand {
  letter-spacing: .26em;
  color: #078b69;
}

.hero-card.compact-hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(38px, 4.8vw, 60px);
  line-height: 1.02;
}

.hero-card.compact-hero p {
  max-width: 660px;
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
}

html[data-theme="dark"] .hero-card.compact-hero {
  background:
    linear-gradient(90deg, rgba(7,17,24,.96) 0%, rgba(7,17,24,.86) 58%, rgba(7,17,24,.42) 100%),
    url("/static/assets/ui/teacher-hero-v2.jpg") right center / cover no-repeat,
    var(--tt-surface);
}

html[data-theme="dark"] .hero-card.compact-hero .brand {
  color: #72e2c8;
}

/* v13.4 form rhythm: prevent card text from touching borders and make target picking readable. */
.shell-page > .panel-card,
.shell-page .admin-grid > .panel-card,
.shell-page .account-settings-grid > .panel-card,
.assignment-page > .panel-card,
.grading-center-page .panel,
.dashboard-page .panel {
  padding: clamp(22px, 2.2vw, 34px);
  border-radius: 28px;
  overflow: hidden;
}

.shell-page .admin-grid > .panel-card,
.shell-page .account-settings-grid > .panel-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,252,252,.92));
}

.account-form-card,
.assignment-create-card {
  overflow: hidden;
}

.assignment-create-grid .native-student-select {
  display: none !important;
}

.student-target-picker {
  min-height: 132px;
  padding: 12px;
  border: 1px solid var(--tt-border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(244,250,250,.86));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.student-target-empty {
  min-height: 104px;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 14px;
  background: rgba(239, 247, 248, .72);
  color: var(--tt-subtle);
  text-align: center;
  line-height: 1.6;
}

.student-target-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.student-target-all {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(15, 151, 112, .12);
  color: #087a5e !important;
  font-weight: 900 !important;
}

.student-target-all input,
.student-target-chip input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: #0a8b6a;
}

.student-target-toolbar button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13px;
}

.student-target-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
  padding: 4px 2px 2px;
}

.student-target-list.is-muted {
  opacity: .58;
}

.student-target-chip {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(194, 216, 226, .88);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: var(--tt-text) !important;
  font-weight: 850 !important;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.student-target-chip:has(input:checked) {
  border-color: rgba(13, 139, 105, .72);
  background: rgba(223, 247, 239, .94);
  color: #075f4e !important;
}

.student-target-chip:hover {
  transform: translateY(-1px);
}

html[data-theme="dark"] .student-target-picker {
  background:
    linear-gradient(135deg, rgba(9, 24, 35, .92), rgba(11, 28, 38, .8));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

html[data-theme="dark"] .shell-page .admin-grid > .panel-card,
html[data-theme="dark"] .shell-page .account-settings-grid > .panel-card {
  background:
    linear-gradient(135deg, rgba(9, 21, 32, .96), rgba(7, 18, 28, .9));
}

html[data-theme="dark"] .student-target-empty {
  background: rgba(12, 30, 42, .72);
}

html[data-theme="dark"] .student-target-all {
  background: rgba(64, 220, 181, .13);
  color: #9bf3d9 !important;
}

html[data-theme="dark"] .student-target-chip {
  background: rgba(10, 25, 36, .88);
  border-color: rgba(126, 158, 178, .34);
}

html[data-theme="dark"] .student-target-chip:has(input:checked) {
  background: rgba(21, 95, 79, .52);
  border-color: rgba(114, 226, 200, .52);
  color: #f4fffb !important;
}

@media (max-width: 760px) {
  .hero-card.compact-hero {
    min-height: 148px;
    padding: 24px;
    border-radius: 24px;
    background:
      linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.92) 66%, rgba(255,255,255,.54) 100%),
      url("/static/assets/ui/teacher-hero-v2.jpg") right center / auto 110% no-repeat,
      var(--tt-surface);
  }

  .hero-card.compact-hero .brand {
    font-size: 11px;
    letter-spacing: .22em;
  }

  .hero-card.compact-hero h1 {
    font-size: clamp(34px, 11vw, 44px);
  }

  .hero-card.compact-hero p {
    max-width: 285px;
    font-size: 15px;
  }

html[data-theme="dark"] .hero-card.compact-hero {
    background:
      linear-gradient(90deg, rgba(7,17,24,.98) 0%, rgba(7,17,24,.9) 68%, rgba(7,17,24,.54) 100%),
      url("/static/assets/ui/teacher-hero-v2.jpg") right center / auto 110% no-repeat,
      var(--tt-surface);
  }
}

/* Final form-control cleanup: keep one crisp select arrow and no fake arrows on file inputs. */
select,
.stack-form select,
.search-field select,
.student-mode select {
  appearance: none !important;
  -webkit-appearance: none !important;
  padding-right: 42px !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: right 16px center, 0 0 !important;
  background-size: 14px 14px, 100% 100% !important;
}

html[data-theme="light"] select,
html[data-theme="light"] .stack-form select,
html[data-theme="light"] .search-field select,
html[data-theme="light"] .student-mode select {
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23566a7f' d='M4.2 6.1h7.6L8 10z'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #ffffff, #f8fbfc) !important;
}

html[data-theme="dark"] select,
html[data-theme="dark"] .stack-form select,
html[data-theme="dark"] .search-field select,
html[data-theme="dark"] .student-mode select {
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23b9c9d8' d='M4.2 6.1h7.6L8 10z'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(8, 22, 33, .94), rgba(6, 17, 27, .96)) !important;
}

select[multiple],
html[data-theme="light"] select[multiple],
html[data-theme="dark"] select[multiple],
.native-student-select {
  background-image: none !important;
  padding-right: 12px !important;
}

input[type="file"],
html[data-theme="light"] input[type="file"],
html[data-theme="dark"] input[type="file"] {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
  background-size: auto !important;
  background-position: initial !important;
  padding-right: 14px !important;
}

/* Account and homework submission polish */
.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.password-field input {
  width: 100%;
  min-width: 0;
}

.password-field button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--tt-border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(238,247,249,.9));
  color: var(--tt-text);
  font-weight: 900;
  cursor: pointer;
}

.login-password-field {
  margin: 8px 0 14px;
}

.login-password-field button {
  min-width: 72px;
}

.org-list-row > div {
  min-width: 0;
}

.org-list-row b,
.org-list-row span {
  overflow-wrap: anywhere;
}

.org-list-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.soft-mini {
  min-width: 72px;
  min-height: 36px;
  border: 1px solid rgba(181, 210, 225, .9);
  border-radius: 999px;
  background: rgba(241, 248, 251, .95);
  color: #245875;
  font-weight: 950;
  cursor: pointer;
}

.account-center-page .org-card,
.account-center-page .account-form-card {
  padding: clamp(22px, 2vw, 30px);
}

.account-center-page .section-heading p {
  max-width: 58ch;
}

.assignment-submit-form .student-search-label {
  margin-bottom: -4px;
}

.assignment-submit-form .student-search-label input {
  width: 100%;
}

.student-file-picker,
.app-file-picker {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 48px;
  border: 1px solid rgba(179, 205, 219, .92);
  border-radius: 12px;
  background: rgba(255, 255, 255, .94);
  overflow: hidden;
}

.student-file-picker input[type="file"],
.app-file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.student-file-picker-button,
.app-file-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 112px;
  padding: 0 16px;
  border-right: 1px solid rgba(179, 205, 219, .72);
  background: #eef7f7;
  color: #102238;
  font-weight: 950;
}

.student-file-picker-text,
.app-file-picker-text {
  min-width: 0;
  padding: 0 14px;
  color: #263d55;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="dark"] .student-file-picker,
html[data-theme="dark"] .app-file-picker {
  border-color: rgba(126, 158, 178, .38);
  background: rgba(9, 24, 35, .92);
}

html[data-theme="dark"] .student-file-picker-button,
html[data-theme="dark"] .app-file-picker-button {
  border-right-color: rgba(126, 158, 178, .32);
  background: rgba(20, 45, 58, .94);
  color: #e6f2f7;
}

html[data-theme="dark"] .student-file-picker-text,
html[data-theme="dark"] .app-file-picker-text {
  color: #d8e8f5;
}

.assignment-attachment-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: -6px;
  padding: 12px 14px;
  border: 1px solid rgba(179, 205, 219, .72);
  border-radius: 14px;
  background: rgba(241, 248, 251, .92);
  color: var(--tt-muted);
  font-weight: 850;
  line-height: 1.5;
}

.assignment-attachment-preview-text {
  flex: 1 1 220px;
  min-width: 0;
}

.attachment-missing-upload {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(16, 132, 84, .22);
  border-radius: 8px;
  background: #eafff5;
  color: #146447;
  font-size: 12px;
  font-weight: 900;
}

html[data-theme="dark"] .password-field button,
html[data-theme="dark"] .soft-mini {
  background: linear-gradient(180deg, rgba(12, 30, 43, .96), rgba(7, 20, 31, .94));
  border-color: rgba(126, 158, 178, .36);
  color: #d8e8f5;
}

html[data-theme="dark"] .assignment-attachment-preview {
  background: rgba(9, 24, 35, .84);
  border-color: rgba(126, 158, 178, .34);
}

html[data-theme="dark"] .attachment-missing-upload {
  border-color: rgba(104, 211, 145, .34);
  background: rgba(18, 78, 58, .72);
  color: #dbfff1;
}

@media (max-width: 760px) {
  .account-center-page .org-maintenance-grid,
  .account-center-page .admin-grid {
    grid-template-columns: 1fr;
  }

  .org-list-row {
    align-items: flex-start;
  }

  .assignment-public-card,
  .assignment-public-hero {
    border-radius: 22px;
  }
}

/* Final shell QA polish: account center, task center and public task pages */
.account-center-page,
.assignment-page {
  width: min(100% - 48px, 1760px);
  margin-inline: auto;
}

.account-center-page .org-maintenance-grid,
.account-center-page .admin-grid {
  gap: clamp(20px, 1.8vw, 30px);
}

.account-center-page .org-maintenance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.account-center-page .admin-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.72fr) minmax(0, 1.28fr);
  margin-top: 24px;
}

.account-center-page .panel-card,
.assignment-page .panel-card {
  padding: clamp(26px, 2.4vw, 38px);
}

.account-center-page .section-heading,
.assignment-page .section-heading {
  align-items: flex-start;
}

.account-center-page .section-heading h2,
.assignment-page .section-heading h2 {
  line-height: 1.18;
}

.account-center-page .section-heading p,
.assignment-page .section-heading p {
  line-height: 1.7;
}

.inline-org-form,
.stack-form,
.assignment-create-grid {
  min-width: 0;
}

.inline-org-form {
  display: grid;
  grid-template-columns: minmax(150px, .82fr) minmax(190px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.teacher-list + .inline-message,
.org-list + .inline-message {
  margin-top: 12px;
}

.inline-org-form label,
.stack-form label,
.assignment-create-grid label,
.assignment-create-grid .field-block,
.assignment-filter-grid label,
.assignment-submit-form label {
  min-width: 0;
}

.account-center-page .clean-table th,
.account-center-page .clean-table td,
.assignment-page .clean-table th,
.assignment-page .clean-table td {
  padding: 16px 18px;
  vertical-align: top;
}

.account-center-page .fixed-table-wrap,
.assignment-page .fixed-table-wrap {
  border-radius: 22px;
}

.assignment-page .assignment-create-card {
  padding: clamp(28px, 2.6vw, 42px);
}

.assignment-create-shortcut {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 22px;
}

.assignment-page .assignment-create-grid {
  gap: 10px 16px;
  align-items: start;
  align-content: start;
  grid-auto-rows: min-content;
}

.assignment-page .assignment-create-grid .wide {
  align-self: stretch;
}

.assignment-page .toolbar-row {
  margin-top: 18px;
}

.assignment-page .assignment-filter-grid {
  align-items: end;
}

.assignment-public-page .student-theme-dock {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 30;
  backdrop-filter: blur(18px);
}

.assignment-public-page select,
.assignment-public-page input,
.assignment-public-page textarea,
.student-mode select,
.student-mode input,
.student-mode textarea {
  font-size: 16px;
}

html[data-theme="dark"] .account-center-page .panel-card,
html[data-theme="dark"] .assignment-page .panel-card {
  background:
    linear-gradient(180deg, rgba(12, 24, 36, .96), rgba(7, 18, 28, .94)),
    radial-gradient(circle at 96% 0%, rgba(73, 179, 166, .12), transparent 34%);
  border-color: rgba(128, 164, 184, .28);
}

.completion-page .completion-filter-panel {
  margin-top: 0;
}

.completion-toolbar {
  align-items: end;
  grid-template-columns: minmax(150px, 190px) minmax(150px, 190px) auto auto;
}

.completion-toolbar + .completion-toolbar {
  margin-top: 12px;
  grid-template-columns: minmax(170px, 240px) minmax(170px, 260px) minmax(170px, 260px) minmax(160px, 220px);
}

.period-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 46px;
  border: 1px solid rgba(199,214,224,.9);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.88);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

.period-switch button {
  min-height: 46px;
  min-width: 72px;
  border: 0;
  border-right: 1px solid rgba(199,214,224,.9);
  border-radius: 0;
  background: transparent;
  color: #526477;
  box-shadow: none;
  font-weight: 950;
}

.period-switch button:last-child {
  border-right: 0;
}

.period-switch button.active {
  background: #2d8cff;
  color: #fff;
}

.completion-definition {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.completion-definition span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(237, 247, 244, .9);
  border: 1px solid rgba(190, 220, 211, .9);
  color: #426476;
  font-size: 12px;
  font-weight: 850;
}

.completion-kpi-grid {
  margin: 18px 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.completion-kpi-card em {
  display: block;
  margin-top: 6px;
  color: #6f8192;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.completion-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
  gap: 18px;
  margin: 18px 0;
}

.completion-chart-card {
  margin: 0;
  min-height: 310px;
}

.section-heading.compact {
  margin-bottom: 16px;
}

.section-heading.compact h2 {
  margin-bottom: 3px;
}

.completion-chart-body {
  display: grid;
  gap: 14px;
}

.completion-bar-row {
  display: grid;
  grid-template-columns: 84px minmax(160px, 1fr) 72px;
  gap: 10px 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(207, 224, 234, .7);
}

.completion-bar-row:last-child {
  border-bottom: 0;
}

.completion-bar-row > span {
  color: #304860;
  font-size: 13px;
  font-weight: 950;
}

.completion-bar-row > strong {
  color: #152238;
  font-size: 18px;
  text-align: right;
}

.completion-bar-row > small {
  grid-column: 2 / 4;
  color: #718395;
  font-size: 12px;
  font-weight: 850;
}

.completion-bar-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(222, 233, 239, .86);
  box-shadow: inset 0 1px 2px rgba(31, 52, 74, .08);
}

.completion-bar-track i {
  display: block;
  width: var(--bar-width, 0%);
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bar, #078b69), color-mix(in srgb, var(--bar, #078b69) 74%, white));
}

.completion-stack {
  display: flex;
  width: 100%;
  height: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(222, 233, 239, .9);
  box-shadow: inset 0 1px 2px rgba(31, 52, 74, .08);
}

.completion-stack i {
  display: block;
  min-width: 0;
  height: 100%;
  background: var(--seg, #078b69);
}

.completion-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.completion-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #607287;
  font-size: 12px;
  font-weight: 850;
}

.completion-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.completion-followup-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.completion-followup-list > div {
  display: grid;
  gap: 3px;
  padding: 12px 13px 12px 16px;
  border: 1px solid rgba(207, 224, 234, .82);
  border-left: 4px solid var(--follow, #078b69);
  border-radius: 14px;
  background: rgba(248, 252, 252, .9);
}

.completion-followup-list span {
  color: #607287;
  font-size: 12px;
  font-weight: 900;
}

.completion-followup-list strong {
  color: #152238;
  font-size: 17px;
}

.completion-followup-list small,
.empty-chart {
  color: #718395;
  font-size: 12px;
  font-weight: 850;
}

.empty-chart {
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(187, 210, 223, .9);
  border-radius: 16px;
  background: rgba(248, 252, 252, .72);
}

.completion-table-wrap {
  margin-top: 14px;
}

.completion-table-tools {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.completion-table-tools .search-field {
  margin: 0;
}

.completion-table-tools span {
  align-self: center;
  color: #718395;
  font-size: 12px;
  font-weight: 850;
}

.completion-table {
  min-width: 1180px;
}

.completion-table th,
.completion-table td {
  vertical-align: middle;
}

.completion-table th:nth-child(1) { width: 70px; }
.completion-table th:nth-child(2) { width: 140px; }
.completion-table th:nth-child(3) { width: 180px; }
.completion-table th:nth-child(4) { width: 90px; }

.table-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.table-sort-btn::after {
  content: attr(data-arrow) " " attr(data-sort-label);
  min-width: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  color: #2f6f9f;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
  transition: max-width .16s ease, opacity .16s ease;
}

.table-sort-btn.active {
  color: #235f90;
}

.table-sort-btn.active::after {
  max-width: 70px;
  opacity: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(47, 111, 159, .12);
}

.overview-metric-cell {
  display: grid;
  gap: 3px;
  min-width: 104px;
}

.overview-metric-cell strong {
  color: #158161;
  font-size: 18px;
}

.overview-metric-cell.overall-rate strong {
  color: #2f5faa;
}

.overview-metric-cell span,
.overview-metric-cell small {
  color: #6b7f91;
  font-size: 12px;
  font-weight: 850;
}

.overview-total-row {
  background: rgba(241, 248, 250, .95);
}

html[data-theme="dark"] .completion-page .panel-card {
  background:
    linear-gradient(180deg, rgba(12, 24, 36, .96), rgba(7, 18, 28, .94)),
    radial-gradient(circle at 96% 0%, rgba(73, 179, 166, .12), transparent 34%);
  border-color: rgba(128, 164, 184, .28);
}

html[data-theme="dark"] .period-switch,
html[data-theme="dark"] .completion-definition span,
html[data-theme="dark"] .overview-total-row {
  background: rgba(12, 22, 32, .82);
  border-color: rgba(137, 166, 188, .28);
}

html[data-theme="dark"] .period-switch button {
  color: #c6d3df;
  border-color: rgba(137, 166, 188, .24);
}

html[data-theme="dark"] .completion-bar-row {
  border-bottom-color: rgba(137, 166, 188, .18);
}

html[data-theme="dark"] .completion-bar-row > span,
html[data-theme="dark"] .completion-bar-row > strong,
html[data-theme="dark"] .completion-followup-list strong {
  color: #eff7fb;
}

html[data-theme="dark"] .completion-bar-track,
html[data-theme="dark"] .completion-stack,
html[data-theme="dark"] .empty-chart {
  background: rgba(14, 31, 44, .9);
}

html[data-theme="dark"] .completion-followup-list > div {
  background: rgba(10, 24, 35, .82);
  border-color: rgba(137, 166, 188, .24);
}

html[data-theme="dark"] .completion-legend span,
html[data-theme="dark"] .completion-followup-list span,
html[data-theme="dark"] .completion-followup-list small,
html[data-theme="dark"] .empty-chart {
  color: #9fb2c0;
}

@media (max-width: 1480px) {
  .top-nav-inner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 14px;
    padding: 8px 0;
  }

  .top-nav-links {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    width: 100%;
  }

  .top-right-tools {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .admin-badge {
    max-width: min(420px, 42vw);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 1120px) {
  .account-center-page,
  .assignment-page,
  .completion-page {
    width: min(100% - 28px, 980px);
  }

  .account-center-page .org-maintenance-grid,
  .account-center-page .admin-grid {
    grid-template-columns: 1fr;
  }

  .assignment-create-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .completion-toolbar,
  .completion-toolbar + .completion-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .completion-analytics-grid {
    grid-template-columns: 1fr;
  }

  .period-switch {
    grid-column: 1 / -1;
    width: 100%;
  }

  .period-switch button {
    flex: 1;
    min-width: 0;
  }

  .completion-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .account-center-page,
  .assignment-page,
  .completion-page {
    width: min(100% - 18px, 560px);
  }

  .account-center-page .panel-card,
  .assignment-page .panel-card,
  .completion-page .panel-card {
    padding: 20px;
    border-radius: 24px;
  }

  .inline-org-form,
  .assignment-create-grid,
  .assignment-filter-grid,
  .completion-toolbar,
  .completion-toolbar + .completion-toolbar,
  .completion-analytics-grid,
  .completion-kpi-grid {
    grid-template-columns: 1fr;
  }

  .completion-bar-row {
    grid-template-columns: 1fr;
  }

  .completion-bar-row > strong {
    text-align: left;
  }

  .completion-bar-row > small {
    grid-column: auto;
  }

  .password-field {
    grid-template-columns: 1fr;
  }

  .password-field button {
    width: 100%;
  }

  .assignment-method-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assignment-page .toolbar-row {
    align-items: stretch;
  }

  .assignment-page .toolbar-row button,
  .assignment-page .toolbar-row .primary-action {
    width: 100%;
  }

  .assignment-public-page .student-theme-dock {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    transform: scale(.9);
    transform-origin: top right;
  }
}

/* Final shell navigation guard: keep growing role/tool entries from clipping. */
.top-nav-inner {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 16px;
  padding-block: 8px;
}

.top-nav-brand {
  grid-column: 1;
  grid-row: 1;
}

.top-right-tools {
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-end;
  min-width: 0;
}

.top-nav-links {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-content: flex-start;
  overflow-x: auto;
  width: 100%;
  padding: 2px 2px 5px;
}

.top-nav-links a {
  flex: 0 0 auto;
}

.admin-badge {
  min-width: 0;
  max-width: min(520px, 44vw);
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-switch {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .top-nav-brand,
  .top-right-tools,
  .top-nav-links {
    grid-column: 1;
    grid-row: auto;
  }

  .top-right-tools {
    justify-content: stretch;
  }

  .theme-switch {
    justify-self: end;
  }
}

/* Unified product polish: keep every teacher/student surface on the same hierarchy. */
:root {
  --tt-primary: #087f73;
  --tt-primary-strong: #075f56;
  --tt-accent: #1f7da2;
  --tt-ink: #102033;
  --tt-muted: #607286;
  --tt-subtle: #eef6f6;
  --tt-line: #cfe0ea;
  --tt-panel: rgba(255, 255, 255, .92);
  --tt-focus: 0 0 0 4px rgba(8, 127, 115, .14);
}

body {
  color: var(--tt-ink);
  letter-spacing: 0;
}

.page,
.student-page,
.student-mode,
.paper-upload-page,
.ai-settings-page,
.assignment-page,
.account-center-page {
  width: min(100% - 32px, 1640px);
}

.hero,
.dashboard-hero,
.compact-hero {
  border: 1px solid rgba(193, 214, 226, .86);
  border-radius: clamp(20px, 2vw, 28px);
  box-shadow: 0 24px 70px rgba(24, 48, 70, .09);
  overflow: hidden;
}

.hero h1,
.dashboard-hero h1,
.compact-hero h1 {
  color: var(--tt-ink);
  letter-spacing: 0;
}

.hero p,
.dashboard-hero p,
.compact-hero p,
.section-title-row p,
.paper-step-head p {
  color: var(--tt-muted);
  max-width: 900px;
}

.panel,
.panel-card,
.upload-module-panel,
.ai-setting-card,
.ai-status-panel,
.ai-function-map-panel,
.ai-runtime-panel,
.fixed-table-wrap,
.question-card,
.rubric-card,
.recorder {
  border-color: rgba(196, 216, 227, .92);
  box-shadow: 0 16px 48px rgba(25, 52, 74, .07);
}

.panel,
.panel-card,
.upload-module-panel,
.ai-setting-card,
.ai-status-panel,
.ai-function-map-panel,
.ai-runtime-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,253,253,.92));
}

button,
.download,
.primary-action,
input,
select,
textarea {
  letter-spacing: 0;
}

button,
.download,
.primary-action {
  min-height: 42px;
}

button:focus-visible,
.download:focus-visible,
.primary-action:focus-visible,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: var(--tt-focus);
  border-color: rgba(8, 127, 115, .48);
}

.button-row,
.toolbar-row,
.page-actions,
.compact-actions {
  gap: 10px;
}

.clean-table th,
.clean-table td,
.fixed-table-wrap th,
.fixed-table-wrap td {
  line-height: 1.45;
}

.clean-table th,
.fixed-table-wrap th {
  color: #53677c;
  background: rgba(243, 248, 250, .92);
}

.upload-center-selector {
  gap: 18px;
}

.upload-center-tab {
  min-height: 150px;
  border-color: rgba(195, 215, 226, .92);
  box-shadow: 0 18px 46px rgba(24, 52, 74, .075);
}

.upload-center-tab strong {
  color: var(--tt-ink);
}

.upload-center-tab.active {
  border-color: rgba(8, 127, 115, .42);
  box-shadow: 0 22px 56px rgba(8, 127, 115, .13);
}

.upload-center-tab.disabled {
  cursor: not-allowed;
  opacity: .66;
  filter: grayscale(.18);
}

.runtime-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.runtime-control-grid label {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(201, 220, 231, .95);
  border-radius: 18px;
  background: rgba(250, 253, 253, .9);
}

.runtime-control-grid span {
  color: var(--tt-ink);
  font-weight: 900;
}

.runtime-control-grid input {
  width: 100%;
  max-width: 160px;
}

.runtime-control-grid small,
.small-text {
  color: var(--tt-muted);
}

.question-voice-panel {
  align-items: center;
  gap: 14px;
}

.voice-speed-control,
.audio-review-control label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--tt-muted);
  font-size: 13px;
  font-weight: 900;
}

.voice-speed-control select,
.audio-review-control select {
  min-width: 82px;
  min-height: 38px;
  padding: 6px 28px 6px 10px;
}

.audio-review-control {
  display: grid;
  gap: 8px;
  min-width: min(360px, 100%);
}

.audio-review-control audio {
  width: min(360px, 100%);
}

.assignment-public-page .submit-card,
.assignment-public-page .student-card,
.student-mode .student-shell,
.student-mode .practice-card,
.student-mode .question-card {
  border-color: rgba(195, 215, 226, .9);
  box-shadow: 0 16px 42px rgba(24, 52, 74, .07);
}

.student-mode .record-btn,
.assignment-public-page .submit-btn,
.student-mode .primary,
.assignment-public-page .primary {
  background: linear-gradient(135deg, var(--tt-primary), var(--tt-accent));
  box-shadow: 0 18px 36px rgba(8, 127, 115, .16);
}

@media (max-width: 900px) {
  .page,
  .student-page,
  .student-mode,
  .paper-upload-page,
  .ai-settings-page,
  .assignment-page,
  .account-center-page {
    width: min(100% - 20px, 760px);
  }

  .runtime-control-grid {
    grid-template-columns: 1fr;
  }

  .question-voice-panel {
    align-items: stretch;
  }

  .voice-speed-control {
    width: 100%;
    justify-content: space-between;
  }
}

/* v14 data-system polish: denser BI-style surfaces, clearer scan paths, calmer color. */
:root {
  --tt-primary: #087f73;
  --tt-accent: #1f7da2;
  --tt-warning: #d9902f;
  --tt-info: #7167c9;
  --tt-ink: #102033;
  --tt-muted: #5d6f83;
  --tt-subtle: #eef6f6;
  --tt-line: #cfe0ea;
  --tt-panel: rgba(255, 255, 255, .94);
  --tt-focus: 0 0 0 4px rgba(8, 127, 115, .13);
}

html[data-theme="dark"] {
  --tt-primary: #44d5ac;
  --tt-accent: #80b7ef;
  --tt-warning: #efc96b;
  --tt-info: #aba4ff;
  --tt-ink: #eff7fb;
  --tt-muted: #9fb2c0;
  --tt-subtle: rgba(14, 31, 44, .9);
  --tt-line: rgba(126, 158, 178, .28);
  --tt-panel: rgba(9, 18, 28, .92);
}

.shell-page,
.paper-upload-page,
.ai-settings-page,
.dashboard-page {
  background:
    linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,0) 260px);
}

.hero-card.compact-hero,
.dashboard-hero {
  min-height: 188px;
  border-radius: 24px;
  box-shadow: 0 22px 60px rgba(23, 51, 74, .075);
}

.hero-card.compact-hero h1,
.dashboard-hero h1 {
  font-size: clamp(36px, 4vw, 56px);
}

.section-heading {
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(207, 224, 234, .72);
}

.section-heading h2 {
  margin-bottom: 4px;
}

.section-heading p {
  margin-top: 0;
}

.panel-card,
.panel,
.chart-card,
.upload-module-panel,
.fixed-table-wrap {
  border-radius: 20px;
  border-color: rgba(196, 216, 227, .9);
  box-shadow: 0 14px 42px rgba(23, 51, 74, .06);
}

.toolbar-row {
  align-items: end;
}

.search-field input,
.search-field select,
.toolbar-row input,
.toolbar-row select {
  min-height: 44px;
}

.assignment-insight-grid {
  gap: 14px;
}

.assignment-insight-card {
  position: relative;
  min-height: 118px;
  overflow: hidden;
  border-radius: 18px;
}

.assignment-insight-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--tt-primary), var(--tt-accent), var(--tt-warning));
}

.assignment-insight-card strong {
  font-variant-numeric: tabular-nums;
}

.fixed-table-wrap {
  background: rgba(255, 255, 255, .78);
}

.clean-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.clean-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 12px;
  letter-spacing: 0;
}

.clean-table td {
  color: #24384d;
}

.clean-table tbody tr:nth-child(even) td {
  background: rgba(248, 252, 252, .62);
}

.clean-table tbody tr:hover td {
  background: rgba(235, 247, 247, .82);
}

.status-pill {
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .shell-page,
html[data-theme="dark"] .paper-upload-page,
html[data-theme="dark"] .ai-settings-page,
html[data-theme="dark"] .dashboard-page {
  background: transparent;
}

html[data-theme="dark"] .section-heading {
  border-bottom-color: rgba(126, 158, 178, .22);
}

html[data-theme="dark"] .fixed-table-wrap {
  background: rgba(6, 15, 24, .74);
}

html[data-theme="dark"] .clean-table td {
  color: #dcebf3;
}

html[data-theme="dark"] .clean-table tbody tr:nth-child(even) td {
  background: rgba(10, 24, 35, .46);
}

html[data-theme="dark"] .clean-table tbody tr:hover td {
  background: rgba(18, 42, 56, .72);
}

/* v15 module art direction: each workspace gets a distinct, restrained data-system identity. */
body {
  --module-primary: #0b7f70;
  --module-secondary: #2f78a3;
  --module-accent: #d0a141;
  --module-ink: #102033;
  --module-soft: rgba(232, 246, 244, .72);
  --module-tint: rgba(242, 249, 249, .94);
  --module-line: rgba(123, 178, 185, .34);
  --module-shadow: rgba(24, 86, 91, .14);
  --module-hero-image: url("/static/assets/ui/teacher-hero-v2.jpg");
}

body.assignment-publish-page {
  --module-primary: #236fa4;
  --module-secondary: #0b8793;
  --module-accent: #d7a13a;
  --module-soft: rgba(232, 243, 251, .78);
  --module-tint: rgba(244, 249, 252, .96);
  --module-line: rgba(85, 142, 185, .36);
  --module-shadow: rgba(35, 111, 164, .14);
}

body.assignment-manage-page {
  --module-primary: #087f73;
  --module-secondary: #395f8e;
  --module-accent: #d38b3a;
  --module-soft: rgba(228, 246, 243, .76);
  --module-tint: rgba(243, 250, 248, .96);
  --module-line: rgba(73, 156, 147, .38);
  --module-shadow: rgba(8, 127, 115, .15);
}

body.completion-overview-page {
  --module-primary: #3757a8;
  --module-secondary: #148896;
  --module-accent: #d49a37;
  --module-soft: rgba(235, 240, 253, .8);
  --module-tint: rgba(246, 248, 253, .96);
  --module-line: rgba(94, 116, 184, .34);
  --module-shadow: rgba(55, 87, 168, .14);
}

body.upload-center-page {
  --module-primary: #0b8a67;
  --module-secondary: #297da3;
  --module-accent: #c88c2f;
  --module-soft: rgba(231, 247, 241, .82);
  --module-tint: rgba(246, 251, 248, .96);
  --module-line: rgba(76, 160, 127, .38);
  --module-shadow: rgba(11, 138, 103, .16);
  --module-hero-image: url("/static/assets/ui/upload-center.jpg");
}

body.question-images-page {
  --module-primary: #2b78b4;
  --module-secondary: #0e8c8b;
  --module-accent: #de8e3d;
  --module-soft: rgba(232, 243, 252, .82);
  --module-tint: rgba(246, 250, 253, .96);
  --module-line: rgba(75, 142, 190, .34);
  --module-shadow: rgba(43, 120, 180, .14);
}

body.ai-console-page {
  --module-primary: #6957bf;
  --module-secondary: #168999;
  --module-accent: #36a982;
  --module-soft: rgba(240, 237, 253, .78);
  --module-tint: rgba(248, 247, 253, .96);
  --module-line: rgba(121, 105, 196, .34);
  --module-shadow: rgba(105, 87, 191, .15);
}

body.account-admin-page,
body.account-settings-page {
  --module-primary: #3f6f87;
  --module-secondary: #0c8074;
  --module-accent: #8a79c8;
  --module-soft: rgba(235, 244, 247, .78);
  --module-tint: rgba(247, 250, 251, .96);
  --module-line: rgba(96, 139, 158, .34);
  --module-shadow: rgba(63, 111, 135, .13);
}

body.ops-center-page {
  --module-primary: #4d5e75;
  --module-secondary: #0b7f73;
  --module-accent: #d8902f;
  --module-soft: rgba(239, 243, 247, .8);
  --module-tint: rgba(248, 250, 251, .96);
  --module-line: rgba(111, 128, 148, .36);
  --module-shadow: rgba(77, 94, 117, .14);
}

body.assignment-publish-page,
body.assignment-manage-page,
body.completion-overview-page,
body.upload-center-page,
body.question-images-page,
body.ai-console-page,
body.account-admin-page,
body.account-settings-page,
body.ops-center-page {
  background:
    linear-gradient(180deg, var(--module-soft) 0, rgba(255,255,255,0) 360px),
    linear-gradient(90deg, rgba(255,255,255,.64), var(--module-tint) 48%, rgba(255,255,255,.76)),
    #f5f9fa;
}

body.assignment-publish-page .top-nav-links a.active,
body.assignment-manage-page .top-nav-links a.active,
body.completion-overview-page .top-nav-links a.active,
body.upload-center-page .top-nav-links a.active,
body.question-images-page .top-nav-links a.active,
body.ai-console-page .top-nav-links a.active,
body.account-admin-page .top-nav-links a.active,
body.account-settings-page .top-nav-links a.active,
body.ops-center-page .top-nav-links a.active {
  background: linear-gradient(135deg, var(--module-primary), var(--module-secondary));
  border-color: color-mix(in srgb, var(--module-primary) 72%, white);
  box-shadow: 0 14px 28px var(--module-shadow);
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .hero,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .dashboard-hero,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .hero-card.compact-hero {
  position: relative;
  border-color: var(--module-line);
  background:
    linear-gradient(90deg, rgba(255,255,255,.985) 0%, rgba(255,255,255,.94) 43%, rgba(255,255,255,.64) 65%, rgba(255,255,255,.18) 100%),
    linear-gradient(135deg, color-mix(in srgb, var(--module-primary) 12%, transparent), transparent 58%),
    var(--module-hero-image) right center / cover no-repeat,
    var(--tt-surface);
  box-shadow: 0 24px 64px var(--module-shadow);
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .hero::before,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .dashboard-hero::before,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .hero-card.compact-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, var(--module-primary), var(--module-secondary) 58%, var(--module-accent));
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .hero-card.compact-hero::after,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .dashboard-hero::after,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .hero::after {
  background:
    linear-gradient(115deg, rgba(255,255,255,.38), rgba(255,255,255,0) 44%),
    repeating-linear-gradient(90deg, rgba(16,32,51,.035) 0 1px, transparent 1px 84px);
  pointer-events: none;
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .brand,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .hero-card.compact-hero .brand {
  color: var(--module-primary);
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .section-orb {
  background: linear-gradient(135deg, var(--module-primary), var(--module-secondary));
  box-shadow: 0 10px 22px var(--module-shadow);
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .panel-card,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .panel,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .chart-card,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .upload-module-panel,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .ai-setting-card,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .ai-status-panel,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .ai-function-map-panel,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .ai-runtime-panel,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .fixed-table-wrap {
  border-color: color-mix(in srgb, var(--module-line) 82%, white);
  box-shadow: 0 16px 42px rgba(26, 56, 82, .055);
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .panel-card:not(.assignment-insight-card):not(.completion-chart-card),
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .panel,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .upload-module-panel,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .ai-status-panel,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .ai-runtime-panel {
  position: relative;
  overflow: hidden;
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .panel-card:not(.assignment-insight-card):not(.completion-chart-card)::before,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .panel::before,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .upload-module-panel::before,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .ai-status-panel::before,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .ai-runtime-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--module-primary), var(--module-secondary), var(--module-accent));
  opacity: .82;
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .primary-action,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) button.primary-action,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .download:not(.secondary):not(.compact-link) {
  background: linear-gradient(135deg, var(--module-primary), var(--module-secondary));
  box-shadow: 0 16px 34px var(--module-shadow);
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .period-switch button.active,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .published-view-toggle button.active,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .question-images-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .upload-center-tab.active {
  border-color: color-mix(in srgb, var(--module-primary) 52%, white);
  box-shadow: 0 20px 46px var(--module-shadow);
}

.assignment-insight-card::before {
  background: linear-gradient(90deg, var(--module-primary), var(--module-secondary), var(--module-accent));
}

.completion-bar-row,
.completion-followup-list > div {
  border-color: color-mix(in srgb, var(--module-line) 78%, white);
}

.upload-center-tab[data-upload-center="task"],
.upload-center-tab[data-published-view="task"] {
  --center-accent: #0b8a67;
}

.upload-center-tab[data-upload-center="oral"],
.upload-center-tab[data-published-view="oral"] {
  --center-accent: #2b78b4;
}

.upload-center-tab[data-upload-center="student"] {
  --center-accent: #8a79c8;
}

.upload-center-tab.active::before {
  background: linear-gradient(180deg, var(--center-accent), color-mix(in srgb, var(--center-accent) 58%, var(--module-accent)));
}

.question-manager-page .filters-panel,
.ai-settings-page .ai-status-panel,
.account-center-page .org-card,
.ops-center-page .ops-grid .panel-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.97), color-mix(in srgb, var(--module-soft) 36%, white)),
    var(--tt-surface);
}

.ops-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}

.ops-action-row .primary-action.compact-btn {
  min-height: 36px;
  padding: 8px 14px;
}

.ops-action-row .inline-message {
  margin: 0;
  flex: 1 1 240px;
}

.ai-provider-card,
.ai-function-card,
.ops-metric,
.ops-note-grid > div,
.org-list-row,
.account-profile-card {
  border-color: color-mix(in srgb, var(--module-line) 84%, white);
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), color-mix(in srgb, var(--module-soft) 42%, white));
}

.status-pill.ok {
  background: color-mix(in srgb, var(--module-primary) 14%, white);
  color: color-mix(in srgb, var(--module-primary) 82%, #102033);
}

.progress-line span {
  background: linear-gradient(90deg, var(--module-primary), var(--module-secondary));
}

html[data-theme="dark"] body.assignment-publish-page,
html[data-theme="dark"] body.assignment-manage-page,
html[data-theme="dark"] body.completion-overview-page,
html[data-theme="dark"] body.upload-center-page,
html[data-theme="dark"] body.question-images-page,
html[data-theme="dark"] body.ai-console-page,
html[data-theme="dark"] body.account-admin-page,
html[data-theme="dark"] body.account-settings-page,
html[data-theme="dark"] body.ops-center-page {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--module-primary) 20%, #071118) 0, #071118 360px),
    #071118;
}

html[data-theme="dark"] .hero,
html[data-theme="dark"] .dashboard-hero,
html[data-theme="dark"] .hero-card.compact-hero {
  background:
    linear-gradient(90deg, rgba(7,17,24,.97) 0%, rgba(7,17,24,.9) 52%, rgba(7,17,24,.58) 100%),
    linear-gradient(135deg, color-mix(in srgb, var(--module-primary) 22%, transparent), transparent 58%),
    var(--module-hero-image) right center / cover no-repeat,
    var(--tt-surface);
  border-color: color-mix(in srgb, var(--module-primary) 36%, rgba(126, 158, 178, .28));
}

html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .upload-module-panel,
html[data-theme="dark"] .ai-setting-card,
html[data-theme="dark"] .ai-status-panel,
html[data-theme="dark"] .ai-function-map-panel,
html[data-theme="dark"] .ai-runtime-panel,
html[data-theme="dark"] .fixed-table-wrap,
html[data-theme="dark"] .ai-provider-card,
html[data-theme="dark"] .ai-function-card,
html[data-theme="dark"] .ops-metric,
html[data-theme="dark"] .ops-note-grid > div,
html[data-theme="dark"] .org-list-row,
html[data-theme="dark"] .account-profile-card {
  border-color: color-mix(in srgb, var(--module-primary) 28%, rgba(126, 158, 178, .28));
}

body.assignment-publish-page .hero-card.compact-hero,
body.assignment-manage-page .hero-card.compact-hero,
body.completion-overview-page .hero-card.compact-hero,
body.account-admin-page .hero-card.compact-hero,
body.account-settings-page .hero-card.compact-hero,
body.ops-center-page .hero-card.compact-hero,
body.upload-center-page .dashboard-hero,
body.question-images-page .dashboard-hero,
body.ai-console-page .dashboard-hero {
  border-color: var(--module-line);
  background:
    linear-gradient(90deg, rgba(255,255,255,.985) 0%, rgba(255,255,255,.94) 43%, rgba(255,255,255,.64) 65%, rgba(255,255,255,.18) 100%),
    linear-gradient(135deg, color-mix(in srgb, var(--module-primary) 12%, transparent), transparent 58%),
    var(--module-hero-image) right center / cover no-repeat,
    var(--tt-surface);
  box-shadow: 0 24px 64px var(--module-shadow);
}

body.assignment-publish-page .panel-card,
body.assignment-publish-page .panel,
body.assignment-manage-page .panel-card,
body.assignment-manage-page .panel,
body.completion-overview-page .panel-card,
body.completion-overview-page .panel,
body.upload-center-page .panel-card,
body.upload-center-page .panel,
body.upload-center-page .upload-module-panel,
body.question-images-page .panel-card,
body.question-images-page .panel,
body.ai-console-page .panel-card,
body.ai-console-page .panel,
body.ai-console-page .ai-status-panel,
body.ai-console-page .ai-setting-card,
body.ai-console-page .ai-function-map-panel,
body.ai-console-page .ai-runtime-panel,
body.account-admin-page .panel-card,
body.account-settings-page .panel-card,
body.ops-center-page .panel-card {
  border-color: color-mix(in srgb, var(--module-line) 82%, white);
}

body.upload-center-page .dashboard-hero::before,
body.question-images-page .dashboard-hero::before,
body.ai-console-page .dashboard-hero::before {
  background: linear-gradient(180deg, var(--module-primary), var(--module-secondary) 58%, var(--module-accent));
}

body.upload-center-page .dashboard-hero .brand,
body.question-images-page .dashboard-hero .brand,
body.ai-console-page .dashboard-hero .brand {
  color: var(--module-primary);
}

html[data-theme="dark"] body.assignment-publish-page .hero-card.compact-hero,
html[data-theme="dark"] body.assignment-manage-page .hero-card.compact-hero,
html[data-theme="dark"] body.completion-overview-page .hero-card.compact-hero,
html[data-theme="dark"] body.account-admin-page .hero-card.compact-hero,
html[data-theme="dark"] body.account-settings-page .hero-card.compact-hero,
html[data-theme="dark"] body.ops-center-page .hero-card.compact-hero,
html[data-theme="dark"] body.upload-center-page .dashboard-hero,
html[data-theme="dark"] body.question-images-page .dashboard-hero,
html[data-theme="dark"] body.ai-console-page .dashboard-hero {
  background:
    linear-gradient(90deg, rgba(7,17,24,.97) 0%, rgba(7,17,24,.9) 52%, rgba(7,17,24,.58) 100%),
    linear-gradient(135deg, color-mix(in srgb, var(--module-primary) 22%, transparent), transparent 58%),
    var(--module-hero-image) right center / cover no-repeat,
    var(--tt-surface);
  border-color: color-mix(in srgb, var(--module-primary) 36%, rgba(126, 158, 178, .28));
}

/* v16 flat product art direction: calmer enterprise UI, less decoration, clearer hierarchy. */
:root {
  --flat-bg: #f5f7fa;
  --flat-surface: #ffffff;
  --flat-surface-soft: #f8fafc;
  --flat-surface-tint: #eef6f5;
  --flat-border: #d8e3eb;
  --flat-border-strong: #b8c9d6;
  --flat-text: #102033;
  --flat-muted: #657789;
  --flat-subtle: #8795a4;
  --flat-primary: #087f73;
  --flat-primary-strong: #06655f;
  --flat-info: #276f9f;
  --flat-warning: #b97921;
  --flat-danger: #c43c47;
  --flat-radius-xl: 18px;
  --flat-radius-lg: 14px;
  --flat-radius-md: 10px;
  --flat-radius-sm: 8px;
  --flat-focus: 0 0 0 3px rgba(8, 127, 115, .14);
  --shadow: 0 1px 2px rgba(16, 32, 51, .04);
  --shadow-soft: 0 1px 2px rgba(16, 32, 51, .035);
  --shadow-card: 0 1px 2px rgba(16, 32, 51, .04);
  --radius-xl: var(--flat-radius-xl);
  --radius-lg: var(--flat-radius-lg);
  --radius-md: var(--flat-radius-md);
  --tt-bg: var(--flat-bg);
  --tt-surface: var(--flat-surface);
  --tt-surface-soft: var(--flat-surface-soft);
  --tt-border: var(--flat-border);
  --tt-border-strong: var(--flat-border-strong);
  --tt-text: var(--flat-text);
  --tt-ink: var(--flat-text);
  --tt-muted: var(--flat-muted);
  --tt-line: var(--flat-border);
  --tt-panel: var(--flat-surface);
  --tt-primary: var(--flat-primary);
  --tt-accent: var(--flat-info);
  --tt-warning: var(--flat-warning);
  --tt-focus: var(--flat-focus);
}

html[data-theme="dark"] {
  --flat-bg: #071118;
  --flat-surface: #0d1823;
  --flat-surface-soft: #101f2b;
  --flat-surface-tint: #112922;
  --flat-border: rgba(126, 158, 178, .28);
  --flat-border-strong: rgba(154, 184, 204, .42);
  --flat-text: #eef6fb;
  --flat-muted: #9fb0be;
  --flat-subtle: #8194a4;
  --flat-primary: #44d5ac;
  --flat-primary-strong: #6ce5c4;
  --flat-info: #82b9ef;
  --flat-warning: #efc96b;
  --flat-danger: #ff8c95;
  --flat-focus: 0 0 0 3px rgba(68, 213, 172, .18);
  --shadow: none;
  --shadow-soft: none;
  --shadow-card: none;
}

html,
body {
  background: var(--flat-bg) !important;
}

body {
  color: var(--flat-text);
  letter-spacing: 0;
}

body.assignment-publish-page,
body.assignment-manage-page,
body.completion-overview-page,
body.upload-center-page,
body.question-images-page,
body.ai-console-page,
body.account-admin-page,
body.account-settings-page,
body.ops-center-page {
  background: var(--flat-bg) !important;
}

.page,
.student-page,
.student-mode,
.shell-page,
.paper-upload-page,
.ai-settings-page,
.assignment-page,
.account-center-page,
.ops-center-page {
  width: min(100% - 32px, 1600px);
}

.top-module-nav {
  background: var(--flat-surface) !important;
  border-bottom: 1px solid var(--flat-border) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.top-nav-inner {
  min-height: 68px;
}

.top-nav-brand {
  color: var(--flat-text) !important;
}

.top-nav-brand::before {
  width: 32px;
  height: 32px;
  border-radius: var(--flat-radius-sm);
  background: var(--module-primary, var(--flat-primary)) !important;
  box-shadow: none !important;
}

.top-nav-brand::after,
.brand,
.hero-card.compact-hero .brand,
.dashboard-hero .brand,
.hero .brand {
  color: var(--flat-muted) !important;
}

.top-nav-links {
  gap: 6px;
}

.top-nav-links a {
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--flat-radius-md) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  color: #40566a !important;
  transform: none !important;
}

.top-nav-links a:hover {
  background: var(--flat-surface-soft) !important;
  border-color: var(--flat-border) !important;
  color: var(--flat-text) !important;
}

.top-nav-links a.active,
body.assignment-publish-page .top-nav-links a.active,
body.assignment-manage-page .top-nav-links a.active,
body.completion-overview-page .top-nav-links a.active,
body.upload-center-page .top-nav-links a.active,
body.question-images-page .top-nav-links a.active,
body.ai-console-page .top-nav-links a.active,
body.account-admin-page .top-nav-links a.active,
body.account-settings-page .top-nav-links a.active,
body.ops-center-page .top-nav-links a.active {
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 12%, var(--flat-surface)) !important;
  border-color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 34%, var(--flat-border)) !important;
  color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 84%, var(--flat-text)) !important;
  box-shadow: none !important;
}

.admin-badge,
.logout-link,
.theme-switch,
.theme-choice,
.top-health,
.health,
.page-actions .mini-badge {
  border-radius: var(--flat-radius-md) !important;
  background: var(--flat-surface) !important;
  border: 1px solid var(--flat-border) !important;
  box-shadow: none !important;
  color: var(--flat-text) !important;
}

.theme-choice.active,
.page-actions .mini-badge.ok,
.status-pill.ok,
.badge {
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 11%, var(--flat-surface)) !important;
  color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 86%, var(--flat-text)) !important;
  border-color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 26%, var(--flat-border)) !important;
}

.hero,
.dashboard-hero,
.hero-card,
.hero-card.compact-hero,
.compact-hero {
  min-height: 156px;
  border-radius: var(--flat-radius-xl) !important;
  border: 1px solid var(--flat-border) !important;
  background: var(--flat-surface) !important;
  box-shadow: none !important;
  overflow: hidden;
}

.hero::before,
.dashboard-hero::before,
.hero-card.compact-hero::before {
  width: 4px !important;
  background: var(--module-primary, var(--flat-primary)) !important;
}

.hero::after,
.dashboard-hero::after,
.hero-card.compact-hero::after,
.setup-panel::after,
.assignment-insight-card::after,
.metric-card::after {
  display: none !important;
}

.hero h1,
.dashboard-hero h1,
.hero-card.compact-hero h1,
h1 {
  color: var(--flat-text) !important;
  letter-spacing: 0 !important;
}

.hero p,
.dashboard-hero p,
.hero-card.compact-hero p,
.section-title-row p,
.section-heading p,
.paper-step-head p,
.small-text,
.muted {
  color: var(--flat-muted) !important;
}

.panel,
.panel-card,
.filter-panel,
.records-panel,
.record-panel,
.queue-panel,
.chart-card,
.summary-card,
.metric-card,
.completion-chart-card,
.completion-followup-card,
.assignment-insight-card,
.upload-module-panel,
.upload-center-tab,
.ai-setting-card,
.ai-status-panel,
.ai-function-map-panel,
.ai-runtime-panel,
.ai-provider-card,
.ai-function-card,
.fixed-table-wrap,
.table-wrap,
.question-card,
.paper-question-row,
.paper-image-card,
.paper-drop-zone,
.image-card,
.rubric-card,
.recorder,
.account-profile-card,
.org-card,
.org-list-row,
.ops-card,
.ops-metric,
.ops-note-grid > div,
.student-detail-card,
.student-mode .student-shell,
.student-mode .practice-card,
.assignment-public-page .submit-card,
.assignment-public-page .student-card {
  background: var(--flat-surface) !important;
  border: 1px solid var(--flat-border) !important;
  border-radius: var(--flat-radius-lg) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.panel-card:not(.assignment-insight-card):not(.completion-chart-card)::before,
.panel::before,
.upload-module-panel::before,
.ai-status-panel::before,
.ai-runtime-panel::before,
.assignment-insight-card::before {
  height: 2px !important;
  background: var(--module-primary, var(--flat-primary)) !important;
  opacity: 1 !important;
}

.section-heading {
  border-bottom: 1px solid var(--flat-border) !important;
}

.section-orb,
.panel > h2::before,
.upload-center-tab::before,
.completion-ring,
.metric-icon {
  background: var(--module-primary, var(--flat-primary)) !important;
  box-shadow: none !important;
}

.panel > h2::before,
.section-orb {
  border-radius: var(--flat-radius-sm) !important;
}

input,
select,
textarea,
.stack-form input,
.stack-form select,
.search-field input,
.search-field select,
.toolbar-row input,
.toolbar-row select {
  min-height: 42px;
  border-radius: var(--flat-radius-md) !important;
  background-color: var(--flat-surface) !important;
  background-image: none !important;
  border: 1px solid var(--flat-border) !important;
  color: var(--flat-text) !important;
  box-shadow: none !important;
}

select {
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23657789' d='M4 6h8l-4 4z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 13px 13px !important;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.download:focus-visible,
.primary-action:focus-visible {
  border-color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 55%, var(--flat-border)) !important;
  box-shadow: var(--flat-focus) !important;
  outline: none !important;
}

button,
.download,
.primary-action,
.student-mode .record-btn,
.assignment-public-page .submit-btn,
.student-mode .primary,
.assignment-public-page .primary,
.link-publish-btn {
  min-height: 40px;
  border-radius: var(--flat-radius-md) !important;
  background: var(--module-primary, var(--flat-primary)) !important;
  border: 1px solid var(--module-primary, var(--flat-primary)) !important;
  color: #ffffff !important;
  box-shadow: none !important;
  transform: none !important;
}

button:hover:not(:disabled),
.download:hover,
.primary-action:hover {
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 88%, #000) !important;
  border-color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 88%, #000) !important;
  transform: none !important;
}

button.secondary,
.download.secondary,
.download,
button.tiny,
.compact-link,
.nav-step,
.period-switch button,
.published-view-toggle button,
.upload-center-tab,
.paper-scope-option {
  background: var(--flat-surface) !important;
  border: 1px solid var(--flat-border) !important;
  color: var(--flat-text) !important;
  box-shadow: none !important;
}

button.secondary:hover:not(:disabled),
.download.secondary:hover,
button.tiny:hover:not(:disabled),
.compact-link:hover,
.nav-step:hover,
.period-switch button:hover,
.published-view-toggle button:hover {
  background: var(--flat-surface-soft) !important;
  border-color: var(--flat-border-strong) !important;
}

button.ai-action,
.period-switch button.active,
.published-view-toggle button.active,
.upload-center-tab.active,
.nav-step.active {
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 12%, var(--flat-surface)) !important;
  border-color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 36%, var(--flat-border)) !important;
  color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 86%, var(--flat-text)) !important;
  box-shadow: none !important;
}

button.danger,
button.tiny.danger,
.danger,
.delete-btn {
  background: #fff6f6 !important;
  border-color: #f0c8cc !important;
  color: var(--flat-danger) !important;
  box-shadow: none !important;
}

.clean-table,
.report-table,
.paper-table {
  border-collapse: separate;
  border-spacing: 0;
}

.clean-table th,
.fixed-table-wrap th,
.report-table th,
.paper-table th {
  background: var(--flat-surface-soft) !important;
  color: var(--flat-muted) !important;
  border-bottom: 1px solid var(--flat-border) !important;
  font-weight: 850;
}

.clean-table td,
.fixed-table-wrap td,
.report-table td,
.paper-table td {
  color: #24384d;
  border-bottom: 1px solid #edf2f6 !important;
}

.clean-table tbody tr:nth-child(even) td,
.report-table tbody tr:nth-child(even) td,
.paper-table tbody tr:nth-child(even) td {
  background: #fbfcfd !important;
}

.clean-table tbody tr:hover td,
.report-table tbody tr:hover td,
.paper-table tbody tr:hover td {
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 6%, var(--flat-surface)) !important;
}

.progress,
.progress-line,
.progress-bar,
.completion-bar-track {
  background: #edf2f6 !important;
  box-shadow: none !important;
}

.progress-line span,
.progress-bar span,
.completion-bar-fill {
  background: var(--module-primary, var(--flat-primary)) !important;
  box-shadow: none !important;
}

.status-pill,
.pill,
.tag,
.badge,
.mini-badge,
.question-chip,
.paper-analysis-chip {
  border-radius: 999px !important;
  box-shadow: none !important;
}

.upload-center-tab {
  min-height: 132px;
}

.upload-center-tab,
.published-view-card,
.published-view-toggle .published-view-card,
.published-view-toggle .published-view-card.active {
  background: var(--flat-surface) !important;
  border: 1px solid var(--flat-border) !important;
  box-shadow: none !important;
}

.upload-center-tab::after,
.published-view-card::after {
  display: none !important;
}

.upload-center-tab.active::before {
  background: var(--center-accent, var(--module-primary, var(--flat-primary))) !important;
}

.upload-center-tab.active,
.published-view-toggle .published-view-card.active {
  background: color-mix(in srgb, var(--center-accent, var(--module-primary, var(--flat-primary))) 7%, var(--flat-surface)) !important;
  border-color: color-mix(in srgb, var(--center-accent, var(--module-primary, var(--flat-primary))) 38%, var(--flat-border)) !important;
}

.upload-center-tab strong {
  color: var(--flat-text) !important;
  font-size: 22px;
}

.upload-center-tab span:not(.module-eyebrow),
.upload-center-tab em {
  color: var(--flat-muted) !important;
}

.module-eyebrow {
  background: var(--flat-surface-soft) !important;
  border: 1px solid var(--flat-border) !important;
  color: var(--flat-muted) !important;
}

.upload-center-tab.active .module-eyebrow,
.published-view-toggle .published-view-card.active .module-eyebrow {
  background: color-mix(in srgb, var(--center-accent, var(--module-primary, var(--flat-primary))) 12%, var(--flat-surface)) !important;
  border-color: color-mix(in srgb, var(--center-accent, var(--module-primary, var(--flat-primary))) 30%, var(--flat-border)) !important;
  color: color-mix(in srgb, var(--center-accent, var(--module-primary, var(--flat-primary))) 82%, var(--flat-text)) !important;
}

.hero-card.compact-hero,
.dashboard-hero {
  padding: 34px 38px !important;
}

.hero-card.compact-hero h1,
.dashboard-hero h1 {
  font-size: clamp(34px, 3.5vw, 50px) !important;
}

.paper-image-card.selected,
.paper-drop-zone.has-image {
  border-color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 46%, var(--flat-border)) !important;
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 4%, var(--flat-surface)) !important;
}

.chart-card canvas,
.chart-canvas-wrap {
  background: var(--flat-surface) !important;
  border-color: var(--flat-border) !important;
}

html[data-theme="dark"] .top-nav-links a {
  color: #cddce5 !important;
}

html[data-theme="dark"] .top-nav-links a:hover,
html[data-theme="dark"] .top-nav-links a.active {
  color: var(--flat-primary-strong) !important;
}

html[data-theme="dark"] .clean-table td,
html[data-theme="dark"] .fixed-table-wrap td,
html[data-theme="dark"] .report-table td,
html[data-theme="dark"] .paper-table td {
  color: #dcebf3;
  border-bottom-color: rgba(126, 158, 178, .16) !important;
}

html[data-theme="dark"] .clean-table tbody tr:nth-child(even) td,
html[data-theme="dark"] .report-table tbody tr:nth-child(even) td,
html[data-theme="dark"] .paper-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, .015) !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: var(--flat-surface-soft) !important;
}

@media (max-width: 900px) {
  .page,
  .student-page,
  .student-mode,
  .shell-page,
  .paper-upload-page,
  .ai-settings-page,
  .assignment-page,
  .account-center-page,
  .ops-center-page {
    width: min(100% - 20px, 760px);
  }

  .hero,
  .dashboard-hero,
  .hero-card,
  .hero-card.compact-hero,
  .compact-hero {
    min-height: 132px;
    border-radius: var(--flat-radius-lg) !important;
  }
}

/* v17 90-point polish: compact density, sharper rhythm, premium flat data-system finish. */
:root {
  --pro-bg: #f3f6f8;
  --pro-surface: #ffffff;
  --pro-surface-raised: #fbfcfd;
  --pro-surface-pressed: #f1f5f8;
  --pro-border: #d6e1e9;
  --pro-border-soft: #e7eef3;
  --pro-text: #102033;
  --pro-muted: #657688;
  --pro-faint: #8a98a6;
  --pro-row: #fbfcfd;
  --pro-row-hover: #f2f8f7;
  --pro-shadow: 0 1px 2px rgba(16, 32, 51, .045), 0 8px 24px rgba(16, 32, 51, .035);
  --pro-shadow-soft: 0 1px 2px rgba(16, 32, 51, .035);
  --pro-focus: 0 0 0 3px color-mix(in srgb, var(--module-primary, var(--flat-primary)) 16%, transparent);
}

html[data-theme="dark"] {
  --pro-bg: #071118;
  --pro-surface: #0c1721;
  --pro-surface-raised: #111e2a;
  --pro-surface-pressed: #142635;
  --pro-border: rgba(132, 164, 184, .3);
  --pro-border-soft: rgba(132, 164, 184, .18);
  --pro-text: #eef6fb;
  --pro-muted: #a3b3c0;
  --pro-faint: #8194a4;
  --pro-row: rgba(255, 255, 255, .018);
  --pro-row-hover: rgba(67, 213, 172, .075);
  --pro-shadow: none;
  --pro-shadow-soft: none;
}

html,
body {
  background: var(--pro-bg) !important;
}

body {
  color: var(--pro-text);
}

.page,
.student-page,
.student-mode,
.shell-page,
.paper-upload-page,
.ai-settings-page,
.assignment-page,
.account-center-page,
.ops-center-page {
  width: min(100% - 40px, 1640px);
}

.page,
.shell-page {
  margin-top: 24px;
}

.top-module-nav {
  background: color-mix(in srgb, var(--pro-surface) 94%, transparent) !important;
  border-bottom: 1px solid var(--pro-border) !important;
  box-shadow: 0 1px 0 rgba(16, 32, 51, .025) !important;
}

.top-nav-inner {
  width: min(1640px, calc(100% - 40px));
  min-height: 64px;
  gap: 14px;
}

.top-nav-brand {
  font-size: 17px;
}

.top-nav-brand::before {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.top-nav-brand::after {
  font-size: 12px;
}

.top-nav-links {
  gap: 4px;
}

.top-nav-links a {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 9px !important;
  font-size: 13px;
  font-weight: 820;
}

.top-nav-links a.active,
body.assignment-publish-page .top-nav-links a.active,
body.assignment-manage-page .top-nav-links a.active,
body.completion-overview-page .top-nav-links a.active,
body.upload-center-page .top-nav-links a.active,
body.question-images-page .top-nav-links a.active,
body.ai-console-page .top-nav-links a.active,
body.account-admin-page .top-nav-links a.active,
body.account-settings-page .top-nav-links a.active,
body.ops-center-page .top-nav-links a.active {
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 10%, var(--pro-surface)) !important;
  border-color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 42%, var(--pro-border)) !important;
  color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 82%, var(--pro-text)) !important;
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--module-primary, var(--flat-primary)) 78%, transparent) !important;
}

.admin-badge,
.theme-switch,
.theme-choice,
.top-health,
.health,
.logout-link {
  min-height: 36px;
  border-radius: 10px !important;
}

.hero,
.dashboard-hero,
.hero-card,
.hero-card.compact-hero,
.compact-hero {
  min-height: 144px !important;
  padding: 26px 34px !important;
  border-radius: 16px !important;
  border-color: var(--pro-border) !important;
  background: var(--pro-surface) !important;
  box-shadow: var(--pro-shadow-soft) !important;
}

.hero::before,
.dashboard-hero::before,
.hero-card.compact-hero::before {
  width: 5px !important;
}

body:not(.student-mobile-device) .hero::after,
body:not(.student-mobile-device) .dashboard-hero::after,
body:not(.student-mobile-device) .hero-card.compact-hero::after {
  content: "";
  display: block !important;
  position: absolute;
  inset: 28px 32px auto auto !important;
  width: 210px;
  height: 86px;
  border: 1px solid var(--pro-border-soft);
  border-radius: 14px;
  background:
    linear-gradient(90deg, transparent 0 16px, color-mix(in srgb, var(--module-primary, var(--flat-primary)) 26%, transparent) 16px 28px, transparent 28px 44px),
    repeating-linear-gradient(0deg, transparent 0 15px, rgba(16, 32, 51, .045) 15px 16px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(16, 32, 51, .04) 23px 24px),
    var(--pro-surface-raised);
  opacity: .82;
  pointer-events: none;
}

.hero > *,
.dashboard-hero > *,
.hero-card.compact-hero > * {
  position: relative;
  z-index: 1;
}

.brand,
.hero-card.compact-hero .brand,
.dashboard-hero .brand {
  font-size: 11px;
  font-weight: 880;
  letter-spacing: .24em !important;
}

.hero h1,
.dashboard-hero h1,
.hero-card.compact-hero h1,
h1 {
  margin: 8px 0 8px !important;
  font-size: 42px !important;
  line-height: 1.06 !important;
  font-weight: 920;
}

.hero p,
.dashboard-hero p,
.hero-card.compact-hero p {
  max-width: 720px;
  font-size: 15px !important;
  line-height: 1.68;
  font-weight: 720;
}

.panel,
.panel-card,
.filter-panel,
.records-panel,
.record-panel,
.queue-panel,
.chart-card,
.summary-card,
.metric-card,
.completion-chart-card,
.completion-followup-card,
.assignment-insight-card,
.upload-module-panel,
.upload-center-tab,
.ai-setting-card,
.ai-status-panel,
.ai-function-map-panel,
.ai-runtime-panel,
.ai-provider-card,
.ai-function-card,
.fixed-table-wrap,
.table-wrap,
.question-card,
.paper-question-row,
.paper-image-card,
.paper-drop-zone,
.image-card,
.rubric-card,
.recorder,
.account-profile-card,
.org-card,
.org-list-row,
.ops-card,
.ops-metric,
.ops-note-grid > div,
.student-detail-card {
  border-color: var(--pro-border) !important;
  border-radius: 14px !important;
  background: var(--pro-surface) !important;
  box-shadow: var(--pro-shadow-soft) !important;
}

.shell-page > .panel-card,
.shell-page .admin-grid > .panel-card,
.shell-page .account-settings-grid > .panel-card,
.assignment-page > .panel-card,
.completion-page > .panel-card,
.completion-chart-card,
.upload-module-panel,
.ai-status-panel,
.ai-runtime-panel {
  padding: 24px !important;
}

.panel-card:not(.assignment-insight-card):not(.completion-chart-card)::before,
.panel::before,
.upload-module-panel::before,
.ai-status-panel::before,
.ai-runtime-panel::before,
.assignment-insight-card::before {
  height: 3px !important;
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 86%, white) !important;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--pro-border-soft) !important;
}

.section-heading.compact {
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.section-heading h2,
h2 {
  margin: 0 0 3px;
  font-size: 20px;
  line-height: 1.28;
  color: var(--pro-text);
  font-weight: 900;
}

.section-heading p {
  margin: 0;
  font-size: 13px;
  line-height: 1.58;
  color: var(--pro-muted) !important;
  font-weight: 720;
}

.section-orb,
.panel > h2::before {
  width: 4px !important;
  height: 24px !important;
  flex: 0 0 4px !important;
  border-radius: 999px !important;
  margin-top: 2px;
}

label,
.search-field {
  color: var(--pro-muted);
  font-size: 12px;
  font-weight: 840;
}

.search-field,
.toolbar-row .search-field {
  display: grid;
  gap: 7px;
}

input,
select,
textarea,
.stack-form input,
.stack-form select,
.search-field input,
.search-field select,
.toolbar-row input,
.toolbar-row select {
  min-height: 40px;
  border-radius: 8px !important;
  border-color: #cfdbe5 !important;
  background-color: var(--pro-surface) !important;
  color: var(--pro-text) !important;
  font-size: 14px;
}

textarea {
  padding-top: 11px;
  padding-bottom: 11px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.download:focus-visible,
.primary-action:focus-visible {
  box-shadow: var(--pro-focus) !important;
}

button,
.download,
.primary-action,
.link-publish-btn {
  min-height: 38px;
  border-radius: 8px !important;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 860;
}

.primary-action,
button.primary-action,
.student-mode .record-btn,
.assignment-public-page .submit-btn,
.student-mode .primary,
.assignment-public-page .primary,
.link-publish-btn {
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 94%, #123) !important;
  border-color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 94%, #123) !important;
}

button.secondary,
.download.secondary,
.download,
button.tiny,
.compact-link,
.nav-step,
.period-switch button,
.published-view-toggle button,
.paper-scope-option {
  background: var(--pro-surface) !important;
  border-color: var(--pro-border) !important;
  color: #294259 !important;
}

.toolbar-row,
.button-row,
.page-actions,
.compact-actions {
  gap: 10px;
}

.completion-filter-panel,
.assignment-page > .panel-card:first-of-type,
.paper-upload-page .upload-module-panel {
  background: var(--pro-surface) !important;
}

.completion-toolbar,
.assignment-filter-grid {
  display: grid !important;
  gap: 12px !important;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--pro-border-soft);
  border-radius: 12px;
  background: var(--pro-surface-raised);
}

.completion-toolbar {
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto auto;
}

.completion-toolbar + .completion-toolbar {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.assignment-filter-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.completion-toolbar .search-field,
.assignment-filter-grid .search-field {
  min-width: 0;
}

.period-switch {
  min-height: 40px;
  border-radius: 8px !important;
  background: var(--pro-surface) !important;
  border-color: var(--pro-border) !important;
  box-shadow: none !important;
}

.period-switch button {
  min-height: 40px;
  min-width: 66px;
  border-radius: 0 !important;
}

.period-switch button.active {
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 12%, var(--pro-surface)) !important;
  color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 86%, var(--pro-text)) !important;
}

.completion-definition span,
.module-eyebrow,
.status-pill,
.badge,
.tag,
.pill,
.mini-badge,
.question-chip,
.paper-analysis-chip {
  border-radius: 999px !important;
  background: var(--pro-surface-raised) !important;
  border: 1px solid var(--pro-border) !important;
  color: var(--pro-muted) !important;
}

.assignment-insight-grid {
  gap: 12px !important;
}

.assignment-insight-card {
  min-height: 108px;
  padding: 18px !important;
}

.assignment-insight-card span,
.assignment-insight-card small,
.assignment-insight-card em {
  color: var(--pro-muted) !important;
  font-size: 12px;
  font-weight: 780;
}

.assignment-insight-card strong {
  margin-top: 7px;
  color: var(--pro-text) !important;
  font-size: 30px;
  line-height: 1;
  font-weight: 920;
}

.completion-kpi-grid {
  margin: 16px 0;
}

.completion-analytics-grid {
  gap: 16px;
  margin: 16px 0;
}

.completion-chart-card {
  min-height: 292px;
}

.completion-chart-body {
  gap: 12px;
}

.completion-bar-row {
  grid-template-columns: 82px minmax(180px, 1fr) 66px;
  gap: 8px 12px;
  padding: 11px 0;
  border-bottom-color: var(--pro-border-soft) !important;
}

.completion-bar-row > span,
.completion-bar-row > strong {
  color: var(--pro-text) !important;
}

.completion-bar-row > strong {
  font-size: 16px;
}

.completion-bar-row > small {
  color: var(--pro-muted) !important;
}

.completion-bar-track,
.completion-stack,
.progress,
.progress-line,
.progress-bar,
.completion-bar-track {
  background: #edf2f6 !important;
  box-shadow: none !important;
}

.completion-bar-track {
  height: 10px;
}

.completion-stack {
  height: 18px;
  border-radius: 8px;
}

.completion-followup-list > div {
  border-radius: 12px;
  background: var(--pro-surface-raised) !important;
  border-color: var(--pro-border-soft) !important;
}

.fixed-table-wrap,
.table-wrap {
  border-radius: 12px !important;
  background: var(--pro-surface) !important;
  box-shadow: var(--pro-shadow-soft) !important;
}

.clean-table,
.report-table,
.paper-table {
  font-size: 13px;
  background: var(--pro-surface) !important;
}

.clean-table th,
.fixed-table-wrap th,
.report-table th,
.paper-table th {
  height: 44px;
  padding: 10px 14px !important;
  background: var(--pro-surface-raised) !important;
  color: var(--pro-muted) !important;
  font-size: 12px;
  font-weight: 860;
}

.clean-table td,
.fixed-table-wrap td,
.report-table td,
.paper-table td {
  padding: 12px 14px !important;
  color: #24384d;
  line-height: 1.5;
  border-bottom-color: var(--pro-border-soft) !important;
}

.clean-table tbody tr:nth-child(even) td,
.report-table tbody tr:nth-child(even) td,
.paper-table tbody tr:nth-child(even) td {
  background: var(--pro-row) !important;
}

.clean-table tbody tr:hover td,
.report-table tbody tr:hover td,
.paper-table tbody tr:hover td {
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 6%, var(--pro-surface)) !important;
}

.overview-total-row td {
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 7%, var(--pro-surface)) !important;
  font-weight: 860;
}

.overview-metric-cell {
  gap: 2px;
}

.overview-metric-cell strong {
  color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 88%, var(--pro-text));
  font-size: 17px;
}

.clean-table button,
.row-actions button,
.button-link {
  min-height: 34px;
  border-radius: 8px !important;
  padding: 0 10px;
  font-size: 12px;
}

.upload-center-tab,
.published-view-card,
.published-view-toggle .published-view-card {
  min-height: 116px;
  padding: 18px 20px !important;
  border-radius: 14px !important;
}

.upload-center-tab strong {
  font-size: 21px;
  line-height: 1.18;
}

.upload-center-tab span:not(.module-eyebrow) {
  font-size: 13px;
  line-height: 1.55;
}

.upload-center-tab em {
  font-size: 12px;
}

.upload-center-tab::before,
.published-view-card::before {
  width: 4px !important;
}

.upload-center-tab.active,
.published-view-toggle .published-view-card.active {
  background: color-mix(in srgb, var(--center-accent, var(--module-primary, var(--flat-primary))) 6%, var(--pro-surface)) !important;
}

.material-order-panel,
.blueprint-score-panel,
.assignment-blueprint-panel,
.task-preview-blueprint,
.student-target-picker {
  border-radius: 14px !important;
  background: var(--pro-surface-raised) !important;
  border-color: var(--pro-border) !important;
  box-shadow: none !important;
}

.material-order-item,
.paper-image-card,
.paper-question-row,
.paper-drop-zone {
  border-radius: 12px !important;
  background: var(--pro-surface) !important;
}

.blueprint-score-table-wrap {
  border-radius: 12px !important;
  border-color: var(--pro-border) !important;
  background: var(--pro-surface) !important;
}

.blueprint-score-table th,
.blueprint-score-table td {
  padding: 10px 12px !important;
}

.blueprint-score-table input,
.blueprint-score-table textarea,
.blueprint-summary-field input {
  min-height: 38px;
  border-radius: 8px !important;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c8d5df;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #aebfcb;
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .filter-panel,
html[data-theme="dark"] .records-panel,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .completion-chart-card,
html[data-theme="dark"] .assignment-insight-card,
html[data-theme="dark"] .upload-module-panel,
html[data-theme="dark"] .upload-center-tab,
html[data-theme="dark"] .fixed-table-wrap,
html[data-theme="dark"] .table-wrap {
  background: var(--pro-surface) !important;
  border-color: var(--pro-border) !important;
}

html[data-theme="dark"] .completion-toolbar,
html[data-theme="dark"] .assignment-filter-grid,
html[data-theme="dark"] .completion-definition span,
html[data-theme="dark"] .material-order-panel,
html[data-theme="dark"] .blueprint-score-panel,
html[data-theme="dark"] .assignment-blueprint-panel,
html[data-theme="dark"] .task-preview-blueprint,
html[data-theme="dark"] .student-target-picker {
  background: var(--pro-surface-raised) !important;
  border-color: var(--pro-border) !important;
}

html[data-theme="dark"] .clean-table td,
html[data-theme="dark"] .fixed-table-wrap td,
html[data-theme="dark"] .report-table td,
html[data-theme="dark"] .paper-table td {
  color: #dcebf3;
}

@media (max-width: 1120px) {
  .completion-toolbar,
  .completion-toolbar + .completion-toolbar,
  .assignment-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .period-switch {
    grid-column: 1 / -1;
    width: 100%;
  }

  body:not(.student-mobile-device) .hero::after,
  body:not(.student-mobile-device) .dashboard-hero::after,
  body:not(.student-mobile-device) .hero-card.compact-hero::after {
    width: 150px;
    inset: 28px 22px auto auto !important;
  }
}

@media (max-width: 760px) {
  .page,
  .student-page,
  .student-mode,
  .shell-page,
  .paper-upload-page,
  .ai-settings-page,
  .assignment-page,
  .account-center-page,
  .ops-center-page {
    width: min(100% - 20px, 760px);
  }

  .hero,
  .dashboard-hero,
  .hero-card,
  .hero-card.compact-hero,
  .compact-hero {
    min-height: 128px !important;
    padding: 22px !important;
  }

  body:not(.student-mobile-device) .hero::after,
  body:not(.student-mobile-device) .dashboard-hero::after,
  body:not(.student-mobile-device) .hero-card.compact-hero::after {
    display: none !important;
  }

  .hero h1,
  .dashboard-hero h1,
  .hero-card.compact-hero h1,
  h1 {
    font-size: 34px !important;
  }

  .completion-toolbar,
  .completion-toolbar + .completion-toolbar,
  .assignment-filter-grid {
    grid-template-columns: 1fr !important;
    padding: 12px;
  }

  .assignment-insight-card strong {
    font-size: 26px;
  }

  .completion-bar-row {
    grid-template-columns: 1fr;
  }

  .completion-bar-row > strong,
  .completion-bar-row > small {
    text-align: left;
    grid-column: auto;
  }
}

/* v18 ops layout fix: keep the body full-width and center only the ops workspace. */
body.ops-center-page {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  overflow-x: hidden;
}

body.ops-center-page > main.page.shell-page {
  width: min(100% - 48px, 1280px) !important;
  margin: 24px auto 64px !important;
}

body.ops-center-page .ops-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 20px;
  align-items: start;
}

body.ops-center-page .ops-grid.ops-foundation-grid,
body.ops-center-page .ops-grid.ops-maintenance-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.ops-center-page .ops-grid > .panel-card {
  padding: 24px !important;
}

body.ops-center-page .ops-grid > .panel-card:nth-child(3) {
  grid-column: 1 / 2;
}

body.ops-center-page .runtime-metric-path,
body.ops-center-page #runtimeCards .ops-metric-value,
body.ops-center-page #storageTable td:last-child {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 960px) {
  body.ops-center-page > main.page.shell-page {
    width: min(100% - 24px, 760px) !important;
  }

  body.ops-center-page .ops-grid {
    grid-template-columns: 1fr;
  }

  body.ops-center-page .ops-grid.ops-foundation-grid,
  body.ops-center-page .ops-grid.ops-maintenance-grid {
    grid-template-columns: 1fr;
  }

  body.ops-center-page .ops-grid > .panel-card:nth-child(3) {
    grid-column: auto;
  }
}

/* v19 responsive task/report controls: keep dense admin pages usable on smaller laptops. */
@media (max-width: 1180px) {
  .assignment-page .fixed-table-wrap,
  .assignment-page .table-wrap,
  .paper-upload-page .table-wrap {
    overflow-x: auto;
  }

  .assignment-page .clean-table,
  .assignment-page .paper-table,
  .assignment-page .report-table {
    min-width: 860px;
  }

  .assignment-page .row-actions,
  .assignment-page .compact-actions,
  .material-order-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .assignment-page #assignmentTable .row-actions {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .material-preview-stage {
    width: min(100% - 24px, 720px);
    max-height: 84vh;
  }

  .material-preview-stage img {
    max-height: calc(84vh - 76px);
  }

  .material-order-item {
    grid-template-columns: auto 48px minmax(0, 1fr);
  }

  .material-order-actions {
    grid-column: 1 / -1;
  }
}

/* Oral task student page: task-specific copy and calmer practice surface. */
body.oral-assignment-body {
  --module-primary: #0f8b74;
  --oral-task-accent: #b7791f;
  --oral-task-blue: #286f9f;
  --oral-task-line: #c9dde3;
  background:
    linear-gradient(180deg, #f4f8f7 0, #f7faf8 360px, #f2f6f8 100%) !important;
}

.student-mode.oral-assignment-mode {
  max-width: 1500px;
}

.student-mode.oral-assignment-mode::before {
  background:
    linear-gradient(180deg, rgba(247, 250, 248, .98), rgba(242, 246, 248, .98)),
    radial-gradient(circle at 10% 0%, rgba(15, 139, 116, .10), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(183, 121, 31, .12), transparent 30%) !important;
}

.student-mode.oral-assignment-mode .hero {
  min-height: 176px !important;
  background:
    linear-gradient(135deg, #ffffff 0%, #fbfdfb 54%, #f3f8f6 100%) !important;
  border-color: var(--oral-task-line) !important;
}

.student-mode.oral-assignment-mode .hero h1 {
  font-size: clamp(38px, 4.2vw, 54px) !important;
}

.student-mode.oral-assignment-mode .hero p {
  max-width: 680px;
  color: #586d7c !important;
}

body:not(.student-mobile-device) .student-mode.oral-assignment-mode .hero::after {
  width: 250px;
  height: 92px;
  border-color: #dbe8e6 !important;
  background:
    linear-gradient(90deg, transparent 0 20px, rgba(15, 139, 116, .22) 20px 34px, transparent 34px 54px, rgba(183, 121, 31, .16) 54px 64px, transparent 64px),
    repeating-linear-gradient(0deg, transparent 0 15px, rgba(16, 32, 51, .045) 15px 16px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(16, 32, 51, .04) 23px 24px),
    #fbfdfb !important;
}

.student-mode.oral-assignment-mode .layout {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 20px;
}

.student-mode.oral-assignment-mode .setup-panel,
.student-mode.oral-assignment-mode .test-panel {
  background: #ffffff !important;
  border-color: var(--oral-task-line) !important;
}

.student-mode.oral-assignment-mode .setup-panel {
  top: 18px;
}

.student-mode.oral-assignment-mode .setup-panel::before,
.student-mode.oral-assignment-mode .test-panel::before {
  background: var(--module-primary) !important;
}

.student-mode.oral-assignment-mode .setup-panel h2::before {
  background: var(--module-primary) !important;
}

.student-mode.oral-assignment-mode label {
  color: #536879 !important;
}

.student-mode.oral-assignment-mode select,
.student-mode.oral-assignment-mode input {
  border-color: #cddfe6 !important;
  background-color: #fbfdfd !important;
}

.student-mode.oral-assignment-mode .student-roster-note {
  background: #f3faf6 !important;
  border-color: #cfe6dc !important;
  color: #42685d !important;
}

.student-mode.oral-assignment-mode #startBtn,
.student-mode.oral-assignment-mode .primary-record {
  background: #0f8b74 !important;
  border-color: #0f8b74 !important;
}

.student-mode.oral-assignment-mode #startBtn:hover:not(:disabled),
.student-mode.oral-assignment-mode .primary-record:hover:not(:disabled) {
  background: #0b705e !important;
  border-color: #0b705e !important;
}

.student-mode.oral-assignment-mode .question-card {
  padding: 30px 34px !important;
  background:
    linear-gradient(135deg, #ffffff 0%, #fbfdfc 68%, #f7faf9 100%) !important;
  border-color: #c8dde2 !important;
}

.student-mode.oral-assignment-mode .question-card::before {
  top: 26px !important;
  bottom: 26px !important;
  width: 5px !important;
  background: linear-gradient(180deg, #0f8b74, #286f9f) !important;
}

.student-mode.oral-assignment-mode .badge {
  background: #edf7f4 !important;
  border-color: #cfe6dc !important;
  color: #0f7665 !important;
}

.student-mode.oral-assignment-mode .progress {
  background: #f2f6f8 !important;
  border-color: #d8e5ea !important;
  color: #314a5f !important;
}

.student-mode.oral-assignment-mode .question-label {
  color: #657789 !important;
  font-weight: 900;
}

.student-mode.oral-assignment-mode #qTitle {
  max-width: 980px;
  font-size: clamp(30px, 3.2vw, 46px) !important;
  line-height: 1.22 !important;
}

.student-mode.oral-assignment-mode .question-voice-panel {
  background: #f4faf8 !important;
  border-color: #cbe3da !important;
}

.student-mode.oral-assignment-mode .question-voice-panel strong {
  color: #0c5f53 !important;
}

.student-mode.oral-assignment-mode .voice-orb {
  background: #e7f4ef !important;
  color: #0f8b74 !important;
  border-color: #c9e4da !important;
}

.student-mode.oral-assignment-mode .rubric-card {
  background: #fff9ed !important;
  border-color: #ecd8b5 !important;
  color: #684f20 !important;
}

.student-mode.oral-assignment-mode .recorder {
  background:
    linear-gradient(180deg, #ffffff, #f8fbfc) !important;
  border-color: #cbdfe7 !important;
}

.student-mode.oral-assignment-mode #timer {
  background: #f6fafb !important;
  border-color: #d7e5eb !important;
  color: #102033 !important;
}

.student-mode.oral-assignment-mode #status {
  color: #0f6d5f !important;
  font-weight: 900;
}

.student-mode.oral-assignment-mode .record-hint {
  color: #667989 !important;
}

body.oral-assignment-body .completion-card {
  border-color: #cbdfe7 !important;
}

body.oral-assignment-body .completion-card::before {
  background: linear-gradient(90deg, #0f8b74, #286f9f, #b7791f) !important;
}

body.oral-assignment-body .completion-medal {
  background: #0f8b74 !important;
}

html[data-theme="dark"] body.oral-assignment-body {
  background: #071118 !important;
}

html[data-theme="dark"] .student-mode.oral-assignment-mode .hero,
html[data-theme="dark"] .student-mode.oral-assignment-mode .setup-panel,
html[data-theme="dark"] .student-mode.oral-assignment-mode .test-panel,
html[data-theme="dark"] .student-mode.oral-assignment-mode .question-card,
html[data-theme="dark"] .student-mode.oral-assignment-mode .recorder {
  background: #0c1721 !important;
  border-color: rgba(132, 164, 184, .30) !important;
}

html[data-theme="dark"] .student-mode.oral-assignment-mode .question-voice-panel {
  background: #10241f !important;
  border-color: rgba(96, 191, 165, .28) !important;
}

html[data-theme="dark"] .student-mode.oral-assignment-mode .rubric-card {
  background: #241d10 !important;
  border-color: rgba(236, 216, 181, .28) !important;
  color: #efd9af !important;
}

html[data-theme="dark"] .student-mode.oral-assignment-mode #timer {
  background: #101d28 !important;
  border-color: rgba(132, 164, 184, .30) !important;
  color: #eef6fb !important;
}

@media (max-width: 1120px) {
  .student-mode.oral-assignment-mode .layout {
    grid-template-columns: 1fr;
  }

  .student-mode.oral-assignment-mode .setup-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .student-mode.oral-assignment-mode {
    width: 100%;
  }

  .student-mode.oral-assignment-mode .hero {
    min-height: 132px !important;
    padding: 20px 18px !important;
  }

  .student-mode.oral-assignment-mode .hero h1 {
    max-width: 68%;
    font-size: clamp(31px, 8.4vw, 40px) !important;
  }

  .student-mode.oral-assignment-mode .hero p {
    max-width: 70%;
    font-size: 13px !important;
  }

  .student-mode.oral-assignment-mode .question-card {
    padding: 16px 16px 18px !important;
  }

  .student-mode.oral-assignment-mode #qTitle {
    font-size: clamp(24px, 7vw, 34px) !important;
  }

  .student-mode.oral-assignment-mode .record-actions {
    grid-template-columns: 72px minmax(0, 1fr) 72px;
  }
}

/* 2026-05-16 focused UI pass: keep high-frequency task flows compact and explicit. */
.upload-center-tab {
  min-height: 72px !important;
  padding: 14px 18px !important;
  border-radius: 14px !important;
  align-content: center !important;
  gap: 4px !important;
}

.upload-center-tab strong {
  font-size: 20px !important;
}

body.upload-center-page .upload-center-tab span:not(.module-eyebrow),
body.upload-center-page .upload-center-tab em {
  display: none !important;
}

body.upload-center-page .upload-center-tab::after {
  width: 28px !important;
  height: 28px !important;
  border-radius: 10px !important;
  right: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

body:not(.upload-center-page) .upload-center-tab em {
  display: none !important;
}

.task-hidden-advanced-fields {
  display: none !important;
}

.task-optional-details {
  border: 1px solid #d5e5ec;
  border-radius: 14px;
  background: #f8fbfc;
  padding: 0;
  overflow: hidden;
}

.task-optional-details summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  color: #102033;
  font-weight: 900;
  list-style: none;
}

.task-optional-details summary::-webkit-details-marker {
  display: none;
}

.task-optional-details summary::after {
  content: "展开";
  color: #426176;
  border: 1px solid #c9dce6;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: #fff;
}

.task-optional-details[open] summary::after {
  content: "收起";
}

.task-optional-details summary small {
  color: #6c8090;
  font-weight: 760;
}

.task-optional-details label {
  display: block;
  padding: 0 16px 14px;
}

.blueprint-status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid #cbdfe7;
  background: #f2f7fa;
  color: #496274;
}

.blueprint-status-pill.is-ready {
  border-color: #b9dfd3;
  background: #edf8f4;
  color: #08745f;
}

.blueprint-status-pill.is-running {
  border-color: #ead59c;
  background: #fff8e7;
  color: #8b5d12;
}

.blueprint-status-pill.is-failed {
  border-color: #f0b8b8;
  background: #fff1f1;
  color: #b33434;
}

.task-library-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
}

body.upload-center-page .task-library-card {
  padding: 16px 18px !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,252,253,.94)) !important;
}

html[data-theme="dark"] body.upload-center-page .task-library-card {
  border-color: rgba(95, 139, 164, .34) !important;
  background: linear-gradient(180deg, rgba(12, 29, 42, .96), rgba(8, 24, 35, .94)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04) !important;
}

html[data-theme="dark"] body.upload-center-page .task-library-card.is-editing {
  border-color: rgba(74, 210, 174, .52) !important;
  background: linear-gradient(180deg, rgba(11, 43, 45, .96), rgba(8, 31, 38, .94)) !important;
}

html[data-theme="dark"] body.upload-center-page .blueprint-status-pill {
  border-color: rgba(104, 145, 168, .44);
  background: rgba(14, 34, 48, .88);
  color: #d7e9f4;
}

html[data-theme="dark"] body.upload-center-page .blueprint-status-pill.is-ready {
  border-color: rgba(84, 213, 177, .42);
  background: rgba(12, 58, 52, .82);
  color: #91f1d4;
}

html[data-theme="dark"] body.upload-center-page .blueprint-status-pill.is-running {
  border-color: rgba(227, 184, 93, .42);
  background: rgba(68, 46, 13, .72);
  color: #f5d48d;
}

html[data-theme="dark"] body.upload-center-page .blueprint-status-pill.is-failed {
  border-color: rgba(239, 129, 129, .42);
  background: rgba(70, 21, 26, .74);
  color: #ffb8b8;
}

body.upload-center-page .task-library-actions button,
body.upload-center-page .task-library-actions .button-link {
  min-height: 34px !important;
  padding: 8px 12px !important;
  border-radius: 10px !important;
}

body.upload-center-page .blueprint-score-table th:nth-child(3),
body.upload-center-page .blueprint-score-table td:nth-child(3),
body.upload-center-page .blueprint-score-table th:nth-child(4),
body.upload-center-page .blueprint-score-table td:nth-child(4),
body.assignment-admin-page .blueprint-score-table th:nth-child(3),
body.assignment-admin-page .blueprint-score-table td:nth-child(3),
body.assignment-admin-page .blueprint-score-table th:nth-child(4),
body.assignment-admin-page .blueprint-score-table td:nth-child(4) {
  display: none;
}

body.upload-center-page .blueprint-score-table,
body.assignment-admin-page .blueprint-score-table {
  min-width: 760px !important;
}

body.upload-center-page .blueprint-score-table th:nth-child(2),
body.upload-center-page .blueprint-score-table td:nth-child(2),
body.assignment-admin-page .blueprint-score-table th:nth-child(2),
body.assignment-admin-page .blueprint-score-table td:nth-child(2) {
  width: 32% !important;
}

body.upload-center-page .blueprint-score-table th:nth-child(6),
body.upload-center-page .blueprint-score-table td:nth-child(6),
body.assignment-admin-page .blueprint-score-table th:nth-child(6),
body.assignment-admin-page .blueprint-score-table td:nth-child(6) {
  width: 44% !important;
}

body.upload-center-page .blueprint-score-table textarea {
  min-height: 66px !important;
}

.assignment-blueprint-panel .score-matrix-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.assignment-blueprint-panel .score-matrix-head p {
  margin: 4px 0 0;
}

.score-matrix-wrap {
  max-height: 420px;
}

.score-matrix-table th small,
.score-matrix-table td small {
  display: block;
  color: #6b8192;
  font-size: 11px;
  margin-top: 2px;
}

.score-matrix-table input {
  width: 72px;
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #cddfe8;
  font-weight: 900;
}

#detailTable .student-summary-row > td {
  vertical-align: middle;
  padding: 7px 10px;
}

#detailTable {
  min-width: 1120px;
  table-layout: fixed;
}

#detailTable.clean-table th,
#detailTable.clean-table td {
  padding-inline: 10px;
}

#detailTable .detail-col-student { width: 112px; }
#detailTable .detail-col-status { width: 238px; }
#detailTable .detail-col-score { width: 126px; }
#detailTable .detail-col-next { width: auto; }
#detailTable .detail-col-preview { width: 174px; }
#detailTable .detail-col-actions { width: 150px; }

.student-name-cell {
  width: 112px;
  min-width: 104px;
  overflow-wrap: anywhere;
}

.student-status-cell {
  width: 238px;
  min-width: 210px;
}

.student-score-cell {
  display: grid;
  gap: 2px;
  width: 126px;
  min-width: 112px;
}

.student-next-cell {
  min-width: 420px;
  word-break: normal;
}

.student-score-cell strong {
  color: #102033;
  font-size: 17px;
}

.student-score-cell span {
  color: #5e7284;
  font-size: 12px;
  font-weight: 850;
}

#detailTable .compact-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}

#detailTable .compact-actions button,
#detailTable .student-score-editor > button {
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.student-score-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 220px;
}

.student-score-overview .score-chip {
  min-width: 70px;
  padding: 7px 8px;
  border-radius: 10px;
}

.student-score-overview .score-chip b {
  font-size: 13px;
}

.student-score-overview .score-chip small {
  font-size: 11px;
}

.student-next-preview {
  margin-top: 8px;
}

.student-next-list {
  margin: 0;
  padding-left: 17px;
  color: #546a7d;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.38;
}

.student-next-list li + li {
  margin-top: 2px;
}

.student-detail-row > td {
  padding: 0 8px 8px !important;
  background: #f7fbfc;
}

.student-detail-panel {
  display: grid;
  grid-template-columns: minmax(340px, .7fr) minmax(520px, 1.3fr);
  gap: 12px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid #d7e8ee;
  border-radius: 14px;
  background: #fff;
}

.student-score-editor {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
}

.student-score-editor .score-matrix-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.student-score-editor .score-matrix-head p {
  display: none;
}

.student-score-editor .score-matrix-head span {
  flex: 0 0 auto;
  color: #486176;
  font-weight: 950;
}

.score-edit-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 8px;
}

.score-edit-chip {
  display: grid;
  gap: 3px;
  width: auto;
  min-width: 0;
  padding: 7px;
  border: 1px solid #d5e5ec;
  border-radius: 12px;
  background: #f8fcfd;
  color: #102033;
  font-weight: 900;
}

.score-edit-chip span {
  font-size: 12px;
}

.score-edit-chip small {
  color: #627789;
  font-size: 10px;
}

.score-edit-chip input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid #cddfe8;
  border-radius: 9px;
  font-weight: 900;
}

.student-detail-notes {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.student-detail-notes section {
  padding: 10px 12px;
  border: 1px solid #dce9ef;
  border-radius: 12px;
  background: #f8fcfd;
  font-size: 12px;
  font-weight: 820;
}

.student-detail-notes strong {
  display: block;
  margin-bottom: 6px;
  color: #102033;
}

.student-detail-notes p {
  margin: 0;
  line-height: 1.45;
}

.detail-empty-note {
  padding: 12px;
  border: 1px dashed #c8dce6;
  border-radius: 12px;
  color: #607587;
  background: #f9fcfd;
  font-weight: 850;
}

.report-student-score-section {
  margin-top: 14px;
}

.report-student-score-table th,
.report-student-score-table td {
  vertical-align: top;
}

@media (max-width: 980px) {
  .assignment-create-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assignment-create-grid .wide,
  .assignment-create-grid .field-template,
  .assignment-create-grid .field-title,
  .assignment-create-grid .field-campus,
  .assignment-create-grid .field-course,
  .assignment-create-grid .field-teacher,
  .assignment-create-grid .field-class,
  .assignment-create-grid .field-target,
  .assignment-create-grid .field-due,
  .assignment-create-grid .field-score,
  .assignment-create-grid .field-policy {
    grid-column: span 1;
  }

  .assignment-create-grid .field-template,
  .assignment-create-grid .field-due,
  .assignment-create-grid .field-policy {
    grid-column: 1 / -1;
  }

  .student-detail-panel {
    grid-template-columns: 1fr;
  }

  .student-detail-notes {
    grid-template-columns: 1fr;
  }
}

.completion-table th,
.completion-table td {
  vertical-align: middle;
}

.student-mode.oral-assignment-mode .rubric-card strong {
  color: #266f3f !important;
}

.student-mode.oral-assignment-mode .rubric-card {
  background: #fbf8ee !important;
  color: #5b4d29 !important;
}

@media (max-width: 1180px) {
  .task-library-card {
    grid-template-columns: 1fr !important;
  }

  .task-library-actions {
    justify-content: flex-start !important;
  }

  .assignment-create-grid,
  .paper-upload-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .completion-table {
    min-width: 1000px;
  }

  .completion-table th,
  .completion-table td {
    padding-inline: 10px !important;
  }

  .completion-table th:nth-child(1) { width: 54px; }
  .completion-table th:nth-child(2) { width: 112px; }
  .completion-table th:nth-child(3) { width: 132px; }
  .completion-table th:nth-child(4) { width: 74px; }

  .overview-metric-cell {
    min-width: 78px;
  }

  .overview-metric-cell strong {
    font-size: 15px;
  }

  .overview-metric-cell span,
  .overview-metric-cell small {
    font-size: 11px;
  }
}

@media (max-width: 760px) {
  .assignment-create-grid,
  .paper-upload-form,
  .completion-toolbar {
    grid-template-columns: 1fr !important;
  }

  .task-optional-details summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* v11.7 local module audit polish: compact admin flows without changing behavior. */
.top-module-nav {
  background: var(--flat-surface, #fff) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 2px 16px rgba(16, 32, 51, .08) !important;
  isolation: isolate;
}

html[data-theme="dark"] .top-module-nav {
  background: #101923 !important;
  box-shadow: 0 2px 18px rgba(0, 0, 0, .26) !important;
}

body.assignment-publish-page .hero-card.compact-hero,
body.assignment-manage-page .hero-card.compact-hero,
body.completion-overview-page .hero-card.compact-hero,
body.account-admin-page .hero-card.compact-hero,
body.account-settings-page .hero-card.compact-hero,
body.ops-center-page .hero-card.compact-hero,
body.upload-center-page .dashboard-hero,
body.question-images-page .dashboard-hero,
body.ai-console-page .dashboard-hero {
  min-height: 128px !important;
  padding: 24px 30px !important;
}

body.assignment-publish-page .hero-card.compact-hero h1,
body.assignment-manage-page .hero-card.compact-hero h1,
body.completion-overview-page .hero-card.compact-hero h1,
body.account-admin-page .hero-card.compact-hero h1,
body.account-settings-page .hero-card.compact-hero h1,
body.ops-center-page .hero-card.compact-hero h1,
body.upload-center-page .dashboard-hero h1,
body.question-images-page .dashboard-hero h1,
body.ai-console-page .dashboard-hero h1 {
  font-size: clamp(30px, 3vw, 42px) !important;
  line-height: 1.05 !important;
}

body.assignment-publish-page .hero-card.compact-hero p,
body.assignment-manage-page .hero-card.compact-hero p,
body.completion-overview-page .hero-card.compact-hero p,
body.account-admin-page .hero-card.compact-hero p,
body.account-settings-page .hero-card.compact-hero p,
body.ops-center-page .hero-card.compact-hero p,
body.upload-center-page .dashboard-hero p,
body.question-images-page .dashboard-hero p,
body.ai-console-page .dashboard-hero p {
  max-width: 820px !important;
  line-height: 1.55 !important;
}

#detailTable {
  min-width: 1080px;
}

#detailTable .student-summary-row > td {
  padding: 6px 9px;
  vertical-align: middle !important;
}

#detailTable.clean-table th,
#detailTable.clean-table td {
  padding-inline: 9px;
}

#detailTable .detail-col-student { width: 106px; }
#detailTable .detail-col-status { width: 188px; }
#detailTable .detail-col-score { width: 116px; }
#detailTable .detail-col-preview { width: 146px; }
#detailTable .detail-col-actions { width: 132px; }

.student-name-cell {
  width: 106px;
  min-width: 96px;
}

.student-status-cell {
  width: 188px;
  min-width: 176px;
}

.student-score-cell {
  display: table-cell !important;
  width: 116px;
  min-width: 104px;
  vertical-align: middle !important;
  background: inherit !important;
}

.student-score-stack {
  display: flex;
  min-height: 44px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.student-next-cell {
  min-width: 340px;
}

#detailTable .status-reason {
  gap: 4px;
}

#detailTable .status-reason .status-pill {
  width: fit-content;
  min-width: 88px;
  max-width: 100%;
  padding-inline: 12px;
}

#detailTable .status-reason small {
  font-size: 11.5px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
}

#detailTable .student-score-stack strong {
  display: block;
  font-size: 16px;
  line-height: 1.15;
}

#detailTable .student-score-stack span {
  display: block;
  line-height: 1.2;
}

#detailTable .student-next-list {
  margin-block: 0;
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.45;
}

#detailTable .attachment-chip-list {
  gap: 6px;
}

#detailTable .attachment-chip-list .attachment-chip {
  min-width: 56px;
  max-width: 70px;
}

#detailTable .compact-actions {
  gap: 5px;
}

#detailTable .compact-actions button,
#detailTable .student-score-editor > button {
  min-height: 28px;
  padding: 5px 7px;
}

.completion-toolbar,
.assignment-create-grid,
.paper-upload-form {
  align-items: end;
}

.completion-table th,
.completion-table td {
  line-height: 1.35;
}

@media (max-width: 1180px) {
  body.assignment-publish-page .hero-card.compact-hero,
  body.assignment-manage-page .hero-card.compact-hero,
  body.completion-overview-page .hero-card.compact-hero,
  body.account-admin-page .hero-card.compact-hero,
  body.account-settings-page .hero-card.compact-hero,
  body.ops-center-page .hero-card.compact-hero,
  body.upload-center-page .dashboard-hero,
  body.question-images-page .dashboard-hero,
  body.ai-console-page .dashboard-hero {
    min-height: 112px !important;
    padding: 20px 24px !important;
  }

  body.assignment-publish-page .hero-card.compact-hero::after,
  body.assignment-manage-page .hero-card.compact-hero::after,
  body.completion-overview-page .hero-card.compact-hero::after,
  body.account-admin-page .hero-card.compact-hero::after,
  body.account-settings-page .hero-card.compact-hero::after,
  body.ops-center-page .hero-card.compact-hero::after,
  body.upload-center-page .dashboard-hero::after,
  body.question-images-page .dashboard-hero::after,
  body.ai-console-page .dashboard-hero::after {
    opacity: .55;
    transform: scale(.82);
    transform-origin: right center;
  }
}

/* Completion overview: compact controls and calmer sortable table. */
body.completion-overview-page .completion-filter-panel {
  display: grid;
  gap: 10px;
  padding: 16px 18px !important;
}

body.completion-overview-page .completion-toolbar {
  width: auto;
  max-width: 1240px;
  margin-bottom: 0;
}

body.completion-overview-page .overview-toolbar {
  grid-template-columns: 144px 144px max-content 190px 140px 136px minmax(120px, 1fr) !important;
  justify-content: start;
  align-items: end;
  padding: 12px !important;
  border-radius: 16px !important;
  background:
    linear-gradient(180deg, rgba(248, 252, 253, .96), rgba(243, 248, 251, .9)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

body.completion-overview-page .date-toolbar,
body.completion-overview-page .scope-toolbar {
  justify-content: start;
}

body.completion-overview-page .completion-toolbar .search-field {
  width: auto;
  gap: 5px;
  font-size: 11.5px;
  line-height: 1.2;
}

body.completion-overview-page .completion-toolbar input,
body.completion-overview-page .completion-toolbar select {
  min-height: 42px;
  height: 42px;
  padding-inline: 12px;
  font-size: 14px;
}

body.completion-overview-page .date-field {
  width: 144px;
}

body.completion-overview-page .campus-field {
  width: 190px;
}

body.completion-overview-page .type-field {
  width: 140px;
}

body.completion-overview-page #refreshBtn {
  width: 136px;
  min-height: 43px;
  background: linear-gradient(135deg, #2f5faa, #0b8b73) !important;
  border-color: transparent !important;
}

body.completion-overview-page .period-switch {
  width: fit-content;
  min-width: 0;
  min-height: 42px;
}

body.completion-overview-page .period-switch button {
  min-width: 58px;
  min-height: 42px;
  padding-inline: 13px;
}

body.completion-overview-page .completion-count-pill {
  align-self: end;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(202, 222, 231, .86);
  border-radius: 13px;
  background: rgba(255,255,255,.78);
  color: #087f69;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

body.completion-overview-page .completion-count-pill:empty {
  border-color: transparent;
  background: transparent;
}

body.completion-overview-page .completion-table-tools {
  display: grid;
  grid-template-columns: 220px 96px;
  gap: 10px;
  align-items: end;
  margin: 4px 0 12px;
}

body.completion-overview-page .completion-table-tools .search-field {
  min-width: 0;
}

body.completion-overview-page .export-range-btn {
  width: 96px;
  min-height: 42px;
  background: linear-gradient(135deg, #0b8b73, #2f78a3) !important;
  border-color: transparent !important;
}

body.completion-overview-page .sort-state-pill {
  align-self: center;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(171, 196, 210, .72);
  border-radius: 999px;
  background: rgba(247, 251, 252, .92);
  color: #496179;
  font-size: 12px;
  font-weight: 900;
}

body.completion-overview-page .completion-table {
  table-layout: fixed;
  min-width: 980px;
}

body.completion-overview-page .completion-table th,
body.completion-overview-page .completion-table td {
  padding: 14px 12px !important;
}

body.completion-overview-page .completion-table .col-index { width: 56px; }
body.completion-overview-page .completion-table .col-teacher { width: 118px; }
body.completion-overview-page .completion-table .col-course { width: 150px; }
body.completion-overview-page .completion-table .col-count { width: 92px; }
body.completion-overview-page .completion-table .col-rate { width: 128px; }

body.completion-overview-page .completion-table td:nth-child(n+3) {
  font-variant-numeric: tabular-nums;
}

body.completion-overview-page .completion-table td:nth-child(1),
body.completion-overview-page .completion-table td:nth-child(n+3) {
  text-align: center;
}

body.completion-overview-page .completion-table td:nth-child(2),
body.completion-overview-page .completion-table td:nth-child(3) {
  overflow-wrap: anywhere;
}

body.completion-overview-page .table-sort-btn {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 9px !important;
  color: #38526b !important;
  background: rgba(241, 246, 249, .82) !important;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

body.completion-overview-page .table-sort-btn::after {
  content: "↕";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  max-width: none;
  padding: 0;
  border-radius: 999px;
  background: rgba(112, 132, 150, .12);
  color: #6f8498;
  opacity: 1;
  font-size: 11px;
  line-height: 1;
}

body.completion-overview-page .table-sort-btn:hover {
  color: #1d4264 !important;
  border-color: rgba(62, 104, 174, .34) !important;
  background: rgba(238, 244, 252, .96) !important;
}

body.completion-overview-page .table-sort-btn.active {
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 12%, #fff) !important;
  border-color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 34%, var(--flat-border)) !important;
  color: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 86%, var(--flat-text)) !important;
}

body.completion-overview-page .table-sort-btn.active::after {
  content: attr(data-arrow);
  width: 20px;
  height: 20px;
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 88%, #123);
  color: #fff;
  padding: 0;
}

body.completion-overview-page .overview-metric-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

body.completion-overview-page .overview-metric-cell strong {
  font-size: 18px;
  line-height: 1;
}

body.completion-overview-page .overview-metric-cell span,
body.completion-overview-page .overview-metric-cell small {
  display: none;
}

body.completion-overview-page .overview-total-row td {
  background: rgba(242, 247, 250, .86) !important;
}

body.completion-overview-page .clean-table tbody tr:hover td {
  background: color-mix(in srgb, var(--module-primary, var(--flat-primary)) 5%, #fff) !important;
}

html[data-theme="dark"] body.completion-overview-page .sort-state-pill {
  background: rgba(11, 26, 37, .86);
  border-color: rgba(126, 158, 178, .32);
  color: #adc0ce;
}

html[data-theme="dark"] body.completion-overview-page .table-sort-btn {
  background: rgba(12, 25, 36, .9) !important;
  color: #d9e7ef !important;
}

html[data-theme="dark"] body.completion-overview-page .overview-total-row td {
  background: rgba(13, 28, 40, .92) !important;
}

@media (max-width: 1180px) {
  body.completion-overview-page .overview-toolbar,
  body.completion-overview-page .date-toolbar,
  body.completion-overview-page .scope-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.completion-overview-page .date-field,
  body.completion-overview-page .campus-field,
  body.completion-overview-page .type-field,
  body.completion-overview-page #refreshBtn {
    width: auto;
  }

  body.completion-overview-page .period-switch {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 760px) {
  body.completion-overview-page .overview-toolbar,
  body.completion-overview-page .date-toolbar,
  body.completion-overview-page .scope-toolbar,
  body.completion-overview-page .completion-table-tools {
    grid-template-columns: 1fr !important;
  }

  body.completion-overview-page .export-range-btn {
    width: 100%;
  }
}

/* Oral published detail: separate listen-and-review workflow from book-task grading. */
.oral-audio-dock {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(260px, 520px) auto;
  align-items: center;
  gap: 12px;
  margin: 12px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(23, 121, 150, .22);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(246, 253, 254, .96), rgba(240, 249, 250, .9));
}

.oral-audio-dock[hidden] {
  display: none !important;
}

.oral-audio-dock strong {
  display: block;
  color: #10243a;
  font-size: 15px;
}

.oral-audio-dock span {
  color: #66798b;
  font-size: 12px;
  font-weight: 800;
}

.oral-audio-dock audio {
  width: 100%;
  margin: 0;
}

.oral-detail-table {
  table-layout: fixed;
}

.oral-detail-table .oral-col-student { width: 10%; }
.oral-detail-table .oral-col-status { width: 16%; }
.oral-detail-table .oral-col-score { width: 13%; }
.oral-detail-table .oral-col-focus { width: 41%; }
.oral-detail-table .oral-col-actions { width: 20%; }

.oral-student-row td {
  vertical-align: middle;
}

.student-name-cell small {
  display: block;
  margin-top: 4px;
  color: #718295;
  font-size: 12px;
  font-weight: 800;
}

.oral-status small {
  -webkit-line-clamp: 2 !important;
}

.oral-score-cell {
  display: grid;
  gap: 4px;
  min-width: 92px;
}

.oral-score-cell strong {
  color: #10243a;
  font-size: 17px;
}

.oral-score-cell span {
  color: #4f6680;
  font-size: 12px;
  font-weight: 850;
}

.oral-score-bar {
  overflow: hidden;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: #e8f0f4;
}

.oral-score-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #12836f, #2c87b9);
}

.oral-focus-cell {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.oral-focus-cell small {
  color: #4f6680;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.oral-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.oral-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(23, 121, 150, .2);
  border-radius: 999px;
  background: rgba(236, 248, 248, .9);
  color: #166176;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.oral-audio-chip {
  display: inline-grid;
  grid-template-columns: auto;
  justify-items: center;
  min-width: 54px;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid rgba(15, 129, 110, .22);
  border-radius: 12px;
  background: #078b69;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.oral-audio-chip small {
  color: rgba(255, 255, 255, .8);
  font-size: 11px;
  font-weight: 850;
}

.oral-audio-chip.wide {
  justify-self: start;
  min-width: 88px;
}

.oral-actions {
  align-items: flex-start;
}

.student-report-main {
  min-height: 34px;
  white-space: nowrap;
}

.compact-actions button:disabled,
.completion-overview-page button:disabled {
  cursor: wait;
  opacity: .68;
}

.oral-report-menu summary {
  min-height: 34px;
  padding: 7px 10px;
}

.oral-class-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr);
  align-items: start;
  gap: 14px;
}

.oral-class-summary section {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d8e8ed;
  border-radius: 16px;
  background: #fbfefe;
}

.oral-class-summary h3 {
  margin: 0 0 10px;
  color: #10243a;
  font-size: 15px;
}

.oral-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.oral-type-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 121, 150, .18);
  border-radius: 14px;
  background: rgba(244, 251, 251, .9);
}

.oral-type-card span {
  overflow: hidden;
  color: #4f6680;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oral-type-card strong {
  color: #10243a;
  font-size: 22px;
}

.oral-type-card small,
.oral-priority-list span {
  color: #607287;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.45;
}

.oral-priority-list {
  display: grid;
  gap: 7px;
}

.oral-priority-list span {
  padding: 8px 10px;
  border: 1px solid rgba(232, 181, 62, .28);
  border-radius: 12px;
  background: rgba(255, 250, 235, .85);
}

.oral-student-detail {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(23, 121, 150, .18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(249, 253, 253, .98), rgba(244, 250, 250, .88));
}

.oral-student-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.oral-student-detail-head strong {
  color: #10243a;
  font-size: 18px;
}

.oral-student-detail-head span {
  color: #607287;
  font-size: 12px;
  font-weight: 850;
}

.oral-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.oral-record-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d7e8ee;
  border-radius: 16px;
  background: #fff;
}

.oral-record-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.oral-record-card strong {
  color: #10243a;
  font-size: 15px;
}

.oral-record-card span {
  overflow: hidden;
  color: #607287;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oral-record-card p {
  min-height: 44px;
  margin: 0;
  color: #2e4054;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.55;
}

.oral-record-score {
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef4f7;
  color: #1e4059;
  font-size: 13px;
  font-weight: 900;
}

.oral-record-score.ok { background: #e7f7ef; color: #087a5e; }
.oral-record-score.mid { background: #fff7df; color: #8b6510; }
.oral-record-score.low { background: #fff0ee; color: #9a3f30; }

.oral-record-score small {
  margin-left: 6px;
  color: inherit;
}

.oral-feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.oral-feedback-grid section {
  padding: 12px;
  border: 1px solid #d7e8ee;
  border-radius: 14px;
  background: #fbfefe;
}

.oral-feedback-grid strong {
  color: #10243a;
}

.oral-feedback-grid p {
  margin: 7px 0 0;
  color: #50687e;
  font-size: 13px;
  font-weight: 820;
  line-height: 1.55;
}

html[data-theme="dark"] .oral-audio-dock,
html[data-theme="dark"] .oral-class-summary section,
html[data-theme="dark"] .oral-student-detail,
html[data-theme="dark"] .oral-record-card,
html[data-theme="dark"] .oral-feedback-grid section,
html[data-theme="dark"] .oral-type-card {
  background: rgba(12, 25, 36, .92);
  border-color: rgba(126, 158, 178, .28);
}

html[data-theme="dark"] .oral-audio-dock strong,
html[data-theme="dark"] .oral-class-summary h3,
html[data-theme="dark"] .oral-score-cell strong,
html[data-theme="dark"] .oral-student-detail-head strong,
html[data-theme="dark"] .oral-record-card strong,
html[data-theme="dark"] .oral-feedback-grid strong {
  color: #e6f0f6;
}

html[data-theme="dark"] .oral-record-card p,
html[data-theme="dark"] .oral-focus-cell small,
html[data-theme="dark"] .oral-feedback-grid p {
  color: #b9cad6;
}

@media (max-width: 980px) {
  .oral-audio-dock,
  .oral-class-summary,
  .oral-feedback-grid {
    grid-template-columns: 1fr;
  }

  .oral-detail-table .oral-col-student,
  .oral-detail-table .oral-col-status,
  .oral-detail-table .oral-col-score,
  .oral-detail-table .oral-col-focus,
  .oral-detail-table .oral-col-actions {
    width: auto;
  }
}

/* v11.8 published management efficiency pass: denser list, floating actions, modal detail. */
body.assignment-manage-page #publishedManagePane > .panel-card {
  padding: 18px 20px;
}

body.assignment-manage-page .hero-card.compact-hero {
  display: none;
}

body.assignment-manage-page .published-view-toggle {
  grid-template-columns: repeat(2, minmax(180px, 280px));
  justify-content: start;
  gap: 10px;
  margin-bottom: 12px;
}

body.assignment-manage-page .published-view-toggle .published-view-card {
  min-height: 54px !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
}

body.assignment-manage-page .published-view-toggle .published-view-card strong {
  font-size: 16px;
}

body.assignment-manage-page .published-view-toggle .published-view-card .module-eyebrow {
  display: none;
}

body.assignment-manage-page .published-view-toggle .published-view-card span:not(.module-eyebrow),
body.assignment-manage-page .published-view-toggle .published-view-card em {
  display: none;
}

.assignment-list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 10px;
  padding: 12px 14px;
  border: 1px solid rgba(198, 216, 227, .88);
  border-radius: 8px;
  background: #f7fbfc;
}

.assignment-list-summary strong {
  display: block;
  color: #102033;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.25;
}

.assignment-list-summary span {
  color: #5c7082;
  font-size: 12px;
  font-weight: 820;
}

.assignment-list-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.assignment-list-metrics span {
  padding: 6px 9px;
  border: 1px solid #d9e6ed;
  border-radius: 999px;
  background: #fff;
  color: #30495d;
  font-weight: 900;
}

.assignment-page #assignmentTable {
  table-layout: fixed;
  min-width: 1180px;
}

.assignment-page #assignmentTable th:nth-child(1) { width: 18%; }
.assignment-page #assignmentTable th:nth-child(2) { width: 23%; }
.assignment-page #assignmentTable th:nth-child(3) { width: 24%; }
.assignment-page #assignmentTable th:nth-child(4) { width: 13%; }
.assignment-page #assignmentTable th:nth-child(5) { width: 22%; }

.assignment-page #assignmentTable td {
  vertical-align: middle;
}

.assignment-task-cell,
.assignment-scope-cell,
.assignment-progress-cell,
.assignment-due-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.assignment-task-cell strong,
.assignment-scope-cell strong,
.assignment-progress-cell strong,
.assignment-due-cell strong {
  margin: 0 !important;
  color: #14273c;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.35;
}

.assignment-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assignment-row-tags .status-pill {
  width: fit-content;
}

.assignment-scope-cell span,
.assignment-progress-cell span,
.assignment-due-cell strong {
  color: #5c7082;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.38;
}

.assignment-progress-cell .progress-line {
  width: min(260px, 100%);
  height: 10px;
}

.assignment-due-cell .text-mini-button {
  justify-self: start;
  min-height: 30px !important;
  padding: 0 11px !important;
}

.assignment-page #assignmentTable .row-actions {
  min-width: 0;
}

.assignment-page #assignmentTable .row-action-primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(84px, 1fr)) 70px;
  gap: 8px;
  align-items: center;
}

.assignment-page #assignmentTable .row-action-primary > button {
  width: 100%;
  min-height: 38px;
  justify-content: center;
}

.row-menu-trigger {
  background: #eef5f8 !important;
  border-color: #cddfe8 !important;
  color: #244761 !important;
}

.row-menu-trigger.active {
  border-color: #7cabd0 !important;
  box-shadow: 0 0 0 3px rgba(83, 145, 205, .18);
}

.row-action-popover {
  position: fixed;
  z-index: 8200;
  width: 212px;
  padding: 8px;
  border: 1px solid rgba(192, 213, 226, .95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(20, 43, 66, .18);
}

.row-action-popover[hidden] {
  display: none;
}

.row-popover-actions {
  display: grid;
  gap: 7px;
}

.row-popover-actions button {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  border-radius: 8px !important;
}

.row-popover-actions button[data-end-now] {
  color: #835300 !important;
  background: #fff8e6 !important;
  border-color: #ead093 !important;
}

.row-popover-actions button.ai-guarded-action {
  color: #24506a !important;
  background: #eef7fb !important;
  border-color: #b9d6e5 !important;
}

.row-popover-actions button.ai-guarded-action.paused,
.row-popover-actions button.ai-guarded-action.warning {
  color: #7a4a10 !important;
  background: #fff7e8 !important;
  border-color: #eccb91 !important;
}

.row-popover-actions button.ai-guarded-action.running {
  color: #50606b !important;
  background: #f1f5f8 !important;
  border-color: #cfdbe3 !important;
}

.assignment-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 30, 45, .48);
}

.assignment-detail-modal[hidden] {
  display: none;
}

.assignment-detail-dialog {
  width: min(1480px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(193, 214, 226, .95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(13, 31, 48, .28);
}

.assignment-detail-modal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid #dce8ee;
  background: rgba(255, 255, 255, .96);
}

.assignment-detail-modal-head span {
  color: #0a8276;
  font-size: 12px;
  font-weight: 950;
}

.assignment-detail-modal-head h2 {
  margin: 2px 0 0;
  color: #102033;
  font-size: 22px;
  line-height: 1.25;
}

.assignment-detail-modal-head p {
  margin: 5px 0 0;
  color: #607587;
  font-size: 13px;
  font-weight: 820;
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.assignment-detail-dialog #assignmentDetail {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px 18px 20px;
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
  background: #fff !important;
}

.assignment-detail-dialog #assignmentDetail[hidden] {
  display: none;
}

.assignment-detail-dialog #assignmentDetail > .section-heading {
  display: none;
}

.assignment-detail-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.assignment-detail-kpi-strip div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #dce8ee;
  border-radius: 8px;
  background: #f7fbfc;
}

.assignment-detail-kpi-strip span {
  color: #627789;
  font-size: 12px;
  font-weight: 850;
}

.assignment-detail-kpi-strip strong {
  color: #102033;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.1;
}

.assignment-detail-kpi-strip small {
  color: #607587;
  font-size: 11px;
  font-weight: 820;
}

.assignment-detail-dialog .fixed-table-wrap.small-table {
  max-height: none;
  overflow: auto;
  border-radius: 8px !important;
}

.assignment-detail-dialog #detailTable {
  min-width: 1160px;
}

.assignment-detail-dialog #detailTable th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.assignment-detail-dialog .assignment-blueprint-panel,
.assignment-detail-dialog .oral-class-summary section,
.assignment-detail-dialog .oral-audio-dock {
  border-radius: 8px !important;
}

.modal-actions .danger-lite {
  margin-right: auto;
}

#dueEditEndNow {
  background: #fff7e0 !important;
  border-color: #e6c36e !important;
  color: #805200 !important;
}

.due-edit-modal {
  z-index: 8100;
}

html[data-theme="dark"] .assignment-list-summary,
html[data-theme="dark"] .assignment-list-metrics span,
html[data-theme="dark"] .assignment-detail-kpi-strip div,
html[data-theme="dark"] .row-action-popover,
html[data-theme="dark"] .assignment-detail-dialog,
html[data-theme="dark"] .assignment-detail-modal-head,
html[data-theme="dark"] .assignment-detail-dialog #assignmentDetail {
  background: #101923 !important;
  border-color: rgba(126, 158, 178, .28) !important;
}

html[data-theme="dark"] .assignment-list-summary strong,
html[data-theme="dark"] .assignment-task-cell strong,
html[data-theme="dark"] .assignment-scope-cell strong,
html[data-theme="dark"] .assignment-progress-cell strong,
html[data-theme="dark"] .assignment-detail-kpi-strip strong,
html[data-theme="dark"] .assignment-detail-modal-head h2 {
  color: #e6f0f6;
}

html[data-theme="dark"] .assignment-list-summary span,
html[data-theme="dark"] .assignment-scope-cell span,
html[data-theme="dark"] .assignment-progress-cell span,
html[data-theme="dark"] .assignment-due-cell strong,
html[data-theme="dark"] .assignment-detail-kpi-strip span,
html[data-theme="dark"] .assignment-detail-kpi-strip small,
html[data-theme="dark"] .assignment-detail-modal-head p {
  color: #b9cad6;
}

@media (max-width: 980px) {
  .assignment-list-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .assignment-page #assignmentTable .row-action-primary {
    grid-template-columns: 1fr;
  }

  .assignment-detail-modal {
    padding: 10px;
  }

  .assignment-detail-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .assignment-detail-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* v11.12 published management polish: workbench density, adaptive detail modal, useful menus only. */
body.assignment-manage-page #publishedManagePane > .panel-card {
  padding: 14px 16px 16px;
}

body.assignment-manage-page .toolbar-row.assignment-filter-grid {
  margin-bottom: 10px;
}

body.assignment-manage-page .assignment-list-summary {
  margin: 2px 0 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fbfdfe, #f3f8fa);
}

body.assignment-manage-page .assignment-list-metrics span {
  min-height: 28px;
  padding: 5px 10px;
}

body.assignment-manage-page .table-wrap.fixed-table-wrap {
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(19, 44, 62, .06);
}

body.assignment-manage-page #assignmentTable {
  min-width: 1080px;
}

body.assignment-manage-page #assignmentTable th:nth-child(1) { width: 18%; }
body.assignment-manage-page #assignmentTable th:nth-child(2) { width: 20%; }
body.assignment-manage-page #assignmentTable th:nth-child(3) { width: 26%; }
body.assignment-manage-page #assignmentTable th:nth-child(4) { width: 14%; }
body.assignment-manage-page #assignmentTable th:nth-child(5) { width: 22%; }

body.assignment-manage-page #assignmentTable th {
  padding-top: 10px;
  padding-bottom: 10px;
  background: #f8fbfc;
}

body.assignment-manage-page #assignmentTable td {
  padding-top: 12px;
  padding-bottom: 12px;
}

body.assignment-manage-page #assignmentTable tbody tr:nth-child(even) td {
  background: rgba(247, 251, 252, .66);
}

body.assignment-manage-page #assignmentTable tbody tr:hover td {
  background: rgba(236, 248, 248, .82);
}

body.assignment-manage-page .assignment-task-cell,
body.assignment-manage-page .assignment-scope-cell,
body.assignment-manage-page .assignment-progress-cell,
body.assignment-manage-page .assignment-due-cell {
  gap: 5px;
}

body.assignment-manage-page .assignment-due-cell {
  align-content: center;
  gap: 7px;
}

body.assignment-manage-page .assignment-task-cell strong,
body.assignment-manage-page .assignment-scope-cell strong,
body.assignment-manage-page .assignment-progress-cell strong {
  font-size: 15px;
}

body.assignment-manage-page .assignment-row-tags .status-pill {
  min-height: 26px;
  padding: 4px 9px;
}

body.assignment-manage-page .assignment-progress-cell .progress-line {
  height: 8px;
}

body.assignment-manage-page .assignment-due-cell .status-pill {
  justify-self: start;
  width: auto !important;
  min-width: 78px;
  min-height: 28px;
  padding: 4px 12px;
}

body.assignment-manage-page .assignment-due-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body.assignment-manage-page .assignment-due-top .status-pill,
body.assignment-manage-page .assignment-due-top .text-mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-height: 30px !important;
  line-height: 1;
}

body.assignment-manage-page .assignment-due-top .text-mini-button {
  margin-top: 0 !important;
  padding: 0 11px !important;
}

body.assignment-manage-page .assignment-due-cell strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.assignment-manage-page .assignment-due-date {
  display: block;
  color: #5c7082 !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1.25 !important;
}

body.assignment-manage-page #assignmentTable .row-action-primary {
  grid-template-columns: minmax(88px, .9fr) minmax(104px, 1fr) minmax(58px, .55fr);
  gap: 7px;
  align-items: center;
  max-width: 360px;
}

body.assignment-manage-page #assignmentTable .row-action-primary > button,
body.assignment-manage-page #assignmentTable .row-action-primary .row-inline-secondary > button {
  min-height: 36px;
  padding-inline: 10px;
  border-radius: 8px !important;
}

.row-inline-secondary {
  display: contents;
}

body.assignment-manage-page #assignmentTable td.row-actions {
  vertical-align: middle;
}

.assignment-detail-modal {
  padding: 22px;
}

.assignment-detail-dialog {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: min(1260px, calc(100vw - 48px));
  max-height: calc(100vh - 44px);
}

.assignment-detail-modal.book-detail-modal .assignment-detail-dialog {
  width: min(1160px, calc(100vw - 48px));
}

.assignment-detail-modal.oral-detail-modal .assignment-detail-dialog {
  width: min(1240px, calc(100vw - 48px));
}

.assignment-detail-modal-head {
  flex: 0 0 auto;
  padding: 14px 16px;
  background: #fff;
}

.assignment-detail-dialog #assignmentDetail {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 16px;
  -webkit-overflow-scrolling: touch;
}

.assignment-detail-kpi-strip {
  flex: 0 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.assignment-detail-kpi-strip div {
  padding: 9px 10px;
}

.assignment-detail-kpi-strip strong {
  font-size: 18px;
}

.assignment-detail-dialog .assignment-blueprint-panel,
.assignment-detail-dialog .oral-class-summary {
  flex: 0 0 auto;
}

.assignment-detail-dialog .fixed-table-wrap.small-table {
  flex: 0 0 auto;
  min-height: 280px;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.assignment-detail-dialog #detailTable {
  table-layout: fixed;
  min-width: 980px;
}

.assignment-detail-modal.book-detail-modal #detailTable .detail-col-student { width: 10%; }
.assignment-detail-modal.book-detail-modal #detailTable .detail-col-status { width: 13%; }
.assignment-detail-modal.book-detail-modal #detailTable .detail-col-score { width: 10%; }
.assignment-detail-modal.book-detail-modal #detailTable .detail-col-next { width: 39%; }
.assignment-detail-modal.book-detail-modal #detailTable .detail-col-preview { width: 14%; }
.assignment-detail-modal.book-detail-modal #detailTable .detail-col-actions { width: 14%; }

.assignment-detail-dialog #detailTable th,
.assignment-detail-dialog #detailTable td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.assignment-detail-dialog #detailTable th {
  background: #f8fbfc;
}

.assignment-detail-dialog #detailTable tbody tr:nth-child(even) td {
  background: rgba(247, 251, 252, .62);
}

.assignment-detail-dialog #detailTable .compact-actions {
  gap: 6px;
}

.assignment-detail-dialog #detailTable .compact-actions button,
.assignment-detail-dialog #detailTable .row-action-menu summary {
  min-height: 34px;
  border-radius: 8px !important;
}

.assignment-detail-modal.oral-detail-modal #detailTable {
  min-width: 1040px;
}

.assignment-detail-modal.oral-detail-modal .oral-detail-table .oral-col-student { width: 11%; }
.assignment-detail-modal.oral-detail-modal .oral-detail-table .oral-col-status { width: 15%; }
.assignment-detail-modal.oral-detail-modal .oral-detail-table .oral-col-score { width: 12%; }
.assignment-detail-modal.oral-detail-modal .oral-detail-table .oral-col-focus { width: 44%; }
.assignment-detail-modal.oral-detail-modal .oral-detail-table .oral-col-actions { width: 18%; }

.assignment-detail-modal.oral-detail-modal .oral-actions .row-action-menu:only-child {
  display: none;
}

html[data-theme="dark"] body.assignment-manage-page #assignmentTable th,
html[data-theme="dark"] .assignment-detail-dialog #detailTable th {
  background: rgba(14, 27, 38, .96);
}

@media (max-width: 980px) {
  .assignment-detail-modal {
    padding: 10px;
  }

  .assignment-detail-dialog,
  .assignment-detail-modal.book-detail-modal .assignment-detail-dialog,
  .assignment-detail-modal.oral-detail-modal .assignment-detail-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .assignment-detail-dialog .fixed-table-wrap.small-table {
    max-height: calc(100vh - 260px);
  }
}

/* v11.9 completion overview visual pass: aligned controls and stats-table header band. */
body.completion-overview-page .hero-card.compact-hero {
  display: none;
}

body.completion-overview-page .completion-filter-panel {
  padding: 22px 24px 24px !important;
}

body.completion-overview-page .overview-toolbar {
  display: grid !important;
  grid-template-columns:
    minmax(220px, 252px)
    minmax(220px, 252px)
    minmax(360px, 420px)
    minmax(270px, 1fr)
    minmax(190px, 240px)
    minmax(200px, 240px) !important;
  gap: 18px !important;
  align-items: end;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.completion-overview-page .overview-toolbar .search-field,
body.completion-overview-page .overview-toolbar .period-switch,
body.completion-overview-page .overview-toolbar #refreshBtn {
  min-width: 0 !important;
  width: 100%;
  margin: 0 !important;
}

body.completion-overview-page .overview-toolbar input,
body.completion-overview-page .overview-toolbar select,
body.completion-overview-page .overview-toolbar #refreshBtn,
body.completion-overview-page .overview-toolbar .period-switch,
body.completion-overview-page .overview-toolbar .period-switch button {
  min-height: 46px;
}

body.completion-overview-page .overview-toolbar .search-field {
  grid-template-rows: 18px 46px;
  gap: 8px;
  align-self: stretch;
  color: #66778a;
  font-size: 12px;
  line-height: 18px;
}

body.completion-overview-page .overview-toolbar input,
body.completion-overview-page .overview-toolbar select,
body.completion-overview-page .overview-toolbar #refreshBtn,
body.completion-overview-page .overview-toolbar .period-switch {
  height: 46px;
  align-self: end;
}

body.completion-overview-page .overview-toolbar .period-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  overflow: hidden;
}

body.completion-overview-page .overview-toolbar .period-switch button {
  min-width: 0;
  padding-inline: 10px;
}

body.completion-overview-page .completion-count-pill {
  display: none;
}

body.completion-overview-page .completion-count-pill.loading,
body.completion-overview-page .completion-count-pill.error,
body.completion-overview-page .completion-count-pill.success {
  grid-column: 1 / -1;
  display: flex;
  width: 100%;
  min-height: 38px;
  margin: 2px 0 0;
  border-radius: 8px;
}

body.completion-overview-page .completion-table-tools {
  grid-template-columns: minmax(220px, 300px) 96px;
  align-items: end;
  margin: 2px 0 14px;
}

body.completion-overview-page .completion-table-wrap {
  overflow: auto;
  border-radius: 8px !important;
  border-color: #d5e5ee !important;
  box-shadow: 0 12px 28px rgba(31, 61, 86, .06);
}

body.completion-overview-page .completion-table {
  min-width: 1060px;
  border-collapse: separate;
  border-spacing: 0;
}

body.completion-overview-page .completion-table thead th {
  height: 54px;
  padding: 0 14px !important;
  background: #f8fbfd !important;
  color: #52687b !important;
  border-bottom: 1px solid #dbe8f0 !important;
  text-align: center;
}

body.completion-overview-page .completion-table thead th:first-child {
  border-top-left-radius: 8px;
}

body.completion-overview-page .completion-table thead th:last-child {
  border-top-right-radius: 8px;
}

body.completion-overview-page .completion-table .table-sort-btn {
  min-height: 34px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid rgba(186, 207, 222, .9) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #29435a !important;
  box-shadow: none !important;
  font-size: 14px;
  font-weight: 950;
}

body.completion-overview-page .completion-table .table-sort-btn:hover,
body.completion-overview-page .completion-table .table-sort-btn.active {
  background: #eef5ff !important;
  border-color: #8fb0eb !important;
  color: #315cae !important;
}

body.completion-overview-page .completion-table .table-sort-btn::after {
  width: 19px;
  height: 19px;
  margin-left: 7px;
  background: #e9f0f6;
  color: #607386;
}

body.completion-overview-page .completion-table .table-sort-btn.active::after {
  background: #315cae;
  color: #fff;
}

body.completion-overview-page .completion-table tbody td {
  border-bottom-color: #e2ecf3 !important;
}

body.completion-overview-page .completion-table .overview-total-row td {
  height: 62px;
  background: #eef8f8 !important;
  border-top: 0 !important;
  border-bottom: 2px solid #b9d9dc !important;
  color: #24384d;
  font-size: 15px;
  font-weight: 950;
}

body.completion-overview-page .completion-table .overview-total-row td:first-child {
  color: #20344b;
}

body.completion-overview-page .completion-table .overview-total-row .overview-metric-cell strong {
  font-size: 21px;
}

body.completion-overview-page .completion-table tbody tr:not(.overview-total-row) td {
  height: 58px;
  background: #fff;
}

body.completion-overview-page .completion-table tbody tr:not(.overview-total-row):nth-child(even) td {
  background: #f5f9fc !important;
}

html[data-theme="dark"] body.completion-overview-page .completion-table thead th {
  background: rgba(25, 43, 58, .98) !important;
  color: #d8e5ee !important;
}

html[data-theme="dark"] body.completion-overview-page .completion-table .overview-total-row td {
  background: rgba(24, 91, 91, .22) !important;
  border-bottom-color: rgba(107, 171, 174, .7) !important;
  color: #e6f0f6;
}

@media (max-width: 1540px) {
  body.completion-overview-page .overview-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.completion-overview-page .overview-toolbar .period-switch,
  body.completion-overview-page .overview-toolbar #refreshBtn {
    margin-top: 26px !important;
  }
}

@media (max-width: 1180px) {
  body.completion-overview-page .overview-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.completion-overview-page .overview-toolbar .period-switch {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body.completion-overview-page .overview-toolbar,
  body.completion-overview-page .completion-table-tools {
    grid-template-columns: 1fr !important;
  }
}

/* v11.9 system mobile shell guard: keep long identity/tool bars readable. */
@media (max-width: 760px) {
  .top-nav-inner {
    width: min(100% - 20px, 440px) !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 9px !important;
    padding-block: 10px !important;
    justify-items: stretch;
  }

  .top-nav-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start;
    min-width: 0;
  }

  .top-nav-links {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-start !important;
    padding: 1px 0 5px !important;
    overflow-x: auto;
  }

  .top-nav-links a.active {
    order: -1;
  }

  .top-right-tools {
    grid-column: 1 !important;
    grid-row: 3 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px !important;
    width: 100%;
    min-width: 0;
    justify-content: stretch !important;
  }

  .top-right-tools .admin-badge,
  .top-right-tools .logout-link,
  .top-right-tools .theme-switch {
    width: 100%;
    max-width: none !important;
    min-width: 0;
  }

  .top-right-tools .admin-badge {
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-right-tools .admin-badge-sub {
    flex: 0 0 auto;
  }

  .top-right-tools .theme-switch {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: stretch !important;
  }

  .top-right-tools .theme-choice {
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .top-nav-brand {
    font-size: 16px;
  }

  .top-nav-brand::after {
    display: none;
  }
}

/* v11.9 system audit fixes: remove empty message gutters and protect mobile tabs. */
.inline-message:empty {
  display: none !important;
}

/* v12 oral task draft editor: align the image pool and make per-question image binding direct. */
body.draft-editor-open {
  overflow: hidden;
}

.draft-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(16, 31, 45, .34);
  backdrop-filter: blur(6px);
}

.draft-editor-modal[hidden] {
  display: none !important;
}

.draft-editor-window {
  width: min(1720px, 96vw);
  height: min(920px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #bfd3df;
  border-radius: 18px;
  background: #f7fafc;
  box-shadow: 0 28px 90px rgba(18, 42, 62, .24);
}

.draft-editor-header,
.draft-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid #d8e6ee;
}

.draft-editor-header h2 {
  margin: 4px 0 4px;
  color: var(--pro-text, #102033);
  font-size: 24px;
  line-height: 1.18;
}

.draft-editor-header p {
  margin: 0;
  color: #5d7084;
  font-weight: 760;
  line-height: 1.55;
}

.draft-editor-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 12px !important;
  font-size: 22px;
  line-height: 1;
}

.draft-editor-stage {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.draft-editor-stage .paper-draft-grid {
  margin: 0;
  scroll-margin-top: 0;
}

.draft-editor-stage .paper-draft-grid > .panel {
  box-shadow: none !important;
}

.draft-editor-stage .paper-question-wrap,
.draft-editor-stage .oral-task-draft-panel .paper-question-wrap {
  max-height: none;
}

.draft-editor-stage .paper-question-table {
  min-width: 1120px;
}

.draft-editor-footer {
  border-top: 1px solid #d8e6ee;
  border-bottom: 0;
}

.draft-editor-status {
  min-width: 0;
  color: #52677d;
  font-weight: 820;
  line-height: 1.5;
}

.draft-editor-status.result,
.draft-editor-status.success {
  color: #087563;
}

.draft-editor-status.error,
.draft-editor-status.warn {
  color: #a54141;
}

.draft-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.draft-editor-actions button {
  min-width: 132px;
}

.paper-draft-grid.oral-task-draft-panel {
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.paper-draft-grid.oral-task-draft-panel > .panel {
  margin: 0 !important;
  border-radius: 14px !important;
}

.oral-task-draft-panel .image-tray-panel {
  position: static;
  top: auto;
}

.oral-task-draft-panel .question-draft-panel {
  padding: 22px 22px 20px;
}

.oral-task-draft-panel .paper-step-head.compact {
  align-items: flex-start;
  gap: 14px;
}

.oral-task-draft-panel .paper-step-head h2 {
  margin-top: 6px;
  line-height: 1.2;
}

.oral-task-draft-panel .paper-step-head p {
  max-width: 820px;
  line-height: 1.6;
}

.oral-task-draft-panel .paper-section-summary {
  margin: 14px 0 16px;
}

.oral-task-draft-panel .paper-question-wrap {
  max-height: min(720px, calc(100vh - 180px));
  border: 1px solid var(--pro-border, #d8e5ec);
  border-radius: 14px;
  background: var(--pro-surface, #fff);
  box-shadow: none;
}

.oral-task-draft-panel .paper-question-table {
  width: 100%;
  min-width: 1040px;
  table-layout: fixed;
}

.oral-task-draft-panel .paper-question-table th,
.oral-task-draft-panel .paper-question-table td {
  padding: 14px 16px;
}

.oral-task-draft-panel .paper-question-table th:nth-child(1) { width: 116px; }
.oral-task-draft-panel .paper-question-table th:nth-child(2) { width: 150px; }
.oral-task-draft-panel .paper-question-table th:nth-child(4) { width: 180px; }

.oral-task-draft-panel .paper-question-table th {
  background: #eef5f8;
  color: #52677d;
  border-bottom: 1px solid var(--pro-border, #d8e5ec);
}

.oral-task-draft-panel .paper-question-table td {
  background: #fff;
  border-bottom: 1px solid #e8f0f4;
}

.oral-task-draft-panel .paper-question-table tr:hover td {
  background: #f8fbfb;
}

.oral-task-draft-panel .paper-order-cell,
.oral-task-draft-panel .paper-id-score-cell {
  vertical-align: top;
}

.oral-task-draft-panel .paper-order-cell input,
.oral-task-draft-panel .paper-id-score-cell input {
  width: 100%;
  min-width: 0;
  height: 42px;
}

.oral-task-draft-panel .score-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.oral-task-draft-panel .score-input-row span {
  margin-bottom: 8px;
}

.oral-task-draft-panel .draft-row-actions {
  margin-top: 8px;
}

.oral-task-draft-panel .paper-question-table select {
  height: 44px;
  margin-bottom: 10px;
}

.oral-task-draft-panel .paper-question-table textarea {
  min-height: 108px;
  border-radius: 12px;
  resize: vertical;
}

.oral-task-draft-panel .draft-reference-label {
  display: block;
  margin: 10px 0 6px;
  color: #41576b;
  font-size: 12px;
  font-weight: 950;
}

.oral-task-draft-panel .draft-reference-hint {
  border: 1px solid #d8e6ee;
  border-radius: 8px;
  background: #f7fafc;
  color: #5d7082;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.55;
  margin-top: 7px;
  padding: 9px 10px;
  display: grid;
  gap: 5px;
}

.oral-task-draft-panel .draft-reference-hint.warn {
  border-color: rgba(191, 122, 24, .34);
  background: #fff8ec;
  color: #8a4e11;
}

.oral-task-draft-panel .draft-reference-hint.ok {
  border-color: rgba(34, 148, 109, .3);
  background: #eef9f4;
  color: #146d50;
}

.oral-task-draft-panel .draft-reference-hint.neutral {
  border-color: rgba(55, 108, 151, .22);
  background: #f5f9fc;
  color: #52677d;
}

.oral-task-draft-panel .draft-reference-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.oral-task-draft-panel .draft-reference-status strong {
  color: #10243a;
  font-size: 13px;
  font-weight: 950;
}

.oral-task-draft-panel .draft-reference-status span:last-child {
  color: inherit;
  font-weight: 800;
}

.oral-task-draft-panel .draft-reference-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(191, 122, 24, .12);
  color: #8a4e11;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.oral-task-draft-panel .draft-reference-hint.ok .draft-reference-badge {
  background: rgba(34, 148, 109, .13);
  color: #087655;
}

.oral-task-draft-panel .draft-reference-hint.neutral .draft-reference-badge {
  background: rgba(55, 108, 151, .10);
  color: #236fa4;
}

.oral-task-draft-panel .draft-reference-detail {
  color: inherit;
  font-size: 12px;
  font-weight: 760;
}

.oral-task-draft-panel .reference-missing-row > td {
  background: #fffdf8;
}

.oral-task-draft-panel .reference-focus-row > td {
  box-shadow: inset 3px 0 #bf7a18;
}

.oral-task-draft-panel .paper-drop-zone {
  min-height: 154px;
  border-radius: 14px !important;
  background: #f7fbfa !important;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.oral-task-draft-panel .paper-drop-zone span {
  color: #23384d;
  font-weight: 900;
}

.oral-task-draft-panel .paper-drop-zone.has-image {
  background: #f4fbf8 !important;
  border-color: #77bcb0;
}

.oral-task-draft-panel .paper-drop-zone img {
  height: 96px;
  border-radius: 10px;
  background: #fff;
}

.oral-task-draft-panel .paper-image-tray {
  max-height: min(660px, calc(100vh - 210px));
}

.oral-task-draft-panel .paper-image-card {
  border-radius: 12px !important;
}

.oral-task-draft-panel .paper-image-card img {
  height: 112px;
}

@media (max-width: 1100px) {
  .paper-draft-grid.oral-task-draft-panel {
    grid-template-columns: 1fr;
  }

  .oral-task-draft-panel .paper-image-tray {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .draft-editor-window {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .draft-editor-modal {
    padding: 0;
  }

  .draft-editor-footer,
  .draft-editor-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .draft-editor-actions {
    width: 100%;
    justify-content: stretch;
  }

  .draft-editor-actions button {
    flex: 1 1 150px;
  }
}

@media (max-width: 760px) {
  body.assignment-manage-page .published-view-toggle {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100%;
  }

  body.assignment-manage-page .published-view-toggle .published-view-card {
    width: 100%;
    min-width: 0;
    padding-inline: 10px !important;
  }

  body.assignment-manage-page .published-view-toggle .published-view-card strong {
    font-size: 15px;
    line-height: 1.25;
    white-space: normal;
  }

  .ai-settings-page .card-grid,
  .ai-settings-page .ai-settings-grid,
  .ai-settings-page .form-grid,
  .ai-settings-page label,
  .ai-settings-page input {
    min-width: 0;
  }

  .ai-settings-page #dashscopeAsrBaseUrl,
  .ai-settings-page #dashscopeMmBaseUrl,
  .ai-settings-page #dashscopeTtsEndpoint,
  .ai-settings-page #deepseekBaseUrl {
    font-size: 12px;
    padding-inline: 10px;
    text-overflow: ellipsis;
  }
}

/* v11.13 task-center-6 visual audit polish: calmer admin UI, clearer mobile navigation, safer dense cards. */
.nav-voice {
  --nav-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 10a3 3 0 0 1 3-3h2.4L14 3.6A1 1 0 0 1 15.6 4v16a1 1 0 0 1-1.6.8L9.4 17H7a3 3 0 0 1-3-3zm14.2-2.8 1.4-1.4A8.5 8.5 0 0 1 22 12a8.5 8.5 0 0 1-2.4 6.2l-1.4-1.4A6.5 6.5 0 0 0 20 12a6.5 6.5 0 0 0-1.8-4.8m-2.4 2.4 1.4-1.4A5.3 5.3 0 0 1 18.8 12a5.3 5.3 0 0 1-1.6 3.8l-1.4-1.4A3.2 3.2 0 0 0 16.8 12a3.2 3.2 0 0 0-1-2.4'/%3E%3C/svg%3E");
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .panel-card,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .panel,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .upload-module-panel,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .ai-setting-card,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .sound-card,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .voice-profile-card,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .ops-metric,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .ops-note-grid > div,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .leaderboard-summary > div,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .leaderboard-podium-card {
  border-radius: 8px !important;
  box-shadow: 0 10px 26px rgba(24, 54, 78, .055) !important;
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .hero,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .dashboard-hero,
body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .hero-card.compact-hero {
  border-radius: 8px !important;
  box-shadow: 0 12px 34px rgba(24, 54, 78, .07) !important;
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .section-orb {
  width: 4px !important;
  height: 30px !important;
  border-radius: 4px !important;
  background: var(--module-primary, #0c8c74) !important;
  box-shadow: none !important;
}

body:is(.assignment-publish-page, .assignment-manage-page, .completion-overview-page, .upload-center-page, .sound-creator-page, .ai-console-page, .account-admin-page, .account-settings-page, .ops-center-page) .section-heading {
  gap: 12px;
}

.fixed-table-wrap {
  scrollbar-gutter: stable;
}

.fixed-table-wrap .clean-table thead th,
.fixed-table-wrap table.clean-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fbfc;
}

html[data-theme="dark"] .fixed-table-wrap .clean-table thead th,
html[data-theme="dark"] .fixed-table-wrap table.clean-table thead th {
  background: #122331;
}

.clean-table tbody tr {
  transition: background-color .14s ease;
}

.clean-table tbody tr:hover td {
  background: rgba(236, 248, 248, .76);
}

html[data-theme="dark"] .clean-table tbody tr:hover td {
  background: rgba(17, 39, 52, .9);
}

button:disabled,
.primary-action:disabled,
.secondary:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed !important;
  filter: grayscale(.18);
  opacity: .58 !important;
  transform: none !important;
  box-shadow: none !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(12, 139, 105, .18);
  outline-offset: 2px;
}

.modal-head-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.ai-console-page .ai-role-strip > div,
body.ai-console-page .ai-function-card,
body.ai-console-page .oss-plan-card,
body.ai-console-page .oss-plan-summary > div {
  overflow: visible !important;
  border-radius: 8px !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

body.ai-console-page .ai-role-strip > div::after {
  display: none !important;
}

body.ai-console-page .ai-role-strip p,
body.ai-console-page .ai-function-card p,
body.ai-console-page .oss-plan-card p,
body.ai-console-page .oss-plan-card small {
  max-width: 100%;
}

body.ai-console-page .ai-role-strip {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) !important;
}

@media (max-width: 700px) {
  .top-module-nav {
    position: static;
  }

  .top-nav-inner {
    width: min(100% - 20px, 520px);
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 0;
  }

  .top-nav-brand {
    min-width: 0;
  }

  .top-nav-brand::after {
    display: none;
  }

  .top-nav-links {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    overflow: visible;
    padding: 0;
  }

  .top-nav-links a {
    justify-content: center;
    min-width: 0;
    min-height: 36px;
    padding: 0 4px;
    gap: 0;
    font-size: 11px;
  }

  .nav-icon {
    display: none;
  }

  .top-right-tools {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    justify-content: flex-end;
    gap: 8px;
  }

  .admin-badge,
  .logout-link {
    display: none;
  }

  .theme-switch {
    margin-left: auto;
  }

  .theme-choice {
    min-width: 58px;
    padding-inline: 8px;
  }

  .modal-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 360px) {
  .top-nav-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body.assignment-manage-page .assignment-due-top .text-mini-button {
  height: 34px !important;
  min-height: 34px !important;
}

/* v11.14 global interaction lift: reclaim first-screen space and clarify current navigation. */
.top-nav-links a[aria-current="page"] {
  font-weight: 950;
}

@media (min-width: 701px) and (max-width: 1480px) {
  .top-nav-inner {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    gap: 12px !important;
    min-height: 66px !important;
    padding: 6px 0 !important;
  }

  .top-nav-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .top-nav-links {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    justify-content: center !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding: 0 !important;
  }

  .top-right-tools {
    grid-column: 3 !important;
    grid-row: 1 !important;
    display: flex !important;
    width: auto !important;
    justify-content: flex-end !important;
    min-width: 0 !important;
  }

  .top-right-tools .admin-badge {
    display: inline-flex !important;
    width: 44px !important;
    max-width: 44px !important;
    min-width: 44px !important;
    justify-content: center !important;
    overflow: hidden !important;
    padding-inline: 0 !important;
    font-size: 0 !important;
  }

  .top-right-tools .admin-badge::before {
    content: "我的";
    font-size: 12px;
    font-weight: 950;
  }

  .top-right-tools .admin-badge-sub {
    display: none !important;
  }

  .top-right-tools .logout-link {
    display: inline-flex !important;
    width: 44px !important;
    max-width: 44px !important;
    min-width: 44px !important;
    justify-content: center !important;
    overflow: hidden !important;
    padding-inline: 0 !important;
    font-size: 12px !important;
  }

  .top-right-tools .theme-switch {
    width: auto !important;
    min-width: 0 !important;
  }
}

@media (max-width: 700px) {
  .top-nav-inner {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
    min-height: 0 !important;
    padding: 8px 0 !important;
    width: min(100% - 20px, 520px) !important;
  }

  .top-nav-brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-height: 36px !important;
  }

  .top-right-tools {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    width: auto !important;
    min-width: 0 !important;
    justify-content: flex-end !important;
  }

  .top-right-tools .admin-badge,
  .top-right-tools .logout-link {
    display: none !important;
  }

  .top-right-tools .theme-switch {
    display: flex !important;
    width: auto !important;
    min-width: 0 !important;
    height: 36px !important;
    justify-self: auto !important;
  }

  .top-right-tools .theme-choice {
    min-height: 34px !important;
    min-width: 54px !important;
    padding-inline: 7px !important;
  }

  .top-nav-links {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 7px !important;
    width: 100% !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .top-nav-links a {
    min-height: 34px !important;
    padding: 0 4px !important;
  }
}

.assignment-public-page .assignment-submit-btn {
  min-height: 52px !important;
  font-size: 16px !important;
}

@media (max-width: 700px) {
  .assignment-public-page .assignment-submit-btn {
    min-height: 48px !important;
    width: 100%;
  }
}

.student-mode.student-mobile .question-voice-panel.hidden,
.student-mode.oral-assignment-mode .question-voice-panel.hidden,
.student-mode.student-mobile .question-voice-panel[hidden],
.student-mode.oral-assignment-mode .question-voice-panel[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .student-mode.student-mobile .recorder,
  .student-mode.oral-assignment-mode .recorder {
    padding: 16px 14px !important;
  }

  .student-mode.student-mobile #timer,
  .student-mode.oral-assignment-mode #timer {
    min-width: 112px !important;
    height: 48px !important;
    margin: 0 auto 8px !important;
    padding: 0 16px !important;
    font-size: clamp(30px, 9vw, 38px) !important;
    line-height: 1 !important;
  }

  .student-mode.student-mobile #status,
  .student-mode.oral-assignment-mode #status {
    margin-bottom: 4px !important;
    font-size: 15px !important;
  }

  .student-mode.student-mobile .record-hint,
  .student-mode.oral-assignment-mode .record-hint {
    margin: 4px auto 0 !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
  }

  .student-mode.student-mobile .record-actions,
  .student-mode.oral-assignment-mode .record-actions {
    margin-top: 10px !important;
  }
}

/* 2026-05-24 oral-mobile-answer-sheet-polish: calmer proportions for phone task taking. */
@media (max-width: 760px) {
  .student-mode.student-mobile.assessment-started,
  .student-mode.oral-assignment-mode.student-mobile.assessment-started {
    width: min(100% - 14px, 430px) !important;
    padding: 6px 7px max(14px, env(safe-area-inset-bottom)) !important;
    background:
      linear-gradient(180deg, rgba(239, 248, 246, .96), rgba(245, 249, 250, .98)) !important;
  }

  .student-mode.student-mobile.assessment-started > .student-theme-dock {
    top: calc(max(6px, env(safe-area-inset-top)) + 2px) !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    padding: 3px !important;
    gap: 2px !important;
    opacity: .66 !important;
    transform: scale(.82) translateZ(0) !important;
    transform-origin: top right !important;
  }

  .student-mode.student-mobile.assessment-started > .student-theme-dock .theme-choice {
    width: 32px !important;
    min-height: 30px !important;
    padding: 0 !important;
    justify-content: center !important;
    font-size: 0 !important;
  }

  .student-mode.student-mobile.assessment-started > .student-theme-dock .theme-dot {
    width: 11px !important;
    height: 11px !important;
    margin: 0 !important;
  }

  .student-mode.student-mobile.assessment-started .test-panel {
    display: grid !important;
    gap: 10px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .student-mode.student-mobile.assessment-started .question-card {
    margin: 0 !important;
    padding: 15px 15px 17px 18px !important;
    border-radius: 18px !important;
    background: linear-gradient(180deg, #ffffff, #fbfefd) !important;
    border: 1px solid #d9e9ea !important;
    box-shadow: 0 12px 32px rgba(26, 60, 72, .08) !important;
  }

  .student-mode.student-mobile.assessment-started .question-card::before {
    top: 16px !important;
    bottom: 16px !important;
    left: 0 !important;
    width: 4px !important;
    border-radius: 0 999px 999px 0 !important;
    background: linear-gradient(180deg, #15977d, #2a6f9e) !important;
  }

  .student-mode.student-mobile.assessment-started .question-card-head {
    margin-bottom: 12px !important;
  }

  .student-mode.student-mobile.assessment-started .badge,
  .student-mode.student-mobile.assessment-started .progress {
    height: 30px !important;
    padding: 0 11px !important;
    font-size: 12px !important;
    border-radius: 999px !important;
  }

  .student-mode.student-mobile.assessment-started .question-label {
    margin-bottom: 6px !important;
    color: #617182 !important;
    font-size: 12px !important;
  }

  .student-mode.student-mobile.assessment-started #qTitle {
    font-size: clamp(34px, 10.4vw, 46px) !important;
    line-height: 1.08 !important;
    color: #102136 !important;
    letter-spacing: 0 !important;
  }

  .student-mode.student-mobile.assessment-started .rubric-card {
    margin: 0 !important;
    padding: 10px 12px 11px 14px !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    border: 1px solid #dce8e8 !important;
    color: #334356 !important;
    font-size: 15px !important;
    line-height: 1.45 !important;
    box-shadow: 0 8px 24px rgba(31, 52, 74, .045) !important;
  }

  .student-mode.student-mobile.assessment-started .rubric-card strong {
    color: #16735d !important;
    font-size: 15px !important;
  }

  .student-mode.student-mobile.assessment-started .recorder {
    margin: 0 !important;
    padding: 13px 12px 15px !important;
    border-radius: 18px !important;
    background: linear-gradient(180deg, #ffffff, #fbfdfe) !important;
    border: 1px solid #d9e8ee !important;
    box-shadow: 0 14px 34px rgba(26, 60, 72, .075) !important;
  }

  .student-mode.student-mobile.assessment-started #timer {
    min-width: 104px !important;
    height: 42px !important;
    margin: 0 auto 7px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    background: #f5fafb !important;
    border: 1px solid #dfeaed !important;
    color: #112238 !important;
    font-size: clamp(27px, 8vw, 34px) !important;
    line-height: 1 !important;
  }

  .student-mode.student-mobile.assessment-started #status {
    max-width: 310px !important;
    margin: 0 auto 7px !important;
    color: #166f60 !important;
    font-size: 17px !important;
    line-height: 1.34 !important;
    font-weight: 900 !important;
  }

  .student-mode.student-mobile.assessment-started .record-hint {
    max-width: 320px !important;
    max-height: 56px !important;
    margin: 6px auto 0 !important;
    color: #6a7786 !important;
    font-size: 12.5px !important;
    line-height: 1.4 !important;
  }

  .student-mode.student-mobile.assessment-started .record-hint.warn {
    padding: 8px 10px !important;
    border-radius: 12px !important;
    background: #fffaf0 !important;
    border: 1px solid #eadcac !important;
    color: #66501c !important;
    font-size: 13px !important;
  }

  .student-mode.student-mobile.assessment-started .record-actions {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 11px !important;
  }

  .student-mode.student-mobile.assessment-started #recordBtn {
    grid-column: 1 / -1 !important;
    order: 1 !important;
  }

  .student-mode.student-mobile.assessment-started #prevBtn {
    order: 2 !important;
  }

  .student-mode.student-mobile.assessment-started #nextBtn {
    order: 3 !important;
  }

  .student-mode.student-mobile.assessment-started .record-actions .nav-step {
    min-height: 44px !important;
    border-radius: 14px !important;
    color: #29445b !important;
    font-size: 15px !important;
    background: #fbfdfe !important;
    border-color: #dbe8ed !important;
  }

  .student-mode.student-mobile.assessment-started .primary-record {
    min-height: 56px !important;
    border-radius: 17px !important;
    padding: 0 18px !important;
    font-size: 22px !important;
    background: linear-gradient(135deg, #2f9479, #287a91) !important;
    box-shadow: 0 12px 26px rgba(32, 126, 113, .22) !important;
  }

  .student-mode.student-mobile.assessment-started .primary-record .record-icon {
    width: 26px !important;
    height: 26px !important;
  }

  .student-mode.student-mobile.assessment-started .audio-check-panel {
    margin: 12px 0 0 !important;
    padding: 11px 12px !important;
    border-radius: 16px !important;
    text-align: left !important;
    box-shadow: none !important;
  }

  .student-mode.student-mobile.assessment-started .audio-check-head {
    margin-bottom: 6px !important;
  }

  .student-mode.student-mobile.assessment-started .audio-check-head strong {
    font-size: 15px !important;
  }

  .student-mode.student-mobile.assessment-started .audio-check-panel p {
    font-size: 13px !important;
    line-height: 1.42 !important;
  }

  .student-mode.student-mobile.assessment-started .audio-check-actions {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 8px !important;
  }

  .student-mode.student-mobile.assessment-started .audio-check-actions button {
    min-height: 40px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
  }

  html[data-theme="dark"] .student-mode.student-mobile.assessment-started .question-card,
  html[data-theme="dark"] .student-mode.student-mobile.assessment-started .rubric-card,
  html[data-theme="dark"] .student-mode.student-mobile.assessment-started .recorder {
    background: #0d1722 !important;
    border-color: rgba(132, 164, 184, .28) !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .28) !important;
  }

  html[data-theme="dark"] .student-mode.student-mobile.assessment-started .rubric-card {
    color: #d6e1df !important;
  }

  html[data-theme="dark"] .student-mode.student-mobile.assessment-started #status {
    color: #9debd5 !important;
  }
}
