/* 机械工程学院 · 淡蓝动感宽屏设计系统 */
:root {
  --blue-50: #f0f9ff;
  --blue-100: #e0f2fe;
  --blue-200: #bae6fd;
  --blue-300: #7dd3fc;
  --blue-400: #38bdf8;
  --blue-500: #0ea5e9;
  --blue-600: #0284c7;
  --blue-700: #0369a1;
  --blue-800: #1e4a6e;
  --blue-900: #1e3a5f;

  --mech-amber: #f59e0b;
  --mech-amber-light: #fbbf24;
  --mech-red: #ef4444;
  --mech-green: #10b981;

  --primary: var(--blue-700);
  --accent: var(--blue-500);
  --accent-light: var(--blue-300);
  --teacher: var(--mech-amber);
  --bg: var(--blue-50);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --text: var(--blue-900);
  --text-muted: #5b7a9d;
  --border: rgba(14, 165, 233, 0.18);
  --border-strong: rgba(14, 165, 233, 0.35);
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 4px 20px rgba(2, 132, 199, 0.08);
  --shadow-hover: 0 12px 40px rgba(2, 132, 199, 0.15);
  --font-mono: "Cascadia Code", "Consolas", monospace;
  --page-pad-x: clamp(16px, 2.2vw, 40px);
  --page-pad-y: clamp(12px, 1.5vh, 24px);
  --fs-min: 15px;
  --fs-base: 16px;
  --fs-sm: 15px;
  --fs-lg: 18px;
  --fs-nav: 19px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 36px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: var(--fs-base); min-height: 100%; }

/* 浏览器默认 small 约 13px，强制不低于 15px */
small, .portal-btn small {
  font-size: var(--fs-min);
  line-height: 1.5;
}

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 40%, #dbeafe 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(14, 165, 233, 0.1) 0%, transparent 40%),
    linear-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  pointer-events: none;
  z-index: 0;
  animation: bg-drift 20s ease-in-out infinite alternate;
}

@keyframes bg-drift {
  0% { opacity: 0.85; }
  100% { opacity: 1; }
}

a { color: var(--blue-600); text-decoration: none; transition: color 0.25s; }
a:hover { color: var(--blue-500); }

/* ── 动感渐变边框卡片 ── */
.card, .tech-panel, .stat-card, .case-card, .filter-bar, .login-card {
  position: relative;
}

.card-glow, .card, .tech-panel, .stat-card, .case-card {
  background: var(--surface-solid);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-glow::before, .card::before, .tech-panel::before, .stat-card::before, .case-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius-lg) + 2px);
  padding: 1.5px;
  background: linear-gradient(90deg, var(--blue-300), var(--blue-500), var(--blue-200), var(--blue-400), var(--blue-300));
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: border-flow 4s linear infinite;
  pointer-events: none;
  opacity: 0.65;
  z-index: 0;
}

.card:hover::before, .tech-panel:hover::before, .case-card:hover::before {
  opacity: 1;
  animation-duration: 2s;
}

@keyframes border-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(14, 165, 233, 0.15); }
  50% { box-shadow: 0 0 32px rgba(14, 165, 233, 0.28); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-in {
  animation: fade-up 0.5s ease forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }

/* ── 品牌 ── */
.mech-brand { display: flex; align-items: center; gap: 0.85rem; position: relative; z-index: 1; }
.mech-brand-icon { color: var(--blue-500); display: flex; animation: pulse-glow 3s ease-in-out infinite; border-radius: 50%; }
.mech-brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.mech-brand-college {
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--blue-500);
  font-family: var(--font-mono);
}
.mech-brand-title { font-size: var(--fs-lg); font-weight: 700; color: var(--blue-800); }
.mech-brand-sub { font-size: var(--fs-sm); color: var(--text-muted); }

.mech-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blue-600);
  background: linear-gradient(90deg, rgba(14,165,233,0.1), rgba(56,189,248,0.15));
  border: 1px solid var(--border-strong);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

