/* ==========================================================================
   Taimei News — 响应式适配（仅 news.html 引入，不影响其他页面与 PC 端）
   设计稿基准 1440px；以下规则只在小屏媒体查询内生效，PC 端样式保持不变。
   ========================================================================== */

/* 移动端专属元素：桌面端不显示（仅存在于 public/header-news 模板中） */
.navbar__burger {
  display: none;
}

.news-nav {
  display: none;
}

body.is-nav-open {
  overflow: hidden;
}

/* ==========================================================================
   980px–1439px：窄屏 PC
   此时 .page(1440px) 宽于视口，CSS 会把 margin:auto 解析为 0（不产生负边距），
   .page 左边缘在 0 而非居中，style.css 里为居中场景准备的
   left: calc(720px - 50vw) 无法被抵消，会把 .news-bg 整体右移、左侧露出白边。
   这里把背景直接钉在左边缘即可铺满视口。
   ========================================================================== */

@media (min-width: 980px) and (max-width: 1439px) {
  .news-bg {
    left: 0;
  }
}

/* ==========================================================================
   ≤979px：平板 / 手机
   ========================================================================== */

@media (max-width: 979px) {
  /* ---------- 顶部导航（汉堡菜单） ---------- */

  .site-header {
    height: 64px;
  }

  .navbar {
    height: 64px;
    padding: 0 16px;
    justify-content: space-between;
    gap: 12px;
  }

  .navbar__menu,
  .navbar__product,
  .navbar__cta {
    display: none;
  }

  .navbar__actions {
    gap: 14px;
  }

  .navbar__brand img {
    width: 88px;
    height: 32px;
  }

  html[lang="zh-cn"] .navbar__brand img {
    width: 72px;
    height: 29px;
  }

  .navbar__lang img {
    width: 22px;
    height: 22px;
  }

  .navbar__burger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
  }

  .navbar__burger span {
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: #ffffff;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .navbar__burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .navbar__burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .navbar__burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* ---------- 移动端导航面板 ---------- */

  .news-nav {
    display: block;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    background: #041884;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 0;
  }

  .news-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .news-nav__scroll {
    padding: 4px 0 32px;
  }

  .news-nav__item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .news-nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    line-height: 24px;
    color: #ffffff;
    text-align: left;
  }

  .news-nav__caret {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    transition: transform 0.25s ease;
  }

  .news-nav__link--toggle[aria-expanded="true"] .news-nav__caret {
    transform: rotate(180deg);
  }

  .news-nav__sub {
    display: none;
    padding: 0 20px 12px;
  }

  .news-nav__sub.is-open {
    display: block;
  }

  .news-nav__sub a {
    display: block;
    padding: 10px 0;
    font-size: 14px;
    line-height: 22px;
    color: rgba(255, 255, 255, 0.72);
  }

  .news-nav__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    margin: 24px 20px 0;
    font-size: 15px;
    line-height: 22px;
    color: #ffffff;
    background: var(--blue);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
  }

  /* ---------- 页面容器 ---------- */

  .page {
    width: 100%;
  }

  /* ---------- Hero ---------- */

  .news-banner {
    height: auto;
    padding: 96px 0 32px;
    overflow: hidden;
  }

  .news-bg {
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
  }

  .news-block {
    top: -108px;
    left: 50%;
    transform: translateX(-50%);
    width: 160%;
    max-width: 720px;
    height: auto;
  }

  .news-glow--1 {
    top: -160px;
    left: auto;
    right: -120px;
    width: 340px;
    height: 320px;
    filter: blur(90px);
  }

  .news-glow--2 {
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    height: 300px;
    filter: blur(100px);
  }

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

  .news-title {
    position: static;
    transform: none;
    padding: 0 20px;
    font-size: clamp(28px, 5.2vw, 40px);
    line-height: 1.25;
    letter-spacing: -0.02em;
  }

  .news-frame {
    position: relative;
    top: auto;
    left: auto;
    width: calc(100% - 32px);
    max-width: 620px;
    height: auto;
    margin: 24px auto 0;
    padding: 12px 12px 40px;
    border-radius: 24px;
  }

  /* ---------- 头条轮播 ---------- */

  .news-featured {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: visible;
  }

  .news-slider__track {
    height: auto;
    border-radius: 16px;
    overflow: hidden;
  }

  .news-slide {
    width: 100%;
    height: auto;
    flex-direction: column;
  }

  .featured__body {
    flex: none;
    padding: 20px 20px 0;
  }

  .featured__title {
    width: auto;
    font-size: 19px;
    line-height: 27px;
  }

  .featured__btn {
    position: static;
    display: inline-flex;
    margin: 14px 0 18px;
    padding: 8px 20px;
    font-size: 14px;
    line-height: 22px;
    background: #f2f6ff;
  }

  .featured__btn-icon {
    width: 12px;
    height: 12px;
  }

  .featured__media {
    width: 100%;
    height: 190px;
    flex: none;
  }

  .featured__img {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  .featured__shade {
    width: 100%;
    height: 64px;
  }

  .featured__overlay {
    top: auto;
    bottom: 14px;
    left: 18px;
    right: 18px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .featured__overlay span {
    gap: 6px;
    font-size: 13px;
    line-height: 20px;
  }

  .featured__overlay img {
    width: 14px;
    height: 14px;
  }

  .news-slider__dots {
    left: 50%;
    top: auto;
    bottom: -22px;
    transform: translateX(-50%);
    gap: 8px;
  }

  .news-dot {
    width: 10px;
    height: 10px;
    border-radius: 5px;
  }

  .news-dot.is-active {
    width: 30px;
  }

  /* ---------- 新闻列表（每行 1 条：标题 + 日期） ---------- */

  .news-list {
    width: calc(100% - 32px);
    max-width: 620px;
    margin: 28px auto 0;
  }

  .news-card {
    width: 100%;
    height: auto;
    padding: 18px 20px;
  }

  .news-card__title {
    position: static;
    width: auto;
    height: auto;
    font-size: 17px;
    line-height: 26px;
    -webkit-line-clamp: 3;
  }

  .news-card__date {
    position: static;
    width: auto;
    margin-top: 8px;
    font-size: 14px;
    line-height: 22px;
  }

  /* ---------- 分页（页码导航） ---------- */

  .news-pager {
    margin-top: 32px;
    gap: 8px;
    padding: 0 16px;
  }

  .news-pager__item,
  .news-pager__nav,
  .news-pager__gap {
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 15px;
  }

  /* ---------- 页脚（仅 news.html 生效，共享 footer.css 不动） ---------- */

  .footer {
    height: auto;
    margin-top: 56px;
    padding: 44px 20px 32px;
  }

  /* 移动端 .footer 自身即为 100vw 且已铺黑，全屏黑底层不再需要；
     同时它 z-index:0 会盖住改为 static 的内容，必须移除 */
  .footer::before {
    display: none;
  }

  /* 必须带上 .footer__brands 前缀：共享 footer.css 中该选择器特异性更高 */
  .footer__brands .footer__logo,
  .footer__logo {
    position: static;
    width: 124px;
    height: 45px;
  }

  .footer__nav {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 16px;
    margin-top: 28px;
  }

  .footer__nav-col a {
    white-space: normal;
  }

  .footer__nav::before,
  .footer__info::before {
    display: none;
  }

  .footer__info {
    position: static;
    width: auto;
    margin-top: 28px;
  }

  .footer__social {
    position: static;
    margin-top: 16px;
    gap: 24px;
  }

  .footer__qr {
    position: static;
    display: inline-block;
    width: 74px;
    height: 74px;
    margin: 18px 12px 0 0;
  }

  .footer__qr--taimei {
    left: auto;
  }

  .footer__badge {
    position: static;
    display: block;
    margin: 24px auto 0;
  }

  .footer__legal {
    position: static;
    left: auto;
    transform: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px 16px;
    margin-top: 24px;
    white-space: normal;
  }

  .footer__legal span,
  .footer__legal a.footer__legal-link {
    white-space: normal;
  }
}

/* ==========================================================================
   768px–979px：平板窄屏，列表加宽到 720
   ========================================================================== */

@media (min-width: 768px) and (max-width: 979px) {
  .news-frame,
  .news-list {
    max-width: 720px;
  }
}

/* ==========================================================================
   ≤479px：小屏手机微调
   ========================================================================== */

@media (max-width: 479px) {
  .news-banner {
    padding-top: 88px;
  }

  .news-title {
    font-size: 28px;
    line-height: 36px;
  }

  .featured__title {
    font-size: 17px;
    line-height: 25px;
  }

  .featured__media {
    height: 168px;
  }

  .news-pager {
    gap: 6px;
  }

  .news-pager__item,
  .news-pager__nav,
  .news-pager__gap {
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    font-size: 14px;
  }
}
