:root {
  --bg-outer: #F2F2F2;
  --bg-white: #FFFFFF;
  --bg-subtle: #F7F8FA;
  --bg-greeting: #F3F7FE;
  --border-greeting: #DCE8FE;
  --bg-primary-light: #EAF1FF;
  --primary: #0959FA;
  --primary-hover: #0749CF;
  --text-primary: #1F2329;
  --text-secondary: #59606B;
  --text-tertiary: #8C939F;
  --border-light: #E8ECF2;
  --border-medium: #D5DCE6;
  --orange-accent: #F55F30;

  /* Status semantic colors (always paired with text labels) */
  --tag-danger-bg: #FEF2F2;
  --tag-danger-text: #D92D20;
  --tag-danger-border: #FECACA;

  --tag-warn-bg: #FFF7ED;
  --tag-warn-text: #C2410C;
  --tag-warn-border: #FED7AA;

  --tag-success-bg: #ECFDF5;
  --tag-success-text: #047857;
  --tag-success-border: #A7F3D0;

  --tag-info-bg: #EFF6FF;
  --tag-info-text: #1D4ED8;
  --tag-info-border: #BFDBFE;

  --tag-neutral-bg: #F3F4F6;
  --tag-neutral-text: #4B5563;
  --tag-neutral-border: #E5E7EB;

  --sidebar-w: 156px;
  --topbar-h: 52px;
  --drawer-w: 420px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-float: 0 8px 28px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-outer);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Narrow 1024px Simulation Frame */
body.narrow-sim {
  background: #D8DCE3;
  display: flex;
  justify-content: center;
  align-items: center;
}

body.narrow-sim .app-shell {
  width: 1024px;
  height: 100vh;
  max-height: 900px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

/* App Shell Layout */
.app-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  background: var(--bg-outer);
  position: relative;
}

/* Left Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-white);
  border-right: 1px solid #ECEEF2;
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 20;
}

.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  flex-shrink: 0;
}

.sidebar-brand img {
  width: 24px;
  height: 22px;
  object-fit: contain;
}

.sidebar-brand-text {
  font-size: 13px;
  font-weight: 600;
  color: #1A1D24;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px 14px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: #DCE0E6;
  border-radius: 4px;
}

.nav-group-label {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 12px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #2B303A;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #4E5663;
}

.nav-item:hover {
  background: #F5F7FA;
}

.nav-item.active {
  background: var(--bg-primary-light);
  color: var(--primary);
  font-weight: 500;
}

.nav-item.active svg {
  color: var(--primary);
}

.sidebar-footer {
  padding: 8px 10px 10px;
  border-top: 1px solid #F0F2F5;
}

.demo-guide-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #F5F7FA;
  border: 1px solid #E5E9F0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.demo-guide-trigger:hover {
  background: var(--bg-primary-light);
  color: var(--primary);
  border-color: #C7DBFF;
}

body.hide-demo-trigger .sidebar-footer {
  display: none;
}

body.no-anim *,
body.no-anim .ai-drawer {
  transition: none !important;
  animation: none !important;
}

/* Main Area (Right of Sidebar) */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-outer);
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-outer);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-breadcrumb .crumb-muted {
  color: var(--text-secondary);
  font-weight: 400;
  cursor: pointer;
}

.topbar-breadcrumb .crumb-muted:hover {
  color: var(--primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 5px;
  border-radius: 15px;
  background: var(--bg-white);
  border: 1px solid #C6DAFF;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(9, 89, 250, 0.08);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.topbar-ai-btn:hover,
.topbar-ai-btn.active {
  background: var(--bg-primary-light);
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(9, 89, 250, 0.14);
}

.topbar-ai-btn img {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  object-fit: cover;
}

.topbar-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--primary);
  padding: 4px 6px;
  border-radius: 6px;
}

.topbar-guide-btn:hover {
  background: rgba(9, 89, 250, 0.08);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #E2E6EC;
}