/* ── 首页宽屏（控制工程主视觉） ── */
.home-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

.home-page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0b3a55, #1a8fc4, #d4a017, #1a8fc4, #0b3a55);
  background-size: 200% 100%;
  animation: border-flow 4s linear infinite;
}

.home-v2 .home-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem clamp(1.2rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(14, 165, 233, 0.12);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
}

.home-college {
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: var(--blue-700);
  font-weight: 600;
}

.home-platform-tag {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.home-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vh, 3rem) clamp(1rem, 4vw, 3rem) 1.5rem;
  text-align: center;
  width: 100%;
}

.home-brand-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  color: var(--blue-600);
  margin-bottom: 0.85rem;
  opacity: 0.9;
  animation: home-fade-up 0.7s ease both;
}

.home-brand {
  font-family: "STSong", "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: clamp(3.6rem, 9vw, 7.2rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.12em;
  margin: 0 0 0.35rem;
  color: #0b2f48;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65),
    0 18px 40px rgba(11, 58, 85, 0.18);
  animation: home-fade-up 0.85s ease both 0.05s;
}

.home-brand-sub {
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: var(--blue-700);
  letter-spacing: 0.22em;
  font-weight: 500;
  margin-bottom: 1.75rem;
  animation: home-fade-up 0.85s ease both 0.12s;
}

.home-semester {
  width: min(920px, 100%);
  margin-bottom: clamp(1.5rem, 3.5vh, 2.5rem);
  animation: home-fade-up 0.9s ease both 0.18s;
}

.semester-label {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
  text-transform: uppercase;
}

.semester-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.semester-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, 0.28);
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue-800);
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.semester-pill-lg {
  padding: 0.85rem 1.45rem;
  font-size: 1.15rem;
  gap: 0.55rem;
  cursor: default;
  pointer-events: none;
}

.semester-pill-lg .semester-code {
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.semester-pill-lg .semester-badge {
  font-size: 0.8rem;
  padding: 0.18rem 0.55rem;
}

.semester-pills-display {
  gap: 0.85rem;
}

.semester-pill:hover {
  transform: translateY(-2px);
  border-color: var(--blue-400);
  color: var(--blue-700);
  box-shadow: 0 8px 22px rgba(2, 132, 199, 0.12);
}

.semester-pill-lg:hover {
  transform: none;
  box-shadow: none;
}

.semester-pill.is-active {
  background: linear-gradient(135deg, #0c4a6e, #0369a1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 28px rgba(3, 105, 161, 0.28);
}

.semester-pill.is-current:not(.is-active) {
  border-color: rgba(212, 160, 23, 0.55);
  background: rgba(255, 251, 235, 0.9);
}

.semester-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.semester-pill.is-active .semester-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.semester-badge.muted {
  background: rgba(91, 122, 157, 0.12);
  color: var(--text-muted);
}

.semester-hint {
  margin-top: 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

.semester-hint strong {
  color: var(--blue-800);
}

.home-portals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
  width: min(920px, 100%);
  animation: home-fade-up 1s ease both 0.26s;
}

.portal-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.45rem;
  min-height: 210px;
  padding: 1.6rem 1.7rem 1.4rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  text-decoration: none;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.portal-panel.teacher {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(251, 191, 36, 0.35), transparent 55%),
    linear-gradient(145deg, #7a4a08 0%, #b45309 42%, #1e3a5f 100%);
  box-shadow: 0 18px 40px rgba(180, 83, 9, 0.28);
}

.portal-panel.student {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(56, 189, 248, 0.38), transparent 55%),
    linear-gradient(145deg, #0c4a6e 0%, #0284c7 48%, #0f766e 100%);
  box-shadow: 0 18px 40px rgba(2, 132, 199, 0.28);
}

.portal-panel-glow {
  position: absolute;
  inset: -40% auto auto -20%;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 70%);
  filter: blur(8px);
  animation: portal-glow 5s ease-in-out infinite alternate;
  z-index: -1;
}

.portal-panel.student .portal-panel-glow {
  inset: -30% -10% auto auto;
}

.portal-panel-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.45;
  z-index: -1;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 95%);
}

