﻿/* ========================================
   响应式样式 — 武汉晴川学院 #003399 主题
   ======================================== */

/* === 大屏 >1400px === */
@media (min-width: 1400px) {
  .carousel-container { max-height: 520px; }
  .carousel-slide { max-height: 520px; }
}

/* === 中等屏 993-1199px === */
@media (max-width: 1199px) {
  :root { --sidebar-width: 230px; }
  .header-right .slogan { font-size: 1.4rem; }
  .header-right .project-title { font-size: 1.6rem; }
  .three-col-grid { gap: 18px; }
  .two-col-grid { gap: 18px; }
  .team-grid { gap: 18px; }
}

/* === 平板 769-992px === */
@media (max-width: 992px) {
  :root { --sidebar-width: 200px; }

  /* 头部 */
  .site-header .container { gap: 16px; }
  .header-logo { width: 130px; height: 60px; }
  .header-left .logo-text { font-size: 0.8rem; }
  .header-right .slogan { font-size: 1.15rem; }
  .header-right .project-title { font-size: 1.3rem; }

  /* 导航 */
  .main-nav .nav-list > li > a { padding: 12px 4px; font-size: 0.9rem; }

  /* 轮播 */
  .carousel-container { max-height: 340px; }
  .carousel-slide { max-height: 340px; aspect-ratio: auto; }
  .carousel-arrow { width: 34px; height: 34px; font-size: 1rem; }

  /* 三栏 → 内容堆叠 */
  .three-col-grid { grid-template-columns: 1fr; gap: 16px; max-width: 500px; margin: 0 auto; }
  .feature-card { flex-direction: row; }
  .feature-card .card-img { width: 180px; flex-shrink: 0; aspect-ratio: auto; min-height: 140px; }
  .feature-card .card-body { justify-content: center; }

  /* 两栏 → 堆叠 */
  .two-col-grid { grid-template-columns: 1fr; gap: 20px; }
  .demo-carousel .demo-slide { flex: 0 0 100%; }

  /* 内容区 */
  .content-wrapper { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar-nav { position: static; }
  .sidebar-nav ul { display: flex; flex-wrap: wrap; }
  .sidebar-nav ul li { border-bottom: none; border-right: 1px solid var(--border-light); }
  .sidebar-nav ul a {
    border-left: none; border-bottom: 2px solid transparent;
    padding: 10px 14px; font-size: 0.9rem;
  }
  .sidebar-nav ul a:hover,
  .sidebar-nav ul a.active { border-left-color: transparent; border-bottom-color: var(--primary); }

  /* 团队两列 */
  .team-grid { grid-template-columns: repeat(2, 1fr); }

  /* 成员详情：平板端仍保持左图右文 */
  .member-detail.active { gap: 20px; }
  .member-detail .member-photo { width: 160px; }
}

/* === 平板竖屏 577-768px === */
@media (max-width: 768px) {
  html { font-size: 15px; }

  /* 头部 */
  .site-header { padding: 14px 0; }
  .site-header .container { gap: 12px; }
  .header-logo { width: 100px; height: 52px; }
  .header-left .logo-text { font-size: 0.75rem; }
  .header-right .slogan { font-size: 1rem; letter-spacing: 0.06em; }
  .header-right .project-title { font-size: 1.15rem; }

  /* 汉堡菜单 */
  .nav-toggle { display: block; }

  .main-nav .nav-list {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #fff;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    box-shadow: var(--shadow-lg);
  }

  .main-nav .nav-list.open { display: block; }

  .main-nav .nav-list > li { text-align: left; }
  .main-nav .nav-list > li > a {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
  }

  /* 下拉菜单移动端 */
  .main-nav .nav-list .dropdown {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    border-top: none;
    background: var(--bg-lighter);
    display: none;
  }

  .main-nav .nav-list li.has-dropdown.open .dropdown { display: block; }

  .main-nav .nav-list .dropdown a {
    padding: 10px 36px;
    font-size: 0.9rem;
  }

  /* 轮播缩小 */
  .carousel-container { max-height: 240px; }
  .carousel-slide { max-height: 240px; }
  .carousel-arrow { width: 28px; height: 28px; font-size: 0.85rem; }
  .carousel-slide .slide-caption { padding: 10px 20px; font-size: 0.85rem; }
  .carousel-dots { bottom: 8px; gap: 5px; }
  .carousel-dots button { width: 8px; height: 8px; }

  /* 三栏卡片堆叠 */
  .feature-card { flex-direction: column; }
  .feature-card .card-img { width: 100%; aspect-ratio: 16/10; min-height: auto; }

  /* 证书垂直滚动 */
  .cert-vertical { height: 260px; }
  .cert-vertical .cert-v-item .cert-v-img { height: 130px; }

  /* 团队单列 */
  .team-grid { grid-template-columns: 1fr; max-width: 300px; margin: 0 auto; }
  .video-grid { grid-template-columns: 1fr; }

  /* 页脚圆形logo缩小 */
  .site-footer { padding-top: 40px; }
  .site-footer .footer-logo { width: 130px; height: 130px; top: -40px; z-index: 1; }
  .site-footer .footer-logo img { height: 65px; }
  .site-footer .footer-info { font-size: 0.85rem; padding-top: 22px; z-index: 2; position: relative; }

  /* 成员详情：手机端上下堆叠 */
  .member-detail.active { flex-direction: column; align-items: center; text-align: center; }
  .member-detail .member-photo { width: 180px; }
  .member-detail .member-info .member-bio p { text-indent: 0; }

  /* 内容卡 */
  .content-card { padding: 18px 14px; }
  .content-card iframe { height: 360px !important; }

  .section-header h2 { font-size: 1.3rem; }
}

/* === 手机 <577px === */
@media (max-width: 576px) {
  html { font-size: 14px; }
  .container { padding: 0 12px; }

  .site-header { padding: 10px 0; }
  .site-header .container { gap: 8px; }
  .header-logo { width: 90px; height: 48px; }
  .header-left .logo-text { font-size: 0.7rem; letter-spacing: 0.03em; }
  .header-right .slogan { font-size: 0.9rem; }
  .header-right .project-title { font-size: 1rem; letter-spacing: 0.04em; }

  .carousel-container { max-height: 180px; }
  .carousel-slide { max-height: 180px; }
  .carousel-slide .slide-caption { padding: 8px 14px; font-size: 0.75rem; }
  .carousel-arrow { width: 24px; height: 24px; font-size: 0.7rem; }
  .carousel-arrow.prev { left: 6px; }
  .carousel-arrow.next { right: 6px; }

  .three-col-section, .two-col-section { padding: 24px 0; }

  .content-card { padding: 14px 10px; }
  .content-card h2 { font-size: 1.1rem; }

  .sidebar-nav ul { flex-direction: column; }
  .sidebar-nav ul li { border-right: none; border-bottom: 1px solid var(--border-light); }
  .sidebar-nav ul a { border-bottom: none; border-left: 3px solid transparent; }
  .sidebar-nav ul a:hover,
  .sidebar-nav ul a.active { border-bottom-color: transparent; border-left-color: var(--primary); }

  .file-card { flex-direction: column; align-items: flex-start; gap: 8px; }

  .back-to-top { bottom: 14px; right: 14px; width: 36px; height: 36px; font-size: 1rem; }
}

/* === 小手机 <400px === */
@media (max-width: 400px) {
  html { font-size: 13px; }
  .header-left .logo-text { font-size: 0.65rem; }
  .header-right .project-title { font-size: 0.9rem; }
  .carousel-container { max-height: 150px; }
  .carousel-slide { max-height: 150px; }
  .cert-vertical { height: 220px; }
  .cert-vertical .cert-v-item .cert-v-img { height: 110px; }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
  .feature-card:hover, .team-card:hover, .video-card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .main-nav .nav-list > li > a:hover { color: var(--text-body); }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* 高对比度 */
@media (prefers-contrast: high) {
  :root { --text-body: #000; --text-muted: #222; --border-color: #555; }
  body { background: #fff; }
}