/* Workspace Split: Content + Right Drawer */
.workspace-body {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  overflow: hidden;
}

.page-scroll {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  padding: 0 16px 16px 16px;
}

.page-scroll::-webkit-scrollbar {
  width: 6px;
}
.page-scroll::-webkit-scrollbar-thumb {
  background: #D4D9E2;
  border-radius: 6px;
}

.page-sheet {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 18px 20px 24px;
  min-height: calc(100% - 4px);
}

/* Homepage Top Row — align-items: start prevents stretching 近7日上新 cards */
.home-top-row {
  display: grid;
  grid-template-columns: minmax(340px, 1.02fr) minmax(440px, 1.98fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

/* Drawer open responsive compaction on left workspace */
.app-shell.drawer-open .home-top-row {
  grid-template-columns: 1fr;
}

.app-shell.drawer-open .featured-grid {
  grid-template-columns: repeat(3, 1fr);
}

.app-shell.drawer-open .shortcut-grid {
  grid-template-columns: repeat(3, 1fr);
}

.app-shell.drawer-wide .home-top-row,
.app-shell.drawer-wide .featured-grid,
.app-shell.drawer-wide .shortcut-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* Greeting Card (Entry A) — sleek compact height matching original homepage */
.greeting-card {
  background: var(--bg-greeting);
  border: 1px solid var(--border-greeting);
  border-radius: 12px;
  padding: 13px 14px 11px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.greeting-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 54px;
}

.greeting-date {
  font-size: 11.5px;
  color: #4A5B7C;
  margin-bottom: 2px;
}

.greeting-title {
  font-size: 20px;
  font-weight: 700;
  color: #0E234E;
  line-height: 1.25;
}

.greeting-mascot {
  width: 78px;
  height: 62px;
  object-fit: contain;
  flex-shrink: 0;
  margin: -6px -2px -6px 0;
}

/* Greeting AI Input Box — sleek pill replacing original hint capsule */
.home-ai-input-wrap {
  position: relative;
  z-index: 30;
}

.home-ai-input-box {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  background: var(--bg-white);
  border: 1px solid #BDD4FE;
  border-radius: 17px;
  padding: 3px 4px 3px 12px;
  box-shadow: 0 1px 2px rgba(9, 89, 250, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.home-ai-input-box:focus-within,
.home-ai-input-box.focused {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(9, 89, 250, 0.11);
}

.home-ai-input-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 12.5px;
  color: var(--text-primary);
}

.home-ai-input-box input::placeholder {
  color: #8A95A8;
}

.home-ai-send-btn {
  height: 26px;
  padding: 0 11px;
  border-radius: 13px;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.home-ai-send-btn:hover {
  background: var(--primary-hover);
}

/* S02 Autocomplete Dropdown */
.home-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-white);
  border: 1px solid #D6E1F5;
  border-radius: 10px;
  box-shadow: var(--shadow-float);
  padding: 6px;
  display: none;
  z-index: 40;
}

.home-autocomplete.show {
  display: block;
}

.autocomplete-header {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 4px 10px 6px;
  display: flex;
  justify-content: space-between;
}

.autocomplete-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  text-align: left;
  font-size: 13px;
  color: var(--text-primary);
}

.autocomplete-item:hover {
  background: var(--bg-greeting);
  color: var(--primary);
}

.autocomplete-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #F2F4F7;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.home-quick-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 0;
  overflow: hidden;
}

.quick-pill {
  font-size: 11.5px;
  color: #2B4C8C;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #D5E3FC;
  border-radius: 12px;
  padding: 2px 9px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.quick-pill:hover {
  background: var(--bg-primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Section Headers (Faithful to existing homepage) */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--orange-accent);
  display: inline-block;
}

.section-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
}

.section-link {
  font-size: 12px;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.section-link:hover {
  text-decoration: underline;
}

/* 近7日上新 Stat Cards — fixed compact proportions matching real homepage */
.stats-section {
  display: flex;
  flex-direction: column;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 13px 11px 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 98px;
}

.stat-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
}