.portal-panel-role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  opacity: 0.78;
}

.portal-panel-title {
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.portal-panel-desc {
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.88;
  max-width: 18rem;
}

.portal-panel-cta {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.92;
}

.portal-panel:hover {
  transform: translateY(-8px) scale(1.015);
  color: #fff;
  box-shadow: 0 28px 56px rgba(15, 55, 85, 0.32);
}

.portal-panel:hover .portal-panel-cta {
  letter-spacing: 0.16em;
}

.home-strip {
  margin-top: auto;
  padding: 0.95rem clamp(1rem, 4vw, 2.5rem) 1.15rem;
  border-top: 1px solid rgba(14, 165, 233, 0.14);
  background: rgba(11, 47, 72, 0.92);
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
}

.home-strip-lead {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 64rem;
  margin: 0 auto 0.55rem;
  color: rgba(226, 242, 255, 0.92);
}

.home-strip-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: rgba(186, 230, 253, 0.78);
}

.home-strip-features span:not(:last-child)::after {
  content: '·';
  margin-left: 0.9rem;
  opacity: 0.55;
}

/* 兼容旧类名（可编辑覆盖页） */
.home-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3vh var(--page-pad-x);
  text-align: center;
  width: 100%;
}

.home-college-badge {
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  letter-spacing: 0.18em;
  color: var(--blue-600);
  border: 1px solid var(--border-strong);
  padding: 0.45rem 1.25rem;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.7);
  border-radius: 8px;
}

.home-hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: var(--blue-800);
}

.home-hero .course-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  color: var(--blue-600);
  margin-bottom: 1rem;
}

.home-hero .subtitle {
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: var(--text-muted);
  max-width: 900px;
  margin-bottom: 2.5rem;
  line-height: 1.75;
}

.home-features {
  display: none;
}

.login-portals {
  display: flex;
  gap: 2rem;
  justify-content: center;
  width: 100%;
}

.portal-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 3.5rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-strong);
  background: rgba(255,255,255,0.9);
  color: var(--blue-800);
  font-size: var(--fs-xl);
  font-weight: 700;
  min-width: 280px;
}

.portal-btn-desc {
  font-size: var(--fs-min);
  opacity: 0.75;
  font-weight: 400;
}

.home-footer {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-base);
  font-family: var(--font-mono);
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.5);
}

@keyframes home-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes portal-glow {
  from { transform: translate(0, 0) scale(1); opacity: 0.7; }
  to { transform: translate(18px, 12px) scale(1.12); opacity: 1; }
}

/* ── 登录 ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem var(--page-pad-x);
  position: relative;
  z-index: 1;
}

.login-card {
  padding: 2.75rem 3rem;
  width: 100%;
  max-width: 480px;
  border-top: 3px solid var(--blue-500);
  z-index: 1;
}

.login-card.teacher-card { border-top-color: var(--mech-amber); }
.login-card h2 { font-size: var(--fs-2xl); margin-bottom: 0.35rem; color: var(--blue-800); }
.login-card .login-college { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 1rem; }

.role-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.role-badge.teacher { background: rgba(245,158,11,0.12); color: #b45309; border: 1px solid rgba(245,158,11,0.3); }
.role-badge.student { background: rgba(14,165,233,0.1); color: var(--blue-600); border: 1px solid var(--border-strong); }

/* ── 门户宽屏布局 ── */
.portal-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  width: 100%;
}

