/* ============================================================
   DYWALES · 移动端竖版样式 (mobile-first, 手机优先)
   仅在窄屏生效（<= 820px），桌面端渲染完全不受影响。
   数据源与桌面端共用同一套：data/site-content.json
   ============================================================ */

@media (max-width: 820px) {

  html { -webkit-text-size-adjust: 100%; }

  body {
    font-size: 16px;
    line-height: 1.78;
    overflow-x: hidden;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .container { padding: 0 18px; max-width: 100%; }

  /* 顶部信任条 ---------- */
  .header-top,
  .site-header,
  .lang-bar,
  .lang-bar-inner { max-width: 100%; }

  .trust-ribbon {
    font-size: 11.5px;
    line-height: 1.55;
    padding: 8px 14px;
    letter-spacing: 0;
  }

  /* ---------- 页头 ---------- */
  .site-header { position: sticky; top: 0; }

  .header-top {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
  }

  /* 品牌独占一行，控件整体换到第二行，避免 CTA 被挤成竖排 */
  .brand-logo { flex: 1 1 100%; min-width: 0; }
  .header-controls {
    flex: 1 1 100%;
    justify-content: space-between;
    align-items: center;
  }
  .brand-mark, .brand-mark-img { width: 34px; height: 34px; }
  .brand-name { font-size: 17px; letter-spacing: 0.02em; }
  .brand-sub { display: none; }

  .header-controls { gap: 8px; }

  .currency-toggle { gap: 4px; flex: 0 0 auto; }
  .currency-btn { font-size: 12px; padding: 5px 9px; min-height: 32px; white-space: nowrap; }

  .btn-cta-nav {
    font-size: 13px;
    padding: 9px 14px;
    min-height: 38px;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* 导航改为整行横向滑动的胶囊条 */
  .nav-links {
    order: 3;
    flex: 0 0 100%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 8px 14px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: var(--bg-card);
    white-space: nowrap;
    scroll-snap-align: start;
  }

  /* ---------- 语言切换条 ---------- */
  .lang-bar { padding: 8px 0; }
  .lang-bar-inner {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding: 0 16px 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .lang-bar-inner::-webkit-scrollbar { display: none; }
  .lang-bar-label { display: none; }
  .lang-pill {
    flex: 0 0 auto;
    font-size: 12.5px;
    padding: 6px 12px;
    min-height: 32px;
    white-space: nowrap;
  }

  /* ---------- Hero ---------- */
  .hero { padding: 34px 0 26px; }
  .hero-grid { grid-template-columns: 1fr; gap: 22px; }

  .eyebrow { font-size: 11.5px; letter-spacing: 0.12em; margin-bottom: 12px; }

  .hero h1 {
    font-size: clamp(27px, 8.2vw, 34px);
    line-height: 1.28;
    letter-spacing: -0.015em;
  }

  .hero-subtitle {
    font-size: 15.5px;
    line-height: 1.78;
    margin-top: 14px;
    color: var(--text-muted);
  }

  .hero-actions { flex-direction: column; gap: 10px; margin-top: 20px; }
  .btn-primary, .btn-secondary {
    width: 100%;
    min-height: 50px;
    font-size: 15.5px;
    justify-content: center;
    text-align: center;
  }

  .hero-badges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 18px;
  }
  .hero-badge { font-size: 12.5px; padding: 9px 11px; line-height: 1.45; }

  .hero-visual { margin-top: 4px; }
  .hero-photo-card { border-radius: 16px; overflow: hidden; }
  .hero-photo-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
  .hero-floating-card {
    position: static;
    margin-top: 12px;
    max-width: 100%;
    border-radius: 14px;
  }
  .hero-floating-card strong { font-size: 14.5px; }
  .hero-floating-card span { font-size: 12.5px; }

  /* ---------- 通用区块 ---------- */
  .section { padding: 46px 0; }
  .section-header { margin-bottom: 22px; }
  .section-header h2 { font-size: clamp(23px, 6.6vw, 28px); line-height: 1.32; }
  .section-header p { font-size: 15px; line-height: 1.78; margin-top: 10px; }

  /* ---------- 数据条 ---------- */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px 14px; border-radius: 14px; }
  .stat-num { font-size: clamp(24px, 7vw, 30px); }
  .stat-label { font-size: 12.5px; line-height: 1.5; margin-top: 4px; }

  /* ---------- 对比表：横向滑动 + 首列吸附 ---------- */
  .comparison-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    position: relative;
  }
  .comparison-table { min-width: 580px; font-size: 13.5px; }
  .comparison-table th, .comparison-table td { padding: 11px 12px; line-height: 1.6; }
  .comparison-table th:first-child,
  .comparison-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg-card);
    box-shadow: 1px 0 0 var(--border-light);
  }
  .comparison-table-wrap::after {
    content: "← 左右滑动查看完整对比 →";
    display: block;
    text-align: center;
    font-size: 11.5px;
    color: var(--text-muted);
    padding: 8px 0 2px;
  }

  /* ---------- 理念块 ---------- */
  .philosophy-box { padding: 20px 18px; border-radius: 14px; overflow: hidden; }
  .philosophy-box h3 { font-size: 18px; line-height: 1.4; }
  .philosophy-box p { font-size: 15px; }
  .philosophy-box .btn-primary {
    display: flex;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 14px 0 0;
    position: static;
    left: auto;
  }

  /* ---------- 筛选按钮 ---------- */
  .filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-btn {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 8px 14px;
    min-height: 36px;
    white-space: nowrap;
  }

  /* ---------- 卡片列表：全部竖排单列 ---------- */
  .cases-grid,
  .packages-grid,
  .guides-grid,
  .alliances-grid,
  .timeline-grid,
  .medtech-bar { grid-template-columns: 1fr; gap: 14px; }

  .case-card { padding: 0 0 4px; border-radius: 16px; overflow: hidden; }
  .case-cover-wrap img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
  .case-card-body { padding: 16px 16px 18px; }
  .case-meta-top { font-size: 11.5px; gap: 6px; flex-wrap: wrap; }
  .case-tag, .case-origin { font-size: 11px; padding: 3px 8px; }
  .case-hospital { font-size: 12px; }
  .case-card h3 { font-size: 17.5px; line-height: 1.42; margin: 10px 0 8px; }
  .case-summary { font-size: 15px; line-height: 1.75; }
  .case-read-more { font-size: 14px; min-height: 40px; display: inline-flex; align-items: center; }

  /* 套餐卡 */
  .package-card { padding: 18px 16px; border-radius: 16px; }
  .pkg-head h3 { font-size: 18px; line-height: 1.4; }
  .pkg-price { font-size: 25px; }
  .pkg-features li { font-size: 14.5px; line-height: 1.7; padding: 5px 0 5px 22px; }
  .pkg-body { margin-top: 14px; }
  .pkg-cn, .pkg-hosp-est { font-size: 13px; }

  /* 图集 */
  .sheshan-gallery {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .sheshan-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 10px;
  }

  /* 流程步骤 */
  .timeline-step { padding: 16px 16px 16px 18px; border-radius: 14px; }
  .step-tag { font-size: 11.5px; }
  .timeline-step h4 { font-size: 16.5px; line-height: 1.45; }
  .timeline-step p { font-size: 14.5px; }

  /* 医疗科技 */
  .medtech-card { border-radius: 14px; overflow: hidden; }
  .medtech-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
  .medtech-card p { font-size: 14px; }

  /* 医院卡 */
  .hospitals-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hospital-card { border-radius: 14px; padding: 14px 12px; }
  .hospital-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; }
  .hospital-card h4 { font-size: 14px; line-height: 1.4; margin-top: 8px; }
  .hospital-card .hosp-zh { font-size: 12px; }
  .hospital-card p { font-size: 12.5px; line-height: 1.55; }

  /* 指南 / 联盟 */
  .guide-card, .alliance-card { padding: 16px; border-radius: 14px; }
  .guide-card h3, .alliance-card h3 { font-size: 17px; line-height: 1.42; }
  .guide-card p, .alliance-card p { font-size: 14.5px; }

  /* ---------- 咨询表单 ---------- */
  .inquiry-grid { grid-template-columns: 1fr; gap: 18px; }
  .form-group label { font-size: 13.5px; }
  .form-control {
    font-size: 16px;               /* 防止 iOS 聚焦放大 */
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 12px;
    width: 100%;
  }
  textarea.form-control { min-height: 120px; }
  .form-row-2 { grid-template-columns: 1fr; gap: 12px; }
  .inquiry-grid .btn-primary { margin-top: 6px; }

  /* 二维码 */
  .qr-box-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .qr-card { padding: 12px 10px; border-radius: 14px; }
  .qr-card img { width: 100%; max-width: 150px; margin: 0 auto 8px; }
  .qr-card span { font-size: 12px; }

  /* ---------- 弹窗：全屏抽屉 ---------- */
  .modal-backdrop { padding: 0; }
  .modal-panel {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
  .modal-close {
    position: sticky;
    top: 8px;
    float: right;
    width: 44px;
    height: 44px;
    margin: 8px 10px 0 0;
    z-index: 5;
  }
  .modal-section-block h4 { font-size: 15.5px; }
  .modal-case-img { border-radius: 12px; }

  /* ---------- 页脚 ---------- */
  .site-footer { padding: 34px 0 22px; }
  .footer-top { flex-direction: column; gap: 18px; }
  .footer-brand { font-size: 15px; }
  .footer-links { flex-wrap: wrap; gap: 10px 16px; font-size: 13.5px; }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    line-height: 1.6;
    text-align: left;
  }
  .admin-link { font-size: 12px; }

  .disclaimer-note { font-size: 12px; line-height: 1.65; }
}

@media (max-width: 380px) {
  .hospitals-grid { grid-template-columns: 1fr; }
  .hero-badges { grid-template-columns: 1fr; }
  .qr-box-grid { grid-template-columns: 1fr; }
}