/* ==========================================================================
   CytheScoreBoard - RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 1200px) {
  .painpoints-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .canvas-split-grid {
    grid-template-columns: 220px 1fr 240px;
  }

  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hotkey-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 992px) {
  .nav-links {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

  .tech-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .stat-item:nth-child(2)::after {
    display: none;
  }

  .canvas-split-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .editor-sidebar, .editor-props {
    display: none;
  }

  .editor-viewport {
    height: 320px;
  }

  .code-editor-window {
    grid-template-columns: 1fr;
    height: auto;
  }

  .code-editor-pane {
    height: 260px;
  }

  .code-preview-pane {
    height: 200px;
  }

  .floating-badge {
    display: none;
  }

  /* 截图上的特性气泡标签为绝对定位，窄屏下必然互相叠字，直接隐藏 */
  .ss-feature-callouts {
    display: none;
  }

  .sim-teams-grid {
    gap: 12px;
  }

  .team-card-hero h4 {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding-top: 110px;
    padding-bottom: 60px;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .painpoints-grid,
  .matrix-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }

  /* 旗舰条在窄屏退回单列，标题与正文纵向堆叠 */
  .matrix-card.matrix-card-feature {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 26px 22px;
  }

  .matrix-card.matrix-card-feature .matrix-tags {
    margin-top: 16px;
  }

  /* 选项卡改横向滚动，避免四组标签在窄屏折行成块 */
  .matrix-tabs {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-radius: var(--radius-lg);
    padding: 6px;
    margin-bottom: 32px;
    scrollbar-width: none;
  }

  .matrix-tabs::-webkit-scrollbar {
    display: none;
  }

  .matrix-tab {
    padding: 10px 14px;
    font-size: 0.84rem;
  }

  .matrix-panel-head {
    margin-bottom: 22px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-item::after {
    display: none !important;
  }

  .hotkey-grid {
    grid-template-columns: 1fr;
  }

  .sim-teams-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .team-card-hero, .team-card-hero.team-away {
    flex-direction: column !important;
    text-align: center !important;
    justify-content: center;
  }

  .team-away .team-meta {
    justify-content: center;
  }

  .sim-score-center {
    margin: 16px 0;
  }

  .sim-interactive-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .ctrl-group {
    justify-content: center;
    flex-wrap: wrap;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  /* 相册行窄屏优化 */
  .gallery-albums {
    gap: 40px;
  }

  .album-head {
    align-items: center;
    margin-bottom: 14px;
  }

  .album-sub {
    display: none;
  }

  .album-index {
    font-size: 1.35rem;
  }

  .album-title {
    font-size: 1.12rem;
  }

  .album-nav {
    display: none;
  }

  .album-track .gallery-card {
    flex-basis: 82%;
  }
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: rgba(10, 15, 24, 0.96);
  backdrop-filter: blur(25px);
  z-index: 200;
  padding: 80px 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-left: 1px solid var(--border-subtle);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-drawer.open {
  right: 0;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-nav-links a {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  padding: 8px 0;
}

.mobile-drawer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

/* ==========================================================================
   APP WINDOW RESPONSIVE ADAPTATIONS
   ========================================================================== */
@media (max-width: 900px) {
  .cythe-app-sidebar {
    width: 60px;
    padding: 8px 0;
  }

  .sidebar-item {
    padding: 10px 8px;
    justify-content: center;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-bottom-actions {
    flex-direction: column;
    padding: 8px;
  }

  .director-monitors-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .cythe-win-titlebar {
    display: none;
  }

  .cythe-app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .ctrl-top-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ctrl-score-digit {
    font-size: 3rem;
  }

  .ctrl-clock-digit {
    font-size: 2.8rem;
  }

  .pso-controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .pso-team-btns {
    justify-content: center;
  }

  .hotkey-modal-body {
    grid-template-columns: 1fr;
  }
}

/* 页脚：视口够宽就保持两栏，只有很窄时才退回单栏 */
@media (max-width: 992px) {
  .footer-grid {
    gap: 34px 24px;
  }

  .footer-brand p {
    max-width: none;
  }
}

@media (max-width: 520px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* 装饰浮标外挑量在窗口收窄后会顶出视口被切掉，收到容器边界内
   （≤992 时 .floating-badge 整组隐藏，不与此规则冲突） */
@media (max-width: 1360px) {
  .badge-top-left {
    left: -12px;
  }

  .badge-bottom-right,
  .badge-mid-right {
    right: -12px;
  }
}