/* 统一顶栏：品牌 + 导航 + 用户在同一行 */
.portal-topbar {
  background: linear-gradient(90deg, rgba(255,255,255,0.96), rgba(224,242,254,0.96));
  border-bottom: 1px solid var(--border-strong);
  padding: 0 var(--page-pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 16px rgba(14, 165, 233, 0.06);
  min-height: 44px;
  gap: 0.5rem;
}

.unified-topbar {
  flex-wrap: nowrap;
  justify-content: flex-start;
}

/* 紧凑品牌 */
.mech-brand-compact {
  flex-shrink: 0;
  gap: 0.45rem;
  align-items: center;
}
.mech-brand-compact .mech-brand-icon {
  width: 24px;
  height: 24px;
}
.mech-brand-compact .mech-brand-icon svg {
  width: 24px;
  height: 24px;
}
.mech-brand-compact .mech-brand-text {
  flex-direction: column;
  line-height: 1.2;
}
.mech-brand-compact .mech-brand-college {
  font-size: var(--fs-min);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue-600);
}
.mech-brand-course {
  font-size: var(--fs-min);
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 内联导航 */
.h-nav-inline {
  display: flex;
  flex: 1;
  overflow-x: auto;
  min-width: 0;
  gap: 0;
  padding: 0 0.15rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.h-nav-inline::-webkit-scrollbar { display: none; }

.h-nav-inline a {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.3rem;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.25s;
  position: relative;
  flex-shrink: 0;
}

.h-nav-inline a:hover {
  color: var(--blue-600);
  background: rgba(14, 165, 233, 0.06);
}

.h-nav-inline a.active {
  color: var(--blue-600);
  border-bottom-color: var(--blue-500);
  font-weight: 800;
  background: linear-gradient(180deg, transparent, rgba(14,165,233,0.06));
}

.h-nav-inline.teacher-nav a.active {
  color: #b45309;
  border-bottom-color: var(--mech-amber);
}

/* 保留旧版 nav-wrapper 兼容（首页等不需要内联导航的页面仍需） */
.h-nav-wrapper {
  background: rgba(255,255,255,0.88);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.h-nav {
  display: flex;
  padding: 0 var(--page-pad-x);
  min-width: max-content;
  gap: 0.25rem;
}

.h-nav a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 1.05rem 1.4rem;
  color: var(--text-muted);
  font-size: var(--fs-nav);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-bottom: 4px solid transparent;
  transition: all 0.25s;
  position: relative;
}

.h-nav a:hover {
  color: var(--blue-600);
  background: rgba(14, 165, 233, 0.06);
}

.h-nav a.active {
  color: var(--blue-600);
  border-bottom-color: var(--blue-500);
  font-weight: 800;
  font-size: calc(var(--fs-nav) + 1px);
  background: linear-gradient(180deg, transparent, rgba(14,165,233,0.06));
}

.h-nav.teacher-nav a.active {
  color: #b45309;
  border-bottom-color: var(--mech-amber);
}

.portal-user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-min);
  color: var(--blue-700);
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
  padding-right: 0.25rem;
}
.portal-user-name {
  max-width: 5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 宽屏内容区 — 接近显示器边缘 */
.portal-content {
  flex: 1;
  padding: var(--page-pad-y) var(--page-pad-x);
  width: 100%;
  max-width: none;
  margin: 0;
}

/* ── 宽屏仪表盘布局 ── */
.dashboard-wide { display: flex; flex-direction: column; gap: 1rem; width: 100%; }

.dash-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.dash-main-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1rem;
  align-items: start;
}

.dash-main-row.equal { grid-template-columns: 1fr 1fr; }
.dash-main-row.triple { grid-template-columns: 2fr 1.2fr 1fr; }

.dash-side-stack { display: flex; flex-direction: column; gap: 1rem; }

/* ── 页面标题 ── */
.page-header, .mech-page-header { margin-bottom: 1rem; }
.mech-page-header h1, .page-header h1 {
  font-size: var(--fs-2xl);
  color: var(--blue-800);
  font-weight: 800;
}
.page-header p, .mech-page-header p { font-size: var(--fs-base); color: var(--text-muted); }

/* ── 卡片 ── */
.card, .tech-panel {
  padding: 1.15rem 1.35rem;
  margin-bottom: 0;
  border: 1px solid var(--border);
  transition: transform 0.25s, box-shadow 0.25s;
  z-index: 1;
}

