/* ===== 糖心vlog 响应式布局 · 手机 + 电脑 ===== */

/* 全站顶栏 */
.site-header { position: relative; z-index: 100; }

/* ---------- 平板 (≥768px) ---------- */
@media (min-width: 768px) {
  :root {
    --content-max: 1200px;
    --gutter: 24px;
    --header-h: 68px;
    --radius-md: 28px;
    --radius-lg: 40px;
  }

  .page-hero h1 { font-size: 2.8rem; }
  .page-hero p { font-size: 1.05rem; }

  .vcard-thumb { height: 240px; }

  /* 视频列表双列 */
  .videos-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 0 var(--gutter) !important;
  }

  /* 子页网格 */
  .data-grid,
  .income-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 0 var(--gutter) !important;
    gap: 16px !important;
  }

  .post-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    padding: 0 var(--gutter) !important;
  }

  .stories-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    padding: 0 var(--gutter) !important;
  }

  .story-card { flex-direction: column; }
  .story-img { width: 100% !important; height: 160px; }

  .features-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    padding: 0 var(--gutter) !important;
  }

  .footer-nav-cols { gap: 16px 32px; max-width: 100%; }
  .footer-links { gap: 10px 28px; }
  .footer-brand { font-size: 1.8rem; }

  .footer-top {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    text-align: left;
    gap: 28px 36px;
    padding-bottom: 28px;
  }

  .footer-brand-col { flex: 0 0 auto; max-width: 220px; }

  .footer-nav-cols {
    flex: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-items: start;
  }

  .footer-col { align-items: flex-start; gap: 11px; }

  /* 平板：导航单行横向滚动，禁止换行 */
  .nav-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
  }

  .pill { scroll-snap-align: start; }

  .legal-content { max-width: var(--content-max) !important; }

  .login-box { max-width: 480px; }

  .video-detail-cover { height: 320px; }
  .related-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .category-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* ---------- 电脑 (≥1024px) ---------- */
