/* ===========================================================
   御山川 · 移动端专属样式（仅 ≤768px 生效）
   桌面端保持 site.css / home.css 原样，本文件不影响桌面。
   所有规则包在 @media(max-width:768px) 内，作为移动端的"单独样式层"。
   =========================================================== */
@media (max-width: 768px) {

  /* ---------- 全局移动端节奏 ---------- */
  * { -webkit-tap-highlight-color: transparent; }   /* 去掉点按蓝色闪块，移动原生触感 */
  html { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  body { font-size: 16px; overflow-x: hidden; }
  .wrap { padding: 0 18px; }
  .section { padding: 44px 0; }

  /* ---------- 区块标题：左对齐，靠衬线字号/字距建立层级（去掉竖条，与桌面端保持一致） ---------- */
  .sec-head { margin-bottom: 28px; text-align: left; }
  .sec-head h2 {
    font-size: 24px; letter-spacing: 2px; font-weight: 700;
    color: var(--ink);
  }
  .sec-head p {
    font-size: 14px; line-height: 1.8; margin-top: 10px;
    margin-left: 0; margin-right: 0; max-width: 100%; text-align: left;
    color: var(--muted);
    text-wrap: balance;   /* 避免尾字单独成行 */
  }
  /* 正文可读性：移动端统一放宽行距 */
  .section p, .about-intro p, .history .row p, .trust .box p, .whyus-list p,
  .detail .lead, .convert li, .contact-info .item p { line-height: 1.85; }

  /* ---------- 移动端顶栏 + 导航：合并为单栏（Logo 居中 + 右上汉堡） ---------- */
  .topbar {
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 1px 0 rgba(0,0,0,.06);
    background: var(--paper);
  }
  .topbar .wrap { height: 50px; justify-content: center; gap: 0; }
  .brand { gap: 0; }
  .brand img { height: 34px; }
  .brand .slogan { display: none; }                              /* 移动端隐藏标语 */
  .topbar .phone { display: none; }                               /* 移动端去掉电话 */

  /* 导航行：透明背景 + 汉堡按钮绝对定位 */
  nav#navBar {
    position: fixed; top: 0; right: 0;
    background: transparent; box-shadow: none;
    z-index: 55;
  }
  nav#navBar .wrap {
    position: relative; height: 50px; padding: 0 12px;
    background: transparent; box-shadow: none; z-index: 2;
  }
  .nav-toggle {
    position: relative; z-index: 3;
    display: inline-flex; margin: 0;
    width: 46px; height: 46px; gap: 5px;
    flex-direction: column; justify-content: center; align-items: center;
    background: transparent; border: none; cursor: pointer;
    border-radius: 50%;
    transition: background .2s;
  }
  .nav-toggle:active { background: rgba(0,0,0,.05); }
  .nav-toggle span {
    width: 22px; height: 2px; background: var(--ink);
    border-radius: 2px; transition: transform .28s cubic-bezier(.2,.7,.2,1), opacity .2s;
  }
  .nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: #fff; }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: #fff; }

  /* 汉堡展开面板：从右侧滑入的全屏遮罩 + 单列菜单 */
  .nav-menu {
    position: fixed !important; top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(20,18,16,.97);
    flex-direction: column !important; align-items: stretch !important;
    padding: 70px 20px 40px;
    max-height: none !important; height: auto;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.32,.72,.25,1);
    overflow-y: auto;
    box-shadow: none;
    z-index: 1;
  }
  .nav-menu.open {
    transform: translateX(0);
    max-height: none !important; height: 100%;
  }
  .nav-menu a {
    padding: 18px 0 !important; border-top: none !important; border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: 18px; letter-spacing: 2px; color: #EDE6D8; text-align: left;
    border-radius: 0 !important;
  }
  .nav-menu a.active {
    background: transparent !important; color: var(--gold);
  }
  .nav-menu a:last-child { border-bottom: none; }

  /* ---------- 首屏 hero ---------- */
  .hero {
    /* 首屏收紧：配合下方数据区，减少「联系合作」到数据区之间的空白 */
    height: 450px;
    position: relative;
  }
  .hero::before {
    /* 顶部渐变遮罩，防止状态栏文字被 hero 图片背景淹没 */
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 120px;
    background: linear-gradient(180deg, rgba(20,18,16,.55), transparent);
    z-index: 1; pointer-events: none;
  }
  .hero .inner { padding: 0 22px; }
  .hero h1 { font-size: 32px; letter-spacing: 4px; line-height: 1.2; font-weight: 700; }
  .hero .hero-title-img { max-width: 200px; max-height: 52px; }
  /* 强化左侧/整体遮罩，文字与建筑纹理分离 */
  .hero::after { background: linear-gradient(180deg, rgba(20,18,16,.5) 0%, rgba(20,18,16,.82) 100%); }
  .hero p { font-size: 15px; margin-top: 12px; line-height: 1.85; max-width: 100%;
    text-shadow: 0 1px 6px rgba(20,18,16,.45); color: #ECE6D8; }

  /* CTA：全宽胶囊按钮 */
  .cta-row {
    gap: 12px; margin-top: 22px;
    flex-direction: column; align-items: stretch;
  }
  .cta-row .btn {
    width: 100%; justify-content: center;
    border-radius: 999px; padding: 15px 24px; font-size: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
  }
  .btn { border-radius: 999px; min-height: 48px; padding: 14px 28px; }

  /* ---------- 数据信任区：移动端排 2 列，只显示前 4 项 ---------- */
  /* 5 项在 2 列下必然剩一个孤项；第 5 项「1 脉」是结语文案而非链接，移动端直接不显示，换取 2×2 完全平衡 */
  .stats { position: relative; }
  .stats .wrap {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 10px;
    padding: 18px 20px 26px;
  }
  .stat {
    border-right: none !important;
    text-align: center;
  }
  .stat .num { font-size: 28px; line-height: 1.2; }
  .stat .num small { font-size: 1em; margin-left: 2px; }
  .stat .label { font-size: 12px; margin-top: 4px; letter-spacing: 1px; line-height: 1.6; }
  .stat:last-child { display: none; }

  /* ---------- 主推/产品中心/案例/资讯：移动端一行两列紧凑卡 ---------- */
  .home-products, .products.cols-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .products { gap: 12px; }
  .card {
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 12px rgba(28, 26, 23, .08);
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .card:hover { transform: none; box-shadow: 0 2px 12px rgba(28, 26, 23, .08); }
  .card:active { transform: scale(.97); box-shadow: 0 1px 6px rgba(28, 26, 23, .12); }
  .card .thumb { aspect-ratio: 1/1; background-size: contain; background-position: center; }
  .card .body { padding: 10px 12px 12px; }
  .card h3 { font-size: 15px; margin: 2px 0; font-weight: 600; }
  .card .tag { font-size: 10px; padding: 2px 7px; margin: 4px 0; }
  .card .desc {
    font-size: 12px; line-height: 1.55; margin-top: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .card .price { font-size: 14px; margin-top: 6px; }
  .card .price span { font-size: 11px; }
  .card .more { display: none; }

  /* ---------- 产品详情页 ---------- */
  .detail { grid-template-columns: 1fr; gap: 28px; }
  .detail .gallery .main { height: 300px; border-radius: 10px; }
  .detail .gallery .thumbs div { height: 60px; border-radius: 6px; }
  .detail h1 { font-size: 26px; letter-spacing: 1px; }
  .detail .price-big { font-size: 22px; }
  .detail .specs li { font-size: 14px; padding: 10px 0; }
  .detail .buy { flex-direction: column; gap: 10px; }
  .detail .buy .btn { width: 100%; justify-content: center; }

  /* ---------- 古法工艺时间线（深色，首页 .step） ---------- */
  .craft .sec-head p { color: #C9C0B0; }

  /* 视频：移动端换成「封面 + 居中播放按钮」，点击才加载（不再自动下载 6.7MB） */
  .craft-video { position: relative; margin: 0 auto 24px; }
  .craft-video.video-ready .video-cover {
    position: absolute; inset: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    border: 0; padding: 0; margin: 0; background: transparent;
    border-radius: 12px; overflow: hidden; cursor: pointer;
  }
  .craft-video .video-cover-bg { position: absolute; inset: 0; background: center/cover no-repeat; }
  .craft-video .video-cover::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.05) 40%, rgba(0,0,0,.5));
  }
  .craft-video .video-play {
    position: relative; z-index: 2;
    width: 58px; height: 58px; border-radius: 50%;
    background: rgba(28, 26, 23, .5); border: 1.5px solid rgba(255, 255, 255, .8);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .38);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  }
  .craft-video .video-play svg { width: 24px; height: 24px; color: #fff; margin-left: 3px; }
  .craft-video .video-tip {
    position: absolute; z-index: 2; left: 0; right: 0; bottom: 12px;
    text-align: center; color: rgba(255,255,255,.88); font-size: 12px; letter-spacing: 2px;
  }
  .craft-video.playing .video-cover { display: none !important; }

  /* 序号与标题同排，描述整行通栏（与下方图片左边缘对齐，不再缩进） */
  .step {
    grid-template-columns: 48px 1fr; column-gap: 12px; row-gap: 6px; align-items: start;
    padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .step > div:nth-child(2) { display: contents; }   /* 让 h3 / p 成为 grid item */
  .step .idx { grid-column: 1; grid-row: 1; font-size: 22px; white-space: normal; line-height: 1.15; }
  .step .idx small { display: none; }   /* 去掉与右侧 h3 重复的标题，避免拥挤 */
  .step h3 { grid-column: 2; grid-row: 1; font-size: 18px; margin: 0; }
  .step p { grid-column: 1 / -1; grid-row: 2; font-size: 14px; max-width: none; line-height: 1.8; margin: 0; }
  .step .pic { grid-column: 1 / -1; grid-row: 3; height: 140px; margin-top: 10px; border-radius: 8px; }

  /* 内页工艺时间线 .step2（craft.ejs）同步收窄 */
  .timeline2::before { display: none; }
  .craft-hero-quote { font-size: 16px; margin: 0 auto 28px; line-height: 1.8; }
  .step2 {
    grid-template-columns: 56px 1fr; column-gap: 12px; row-gap: 8px;
    align-items: center; padding: 16px 0;
  }
  .step2 > div:nth-child(2) { display: contents; }
  .step2 .idx { grid-column: 1; grid-row: 1; width: 56px; height: 56px; }
  .step2 .idx b { font-size: 20px; }
  .step2 .idx small { display: none; }   /* 圆章内不再塞标题，避免文字溢出圆圈（标题右侧已有 h3） */
  .step2 h3 { grid-column: 2; grid-row: 1; font-size: 18px; margin: 0; }
  .step2 p { grid-column: 1 / -1; grid-row: 2; font-size: 14px; max-width: none; line-height: 1.8; margin: 0; }
  .step2 .pic { grid-column: 1 / -1; grid-row: 3; height: 160px; margin-top: 10px; border-radius: 8px; }

  /* ---------- 客户口碑（深色） ---------- */
  .voices { grid-template-columns: 1fr; gap: 30px; }
  .voice p { font-size: 18px; line-height: 1.8; }
  .voice cite { margin-top: 14px; font-size: 13px; }

  /* ---------- 为什么信赖 / 我们的坚持（关于页 .trust） ---------- */
  .whyus-section .sec-head p { font-size: 13px; color: var(--muted); margin-top: 12px; line-height: 1.7; }
  .whyus-list {
    grid-template-columns: 1fr; gap: 0;
  }
  .whyus-list li {
    position: relative;
    padding: 22px 0 20px;
    border-bottom: 1px solid var(--line);
  }
  .whyus-list li:last-child { border-bottom: none; }
  /* 移动端：序号与标题合成一行（传统条目编号感），去掉桌面端独占的空行 */
  .whyus-list li .num {
    display: inline-block;
    font-family: var(--serif);
    font-size: 17px; line-height: 1;
    color: var(--soy);
    letter-spacing: 2px;
    margin: 0 7px 0 0;
    vertical-align: 3px;
  }
  .whyus-list h3 {
    display: inline;
    font-size: 20px; letter-spacing: 2px;
    padding-top: 0;
  }
  /* 硬指标独立于正文，作数据锚点 */
  .whyus-list .metric {
    font-size: 14px; line-height: 1.6;
    padding-top: 12px; padding-bottom: 12px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--line);
  }
  /* 移动端全文展示，不再截断（每条仅一句，非文字墙；截断+展开反而像被腰斩） */
  .whyus-list p {
    font-size: 14.5px; line-height: 1.85;
    color: var(--muted);
    max-height: none; display: block;
    -webkit-line-clamp: unset; overflow: visible;
    margin-top: 12px;
  }
  .whyus-list .toggle-desc { display: none; }   /* 全文展示后无需展开 */
  .trust { grid-template-columns: 1fr; gap: 14px; }
  .trust .box { padding: 24px 20px 22px; border-radius: 12px; }
  .trust .box .ic { width: 44px; height: 44px; margin-bottom: 14px; }
  .trust .box h3 { font-size: 19px; }
  .trust .box p { font-size: 14.5px; line-height: 1.8; }

  /* ---------- 关于我们页面 ---------- */
  .about-intro { grid-template-columns: 1fr; gap: 28px; }
  .about-intro .pic { height: 240px; border-radius: 10px; }
  .about-intro h2 { font-size: 24px; margin-bottom: 12px; }
  .history .row { grid-template-columns: 1fr; gap: 4px; padding: 14px 8px; }
  .history .row .yr { font-size: 20px; }

  /* ---------- FAQ ---------- */
  .section.alt { padding-top: 28px; }
  .section.alt .sec-head { margin-bottom: 16px; }
  .faq .item { padding: 6px 0; border-bottom: 1px solid var(--line); }
  .faq .item:last-child { border-bottom: none; }
  .faq .q { font-size: 15px; padding: 6px 0; align-items: flex-start; gap: 8px; }
  .faq .q .mark { font-size: 16px; flex: none; }
  .faq .a { font-size: 14px; padding: 2px 0 8px 20px; line-height: 1.8; }
  .faq-cta { margin-top: 24px; }

  /* ---------- 底部强转化 ---------- */
  .convert .wrap { grid-template-columns: 1fr; gap: 28px; padding: 40px 20px; }
  .convert h2 { font-size: 22px; letter-spacing: 1px; }
  .convert ul { margin-top: 14px; }
  .convert li { font-size: 14px; padding: 4px 0; }
  .form { padding: 20px; border-radius: 12px; }
  .form h3 { font-size: 16px; }
  .form input, .form textarea {
    font-size: 16px; padding: 12px 14px; border-radius: 10px;
    margin-bottom: 10px;
  }
  /* iOS 上输入框聚焦时自动放大，font-size 必须 >= 16px */
  .form input:focus, .form textarea:focus { outline: 2px solid var(--soy); outline-offset: 1px; }
  .form button { font-size: 16px; padding: 14px; border-radius: 999px; font-weight: 700; }

  /* ---------- 页脚：移动端只保留品牌与合规信息 ---------- */
  /* 三组导航链接在移动端由顶部汉堡菜单 + 右下角咨询胶囊承担，页脚不再重复堆叠 */
  footer .f-contact,
  footer .f-prod,
  footer .f-about { display: none; }
  footer .cols {
    grid-template-columns: 1fr;
  }
  /* 品牌区：通栏，其下不再单独画线（与合规区的分隔线会叠成双线） */
  footer .f-brand {
    grid-column: 1 / -1; order: 1;
    padding-bottom: 0;
    border-bottom: none;
  }
  footer .f-prod { display: none; }
  footer .f-about { display: none; }
  footer { padding: 32px 0 18px; }
  footer h4 { font-size: 15px; margin-bottom: 10px; letter-spacing: 2px; }
  footer .f-brand h4 { font-size: 17px; letter-spacing: 3px; }
  footer .cols > div > p { font-size: 13px; line-height: 1.8; }
  footer a {
    display: block;
    padding: 8px 0;           /* 配合 7px 外边距，链接热区保持在 44px 上下 */
    font-size: 14px;
    letter-spacing: .5px;
  }
  /* 合规区左对齐 + 各行独立成行：居中排版会把公司名、地址拦腰折断，读起来更乱 */
  footer .bottom {
    margin-top: 18px; padding-top: 16px;
    font-size: 12px; line-height: 1.8;
    text-align: left;
  }
  footer .bottom > div + div { margin-top: 4px; }
  footer .bottom a { display: inline; padding: 0; font-size: 12px; }
  /* 合规信息合成一块，不再二次分隔 */
  footer .bottom.meta { margin-top: 6px; border-top: none; }
  footer .bottom.meta .sep { display: none; }
  footer .bottom.meta span { display: block; white-space: normal; }
  /* 电话在移动端由这里补位（「联系」分组已隐藏、顶栏电话也不显示） */
  footer .f-phone-line { display: block; }
  footer .f-phone-line a { color: #B0A697; }

  /* ---------- 悬浮按钮：移动端收敛为单个带文字的咨询胶囊 ---------- */
  .fab {
    right: 14px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }
  .fab .fab-top { display: none; }
  .fab .fab-chat { display: none; }
  /* 纯图标容易被误认，改为「图标 + 文字」胶囊，明确点击后会发生什么 */
  .fab .fab-call {
    width: auto;
    height: 46px;
    padding: 0 16px 0 13px;
    border-radius: 23px;
    gap: 7px;
    background: var(--soy);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(156, 61, 27, .32);
  }
  .fab .fab-call svg { width: 18px; height: 18px; }
  .fab .fab-call:hover { transform: translateY(-2px); }
  .fab .fab-label {
    display: inline;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .5px;
    white-space: nowrap;
  }

  /* ---------- 内页头图横幅 ---------- */
  .subhero { height: 220px; }
  .subhero::after { background: linear-gradient(180deg, rgba(20,18,16,.45), rgba(20,18,16,.72)); }
  .subhero h1 { font-size: 24px; letter-spacing: 3px; margin-top: 6px; }
  .subhero p { font-size: 13px; margin-top: 6px; }
  .crumb { padding: 12px 0; font-size: 13px; }

  /* ---------- 联系页面 ---------- */
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .contact-info .item { padding: 14px 0; gap: 12px; }
  .contact-info .item .ic { width: 20px; height: 20px; margin-top: 2px; }
  .map { height: 280px; border-radius: 10px; }

  /* ---------- 面包屑 ---------- */
  .crumb { font-size: 13px; }

  /* ---------- 资质弹窗 ---------- */
  .qual-modal { padding: 16px; }
  .qual-inner { border-radius: 12px; padding: 20px; max-height: 90vh; }
  .qual-head h3 { font-size: 18px; }
}

/* 极窄屏（≤420px）进一步微调 */
@media (max-width: 420px) {
  .wrap { padding: 0 14px; }
  /* 窄屏首屏再收一档，避免按钮与数据区之间留白过大 */
  .hero { height: 410px; }
  .hero h1 { font-size: 28px; letter-spacing: 3px; }
  .hero .hero-title-img { max-width: 170px; max-height: 44px; }
  .sec-head h2 { font-size: 22px; }
  .stat .num { font-size: 26px; }
  .stat .num small { font-size: 1em; margin-left: 2px; }
  /* 产品保持一行两列（用户明确要求），窄屏只收紧尺寸不改列数 */
  .home-products, .products.cols-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card .thumb { aspect-ratio: 1/1; background-size: contain; }
  .card .body { padding: 9px 10px 11px; }
  .card h3 { font-size: 14px; }
  .card .desc { font-size: 11px; line-height: 1.5; }
  .card .price { font-size: 13px; }
  .card .price span { font-size: 10px; }
  .subhero { height: 180px; }
  .subhero h1 { font-size: 20px; }
  footer .cols { gap: 16px; }
}
