/**
 * =========================================================
 * 大华导航 Dahua Nav
 * Cyber 科技风模板响应式适配：public/themes/cyber/assets/css/responsive.css
 * =========================================================
 */

/* ---------------------------------------------------------
   平板：≤1024px
--------------------------------------------------------- */

@media (max-width: 1024px) {
  .cy-app {
    padding: 0 14px;
    padding-bottom: calc(32px + var(--safe-bottom));
  }

  .cy-header {
    margin-left: -14px;
    margin-right: -14px;
    padding: 0 14px;
  }

  .cy-header-inner {
    height: 50px;
    gap: 10px;
  }

  .cy-search {
    max-width: 240px;
  }

  .cy-brand-name {
    font-size: 14px;
  }

  .cy-logo {
    height: 26px;
    max-width: 100px;
  }

  .cy-carousel-stage {
    aspect-ratio: 2.4 / 1;
    min-height: 180px;
    max-height: 340px;
  }

  .cy-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
  }

  .cy-glow-1 { width: 500px; height: 500px; }
  .cy-glow-2 { width: 400px; height: 400px; }
  .cy-glow-3 { width: 350px; height: 350px; }
}

/* ---------------------------------------------------------
   手机横屏 / 小平板：≤768px
--------------------------------------------------------- */

@media (max-width: 768px) {
  .cy-app {
    padding: 0 12px;
    padding-bottom: calc(24px + var(--safe-bottom));
  }

  .cy-header {
    margin-left: -12px;
    margin-right: -12px;
    padding: 0 12px;
  }

  .cy-header-inner {
    height: 48px;
    gap: 8px;
  }

  .cy-brand-name {
    display: none;
  }

  .cy-logo {
    height: 24px;
    max-width: 80px;
  }

  .cy-search {
    max-width: none;
    flex: 1;
  }

  .cy-search-input {
    height: 34px;
    font-size: 12px;
    padding: 0 32px 0 34px;
  }

  .cy-search-icon {
    width: 16px;
    height: 16px;
    left: 10px;
  }

  .cy-cta {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 16px;
  }

  .cy-marquee {
    padding: 5px 0;
    margin-top: 6px;
  }

  .cy-marquee-text {
    font-size: 11px;
  }

  .cy-carousel {
    border-radius: var(--cy-radius);
  }

  .cy-carousel-stage {
    aspect-ratio: 2 / 1;
    min-height: 140px;
    max-height: 260px;
  }

  .cy-car-btn {
    width: 34px;
    height: 34px;
    opacity: 0.6;
  }

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

  .cy-car-prev { left: 8px; }
  .cy-car-next { right: 8px; }

  .cy-car-dots {
    bottom: 8px;
    gap: 6px;
  }

  .cy-car-dot {
    width: 6px;
    height: 6px;
  }

  .cy-car-dot.active {
    width: 20px;
  }

  .cy-icon-strip {
    padding: 6px 0;
    margin-bottom: 6px;
  }

  .cy-icon-item {
    width: 36px;
    height: 36px;
  }

  .cy-icon-item img {
    width: 24px;
    height: 24px;
  }

  .cy-main-header {
    margin-bottom: 10px;
  }

  .cy-tab {
    padding: 5px 12px;
    font-size: 12px;
  }

  .cy-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }

  .cy-card {
    padding: 14px 8px 10px;
    gap: 6px;
  }

  .cy-card-icon {
    width: 38px;
    height: 38px;
  }

  .cy-card-title {
    font-size: 12px;
  }

  .cy-card-desc {
    display: none;
  }

  .cy-footer {
    margin-top: 14px;
    padding-top: 14px;
  }

  .cy-glow-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -80px;
  }

  .cy-glow-2 {
    width: 260px;
    height: 260px;
    bottom: -100px;
    right: -60px;
  }

  .cy-glow-3 {
    display: none;
  }

  .cy-bg-grid {
    background-size: 36px 36px;
  }
}

/* ---------------------------------------------------------
   小屏手机：≤480px
--------------------------------------------------------- */

