/* ==========================================================================
   备课箱 · 虚拟实验室 (Lab Portal Styles)
   设计风格：清新教育科技 / 现代卡片式 / 高可读性 / 全端自适应
   ========================================================================== */

:root {
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-light: #f0fdfa;
  --primary-border: #99f6e4;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-light: #fef3c7;
  --dark: #0f172a;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 页面通用容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 顶部通用导航 */
.portal-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-btn-shop {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.nav-btn-shop:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* 首屏 Banner */
.hero-section {
  background: radial-gradient(circle at 80% 20%, #ccfbf1 0%, transparent 40%),
              radial-gradient(circle at 10% 80%, #fef3c7 0%, transparent 35%),
              #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 56px 0 48px;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid var(--primary-border);
  margin-bottom: 20px;
}

.hero-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.5px;
  margin-bottom: 14px;
  line-height: 1.25;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 32px;
}

/* 搜索栏 */
.search-box-wrap {
  max-width: 580px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 20px;
  font-size: 15px;
  background: #ffffff;
  border: 2px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

.search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-light);
  pointer-events: none;
}

/* 快速状态条 (药丸胶囊徽章) */
.stat-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.stat-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
  background: #e6fffa;
  border: 1px solid #99f6e4;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.08);
}

/* 筛选工具栏 */
.filter-section {
  padding: 32px 0 20px;
}

.filter-group {
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 72px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

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

.pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
}

/* 结果摘要条 */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.result-count {
  font-size: 14px;
  color: var(--text-muted);
}

.result-count strong {
  color: var(--dark);
}

/* 实验卡片网格 */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 28px;
  margin-bottom: 64px;
}

.lab-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
}

.lab-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-border);
}

.card-top {
  padding: 20px 24px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-version-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge-version {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
}

.badge-grade {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}

.badge-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-online {
  background: #dcfce7;
  color: #15803d;
}

.status-coming {
  background: #fef3c7;
  color: #b45309;
}

.card-body {
  padding: 0 24px 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-unit {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 6px;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.35;
  margin-bottom: 8px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-desc {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 16px;
  flex-grow: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.tag-pill {
  font-size: 11px;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 8px;
  border-radius: 4px;
}

/* 卡片底栏操作 */
.card-actions {
  padding: 16px 24px;
  background: #fafafa;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-lab-enter {
  flex: 1;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

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

.btn-lab-enter.disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-card-shop {
  flex: 1;
  background: #ffffff;
  color: #d97706;
  border: 1px solid #fed7aa;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-card-shop:hover {
  background: #fff7ed;
  border-color: #f97316;
  color: #ea580c;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  grid-column: 1 / -1;
  background: #ffffff;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-text {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* 底部引流横幅 */
.portal-cta-banner {
  background: linear-gradient(135deg, #0d9488, #047857);
  color: #ffffff;
  padding: 48px 0;
  text-align: center;
}
.portal-cta-banner h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}
.portal-cta-banner p {
  font-size: 15px;
  opacity: 0.92;
  max-width: 650px;
  margin: 0 auto 24px;
  line-height: 1.6;
}
.btn-portal-banner-shop {
  display: inline-block;
  background: #f59e0b;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 32px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-portal-banner-shop:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

/* 底部声明与引流 */
.portal-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col-main {
  max-width: 420px;
}

.footer-col-links {
  display: flex;
  gap: 48px;
}

.footer-group h4 {
  font-size: 14px;
  color: var(--dark);
  margin-bottom: 12px;
}

.footer-group ul {
  list-style: none;
}

.footer-group li {
  margin-bottom: 8px;
}

.footer-group a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-group a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 12px;
}

/* ==========================================================================
   移动端深度自适应优化 (<768px)
   包含：紧凑导航、横滑导轨筛选器、iOS防输入缩放、触控大靶区
   ========================================================================== */
@media (max-width: 768px) {
  /* 移动端统一安全视口内边距 */
  .container {
    padding: 0 16px !important;
  }

  /* 导航栏防挤压防折行 */
  .portal-header {
    height: 52px;
  }
  .portal-header .container {
    padding: 0 14px;
  }
  .nav-wrap {
    height: 52px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
  }
  .brand-link {
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
  }
  .brand-logo {
    width: 28px;
    height: 28px;
    font-size: 15px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .brand-info {
    min-width: 0;
  }
  .brand-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-subtitle {
    display: none !important;
  }
  .nav-actions {
    flex-shrink: 0;
    gap: 0;
  }
  .nav-actions .nav-link {
    display: none !important;
  }
  .nav-btn-shop {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 999px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  /* 首屏紧凑化 */
  .hero-section {
    padding: 24px 0 18px;
  }
  .hero-pill {
    font-size: 11.5px;
    padding: 3px 10px;
    margin-bottom: 10px;
  }
  .hero-title {
    font-size: 21px;
    line-height: 1.3;
    margin-bottom: 10px;
  }
  .hero-desc {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 18px;
  }
  .search-box-wrap {
    max-width: 100%;
  }
  .search-input {
    height: 44px;
    font-size: 16px !important; /* 强制16px彻底杜绝iOS Safari聚焦缩放 */
    padding: 0 42px 0 16px;
  }
  .search-icon {
    right: 14px;
    font-size: 16px;
  }

  /* 优势特色单行横向顺滑胶囊 (彻底告别难看竖排) */
  .stat-strip {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    padding: 4px 6px 8px;
    gap: 8px;
    margin-top: 16px;
    width: 100%;
  }
  .stat-strip::-webkit-scrollbar {
    display: none;
  }
  .stat-item {
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.3;
  }

  /* 筛选工具栏：呼吸边距 + 边缘平滑滑动导轨 */
  .filter-section {
    padding: 16px 16px 12px;
  }
  .filter-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
  }
  .filter-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 700;
  }
  .filter-pills {
    width: auto;
    margin: 0 -16px;
    padding: 0 16px 6px 16px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox 隐藏滚动条 */
    gap: 8px;
  }
  .filter-pills::-webkit-scrollbar {
    display: none; /* Chrome/Safari 隐藏滚动条 */
  }
  .pill-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 14px;
    font-size: 13px;
  }

  /* 结果栏与网格 */
  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 16px;
  }
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 40px;
  }
  .card-top {
    padding: 16px 16px 12px;
  }
  .card-body {
    padding: 0 16px 16px;
  }
  .card-title {
    font-size: 18px;
  }
  .card-desc {
    font-size: 13.5px;
  }
  .card-actions {
    padding: 12px 16px;
    gap: 8px;
  }
  .btn-lab-enter, .btn-card-shop {
    padding: 10px 8px;
    font-size: 12.5px;
    min-height: 42px;
  }

  /* 底部行动呼吁 Banner 移动端适配 */
  .portal-cta-banner {
    padding: 32px 0 28px;
  }
  .portal-cta-banner h2 {
    font-size: 19px;
    line-height: 1.35;
    margin-bottom: 10px;
  }
  .portal-cta-banner p {
    font-size: 13.5px;
    margin-bottom: 20px;
    padding: 0 10px;
  }
  .btn-portal-banner-shop {
    width: calc(100% - 32px);
    max-width: 320px;
    padding: 12px 20px;
    font-size: 14px;
  }

  /* 页脚适配 */
  .footer-content {
    flex-direction: column;
    gap: 24px;
  }
  .footer-col-links {
    flex-direction: column;
    gap: 20px;
  }
}