.stat-icon.orange { background: #FF6B3D; }
.stat-icon.blue { background: #3B7BFF; }
.stat-icon.green { background: #1AC688; }
.stat-icon.amber { background: #FF8A2B; }
.stat-icon.purple { background: #8B6BFF; }

.stat-name {
  font-size: 12px;
  color: var(--text-secondary);
}

.stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-num span {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
  margin-left: 2px;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* 本周精选推荐 */
.featured-section {
  margin-bottom: 20px;
}

.featured-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ai-courseware {
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--bg-primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
}

.pager-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.featured-card {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

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

/* 功能快捷入口 */
.shortcut-section {
  margin-bottom: 20px;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.shortcut-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-white);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.shortcut-card:hover {
  border-color: #BDD3FF;
  background: #FAFCFF;
}

.shortcut-badge {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.shortcut-badge.b-blue { background: #EAF1FF; color: #0959FA; }
.shortcut-badge.b-cyan { background: #E6F7FF; color: #0284C7; }
.shortcut-badge.b-orange { background: #FFF2EB; color: #EA580C; }
.shortcut-badge.b-green { background: #E8F9F1; color: #059669; }
.shortcut-badge.b-purple { background: #F1EDFF; color: #6D28D9; }

.shortcut-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.shortcut-path {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 班级课表 */
.schedule-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding-top: 4px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.calendar-month {
  font-size: 14px;
  font-weight: 600;
}

.calendar-today {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-primary-light);
  color: var(--primary);
  font-size: 11px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  gap: 6px;
}

/* ==========================================
   S05 Practice Binding Page (指给我看目标页)
   ========================================== */
.subpage-view {
  display: none;
}

.subpage-view.active {
  display: block;
}

.home-view.hidden {
  display: none;
}

.subpage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.subpage-filters {
  display: flex;
  gap: 10px;
  align-items: center;
}

.filter-select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  background: var(--bg-white);
  font-size: 12px;
  color: var(--text-primary);
}

.btn-primary {
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.btn-secondary {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--bg-white);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #B8C4D4;
}

.btn-soft {
  height: 30px;
  padding: 0 11px;
  border-radius: 6px;
  background: var(--bg-primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-soft:hover {
  background: #DAE7FF;
}

.binding-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.binding-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--border-light);
}

.binding-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

/* S05 Spotlight Highlight & Popover */
.spotlight-anchor {
  position: relative;
  display: inline-block;
}

.spotlight-active .btn-bind-target {
  box-shadow: 0 0 0 4px rgba(9, 89, 250, 0.25), 0 0 0 2px #0959FA;
  position: relative;
  z-index: 35;
}

.spotlight-popover {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 320px;
  background: var(--bg-white);
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  box-shadow: var(--shadow-float);
  padding: 14px;
  z-index: 36;
}

.spotlight-active .spotlight-popover {
  display: block;
}

.spotlight-popover::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 48px;
  width: 12px;
  height: 12px;
  background: var(--bg-white);
  border-left: 1.5px solid var(--primary);
  border-top: 1.5px solid var(--primary);
  transform: rotate(45deg);
}

.spotlight-step {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--bg-primary-light);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.spotlight-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.spotlight-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.spotlight-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================
   Right AI Assistant Drawer (420px / 720px / 56px slim)
   ========================================== */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  z-index: 50;
}

.ai-drawer {
  width: 0;
  flex-shrink: 0;
  background: var(--bg-white);
  border-left: 1px solid transparent;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: width 0.2s ease;
  z-index: 55;
  position: relative;
}

.app-shell.drawer-open .ai-drawer {
  width: var(--drawer-w);
  border-left-color: #E2E7F0;
}

.app-shell.drawer-open.drawer-wide .ai-drawer {
  width: 720px;
}

/* S05 Slim Collapsed Strip */
.app-shell.drawer-open.drawer-slim .ai-drawer {
  width: 56px;
}

.drawer-slim-bar {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 14px 6px;
  gap: 14px;
  height: 100%;
  background: var(--bg-white);
}

.app-shell.drawer-open.drawer-slim .drawer-slim-bar {
  display: flex;
}

.app-shell.drawer-open.drawer-slim .drawer-full {
  display: none;
}

.slim-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid #C8DBFF;
  object-fit: cover;
}

.slim-label {
  writing-mode: vertical-rl;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 2px;
}

.slim-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slim-btn.secondary {
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

/* S19 Narrow Screen (<=1120px or .narrow-sim) */
@media (max-width: 1120px) {
  .app-shell.drawer-open .ai-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 92vw;
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.16);
  }
  .app-shell.drawer-open .drawer-backdrop {
    display: block;
  }
  .app-shell.drawer-open .home-top-row {
    grid-template-columns: 1fr;
  }
}

body.narrow-sim .app-shell.drawer-open .ai-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.18);
}

body.narrow-sim .app-shell.drawer-open .drawer-backdrop {
  display: block;
  position: absolute;
}

body.narrow-sim .home-top-row {
  grid-template-columns: 1fr;
}

body.narrow-sim .featured-grid {
  grid-template-columns: repeat(3, 1fr);
}

body.narrow-sim .shortcut-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Drawer Full Structure */
.drawer-full {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.drawer-header {
  height: 54px;
  flex-shrink: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-white);
}

.drawer-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.assistant-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #C8DBFF;
  background: var(--bg-greeting);
  object-fit: cover;
  flex-shrink: 0;
}

.agent-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #047857;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-title-group {
  min-width: 0;
}

.drawer-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.drawer-subtitle {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-human-top {
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--bg-primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.btn-human-top:hover {
  background: #DAE7FF;
}

.btn-end-chat {
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--tag-danger-bg);
  color: var(--tag-danger-text);
  border: 1px solid var(--tag-danger-border);
  font-size: 12px;
  font-weight: 500;
}

/* Drawer Body */
.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 20px;
  background: #F8F9FB;
}

.drawer-body::-webkit-scrollbar {
  width: 5px;
}
.drawer-body::-webkit-scrollbar-thumb {
  background: #D5DCE6;
  border-radius: 5px;
}

/* Welcome State (S03) */
.welcome-hero {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.welcome-hero img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid #D5E4FE;
  object-fit: cover;
  flex-shrink: 0;
}

.welcome-hero-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
}

.welcome-hero-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.quad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.quad-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.quad-card:hover {
  border-color: var(--primary);
  background: #FAFCFF;
}

.quad-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.quad-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--bg-primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quad-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.quad-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

.faq-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
}

.faq-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.faq-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-primary);
  text-align: left;
}