@media (min-width: 1024px) {
  :root {
    --content-max: 1200px;
    --gutter: 32px;
    --header-h: 72px;
  }

  body { font-size: 16px; }

  /* 顶栏：单行 Flex — Logo+导航 | 搜索+用户 */
  .site-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 60px;
    padding: 0 var(--gutter);
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 251, 253, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 180, 210, 0.25);
    box-shadow: 0 2px 12px rgba(255, 120, 160, 0.07);
  }

  .site-header .navbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    position: static;
    padding: 0;
  }

  .nav-pills {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 0;
    margin: 0;
    max-width: none !important;
    overflow: visible;
  }

  .header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .search-bar {
    width: 188px;
    max-width: 188px;
    margin: 0;
    padding: 2px 2px 2px 12px;
  }

  .search-bar input {
    font-size: .8rem;
    padding: 7px 0;
  }

  .search-btn {
    width: 30px;
    height: 30px;
    font-size: .78rem;
  }

  #searchToggle { display: none; }

  /* 首页 Hero 双栏 */
  .hero {
    display: grid !important;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 40px;
    padding: 48px var(--gutter) 28px !important;
    max-width: var(--content-max);
    margin: 0 auto;
  }

  .hero h1 { font-size: 3.4rem !important; }
  .hero-sub { font-size: 1.1rem !important; max-width: 480px; }

  .hero-cta { flex-wrap: nowrap; }

  /* 统计条：桌面横排居中 */
  .stats-row {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible !important;
    gap: 14px;
    padding: 0 var(--gutter) 28px !important;
    max-width: var(--content-max);
    margin: 0 auto;
  }

  .stat-chip { padding: 14px 24px; }

  /* 内容精选：桌面双列 */
  .content-hub-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .hub-panel { padding: 22px 20px; }
  .hub-panel-head h2 { font-size: 1.3rem; }

  /* 视频三列 */
  .videos-list {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px;
  }

  .vcard-thumb { height: 200px; }

  /* 创作者网格 */
  .creators-scroll {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    overflow-x: visible !important;
    padding: 4px var(--gutter) 24px !important;
  }

  .creator-chip {
    min-width: 0 !important;
    width: 100%;
  }

  /* 特色功能 */
  .features-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
  }

  .feat-card { padding: 28px 18px !important; }
  .feat-card h3 { font-size: 1.05rem !important; }
  .feat-card p { font-size: .82rem !important; }

  /* 评价三列 */
  .reviews-scroll {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    overflow-x: visible !important;
    padding: 4px var(--gutter) 24px !important;
  }

  .review-card { min-width: 0 !important; width: 100%; }

  /* 成功故事横排 */
  .stories-list {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .story-card { flex-direction: row; }
  .story-img { width: 180px !important; height: auto; min-height: 160px; }

  /* APP 下载区 */
  .app-section {
    margin: 40px var(--gutter) !important;
    padding: 48px 40px !important;
    max-width: calc(var(--content-max) - var(--gutter) * 2);
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .app-section h2 { font-size: 2.6rem !important; }

  /* 子页 */
  .page-hero {
    padding: 40px var(--gutter) 28px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: 8px;
  }

  .page-hero h1 { font-size: 3rem; }

  .post-list {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .team-scroll {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    overflow-x: visible !important;
    padding: 4px var(--gutter) 24px !important;
  }

  .team-card { min-width: 0 !important; }

  .data-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .tool-card { margin: 0 var(--gutter) 16px !important; }

  .income-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .topic-scroll {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible !important;
    gap: 10px;
    padding: 0 var(--gutter) 16px !important;
  }

  .filter-bar {
    justify-content: center;
    flex-wrap: wrap;
    overflow-x: visible !important;
    padding: 0 var(--gutter) 16px !important;
  }

  .sec-head h2 { font-size: 2rem; }

  .seo-intro-inner { padding: 28px 32px; }
  .seo-intro h2 { font-size: 1.8rem; }
  .seo-intro p { font-size: .95rem; }

  .video-detail-cover { height: 400px; }
  .video-detail-body h1 { font-size: 1.85rem; }
  .video-article { padding: 28px 32px; }

  .category-list { grid-template-columns: repeat(3, 1fr); }

  /* 页脚多列 */
  footer { padding: 48px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px)); }

  .footer-top {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    text-align: left;
    gap: 32px 48px;
    padding-bottom: 32px;
  }

  .footer-brand-col {
    flex: 0 0 auto;
    min-width: 200px;
    max-width: 240px;
  }

  .footer-brand { font-size: 1.85rem; }

  .footer-nav-cols {
    flex: 1;
    max-width: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 28px;
    justify-items: start;
  }

  .footer-col {
    align-items: flex-start;
    gap: 12px;
  }

  .footer-links {
    flex: 1;
    max-width: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 28px;
    justify-items: start;
    align-content: start;
  }

  .footer-bottom { padding-top: 26px; margin-top: 32px; }

  .trust-links {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 16px;
  }

  #backTop {
    width: 56px;
    height: 56px;
    bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    right: calc(32px + env(safe-area-inset-right, 0px));
  }
}

/* ---------- 中小桌面 (1024–1199px) 顶栏紧凑 ---------- */
@media (min-width: 1024px) and (max-width: 1199px) {
  .site-header { gap: 12px; }
  .site-header .navbar { gap: 12px; }
  .pill { font-size: .78rem; padding: 6px 10px; }
  .search-bar { width: 160px; max-width: 160px; }
  .logo-text { font-size: 1.1rem; }
  .logo-icon { width: 36px; height: 36px; font-size: 1.25rem; }
}

/* ---------- 大屏 (≥1280px) ---------- */
@media (min-width: 1280px) {
  :root {
    --content-max: 1200px;
    --gutter: 40px;
  }

  .footer-top { gap: 40px 64px; }

  .footer-nav-cols {
    gap: 16px 40px;
  }

  .footer-links {
    gap: 14px 36px;
  }

  .site-header {
    gap: 24px;
    min-height: 64px;
  }

  .site-header .navbar { gap: 24px; }

  .nav-pills { gap: 6px; }

  .pill {
    font-size: .875rem;
    padding: 8px 15px;
  }

  .search-bar {
    width: 210px;
    max-width: 210px;
  }

  .search-bar input { font-size: .84rem; }

  .search-btn {
    width: 32px;
    height: 32px;
  }

  .hero h1 { font-size: 3.8rem !important; }
  .vcard-thumb { height: 220px; }
}

