/* ===== 学虎教育 · 虚拟实验库 · 清新教育风 ===== */
:root {
  --brand-blue: #1886fd;
  --brand-blue-deep: #0b6fe0;
  --brand-blue-soft: #e8f2ff;
  --brand-orange: #ff8a00;
  --brand-orange-soft: #fff3e2;
  --bg: #f3f7fb;
  --card-bg: #ffffff;
  --text: #1f2d3d;
  --text-2: #5e6e82;
  --text-3: #94a3b4;
  --line: #e6edf4;
  --shadow: 0 10px 30px rgba(24, 80, 150, 0.08);
  --shadow-hover: 0 18px 44px rgba(24, 80, 150, 0.16);
  --radius: 16px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* ===== 顶部栏 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(24, 134, 253, 0.25);
  background: #fff;
}

.brand-logo.small { width: 34px; height: 34px; border-radius: 9px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }

.brand-text strong {
  font-size: 19px;
  font-weight: 700;
  color: var(--brand-blue-deep);
  letter-spacing: 0.5px;
}

.brand-text em {
  font-style: normal;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 3px;
}

/* ===== 搜索框 ===== */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 40vw);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(24, 134, 253, 0.12);
}

.search-icon { width: 17px; height: 17px; color: var(--text-3); flex: none; }

.search-box input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
  color: var(--text);
  background: transparent;
}

.search-box input::placeholder { color: var(--text-3); }

/* ===== 页面主体 ===== */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  width: 100%;
  flex: 1;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(120deg, #1a8aff 0%, #2f9dff 55%, #3fb7ff 100%);
  border-radius: 22px;
  padding: 34px 40px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 18px 40px rgba(24, 134, 253, 0.28);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.hero-copy h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.hero-copy p { font-size: 14.5px; opacity: 0.92; }

.hero-stats {
  display: flex;
  gap: 14px;
  flex: none;
  position: relative;
  z-index: 1;
}

.hero-stats div {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 12px 20px;
  text-align: center;
  min-width: 92px;
}

.hero-stats strong { display: block; font-size: 22px; line-height: 1.2; }

.hero-stats span { font-size: 12px; opacity: 0.9; }

/* ===== 学科 Tab ===== */
.subject-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 22px;
}

.tab {
  border: 1.5px solid var(--line);
  background: var(--card-bg);
  color: var(--text-2);
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tab:hover { border-color: var(--brand-blue); color: var(--brand-blue); }

.tab.active {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(24, 134, 253, 0.3);
}

.tab .count {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  padding: 1px 8px;
}

.tab.active .count { background: rgba(255, 255, 255, 0.25); }

/* ===== 实验卡片 ===== */
.sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 20px;
}

.sim-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.sim-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.sim-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #eaf1f9;
  overflow: hidden;
}

.sim-thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.sim-thumb-fallback svg { width: 42px; height: 42px; color: #9db8d8; }

.sim-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}

.sim-card:hover .sim-thumb { transform: scale(1.05); }

.sim-subject-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(24, 134, 253, 0.92);
  color: #fff;
  font-size: 12px;
  padding: 3px 11px;
  border-radius: 999px;
  letter-spacing: 1px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.sim-card-info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

.sim-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sim-card-meta {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sim-subjects { display: flex; gap: 5px; flex-wrap: wrap; }

.mini-badge {
  font-size: 11px;
  color: var(--brand-blue-deep);
  background: var(--brand-blue-soft);
  border-radius: 6px;
  padding: 1px 7px;
}

.mini-badge.orange { color: #d97100; background: var(--brand-orange-soft); }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 70px 0;
  color: var(--text-3);
  font-size: 15px;
}

/* ===== 页脚 ===== */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 20px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

.site-footer span { display: block; font-size: 12px; margin-top: 2px; color: var(--text-3); opacity: 0.85; }

/* ===== 实验播放页 ===== */
body.player-body { background: #101828; }

.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 10;
}

.player-bar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-blue-deep);
  padding: 7px 14px;
  border-radius: 10px;
  transition: background 0.15s;
  white-space: nowrap;
}

.back-btn:hover { background: var(--brand-blue-soft); }

.back-btn svg { width: 18px; height: 18px; }

.player-divider { width: 1px; height: 24px; background: var(--line); }

.player-title {
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  flex: none;
  background: var(--brand-blue-soft);
  color: var(--brand-blue-deep);
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 999px;
  letter-spacing: 1px;
}

.player-bar-right { display: flex; gap: 8px; flex: none; }

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.15s;
}

.icon-btn:hover { border-color: var(--brand-blue); color: var(--brand-blue); }

.icon-btn svg { width: 18px; height: 18px; }

.player-wrap {
  position: absolute;
  inset: 60px 0 0;
}

#sim-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ===== 响应式 ===== */
@media (max-width: 820px) {
  .hero { flex-direction: column; align-items: flex-start; padding: 26px; }
  .hero-stats { width: 100%; }
  .hero-stats div { flex: 1; }
  .header-inner { padding: 10px 16px; }
  .search-box { width: auto; flex: 1; }
  .brand-text em { display: none; }
  .page { padding: 20px 16px 48px; }
  .sim-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .player-title { font-size: 14px; }
  .back-btn span { display: none; }
}

@media (max-width: 480px) {
  .sim-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-copy h1 { font-size: 20px; }
}