.faq-item:hover {
  background: var(--bg-greeting);
  color: var(--primary);
}

/* Chat Messages & Cards */
.chat-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-user-row {
  display: flex;
  justify-content: flex-end;
}

.msg-user-bubble {
  background: var(--primary);
  color: #FFFFFF;
  padding: 9px 13px;
  border-radius: 12px 12px 2px 12px;
  max-width: 86%;
  font-size: 13px;
  line-height: 1.5;
}

.msg-ai-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.msg-ai-avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid #C8DBFF;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-ai-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-box {
  background: var(--bg-white);
  border: 1px solid #E6EAF2;
  border-radius: 10px;
  padding: 13px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.chip-btn {
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--border-medium);
  background: var(--bg-white);
  font-size: 12px;
  color: var(--text-primary);
  transition: all 0.15s;
}

.chip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip-btn.active {
  background: var(--bg-primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

.mapping-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  margin-bottom: 6px;
  width: 100%;
  text-align: left;
  font-size: 12px;
}

.mapping-row:hover {
  border-color: var(--primary);
  background: var(--bg-greeting);
}

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

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-meta {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Status Tags (Color + Text always) */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tag-danger {
  background: var(--tag-danger-bg);
  color: var(--tag-danger-text);
  border-color: var(--tag-danger-border);
}

.tag-warn {
  background: var(--tag-warn-bg);
  color: var(--tag-warn-text);
  border-color: var(--tag-warn-border);
}

.tag-success {
  background: var(--tag-success-bg);
  color: var(--tag-success-text);
  border-color: var(--tag-success-border);
}

.tag-info {
  background: var(--tag-info-bg);
  color: var(--tag-info-text);
  border-color: var(--tag-info-border);
}

.tag-neutral {
  background: var(--tag-neutral-bg);
  color: var(--tag-neutral-text);
  border-color: var(--tag-neutral-border);
}

/* Step List (S04) */
.step-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px;
}

.step-list li {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-primary);
}

