/* AI智学中心 · 班主任工作台
   视觉参考：校园管理后台（Schola）+ Stripe/Linear 的克制密度
   原则：单一字体族、清晰字号阶梯、弱装饰、强层级 */

:root {
  --font: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC",
    "Microsoft YaHei", sans-serif;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1c2430;
  --muted: #667085;
  --line: #e5e7eb;
  --line-strong: #d0d5dd;
  --brand: #0b4f8a;
  --brand-soft: #e8f1f8;
  --brand-hover: #093f6e;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #027a48;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.04);
  --radius: 10px;
  --radius-sm: 8px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* 兼容旧变量名 */
  --ai-bg: var(--bg);
  --ai-panel: var(--panel);
  --ai-ink: var(--ink);
  --ai-muted: var(--muted);
  --ai-line: var(--line);
  --ai-blue: var(--brand);
  --ai-blue-2: var(--brand);
  --ai-cyan: #0e7090;
  --ai-red: var(--danger);
  --ai-green: var(--success);
  --ai-orange: var(--warning);
  --ai-shadow: var(--shadow);
  --ai-radius: var(--radius);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

#ai-center-root {
  min-height: 100vh;
}

#ai-center-root.ready {
  opacity: 1;
}

.ai-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.ai-sidebar {
  display: none !important;
}