.card:hover, .tech-panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card > *, .tech-panel > * { position: relative; z-index: 1; }

.card-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--blue-800);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-compact { padding: 1rem 1.2rem; }
.card-compact .card-title { margin-bottom: 0.6rem; font-size: var(--fs-base); }

/* ── 网格系统（宽屏多列） ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }

.grid-cases {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

@media (min-width: 1600px) {
  .grid-cases { grid-template-columns: repeat(4, 1fr); }
  .home-features { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 2000px) {
  .grid-cases { grid-template-columns: repeat(5, 1fr); }
  .dash-stats-row { grid-template-columns: repeat(5, 1fr); }
}

/* ── 统计卡 ── */
.stat-card {
  padding: 1.15rem 1.35rem;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  border: none;
  transition: transform 0.3s;
  z-index: 1;
}

.stat-card::before {
  background: linear-gradient(90deg, rgba(255,255,255,0.4), rgba(255,255,255,0.1), rgba(255,255,255,0.4));
  opacity: 0.5;
}

.stat-card:hover { transform: scale(1.03); }

.stat-card.teacher-stat {
  background: linear-gradient(135deg, #d97706, var(--mech-amber-light));
}

.stat-card.alt { background: linear-gradient(135deg, var(--blue-700), var(--blue-500)); }
.stat-card.alt2 { background: linear-gradient(135deg, #0891b2, var(--blue-400)); }

.stat-card .value {
  font-size: var(--fs-3xl);
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1.1;
}

.stat-card .label { font-size: var(--fs-base); opacity: 0.92; margin-top: 0.25rem; }

/* ── 工程案例卡 ── */
.case-card {
  display: flex;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid var(--border);
  z-index: 1;
}

.case-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.case-card-accent {
  width: 5px;
  background: linear-gradient(180deg, var(--blue-400), var(--blue-600));
  flex-shrink: 0;
}

.case-card[data-difficulty="intermediate"] .case-card-accent {
  background: linear-gradient(180deg, var(--mech-amber-light), var(--mech-amber));
}

.case-card[data-difficulty="advanced"] .case-card-accent {
  background: linear-gradient(180deg, #f87171, var(--mech-red));
}

.case-card-body { padding: 1.1rem 1.25rem; flex: 1; display: flex; flex-direction: column; position: relative; z-index: 1; }
.case-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.case-card-icon { font-size: 2rem; }
.case-card-meta { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.case-card-title { font-size: var(--fs-lg); font-weight: 700; color: var(--blue-800); margin-bottom: 0.35rem; }
.case-card-summary { font-size: var(--fs-base); color: var(--text-muted); line-height: 1.5; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.case-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.65rem; padding-top: 0.65rem; border-top: 1px solid var(--border); }
.case-card-time { font-size: var(--fs-sm); color: var(--text-muted); font-family: var(--font-mono); display: flex; align-items: center; gap: 0.3rem; }

/* ── 筛选栏 ── */
.filter-bar {
  padding: 0.85rem 1.15rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.8);
  z-index: 1;
}

.filter-group { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.filter-label { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); }
.filter-chip {
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: var(--fs-base);
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--blue-50);
  transition: all 0.25s;
}
.filter-chip:hover { border-color: var(--blue-400); color: var(--blue-600); transform: translateY(-1px); }
.filter-chip.active {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-400));
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* ── 案例详情宽屏 ── */
.case-detail-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1rem;
}

.case-section { margin-bottom: 1rem; }
.case-section-title {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--blue-600);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.case-section-title::before { content: ''; width: 20px; height: 3px; background: linear-gradient(90deg, var(--blue-500), var(--blue-300)); border-radius: 2px; }
.case-section-content { font-size: var(--fs-base); line-height: 1.7; white-space: pre-wrap; color: var(--blue-800); }

.case-embed-zone {
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-base);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

/* ── 进度条 ── */
.progress-bar {
  height: 10px;
  background: var(--blue-100);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-300));
  border-radius: 6px;
  transition: width 0.6s ease;
  animation: border-flow 2s linear infinite;
  background-size: 200% 100%;
}