/* ---------- 手机 / 平板 (<1024px) 顶栏分行 ---------- */
@media (max-width: 1023px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo actions"
      "pills pills"
      "search search";
    align-items: center;
    padding-bottom: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 251, 253, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 180, 210, 0.25);
    box-shadow: 0 2px 12px rgba(255, 120, 160, 0.07);
  }

  .site-header .navbar,
  .header-tools {
    display: contents;
  }

  .logo-wrap {
    grid-area: logo;
    padding: 0 var(--gutter);
    min-height: var(--header-h);
    align-self: center;
  }

  .nav-pills {
    grid-area: pills;
    padding: 4px var(--gutter) 8px;
    max-width: none !important;
  }

  .search-bar {
    grid-area: search;
    margin: 0 var(--gutter) 6px;
    max-width: none;
    width: auto;
  }

  .nav-actions {
    grid-area: actions;
    padding-right: var(--gutter);
    align-self: center;
  }

  .site-header .navbar {
    border: none;
    box-shadow: none;
    background: transparent;
    position: static;
  }
}

/* ---------- 手机小屏 (≤480px) ---------- */
@media (max-width: 480px) {
  :root {
    --gutter: 14px;
    --header-h: 56px;
    --radius-md: 24px;
    --radius-lg: 32px;
  }

  .logo-icon { width: 38px !important; height: 38px !important; font-size: 1.35rem !important; }
  .logo-text { font-size: 1.35rem !important; }
  .nav-btn { width: 38px !important; height: 38px !important; }

  .pill { font-size: .8rem; padding: 7px 14px; }

  .hero h1 { font-size: 2.2rem !important; }
  .page-hero h1 { font-size: 2rem !important; }

  .hero-cta { flex-direction: column; }
  .hero-cta .btn-primary,
  .hero-cta .btn-ghost { width: 100%; justify-content: center; }

  .vcard-thumb { height: 180px; }
  .vcard-title { font-size: 1.05rem !important; }

  .stat-chip { padding: 10px 16px; }
  .stat-num { font-size: 1rem !important; }
  .stat-lbl { font-size: .78rem !important; }

  .features-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .story-card { flex-direction: column !important; }
  .story-img { width: 100% !important; height: 140px !important; }

  .app-section { margin: 24px var(--gutter) !important; padding: 28px 18px !important; }
  .app-section h2 { font-size: 1.8rem !important; }

  .dl-btns { flex-direction: column; align-items: stretch; }
  .dl-btn { justify-content: center; }

  .post-images { grid-template-columns: 1fr !important; }
  .post-img[style*="grid-column"] { grid-column: span 1 !important; height: 160px !important; }

  .footer-nav-cols { gap: 14px 20px; max-width: 100%; }
  .footer-links { gap: 10px 12px; max-width: 100%; }
  .footer-brand { font-size: 1.45rem; }

  .search-bar input { font-size: .9rem; }
  .search-btn { width: 42px !important; height: 42px !important; }

  .login-card { padding: 24px 18px !important; }
}

/* ---------- 资讯文章 ---------- */
@media (max-width: 600px) {
  .article-card { flex-direction: column; }
  .article-card-thumb { width: 100%; min-height: 140px; }
  .article-card-body { padding: 14px 16px 16px; }
  .article-cover { height: 160px; }
  .article-header h1 { font-size: 1.35rem; }
}

@media (min-width: 768px) {
  .trust-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .article-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  .article-card { flex-direction: column; }
  .article-card-thumb { width: 100%; min-height: 140px; }
  .article-card-body { padding: 16px; }
}

/* ---------- 触控优化 ---------- */
@media (hover: none) and (pointer: coarse) {
  .vcard:active { transform: scale(0.98); }
  .pill, .nav-btn, .search-btn, .btn-primary, .btn-ghost {
    min-height: 44px;
  }
}

/* ---------- 减少动画（系统偏好） ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