@media (max-width: 480px) {
  .cy-app {
    padding: 0 10px;
    padding-bottom: calc(20px + var(--safe-bottom));
  }

  .cy-header {
    margin-left: -10px;
    margin-right: -10px;
    padding: 0 10px;
  }

  .cy-header-inner {
    height: 44px;
    gap: 6px;
  }

  .cy-logo {
    height: 22px;
    max-width: 70px;
  }

  .cy-search {
    max-width: none;
  }

  .cy-search-input {
    height: 30px;
    font-size: 11px;
    padding: 0 28px 0 30px;
    border-radius: 16px;
  }

  .cy-search-icon {
    width: 14px;
    height: 14px;
    left: 8px;
  }

  .cy-search-clear {
    width: 18px;
    height: 18px;
    right: 5px;
    font-size: 14px;
  }

  .cy-cta {
    padding: 4px 10px;
    font-size: 11px;
  }

  .cy-carousel-stage {
    aspect-ratio: 1.8 / 1;
    min-height: 100px;
    max-height: 200px;
  }

  .cy-car-btn {
    width: 28px;
    height: 28px;
  }

  .cy-car-btn svg {
    width: 16px;
    height: 16px;
  }

  .cy-card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .cy-card {
    padding: 12px 6px 8px;
    border-radius: var(--cy-radius-sm);
  }

  .cy-card::before {
    left: 4px;
    right: 4px;
  }

  .cy-card-icon {
    width: 34px;
    height: 34px;
  }

  .cy-card-title {
    font-size: 11px;
  }

  .cy-card-badge {
    top: 3px;
    right: 3px;
    padding: 1px 5px;
    font-size: 9px;
  }

  .cy-marquee {
    padding: 4px 0;
    margin-top: 4px;
  }

  .cy-marquee-text {
    font-size: 10px;
  }

  .cy-tab {
    padding: 4px 10px;
    font-size: 11px;
  }

  .cy-lock-modal {
    padding: 28px 20px;
    margin: 0 16px;
  }
}

/* ---------------------------------------------------------
   极小屏：≤360px
--------------------------------------------------------- */

@media (max-width: 360px) {
  .cy-header-inner {
    height: 42px;
  }

  .cy-logo {
    height: 20px;
    max-width: 56px;
  }

  .cy-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }

  .cy-card {
    padding: 10px 4px 8px;
    gap: 4px;
  }

  .cy-card-icon {
    width: 30px;
    height: 30px;
  }

  .cy-card-title {
    font-size: 10px;
  }

  .cy-tab {
    padding: 3px 8px;
    font-size: 10px;
  }

  .cy-search-input {
    font-size: 10px;
  }
}

/* ---------------------------------------------------------
   触摸设备 — 悬停降级
--------------------------------------------------------- */

@media (hover: none) and (pointer: coarse) {
  .cy-carousel .cy-car-btn {
    opacity: 0;
  }

  .cy-card:hover {
    transform: none;
    border-color: var(--cy-border);
    box-shadow: none;
    background: var(--cy-surface);
  }

  .cy-card:hover::before {
    opacity: 0;
  }

  .cy-card:hover::after {
    opacity: 0;
  }

  .cy-card:hover .cy-card-icon {
    transform: none;
  }

  .cy-card:active {
    background: rgba(0, 229, 255, 0.06);
    border-color: var(--cy-border-active);
    transform: scale(0.96);
  }

  .cy-card:active::before {
    opacity: 1;
  }

  .cy-cta:hover {
    transform: none;
    box-shadow: var(--cy-glow-cyan);
  }

  .cy-icon-item:hover {
    transform: none;
    border-color: var(--cy-border);
    box-shadow: none;
  }

  .cy-icon-item:active {
    border-color: var(--cy-border-active);
    box-shadow: var(--cy-glow-cyan);
    transform: scale(0.92);
  }
}

/* ---------------------------------------------------------
   大屏：≥1400px
--------------------------------------------------------- */

@media (min-width: 1400px) {
  .cy-app {
    max-width: 1280px;
  }

  .cy-carousel-stage {
    aspect-ratio: 2.8 / 1;
    max-height: 480px;
  }

  .cy-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
}