/* ── 徽章/标签 ── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.badge-pre { background: rgba(14,165,233,0.12); color: var(--blue-700); border: 1px solid var(--border); }
.badge-in { background: rgba(245,158,11,0.12); color: #b45309; border: 1px solid rgba(245,158,11,0.25); }
.badge-post { background: rgba(16,185,129,0.12); color: #047857; border: 1px solid rgba(16,185,129,0.25); }
.badge-ai { background: rgba(14,165,233,0.1); color: var(--blue-600); }
.badge-pending { background: rgba(239,68,68,0.1); color: var(--mech-red); }
.badge-done { background: rgba(16,185,129,0.12); color: #047857; }
.badge-basic { background: rgba(14,165,233,0.12); color: var(--blue-600); }
.badge-intermediate { background: rgba(245,158,11,0.12); color: #b45309; }
.badge-advanced { background: rgba(239,68,68,0.1); color: var(--mech-red); }
.badge-category { background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--border); }

.tag {
  display: inline-block;
  background: var(--blue-50);
  color: var(--blue-700);
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: var(--fs-sm);
  margin: 0.1rem;
  border: 1px solid var(--border);
}

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  border: none;
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); color: #fff; box-shadow: 0 4px 14px rgba(14,165,233,0.3); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(14,165,233,0.4); }
.btn-accent { background: linear-gradient(135deg, var(--blue-500), var(--blue-400)); color: #fff; box-shadow: 0 4px 14px rgba(14,165,233,0.25); }
.btn-teacher { background: linear-gradient(135deg, #d97706, var(--mech-amber)); color: #fff; box-shadow: 0 4px 14px rgba(245,158,11,0.3); }
.btn-outline { background: rgba(255,255,255,0.8); border: 1px solid var(--border-strong); color: var(--blue-700); }
.btn-outline:hover { border-color: var(--blue-400); background: var(--blue-50); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: var(--fs-min); }

/* ── 表单 ── */
.form-group { margin-bottom: 0.85rem; }
.form-group label { display: block; font-size: var(--fs-base); font-weight: 600; margin-bottom: 0.35rem; color: var(--blue-800); }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: var(--fs-base);
  font-family: inherit;
  background: rgba(255,255,255,0.9);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* ── 表格（紧凑宽屏） ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }

th, td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: linear-gradient(180deg, var(--blue-50), rgba(224,242,254,0.5));
  font-weight: 700;
  color: var(--blue-700);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

tr { transition: background 0.2s; }
tr:hover td { background: rgba(14, 165, 233, 0.04); }

.table-compact th, .table-compact td { padding: 0.5rem 0.85rem; }

/* 行内列表 */
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-base);
  transition: background 0.2s;
}

.list-row:hover { background: rgba(14, 165, 233, 0.04); padding-left: 0.5rem; padding-right: 0.5rem; margin: 0 -0.5rem; border-radius: 6px; }
.list-row:last-child { border-bottom: none; }

