/* =====================================================================
   都市头条 H5 / 平板适配样式 (responsive.css)
   =====================================================================
   断点体系（与 flexible.js 严格对应）：
     >= 1200px          PC —— 本文件所有规则均不生效，PC 端零影响
     768 ~ 1199.98px    平板 —— 布局降级（栅格减列、双栏堆叠），1rem = 16px
     < 768px            手机 —— 等比缩放布局，1rem = 屏宽 / 3.75
                         （以 375px 设计稿为基准：1rem = 100px，
                          即 0.32rem = 32px@375 屏、0.44rem = 44px@375 屏）

   书写约定：
     1. 全部规则包裹在 @media (max-width: 1199.98px) 内，保证 PC 不变；
     2. 手机端尺寸优先使用 rem（随屏宽等比缩放，小屏自动缩小）；
     3. 仅做"覆盖"，不修改 style.css / index.css 等既有 PC 规则；
     4. 引入位置：置于所有既有样式表之后（覆盖依赖加载顺序）：
        <link rel="stylesheet" href="/templates/default/css/responsive.css">
   ===================================================================== */

html { -webkit-text-size-adjust: 100%; }

@media (max-width: 1199.98px) {

  /* ===================================================================
     一、公共头部：汉堡菜单 + 顶部下滑抽屉
     -------------------------------------------------------------------
     PC（>=1200px）        ：汉堡隐藏，登录区正常显示，导航横排；
     平板 + 手机（<1200px） ：汉堡按钮显示在头部栏右侧，登录区隐藏，
                            导航转为"从上往下滑出"的全宽抽屉。
     =================================================================== */

  /* ---------- 平板 + 手机共用：汉堡按钮、隐藏登录、顶部下滑抽屉 ---------- */

  /* 汉堡按钮：仅平板/手机显示，PC 隐藏（默认 display:none） */
  .mobile-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    margin-left: auto;                       /* 登录区隐藏后靠右 */
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 3px 0;
    border-radius: 1px;
    background: var(--text-primary, #1f2937);
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  /* 展开态：三线变叉 */
  .mobile-menu-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .mobile-menu-toggle.open span:nth-child(2) { opacity: 0; }
  .mobile-menu-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  /* 登录区：平板/手机隐藏，仅 PC 显示 */
  .header-actions { display: none; }

  /* 导航：从顶部往下滑出的全宽抽屉（覆盖 style.css 的横排/隐藏规则） */
  .header-nav {
    display: flex;
    position: fixed;
    top: var(--header-height, 64px);         /* 紧贴头部栏下沿 */
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px 16px 24px;
    background: #ffffff;
    transform: translateY(-100%);             /* 收起态整体藏于头部栏之后 */
    /* 抽屉是 header 的子元素，z-index 无法压过兄弟节点，
       收起时必须 visibility 隐藏，避免白底盖住头部内容 */
    visibility: hidden;
    transition: transform 0.28s ease, visibility 0s linear 0.28s;
    overflow-y: auto;
    z-index: 99;                              /* 低于头部(100)，滑出时从头部下方展开 */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    max-height: calc(100vh - var(--header-height, 64px));
  }

  .header-nav.nav-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.28s ease;
  }

  .header-nav a {
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
    border-bottom: 1px solid #f3f4f6;
    min-height: 44px;                         /* 可点区域 >= 44px */
    display: flex;
    align-items: center;
  }

  .header-nav a.active::after { display: none; }
  .header-nav a.active { background: var(--primary-bg, #f0fdf4); }

  /* 抽屉遮罩（紧贴头部栏下沿） */
  .mobile-nav-mask {
    position: fixed;
    top: var(--header-height, 64px);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 98;
  }

  .mobile-nav-mask.show { opacity: 1; visibility: visible; }

  /* 抽屉打开时锁定背景滚动 */
  body.nav-locked { overflow: hidden; }

  /* ---------- 平板（768 ~ 1199.98px）：头部收紧间距 ---------- */
  @media (min-width: 768px) {
    .header-logo .logo-img { height: 24px; }
    .logo-tagline { display: none; }
    .header-inner, .container,
    .hero-inner, .split-inner,
    .app-intro-inner, .sites-nav-inner { padding: 0 1rem; }
    .header-nav a { font-size: 1rem; padding: 1rem 1.5rem; }
  }

  /* ---------- 手机（< 768px）：头部与抽屉尺寸 rem 化 ---------- */
  @media (max-width: 767.98px) {

    .header { height: 0.56rem; }
    .header-inner { height: 0.56rem; padding: 0 0.16rem; }

    .header-logo { gap: 0.02rem; }
    .header-logo .logo-img { height: 0.24rem; }
    .header-logo .logo-tagline { font-size: 0.11rem; }

    /* 汉堡按钮 rem 化（0.44rem = 44px@375） */
    .mobile-menu-toggle { width: 0.44rem; height: 0.44rem; }
    .mobile-menu-toggle span { width: 0.22rem; height: 0.025rem; margin: 0.03rem 0; }
    .mobile-menu-toggle.open span:nth-child(1) { transform: translateY(0.08rem) rotate(45deg); }
    .mobile-menu-toggle.open span:nth-child(3) { transform: translateY(-0.08rem) rotate(-45deg); }

    /* 抽屉紧贴手机头部（0.56rem）下沿，从上往下展开 */
    .header-nav {
      top: 0.56rem;
      padding: 0.08rem 0.16rem 0.4rem;
      max-height: calc(100vh - 0.56rem);
    }

    .header-nav a {
      padding: 0.14rem 0.24rem;
      font-size: 0.16rem;                    /* 16px @375 */
      border-radius: 0.16rem;
      min-height: 0.44rem;
    }

    .mobile-nav-mask { top: 0.56rem; }
  }

  /* ===================================================================
     二、首页（index）
     =================================================================== */

  /* ---------- 平板 ---------- */
  @media (min-width: 768px) {
    .hero { padding: 3rem 0 2.5rem; min-height: auto; }
    .hero-inner { gap: 2rem; }
    .hero-title { font-size: 2.25rem; }
    .hero-right img { max-width: 17.5rem; height: auto; }

    .cr-cards { grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }

    .ai-features { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .ai-body { grid-template-columns: 1fr; gap: 1.5rem; }
    .ai-body > img { max-height: 14rem; object-fit: contain; justify-self: center; }

    .sn-grid { grid-template-columns: repeat(3, 1fr); }

    .split-section, .app-intro-section, .sites-nav-section { padding: 3rem 0; }
  }

  @media (max-width: 1023.98px) and (min-width: 768px) {
    .cr-cards { grid-template-columns: repeat(3, 1fr); }
    .split-inner { grid-template-columns: 1fr; gap: 2rem; }
  }

  /* ---------- 手机 ---------- */
  @media (max-width: 767.98px) {
    .hero { padding: 0.4rem 0 0.3rem; min-height: auto; }
    .hero-inner { flex-direction: column; gap: 0.24rem; text-align: center; }
    .hero-left { flex: none; width: 100%; }
    .hero-title { font-size: 0.32rem; line-height: 1.25; margin-bottom: 0.12rem; }
    .hero-subtitle { font-size: 0.14rem; margin-bottom: 0.2rem; line-height: 1.6; }
    .hero-right { display: none; }          /* 手机样机图隐藏（沿用原逻辑） */

    .hero-actions-row { flex-direction: column; align-items: center; gap: 0.16rem; margin-bottom: 0.2rem; }
    .hero-qr-box { width: 0.9rem; height: 0.9rem; }
    .hero-qr-box img { width: 0.72rem; }
    .hero-btn-group { width: 100%; gap: 0.1rem; }
    .hero-btn-download, .hero-btn-web {
      justify-content: center; width: 100%;
      padding: 0.14rem 0.3rem; font-size: 0.15rem;
    }

    .hero-features { justify-content: center; flex-wrap: wrap; gap: 0.2rem; margin-top: 0.08rem; }
    .hero-feature-item { font-size: 0.14rem; gap: 0.05rem; }
    .hfi-icon { width: 0.3rem; height: 0.3rem; font-size: 0.16rem; }

    /* —— 连接全球声音 + 都市榜单 —— */
    .split-section { padding: 0.4rem 0; }
    .split-inner { grid-template-columns: 1fr; gap: 0.4rem; }
    .global-voices { width: auto; padding: 0.24rem; background-size: 100% 2.4rem; }
    .global-voices h2 { font-size: 0.22rem; margin-bottom: 0.12rem; }
    .global-desc { font-size: 0.14rem; margin-bottom: 0.2rem; }
    .btn-join { padding: 0.1rem 0.24rem; font-size: 0.14rem; }
    .gv-stats { gap: 0.22rem; margin-top: 0.24rem; }
    .gv-stat-num { font-size: 0.25rem; }
    .gv-stat-label { font-size: 0.13rem; }

    .city-ranking-header { flex-wrap: wrap; }
    .city-ranking-header h2 { font-size: 0.22rem; }
    .cr-subtitle { font-size: 0.13rem; margin-bottom: 0.2rem; }
    .cr-cards { grid-template-columns: repeat(2, 1fr); gap: 0.12rem; margin-top: 0.2rem; }
    .cr-card { padding: 0.2rem 0.08rem 0.16rem; }
    .cr-rank { width: 0.22rem; height: 0.22rem; font-size: 0.11rem; top: -0.1rem; }
    .cr-rank img { width: 100%; height: 100%; display: block; }
    .cr-avatar { width: 0.44rem; height: 0.44rem; font-size: 0.17rem; margin: 0.08rem auto 0.09rem; }
    /* PC 用固定高度对齐名称/标签，移动端改自适应 + 2 行截断，避免溢出 */
    .cr-name { font-size: 0.13rem; height: auto; min-height: 0.34rem;
               margin-bottom: 0.03rem; display: -webkit-box;
               -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .cr-tag { font-size: 0.1rem; height: auto; min-height: 0.26rem; margin-bottom: 0.05rem;
              display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .cr-stats-row { font-size: 0.1rem; flex-wrap: wrap; }

    /* —— App 介绍 —— */
    .app-intro-section { padding: 0.4rem 0; }
    .ai-header h2 { font-size: 0.22rem; }
    .ai-header p { font-size: 0.13rem; }
    .ai-body { grid-template-columns: 1fr; gap: 0.24rem; align-items: start; }
    .ai-body > img { width: 100%; height: auto; max-height: 1.8rem; object-fit: cover;
                     border-radius: 0.12rem; }
    .ai-features { grid-template-columns: repeat(2, 1fr); gap: 0.12rem; }
    .ai-feature-card { padding: 0.16rem 0.12rem; border-radius: 0.12rem; }
    .afc-icon { width: 0.36rem; height: 0.36rem; font-size: 0.18rem; border-radius: 0.1rem; margin-bottom: 0.1rem; }
    .ai-feature-card h3 { font-size: 0.14rem; margin-bottom: 0.04rem; }
    .ai-feature-card p { font-size: 0.12rem; line-height: 1.5; }
    .ai-right { flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 0.16rem; margin-top: 0.16rem; }
    .ai-qr-box { width: 0.64rem; height: 0.64rem; }
    .ai-qr-box img { width: 0.52rem; }
    .ai-dl-btn { padding: 0.11rem 0.24rem; font-size: 0.14rem; }
    .ai-more-link { font-size: 0.13rem; width: 100%; text-align: center; }

    /* —— 内容站导航 —— */
    .sites-nav-section { padding: 0.4rem 0; }
    .sn-header { margin-bottom: 0.2rem; }
    .sn-header h2 { font-size: 0.22rem; }
    .sn-header p { font-size: 0.13rem; }
    .sn-grid { grid-template-columns: 1fr; gap: 0.14rem; }
    .sn-card { padding: 0.2rem 0.24rem; border-radius: 0.12rem;
               display: flex; align-items: center; gap: 0.2rem; min-height: 0.88rem; }
    .sn-card-top { margin-bottom: 0; flex-shrink: 0; }
    .sn-icon { width: 0.36rem; height: 0.36rem; font-size: 0.18rem; }
    .sn-name { font-size: 0.16rem; }
    .sn-desc { font-size: 0.13rem; line-height: 1.5; }
    .sn-arrow { float: none; margin: 0 0 0 auto; font-size: 0.16rem; }
  }

  /* ===================================================================
     三、榜单页（bangdan）
     =================================================================== */

  @media (min-width: 768px) {
    .rank-hero { padding: 2.5rem 0; }
    .rank-hero h1 { font-size: 2rem; }
    .rank-hero p { font-size: 0.9375rem; max-width: 40rem; margin: 0 auto; }
    .rank-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .rank-categories { padding: 0 1rem; max-width: 60rem; margin: 0 auto; }
    .top3-section { gap: 0.75rem; }
  }

  @media (max-width: 767.98px) {
    .rank-hero { padding: 0.4rem 0 0.36rem; }
    .rank-hero-inner { padding: 0 0.16rem; }
    .rank-hero h1 { font-size: 0.26rem; }
    .rank-hero p { font-size: 0.13rem; line-height: 1.6; }
    .hero-time-tabs { margin-top: 0.16rem !important; }
    .hero-period-btn { padding: 0.08rem 0.2rem; font-size: 0.13rem; margin: 0 0.03rem; }

    /* 分类切换：横向可滚动，不换行挤压 */
    .rank-categories { padding: 0 0.16rem; }
    .cat-tabs {
      display: flex; flex-wrap: nowrap; overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      justify-content: flex-start;          /* 覆盖居中，避免可滚动时首项被裁切 */
      gap: 0.1rem; padding: 0.16rem 0;
      margin-bottom: 0.4rem;
      scrollbar-width: none;
    }
    .cat-tabs::-webkit-scrollbar { display: none; }
    .cat-tab-btn { flex-shrink: 0; padding: 0.1rem 0.22rem; font-size: 0.13rem;
                   min-height: 0.44rem; white-space: nowrap; }
	  
    .rank-cards-grid { grid-template-columns: 1fr; gap: 0.24rem;padding: 0; }
	  .rank-panel-header{padding: 0.2rem 0.1rem}
	  .rank-list-page{padding-top: .2rem;}
    .rank-panel { border-radius: 0.12rem; }
    .rank-panel-icon { width: 0.35rem; height: 0.35rem; font-size: 0.17rem; }
    .rank-panel-title { font-size: 0.17rem; }
    .rank-panel-update { font-size: 0.1rem; }
    .rank-panel-view { font-size: 0.12rem; }

    /* Top3 领奖台缩放 */
    .top3-section { gap: 0.1rem; }
    .top3-avatar { width: 0.46rem; height: 0.46rem; font-size: 0.18rem; }
    .top3-1 .top3-avatar { width: 0.56rem; height: 0.56rem; font-size: 0.2rem; }
    .top3-rank { width: 0.22rem; height: 0.22rem; }
    .top3-rank img { width: 100%; height: 100%; display: block; }
    .top3-name { font-size: 0.12rem; -webkit-line-clamp: 1; }
    .top3-score { font-size: 0.13rem; }

    /* 榜单列表行 rem 化 */
    .rank-list-row { padding: 0.12rem 0; }
    .rank-num { width: 0.24rem; height: 0.24rem; font-size: 0.12rem; }
    .content-thumb { width: 0.46rem; height: 0.46rem; }
    .content-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0.06rem; }
    .rank-list-title { font-size: 0.13rem; }
    .rank-list-author { font-size: 0.12rem; }
    .rank-list-score { font-size: 0.13rem; }
    .rank-list-trend { font-size: 0.12rem; }
	.page-box .page-btn{font-size: .15rem} 
	.page-box{display: flex;justify-content: center;align-items: center;}
	  .rank-sidebar{display:none;}
  }

  /* ===================================================================
     四、APP 下载页（download）
     =================================================================== */

  @media (min-width: 768px) {
    .app-hero { padding: 3rem 0; }
    .app-hero-text h1 { font-size: 2.25rem; }
    .phone-frame { transform: scale(0.9); transform-origin: bottom center; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-inner { gap: 1.5rem; }
  }

  @media (max-width: 767.98px) {
    .app-hero { padding: 0; }
    .app-hero-inner { flex-direction: column; text-align: center; gap: 0.4rem; }
	  .app-hero-text{display:flex;flex-direction: column;align-items: center;margin: .2rem 0;}
    .app-hero-text h1 { font-size: 0.28rem; }
    .app-hero-text .subtitle { font-size: 0.14rem; }
    .app-hero-text .badge { font-size: 0.12rem; padding: 0.04rem 0.12rem;width: auto }
    .app-hero-btns { flex-direction: column; gap: 0.16rem; align-items: center; }
    .btn-dl { width: 100%; max-width: 2.24rem; justify-content: center;
              padding: 0.12rem 0.2rem; }
    .btn-dl svg { width: 0.24rem; height: 0.24rem; }
    .app-hero-mockup { flex: none; }
    .phone-frame { transform: scale(0.82); transform-origin: top center; margin: -0.4rem 0; }
	  .app-hero-mockup{display:none;}
    .features-section, .stats-strip, .cta-section { padding: 0.4rem 0; }
    .section-header h2 { font-size: 0.24rem; }
    .section-header p { font-size: 0.13rem; }
    .features-grid { grid-template-columns: 1fr; gap: 0.2rem; }
    .feature-card { padding: 0.24rem; text-align: left; }
    .feature-card .fc-icon { width: 0.4rem; height: 0.4rem; font-size: 0.19rem; }
    .feature-card h3 { font-size: 0.17rem;text-align: center}
    .feature-card p { font-size: 0.13rem; line-height: 1.55;text-align: center}

    .stats-inner { gap: 0.2rem; }
    .stat-value { font-size: 0.26rem !important; }
    .stat-label { font-size: 0.13rem !important; }

    .cta-qr img { width: 1.04rem; height: 1.04rem; }
    .cta-qr span { font-size: 0.13rem; }
  }

  /* ===================================================================
     五、创作号页（toutiaohao）—— 老式双栏布局，重点单列化
     =================================================================== */

  @media (min-width: 768px) {
    /* bui 双栏 → 单栏，侧栏下移 */
    .bui-box.container { display: block; }
    .bui-left.index-content { width: 100% !important; float: none !important; }
    .wenji_sousuo { max-width: 24rem; }
  }

  @media (max-width: 767.98px) {
    .bui-box.container { display: block; padding: 0 0.16rem; }
    .bui-left.index-content { width: 100% !important; float: none !important;
                              margin: 0.16rem 0; }
    .pane-module { font-size: 0.14rem !important; line-height: 1.6 !important; }
    .module-head { font-size: 0.19rem; }
    .wenjiDesc { font-size: 0.12rem; }

    /* 搜索框全宽 */
    .wenji_sousuo, .yanshang_sousuo { width: 100%; }
    .search_text { width: 100% !important; height: 0.44rem; font-size: 0.14rem;
                   padding: 0 0.12rem; }
    .queding_sousuo { width: 0.64rem !important; height: 0.44rem; background-size: contain; }

    /* 创作号信息流条目 */
    .publicity h4 { font-size: 0.15rem; line-height: 1.5; }
    .smallIconImg img { width: 0.32rem; height: 0.32rem; border-radius: 50%; }
    .smallIconRT { font-size: 0.1rem; }
    .time { font-size: 0.1rem; }
    .content_titles { font-size: 0.14rem; line-height: 1.55; }
    .content_right img { width: 0.92rem; height: 0.62rem; object-fit: cover; }
    .content_top ul { display: flex; gap: 0.06rem; }
    .content_top ul li { flex: 1; }
    .content_top ul li img { width: 100%; height: 0.56rem; object-fit: cover; }
    .lei_right2 { font-size: 0.12rem; padding: 0.06rem 0.12rem; min-height: 0.32rem; }
    .one-px-border { margin: 0.16rem 0; }
  }

  /* ===================================================================
     六、公共页脚
     =================================================================== */

  @media (min-width: 768px) {
    .footer { padding-top: 2.5rem; }
    .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; gap: 1.5rem; }
  }

  @media (max-width: 767.98px) {
    .footer { padding-top: 0.4rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 0.32rem; padding: 0 0.2rem; }
	  .footer-grid>div:nth-of-type(n+2){display:none;}
    .footer-brand h3 { justify-content: center; margin-bottom: 0.12rem; }
    .footer-brand .flogo-img { height: 0.48rem; }
    .footer-brand p { font-size: 0.13rem; }
    .flogo-tagline { text-align: center; }
    .footer-social { justify-content: center;display: none }
    .footer-social a { width: 0.44rem; height: 0.44rem; font-size: 0.16rem; }
    .footer-col h4 { font-size: 0.16rem; margin-bottom: 0.16rem; }
    .footer-col ul li { margin-bottom: 0.12rem; }
    .footer-col ul li a { font-size: 0.13rem; }
    .footer-bottom { flex-direction: column; gap: 0.12rem; text-align: center;
                     font-size: 0.11rem; padding: 0.2rem 0.16rem; }
    .footer-bottom-links { justify-content: center; gap: 0.24rem;display: none }
	  
  }

  /* ===================================================================
     七、全局微调
     =================================================================== */

  @media (max-width: 767.98px) {
    .section { padding: 0.4rem 0; }
    img { max-width: 100%; }
  }

  /* 触摸设备：去掉 hover 悬浮位移，防止粘滞 */
  @media (hover: none) {
    .cr-card:hover, .sn-card:hover, .ai-feature-card:hover,
    .rank-panel:hover { transform: none; }
  }

} /* ===== end @media (max-width: 1199.98px) ===== */