.step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.video-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  cursor: pointer;
  margin-top: 10px;
}

.video-thumb {
  width: 64px;
  height: 42px;
  border-radius: 6px;
  background: #1E3A8A;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.source-box {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.source-link {
  color: var(--primary);
  display: inline-block;
  margin-right: 10px;
  margin-top: 3px;
}

.feedback-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--border-light);
}

/* Resource Cards (S06) */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resource-item {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--bg-white);
}

.resource-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}

.resource-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Analytics Metrics Grid (S07 & S08) */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.metric-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.metric-cell {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 9px 10px;
}

.metric-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.metric-val {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-val.danger { color: var(--tag-danger-text); }
.metric-val.primary { color: var(--primary); }

.metric-sub {
  font-size: 11px;
  color: var(--text-tertiary);
}

.kp-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.kp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.kp-name {
  flex: 1;
  color: var(--text-primary);
}

.kp-bar-wrap {
  width: 72px;
  height: 6px;
  background: #ECEFF5;
  border-radius: 3px;
  overflow: hidden;
}

.kp-bar {
  height: 100%;
  background: #E11D48;
  border-radius: 3px;
}

.kp-pct {
  width: 34px;
  text-align: right;
  font-weight: 600;
  color: var(--tag-danger-text);
  font-size: 11.5px;
}

.summary-note {
  background: var(--bg-greeting);
  border: 1px solid var(--border-greeting);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 12px;
  color: #1E3A5F;
  margin-bottom: 10px;
}

.student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 7px;
  border: 1px solid var(--border-light);
  background: var(--bg-white);
  margin-bottom: 6px;
}

.student-row.clickable {
  cursor: pointer;
}

.student-row.clickable:hover {
  border-color: var(--primary);
  background: #FAFCFF;
}

.student-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.student-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #EBF1FA;
  color: #274C87;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Accordion Group (S09) */
.group-box {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg-white);
}

.group-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11px;
  background: var(--bg-subtle);
  font-size: 12.5px;
  font-weight: 600;
}

.group-body {
  padding: 8px 10px;
}

.group-body.collapsed {
  display: none;
}

/* Evaluation Draft Card (S11) */
.progress-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-greeting);
  border: 1px solid var(--border-greeting);
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #0E234E;
}