/* ── 消息 ── */
.messages { list-style: none; margin-bottom: 0.85rem; }
.messages li {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  font-size: var(--fs-base);
  border-left: 4px solid;
}
.messages .success { background: rgba(16,185,129,0.1); color: #047857; border-color: var(--mech-green); }
.messages .error { background: rgba(239,68,68,0.08); color: var(--mech-red); border-color: var(--mech-red); }
.messages .info { background: rgba(14,165,233,0.08); color: var(--blue-700); border-color: var(--blue-500); }

/* ── AI 面板 ── */
.agent-panel {
  display: flex;
  flex-direction: column;
  height: 380px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.agent-header {
  background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
  color: #fff;
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: var(--fs-base);
  font-family: var(--font-mono);
}

.agent-messages { flex: 1; overflow-y: auto; padding: 0.85rem; background: var(--blue-50); }
.agent-msg { margin-bottom: 0.65rem; max-width: 88%; }
.agent-msg.user { margin-left: auto; }
.agent-msg.user .bubble { background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); color: #fff; border-radius: 12px 12px 0 12px; }
.agent-msg.assistant .bubble { background: #fff; border: 1px solid var(--border); border-radius: 12px 12px 12px 0; }
.agent-msg .bubble { padding: 0.7rem 0.95rem; font-size: var(--fs-base); line-height: 1.55; white-space: pre-wrap; }
.agent-input-row { display: flex; gap: 0.5rem; padding: 0.7rem; border-top: 1px solid var(--border); background: #fff; }
.agent-input-row input { flex: 1; padding: 0.6rem 0.85rem; border: 1px solid var(--border-strong); border-radius: 8px; font-size: var(--fs-base); }

/* ── 知识图谱 ── */
.graph-container {
  width: 100%;
  height: 420px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--blue-50), #fff);
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  position: relative;
  overflow: hidden;
}

.graph-node {
  position: absolute;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
  border: 1px solid rgba(255,255,255,0.3);
  transition: transform 0.25s;
  z-index: 2;
}

.graph-node:hover { transform: translate(-50%, -50%) scale(1.08); }

.ai-eval-box {
  background: linear-gradient(135deg, rgba(14,165,233,0.06), rgba(224,242,254,0.5));
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--blue-500);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-top: 0.85rem;
  font-size: var(--fs-base);
}

.ai-eval-box h4 { color: var(--blue-700); margin-bottom: 0.4rem; font-size: var(--fs-base); }

.cases-count { font-family: var(--font-mono); font-size: var(--fs-base); color: var(--text-muted); margin-bottom: 0.75rem; }

.empty-state { text-align: center; padding: 2rem; color: var(--text-muted); font-size: var(--fs-base); }

.quick-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.editable-nav-extra {
  padding: 0.5rem var(--page-pad-x);
  background: rgba(14, 165, 233, 0.06);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-base);
}

code {
  font-family: var(--font-mono);
  background: var(--blue-50);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: var(--fs-sm);
}

/* ── 全站最小字号 15px ── */
.badge, .tag, .btn-sm, .filter-label, .filter-chip, th,
.mech-label, .mech-brand-college, .mech-brand-sub, .role-badge,
.case-section-title, .case-card-time, .graph-node, .login-college,
.home-footer, .cases-count, .portal-user, .list-row,
.agent-header, .agent-msg .bubble, .agent-input-row input,
.form-input, .form-textarea, .form-select, .form-group label,
.messages li, .empty-state, .home-college-badge {
  font-size: max(var(--fs-min), 1em);
}

.btn-sm { font-size: var(--fs-min); }
.badge, .tag { font-size: var(--fs-min); }
th { font-size: var(--fs-min); }
.filter-label, .case-section-title, .mech-label { font-size: var(--fs-min); }

/* ── 响应式 ── */
@media (max-width: 1400px) {
  .dash-main-row { grid-template-columns: 1fr 300px; }
  .dash-main-row.triple { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .dash-main-row, .dash-main-row.triple, .case-detail-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .home-portals { grid-template-columns: 1fr; }
  .portal-panel { min-height: 180px; }
  .home-brand { letter-spacing: 0.08em; }
  .home-v2 .home-top { flex-direction: column; gap: 0.35rem; align-items: flex-start; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .login-portals { flex-direction: column; align-items: stretch; }
  .portal-btn { min-width: auto; }
  .present-layout { grid-template-columns: 1fr; }
  .resource-hub-grid { grid-template-columns: 1fr; }
  .chapter-present-grid { grid-template-columns: 1fr; }
  :root { --fs-base: 15px; --fs-sm: 15px; --fs-min: 15px; --fs-nav: 17px; }
}

/* ── 通用弹窗 ── */
.app-modal[hidden] { display: none !important; }
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 40, 70, 0.55);
  backdrop-filter: blur(3px);
}
.app-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 55, 85, 0.28);
  border: 1px solid rgba(14, 165, 233, 0.18);
}
.app-modal-wide { width: min(960px, 100%); }
.app-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.app-modal-header h2 {
  font-size: 1.15rem;
  color: var(--blue-800);
}
.app-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}
.app-modal-body { padding: 1.1rem 1.25rem 0.5rem; }
.app-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.75rem 0 1.1rem;
}