/* ========== Header ========== */
.ai-topbar,
.ai-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 10px clamp(16px, 2.5vw, 28px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.ai-header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.ai-brand-logos {
  display: flex;
  align-items: center;
}

.ai-header .ai-brand-logos img,
.ai-brand-logos img {
  width: 34px;
  height: 34px;
  padding: 2px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
}

.ai-header .ai-brand-logos img + img,
.ai-brand-logos img + img {
  margin-left: -8px;
}

.ai-brand-text {
  display: grid;
  gap: 2px;
}

.ai-brand-text strong {
  color: var(--ink);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ai-brand-text span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-header-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
}

.ai-page-heading h1 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.ai-page-heading small {
  display: none;
}

.ai-top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ai-teacher-badge {
  display: none;
}

.ai-search-trigger,
.ai-context-pill,
.ai-copilot-trigger,
.ai-primary,
.ai-secondary,
.ai-filter-tabs button,
.ai-row-action {
  border-radius: var(--radius-sm);
}

.ai-search-trigger {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-search-trigger:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.ai-context-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 4px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.ai-context-pill b {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
}

.ai-context-pill small {
  display: none;
}

.ai-avatar {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: var(--text-xs);
  font-weight: 600;
}

.ai-avatar.large {
  width: 48px;
  height: 48px;
  font-size: var(--text-md);
}

.ai-avatar.xl {
  width: 64px;
  height: 64px;
  font-size: var(--text-lg);
}

.ai-copilot-trigger {
  height: 36px;
  padding: 0 14px;
  border: 0;
  color: #fff;
  background: var(--brand);
  font-size: var(--text-sm);
  font-weight: 600;
}

.ai-copilot-trigger:hover {
  background: var(--brand-hover);
}

.ai-copilot-trigger i {
  display: none;
}

.ai-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ai-content {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px clamp(16px, 2.5vw, 28px) 28px;
}

.ai-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 12px clamp(16px, 2.5vw, 28px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-embed .ai-footer {
  display: none;
}

/* ========== Buttons ========== */
.ai-primary,
.ai-secondary {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ai-primary {
  border: 0;
  color: #fff;
  background: var(--brand);
}

.ai-primary:hover {
  background: var(--brand-hover);
}

.ai-primary:disabled {
  opacity: 0.5;
  cursor: wait;
}

.ai-primary.wide {
  width: 100%;
}

.ai-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.ai-secondary:hover {
  border-color: var(--line-strong);
  background: #fafafa;
}

.ai-danger-text {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: var(--text-sm);
}

/* ========== Page chrome ========== */
.ai-page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 0 12px;
}

.ai-page-intro p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.ai-page-intro h2,
.ai-page-intro .ai-eyebrow {
  display: none;
}

.ai-page-intro-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.ai-context-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.ai-context-banner > div {
  margin-right: auto;
}

.ai-context-banner b {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
}

.ai-context-banner small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-context-banner > span:not(.ai-avatar) {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 500;
}

.ai-context-banner > button,
.ai-context-banner .ai-secondary,
.ai-context-banner .ai-primary {
  min-height: 32px;
}

.ai-context-banner > button[data-route] {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0 4px;
}

/* ========== Hero / Dashboard ========== */
.ai-hero {
  margin-bottom: 12px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.ai-hero-orbit {
  display: none !important;
}

.ai-eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ai-hero h2 {
  margin: 0;
  max-width: 28em;
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.ai-hero p {
  max-width: 40em;
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.65;
}

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

.ai-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.ai-kpi {
  position: relative;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  color: inherit;
  box-shadow: none;
  transition: border-color 0.15s ease;
}

.ai-kpi:hover {
  border-color: #b9c5d4;
}

.ai-kpi::after,
.ai-kpi-icon,
.ai-kpi > i {
  display: none;
}

.ai-kpi-label {
  display: block;
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-kpi strong {
  display: block;
  margin: 10px 0 6px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ai-kpi small {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  gap: 12px;
}

.ai-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: none;
}

.ai-dashboard-grid > .ai-card {
  min-height: 280px;
  padding: 16px 18px;
}

.ai-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ai-card-head h3 {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 600;
}

.ai-card-head > span,
.ai-card-meta,
.ai-card-head > b {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 500;
}

.ai-card-head > button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0;
}

.ai-step-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* Chart */
.ai-trend-chart {
  position: relative;
  height: 190px;
}

.ai-trend-chart svg {
  width: 100%;
  height: 100%;
}

.ai-trend-chart .grid line {
  stroke: #eef0f4;
}

.ai-trend-chart .area {
  fill: rgba(11, 79, 138, 0.08);
}

.ai-trend-chart .line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.ai-trend-chart .dots circle {
  fill: #fff;
  stroke: var(--brand);
  stroke-width: 2.5;
}

.ai-chart-badge {
  position: absolute;
  right: 4px;
  top: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ai-chart-badge b {
  display: block;
  color: var(--ink);
  font-size: var(--text-sm);
}

.ai-chart-badge span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-mastery-row {
  margin-top: 14px;
}

.ai-mastery-row > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: var(--text-sm);
}

.ai-mastery-row b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.ai-progress,
.ai-mini-progress {
  overflow: hidden;
  border-radius: 999px;
  background: #eef0f4;
}

.ai-progress {
  height: 6px;
}

.ai-progress i,
.ai-mini-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.ai-progress i.high {
  background: var(--success);
}

.ai-progress i.low {
  background: var(--danger);
}

.ai-focus-row {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.ai-focus-row:last-child {
  border-bottom: 0;
}

.ai-focus-row b {
  display: block;
  font-size: var(--text-sm);
}

.ai-focus-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-focus-row strong,
.negative {
  color: var(--danger);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.ai-task-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.ai-task-row:last-child {
  border-bottom: 0;
}

.ai-task-type {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: var(--text-xs);
  font-weight: 600;
}

.ai-task-row b {
  display: block;
  font-size: var(--text-sm);
}

.ai-task-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-task-row em {
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: var(--text-xs);
  font-style: normal;
  font-weight: 600;
}

/* ========== Students ========== */
.ai-student-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.ai-input-wrap {
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.ai-input-wrap span {
  color: var(--muted);
}

.ai-input-wrap input {
  width: 100%;
  height: 34px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: var(--text-sm);
}

.ai-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ai-filter-tabs button {
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-filter-tabs button.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.ai-result-count {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-student-table-wrap {
  overflow: auto;
}

.ai-student-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.ai-student-table th {
  padding: 12px 14px;
  color: var(--muted);
  background: #fafafa;
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.ai-student-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.ai-student-table tbody tr:hover {
  background: #fafbfd;
}

.ai-student-table td b,
.ai-student-table td small {
  display: block;
}

.ai-student-table td small {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-student-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-subject-tag,
.ai-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
}

.ai-subject-tag,
.ai-status.info {
  color: var(--brand);
  background: var(--brand-soft);
}

.ai-status.success {
  color: var(--success);
  background: var(--success-soft);
}

.ai-status.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.ai-status.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.ai-mini-progress {
  width: 72px;
  height: 4px;
  margin-top: 5px;
}

.ai-trend {
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ai-trend.up {
  color: var(--success);
}

.ai-trend.down {
  color: var(--danger);
}

.ai-row-action {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ========== Forms / Work ========== */
.ai-work-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(380px, 1.15fr);
  gap: 12px;
}

.ai-work-grid > .ai-card,
.ai-profile-grid > .ai-card,
.ai-report-layout > .ai-card {
  padding: 16px;
}

.ai-dropzone {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fafafa;
}

.ai-dropzone.compact {
  text-align: left;
}

.ai-upload-icon,
.ai-dropzone h3,
.ai-dropzone p {
  display: none;
}

.ai-dropzone input,
.ai-form-grid input,
.ai-form-grid select,
.ai-form-grid textarea,
.ai-field-full textarea,
.ai-copilot-input textarea,
.ai-command-search input,
.ai-modal input,
.ai-modal select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ai-dropzone input,
.ai-form-grid input,
.ai-form-grid select {
  height: 38px;
  padding: 0 12px;
  font-size: var(--text-sm);
}

.ai-dropzone input:focus,
.ai-form-grid input:focus,
.ai-form-grid select:focus,
.ai-form-grid textarea:focus,
.ai-field-full textarea:focus {
  border-color: #8bb4d6;
  box-shadow: 0 0 0 3px rgba(11, 79, 138, 0.1);
}

.ai-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.ai-form-grid label,
.ai-field-full {
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-form-grid label.full {
  grid-column: 1 / -1;
}

.ai-form-grid textarea,
.ai-field-full textarea {
  min-height: 88px;
  margin-top: 6px;
  padding: 10px 12px;
  resize: vertical;
  font-size: var(--text-sm);
  line-height: 1.55;
}

.ai-field-full {
  display: block;
  margin-top: 12px;
}

.ai-inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.ai-inline-actions > span {
  display: none;
}

.ai-process-log {
  max-height: 120px;
  overflow: auto;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  white-space: pre-wrap;
  background: #fafafa;
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* ========== Insight ========== */
.ai-profile-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1fr) minmax(280px, 0.9fr);
  gap: 12px;
}

.ai-profile-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-profile-person h3 {
  margin: 0;
  font-size: var(--text-lg);
}

.ai-profile-person p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-profile-person .ai-status {
  margin-left: auto;
}

.ai-radar-faux {
  position: relative;
  width: 180px;
  height: 160px;
  margin: 18px auto 12px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--brand-soft), transparent 62%),
    #fff;
}

.ai-radar-faux::before,
.ai-radar-faux::after,
.ai-radar-shape {
  display: none;
}

.ai-radar-faux > span {
  position: absolute;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-radar-faux .r1 { top: 8px; left: 50%; transform: translateX(-50%); }
.ai-radar-faux .r2 { right: 10px; top: 42%; }
.ai-radar-faux .r3 { right: 28px; bottom: 14px; }
.ai-radar-faux .r4 { left: 20px; bottom: 14px; }
.ai-radar-faux .r5 { left: 10px; top: 42%; }

.ai-radar-faux > strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
}

.ai-profile-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ai-profile-metrics > div {
  text-align: center;
}

.ai-profile-metrics b {
  display: block;
  font-size: var(--text-lg);
  font-weight: 600;
}

.ai-profile-metrics span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-insight-callout {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #f0d7a8;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
}

.ai-insight-callout > i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--warning);
  font-size: var(--text-xs);
  font-style: normal;
}

.ai-insight-callout b {
  font-size: var(--text-sm);
}

.ai-insight-callout p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.ai-recommend-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.ai-recommend-row > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: var(--text-xs);
  font-weight: 600;
}

.ai-recommend-row b {
  font-size: var(--text-sm);
}

.ai-recommend-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.ai-recommend-row em {
  color: var(--muted);
  font-size: var(--text-xs);
  font-style: normal;
}

.ai-recommend-card .wide {
  margin-top: 12px;
}

/* ========== Exercise / Report ========== */
.ai-generator-grid {
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 1fr);
}

.ai-preview-card {
  background: #fafafa;
}

.ai-paper-preview {
  position: relative;
  width: 88%;
  min-height: 280px;
  margin: 12px auto;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transform: none;
}

.ai-paper-head {
  text-align: center;
}

.ai-paper-head > span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-paper-head b {
  display: block;
  margin-top: 6px;
  font-size: var(--text-lg);
}

.ai-paper-head small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-paper-lines {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.ai-paper-lines i {
  display: block;
  height: 8px;
  background: #eef0f4;
  border-radius: 4px;
}

.ai-paper-lines i:nth-child(2n) {
  width: 78%;
}

.ai-watermark {
  display: none;
}

.ai-preview-note {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: var(--text-sm);
}

.ai-report-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(420px, 1.25fr);
  gap: 12px;
}

.ai-report-cover {
  min-height: 420px;
  padding: 28px 20px !important;
  color: #fff;
  text-align: center;
  background: linear-gradient(160deg, #0b4f8a, #1468a8);
}

.ai-report-cover::after {
  display: none;
}

.ai-report-brand {
  display: flex;
  justify-content: center;
}

.ai-report-brand img {
  width: 40px;
  height: 40px;
  padding: 2px;
  border-radius: 50%;
  background: #fff;
}

.ai-report-brand img + img {
  margin-left: -8px;
}

.ai-report-cover > span {
  display: block;
  margin-top: 28px;
  opacity: 0.8;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
}

.ai-report-cover h2 {
  margin: 8px 0 28px;
  font-size: 26px;
  font-weight: 600;
}

.ai-report-student strong {
  font-size: var(--text-xl);
}

.ai-report-student p {
  margin: 6px 0 0;
  opacity: 0.8;
  font-size: var(--text-sm);
}

.ai-report-score {
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  align-content: center;
  margin: 28px auto 40px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
}

.ai-report-score b {
  font-size: 30px;
}

.ai-report-score span {
  margin-top: 2px;
  opacity: 0.8;
  font-size: var(--text-xs);
}

.ai-report-cover > small {
  opacity: 0.75;
  font-size: var(--text-xs);
}

.ai-report-summary {
  margin: 0;
  padding: 14px;
  border-left: 3px solid var(--brand);
  color: var(--ink);
  background: #fafafa;
  font-size: var(--text-base);
  line-height: 1.7;
}

.ai-report-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}

.ai-report-columns > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.ai-report-columns h4 {
  margin: 0 0 10px;
  font-size: var(--text-sm);
}

.ai-report-columns ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.8;
}

/* ========== Timeline ========== */
.ai-timeline {
  position: relative;
  padding: 18px 20px;
}

.ai-timeline-line {
  position: absolute;
  left: 34px;
  top: 36px;
  bottom: 36px;
  width: 1px;
  background: var(--line);
}

.ai-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}

.ai-timeline-dot {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: var(--text-xs);
}

.ai-timeline-item h3 {
  margin: 2px 0;
  font-size: var(--text-base);
}

.ai-timeline-item p,
.ai-timeline-item small {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-empty {
  padding: 56px 20px;
  color: var(--muted);
  text-align: center;
}

.ai-empty b {
  color: var(--ink);
  font-size: var(--text-md);
}

.ai-empty p {
  font-size: var(--text-sm);
}

/* ========== Overlay / Drawer / Modal ========== */
.ai-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(16, 24, 40, 0.35);
}

.ai-student-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  width: min(380px, 92vw);
  overflow: auto;
  padding: 18px;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(16, 24, 40, 0.08);
}

.ai-drawer-head,
.ai-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-drawer-head {
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-drawer-head button,
.ai-modal-head > button,
.ai-copilot-head > button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: var(--bg);
  font-size: 18px;
  line-height: 1;
}

.ai-drawer-profile {
  display: grid;
  justify-items: center;
  padding: 24px 0 18px;
}

.ai-drawer-profile h2 {
  margin: 12px 0 4px;
  font-size: var(--text-xl);
}

.ai-drawer-profile p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.ai-drawer-score {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ai-drawer-score > div {
  text-align: center;
}

.ai-drawer-score b {
  display: block;
  font-size: var(--text-lg);
  font-weight: 600;
}

.ai-drawer-score span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-drawer-section {
  margin-top: 18px;
}

.ai-drawer-section h3 {
  margin: 0 0 10px;
  font-size: var(--text-base);
}

.ai-drawer-section p {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.65;
}

.ai-weak-chip {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: var(--text-sm);
}

.ai-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.ai-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.ai-modal {
  position: relative;
  z-index: 81;
  width: min(560px, 95vw);
  padding: 22px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.16);
}

.ai-modal-head small {
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-modal-head h2 {
  margin: 4px 0 0;
  font-size: var(--text-xl);
}

.ai-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.ai-command-layer {
  align-items: start;
  padding-top: 12vh;
}

.ai-command-palette {
  position: relative;
  z-index: 81;
  width: min(560px, 94vw);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.16);
}

.ai-command-search {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.ai-command-search > span {
  color: var(--muted);
}

.ai-command-search input {
  height: 36px;
  border: 0;
  outline: 0;
  font-size: var(--text-md);
}

kbd {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: var(--bg);
  font-family: inherit;
  font-size: 11px;
}

.ai-command-group {
  padding: 10px;
}

.ai-command-group > small {
  display: block;
  padding: 4px 8px 8px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-command-group button {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.ai-command-group button:hover {
  background: var(--bg);
}

.ai-command-group button > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
}

.ai-command-group button b {
  font-size: var(--text-sm);
}

.ai-command-group button small {
  color: var(--muted);
  font-size: var(--text-xs);
}

/* ========== Copilot ========== */
.ai-copilot {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: min(400px, 94vw);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -12px 0 40px rgba(16, 24, 40, 0.08);
  transform: translateX(105%);
  transition: transform 0.25s ease;
}

.ai-copilot.open {
  transform: translateX(0);
}

.ai-copilot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ai-copilot-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-copilot-mark,
.ai-bot-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-size: var(--text-xs);
  font-weight: 700;
}

.ai-copilot-head b {
  display: block;
  font-size: var(--text-md);
}

.ai-copilot-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-copilot-head > button {
  background: var(--bg);
  color: var(--muted);
}

.ai-copilot-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #fafafa;
  font-size: var(--text-xs);
}

.ai-copilot-context b {
  margin-left: auto;
  color: var(--ink);
  font-size: var(--text-sm);
}

.ai-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.ai-copilot-messages {
  flex: 1;
  overflow: auto;
  padding: 16px;
  background: #fafafa;
}

.ai-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-message p {
  max-width: 86%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  white-space: pre-wrap;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.ai-message.user {
  justify-content: flex-end;
}

.ai-message.user p {
  border-color: transparent;
  color: #fff;
  background: var(--brand);
}

.ai-typing {
  display: flex;
  gap: 4px;
}

.ai-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.ai-copilot-chips {
  display: flex;
  gap: 6px;
  overflow: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.ai-copilot-chips button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-size: var(--text-xs);
}

.ai-copilot-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.ai-copilot-input textarea {
  min-height: 42px;
  max-height: 100px;
  padding: 10px 12px;
  resize: none;
  font-size: var(--text-sm);
}

.ai-copilot-input button {
  width: 42px;
  border: 0;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--brand);
  font-size: 16px;
}

.ai-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: #1c2430;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: var(--text-sm);
}

.ai-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ========== Responsive ========== */
@media (max-width: 1120px) {
  .ai-brand-text span,
  .ai-header-divider {
    display: none;
  }

  .ai-dashboard-grid,
  .ai-profile-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ai-profile-grid .ai-recommend-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .ai-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .ai-kpi-grid,
  .ai-dashboard-grid,
  .ai-work-grid,
  .ai-profile-grid,
  .ai-report-layout,
  .ai-generator-grid {
    grid-template-columns: 1fr;
  }

  .ai-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .ai-search-trigger,
  .ai-context-pill span:not(.ai-avatar) {
    display: none;
  }

  .ai-content {
    padding: 12px;
  }

  .ai-hero {
    padding: 18px;
  }

  .ai-hero h2 {
    font-size: 20px;
  }

  .ai-form-grid,
  .ai-report-columns {
    grid-template-columns: 1fr;
  }

  .ai-student-table th:nth-child(3),
  .ai-student-table td:nth-child(3),
  .ai-student-table th:nth-child(5),
  .ai-student-table td:nth-child(5),
  .ai-student-table th:nth-child(6),
  .ai-student-table td:nth-child(6) {
    display: none;
  }

  .ai-timeline-item {
    grid-template-columns: 28px 1fr auto;
  }

  .ai-timeline-item .ai-secondary {
    grid-column: 2 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