.tone-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.tone-tab {
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.tone-tab.active {
  background: var(--bg-primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

.draft-field {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.draft-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.draft-field-text {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.55;
}

.draft-textarea {
  width: 100%;
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12.5px;
  resize: vertical;
  background: var(--bg-white);
}

.basis-box {
  font-size: 11.5px;
  color: var(--text-secondary);
  background: #F4F6FA;
  border-radius: 6px;
  padding: 7px 9px;
  margin-bottom: 8px;
}

.empty-notice {
  background: var(--tag-warn-bg);
  border: 1px solid var(--tag-warn-border);
  color: var(--tag-warn-text);
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 12px;
}

.safety-hint {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 7px 9px;
  margin-top: 8px;
}

/* Form Controls inside Cards (S13, S15, S17) */
.form-row {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  border: 1px solid var(--border-medium);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 12.5px;
  background: var(--bg-white);
  outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
}

.radio-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.radio-pill {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  font-size: 12px;
  background: var(--bg-white);
  color: var(--text-primary);
}

.radio-pill.active {
  background: var(--bg-primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

.filename-preview {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  background: #F4F6FA;
  border: 1px solid var(--border-light);
  padding: 6px 9px;
  border-radius: 6px;
  color: var(--text-primary);
  word-break: break-all;
}

/* Class Code Picker Card */
.class-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-white);
  text-align: left;
  margin-bottom: 6px;
  transition: border-color 0.15s, background 0.15s;
}

.class-option:hover,
.class-option.selected {
  border-color: var(--primary);
  background: var(--bg-greeting);
}

.class-code-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--bg-primary-light);
  padding: 1px 6px;
  border-radius: 4px;
}

.class-manual-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
}

/* Queue live indicator */
.queue-bar-track {
  width: 100%;
  height: 6px;
  background: #E8EEF8;
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0 8px;
}

.queue-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* History / Tickets Tabs (S18) */
.segment-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #ECEFF4;
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.segment-tab {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.segment-tab.active {
  background: var(--bg-white);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Drawer Footer */
.drawer-footer {
  flex-shrink: 0;
  padding: 10px 14px 10px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-white);
}

.attach-preview {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 5px 9px;
  background: var(--bg-greeting);
  border: 1px solid var(--border-greeting);
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--primary);
  margin-bottom: 8px;
}

.attach-preview.show {
  display: flex;
}

.drawer-input-box {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-medium);
  border-radius: 9px;
  padding: 5px 6px 5px 10px;
  background: var(--bg-white);
}

.drawer-input-box:focus-within {
  border-color: var(--primary);
}

.drawer-input-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 12.5px;
}

.drawer-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-right: 54px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.drawer-footer-links {
  display: flex;
  gap: 10px;
}

.drawer-footer-links button {
  font-size: 11px;
  color: var(--text-secondary);
}

.drawer-footer-links button:hover {
  color: var(--primary);
}

/* Sample Data Watermark (Required on every screen) */
.sample-watermark {
  position: fixed;
  right: 14px;
  bottom: 6px;
  font-size: 11px;
  color: #9CA3AF;
  pointer-events: none;
  z-index: 80;
  background: rgba(255, 255, 255, 0.86);
  padding: 1px 6px;
  border-radius: 4px;
}

body.narrow-sim .sample-watermark {
  position: absolute;
}

/* Floating Demo Navigator Popover */
.demo-popover {
  display: none;
  position: fixed;
  left: 164px;
  bottom: 12px;
  width: 340px;
  max-height: 78vh;
  overflow-y: auto;
  background: var(--bg-white);
  border: 1px solid #D5DCE6;
  border-radius: 12px;
  box-shadow: var(--shadow-float);
  padding: 12px;
  z-index: 90;
}

.demo-popover.show {
  display: block;
}

.demo-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 13px;
}

.demo-state-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.demo-state-btn {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  text-align: left;
  font-size: 11.5px;
  color: var(--text-primary);
}

.demo-state-btn:hover,
.demo-state-btn.active {
  background: var(--bg-primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  background: #1F2329;
  color: #FFFFFF;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================
   Real Interactive Workspace Subpages
   (Cloud Disk / Analytics Service / AI Tutor)
   ========================================== */
.tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}

.tab-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.disk-path-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.row-located {
  background: #EFF5FF !important;
  outline: 1.5px solid var(--primary);
  outline-offset: -1.5px;
}

.row-located td:first-child {
  font-weight: 600;
  color: #0E234E;
}

.located-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 500;
  margin-left: 6px;
}

.ai-tutor-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  margin-bottom: 14px;
}

.tutor-robot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1E293B;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================
   High-Fidelity Interactive Preview Modals
   (Courseware Viewer / Report / WrongBook / Video)
   ========================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  z-index: 120;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
  width: 960px;
  max-width: 94vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card.compact {
  width: 680px;
}

.modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-white);
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.modal-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #F4F6FA;
}

/* Courseware Multi-Slide Viewer */
.cw-viewer-layout {
  display: grid;
  grid-template-columns: 184px 1fr;
  height: 520px;
  max-height: 68vh;
}

.cw-thumbs {
  background: var(--bg-white);
  border-right: 1px solid var(--border-light);
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cw-thumb-btn {
  width: 100%;
  text-align: left;
  padding: 8px 9px;
  border-radius: 8px;
  border: 1.5px solid var(--border-light);
  background: var(--bg-subtle);
  transition: border-color 0.15s, background 0.15s;
}

.cw-thumb-btn.active {
  border-color: var(--primary);
  background: var(--bg-greeting);
}

.cw-thumb-num {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.cw-thumb-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}

.cw-stage-wrap {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background: #EEF2F8;
}

.cw-slide-canvas {
  width: 100%;
  max-width: 680px;
  aspect-ratio: 16 / 9;
  background: var(--bg-white);
  border-radius: 10px;
  border: 1px solid #D8E0EC;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.cw-slide-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.cw-stage-controls {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.answer-reveal-box {
  background: var(--bg-greeting);
  border: 1px solid var(--border-greeting);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 13px;
  color: #0E234E;
}

/* Modal Content Padding for Report / WrongBook / Video / Student Archive */
.modal-pad {
  padding: 18px 20px;
}

.paper-sheet {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 18px 20px;
}

.video-player-stage {
  background: #0F172A;
  color: #FFFFFF;
  border-radius: 10px;
  height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 20px;
  text-align: center;
}

/* ==========================================
   Real Official iTeach 2.0 UI Image Stage + Interactive Overlays
   ========================================== */
.real-ui-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.real-ui-stage {
  position: relative;
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-white);
}

.real-ui-stage img.real-ui-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Interactive located row overlay on real Cloud Disk / Practice / AI Tutor screenshots */
.ui-locate-overlay {
  position: absolute;
  left: 1.4%;
  right: 1.4%;
  top: 26.5%;
  height: 9.2%;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background: rgba(9, 89, 250, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  gap: 8px;
  cursor: pointer;
  z-index: 15;
}

.ui-locate-overlay:hover {
  background: rgba(9, 89, 250, 0.14);
}

.ui-locate-badge {
  position: absolute;
  left: 10px;
  top: -12px;
  background: var(--primary);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(9, 89, 250, 0.28);
  white-space: nowrap;
}

/* S05 Spotlight overlay directly on real practice_binding.png "绑定练习" button */
.ui-bind-spotlight {
  position: absolute;
  right: 5.2%;
  top: 36.2%;
  width: 7.4%;
  height: 5.8%;
  border: 2.5px solid var(--primary);
  border-radius: 6px;
  background: rgba(9, 89, 250, 0.12);
  box-shadow: 0 0 0 5px rgba(9, 89, 250, 0.22);
  cursor: pointer;
  z-index: 25;
}

.ui-bind-popover {
  position: absolute;
  right: 2.2%;
  top: 44.5%;
  width: 310px;
  background: var(--bg-white);
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  box-shadow: var(--shadow-float);
  padding: 13px 14px;
  z-index: 26;
}

.ui-bind-popover::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 48px;
  width: 12px;
  height: 12px;
  background: var(--bg-white);
  border-left: 1.5px solid var(--primary);
  border-top: 1.5px solid var(--primary);
  transform: rotate(45deg);
}

/* Real-UI Courseware Preview & Player Modal */
.real-cw-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  gap: 10px;
  flex-wrap: wrap;
}

.real-cw-canvas {
  padding: 14px 16px 16px;
  background: #111827;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.real-cw-canvas img {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.real-cw-caption {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #CBD5E1;
  font-size: 12px;
}