/* ── 智慧资源中心 ── */
.resource-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; }
.resource-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.25rem;
}
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.resource-list { display: flex; flex-direction: column; gap: 0.5rem; }
.resource-list-item {
  text-align: left;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.resource-list-item:hover {
  border-color: var(--blue-400);
  box-shadow: var(--shadow);
}
.resource-list-item .muted,
.muted { color: var(--text-muted); font-size: 0.92rem; }
.type-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.resource-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.85rem;
}
.co-resource-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  background: linear-gradient(180deg, #fff, #f8fbff);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.co-resource-card h3 { font-size: 1rem; color: var(--blue-800); }
.co-resource-type {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--blue-700);
  background: rgba(14, 165, 233, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  width: fit-content;
}
.co-resource-actions { display: flex; gap: 0.4rem; margin-top: 0.45rem; flex-wrap: wrap; }

/* ── 教学内容 / 上课呈现 ── */
.chapter-present-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.chapter-present-card .chapter-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}
.chapter-meta-line { margin-top: 0.35rem; }
.present-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1rem;
  align-items: start;
}
.present-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.present-sidebar {
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 1.5rem);
  overflow: auto;
}
.sidebar-hint { margin-bottom: 0.75rem; }
.sidebar-resource-list { display: flex; flex-direction: column; gap: 0.65rem; }
.sidebar-resource {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.present-frame {
  width: 100%;
  min-height: 62vh;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.present-office-hint { padding: 0.5rem 0 0.25rem; line-height: 1.7; }
.present-prose { line-height: 1.75; font-size: var(--fs-base); }
.syllabus-box {
  background: var(--blue-50);
  padding: 1rem;
  border-radius: 8px;
}
.preview-media { width: 100%; max-height: 70vh; border-radius: 8px; }
.preview-iframe {
  width: 100%;
  min-height: 65vh;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

/* ── 教师学期选择 ── */
.semester-select-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem var(--page-pad-x);
  position: relative;
  z-index: 1;
}
.semester-select-inner {
  width: min(980px, 100%);
}
.semester-select-head {
  text-align: center;
  margin-bottom: 1.75rem;
}
.semester-select-head h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--blue-800);
  margin: 0.35rem 0;
}
.semester-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.semester-square-card {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.35rem;
  border-radius: 18px;
  text-decoration: none;
  color: var(--blue-900);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(56, 189, 248, 0.22), transparent 55%),
    linear-gradient(160deg, #ffffff 0%, #eef7ff 100%);
  border: 1px solid rgba(14, 165, 233, 0.28);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.semester-square-card:hover {
  transform: translateY(-6px);
  border-color: var(--blue-400);
  box-shadow: 0 20px 40px rgba(2, 132, 199, 0.18);
  color: var(--blue-900);
}
.semester-square-card.is-current {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(251, 191, 36, 0.28), transparent 55%),
    linear-gradient(160deg, #fffbeb 0%, #e0f2fe 100%);
  border-color: rgba(245, 158, 11, 0.45);
}
.semester-square-code {
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.04em;
}
.semester-square-note {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.semester-square-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}
.semester-square-badge.muted {
  background: rgba(91, 122, 157, 0.14);
  color: var(--text-muted);
}
.semester-square-cta {
  font-weight: 700;
  color: var(--blue-700);
}
.semester-select-foot {
  text-align: center;
  margin-top: 1.75rem;
  color: var(--text-muted);
}
@media (max-width: 900px) {
  .semester-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .semester-card-grid { grid-template-columns: 1fr; }
  .semester-square-card { aspect-ratio: auto; min-height: 160px; }
}
