/* ---------- 980px：平板 / 小笔记本 ---------- */
@media (max-width: 980px) {
  .hero-grid,
  .dl-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .hero-qr {
    width: 100%;
    max-width: 640px;
  }

  .stage {
    height: auto;
    min-height: 430px;
  }

  h1 {
    font-size: 38px;
  }

  .grid4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .cert {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .dl {
    padding: 30px;
  }

  .qrbox {
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
  }

  .page-hero h1 {
    font-size: 38px;
  }

  .guide-layout,
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .toc-card,
  .legal-aside {
    position: static;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-card-flush {
    overflow-x: auto;
  }

  .cases-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .case-card,
  .case-card:nth-child(1),
  .case-card:nth-child(2) {
    grid-column: span 1;
  }

  .case-card:nth-child(5) {
    grid-column: span 2;
  }

  .error-code {
    font-size: 96px;
  }
}

/* ---------- 900px：切换为移动端导航 ---------- */
@media (max-width: 900px) {
  .official .grid4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav {
    gap: 16px;
  }

  .nav-links,
  .nav-cta {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }
}

/* ---------- 640px：手机 ---------- */
@media (max-width: 640px) {
  h1 {
    font-size: 31px;
  }

  h2 {
    font-size: 25px;
  }

  section {
    padding: 44px 0;
  }

  .grid2,
  .grid4,
  .cert-grid {
    grid-template-columns: 1fr;
  }

  .official .grid4 {
    grid-template-columns: 1fr;
  }

  .official .cert-card,
  .official .verify-card {
    padding: 20px 16px;
  }

  .cases-grid {
    grid-template-columns: 1fr;
  }

  .case-card,
  .case-card:nth-child(1),
  .case-card:nth-child(2),
  .case-card:nth-child(5) {
    grid-column: span 1;
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .case-card:nth-child(n+3) {
    grid-template-columns: 1fr;
  }

  .case-photo {
    order: -1;
    height: 176px;
  }

  .case-body {
    padding: 14px 16px 16px;
  }

  .case-card:nth-child(n+3) .case-label {
    font-size: 10.5px;
  }

  .official .cert-grid {
    gap: 0 16px;
  }

  .official .cert-grid > div:nth-last-child(-n + 2) {
    border-bottom: 1px solid #F2F3F5;
    padding-bottom: 12px;
  }

  .official .cert-grid > div:last-child {
    border-bottom: 0;
    padding-bottom: 2px;
  }

  .official .adv .card {
    padding: 18px 16px;
  }

  .hero {
    padding: 38px 0 18px;
  }

  .hero-grid {
    gap: 22px;
  }

  .hero-qr {
    width: 100%;
    gap: 16px;
    padding: 14px;
  }

  .hero-qr-code {
    width: 168px;
    height: 168px;
    padding: 7px;
    border-radius: 12px;
  }

  .lede {
    font-size: 15px;
  }

  /* 小屏改为竖向堆叠，避免打印机卡片覆盖聊天界面 */
  .stage {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 6px 0 4px;
    min-height: 0;
  }

  .phone {
    position: relative;
    right: auto;
    top: auto;
    transform: rotate(-1deg);
    width: 206px;
    height: 436px;
  }

  .printer {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    width: 230px;
  }

  .f1,
  .f2 {
    display: none;
  }

  .ticker {
    padding: 12px 14px;
    gap: 12px;
  }

  .ticker .tt {
    font-size: 11.5px;
  }

  .track {
    gap: 0;
  }

  .item {
    padding: 0 12px;
  }

  .dl {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .dl h2 {
    font-size: clamp(21px, 6.2vw, 25px);
  }

  .dl-h2-l1,
  .dl-h2-l2 {
    display: block;
  }

  .platforms {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding-bottom: 96px;
  }

  .mobile-bar {
    display: flex;
  }

  .page-hero {
    padding: 38px 0 30px;
  }

  .page-hero h1 {
    font-size: 31px;
  }

  .page-hero .lede {
    margin-bottom: 18px;
  }

  .section-page {
    padding: 36px 0 54px;
  }

  .form-card {
    padding: 20px 18px;
  }

  .contact-board {
    border-radius: 14px;
  }

  .contact-board-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 16px 16px 12px;
  }

  .contact-board-head h2 {
    font-size: 18px;
  }

  .contact-board-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-info-grid {
    padding: 4px 6px;
  }

  .contact-tile {
    gap: 12px;
    padding: 12px 10px;
  }

  .contact-tile-value {
    font-size: 16px;
  }

  .contact-tile + .contact-tile::before {
    left: 58px;
    right: 10px;
  }

  .contact-tile-action {
    padding: 5px 10px;
    font-size: 11px;
  }

  .contact-section {
    padding-top: 22px;
  }

  .contact-qr-card {
    width: 100%;
    max-width: none;
    padding: 18px 16px 16px;
    border-left: 0;
    border-top: 1px solid #F1EEF8;
  }

  .contact-qr-card img {
    width: 180px;
    height: 180px;
  }

  .contact-board-foot {
    padding: 12px 16px 16px;
  }

  .guide-block,
  .compat-card,
  .toc-card {
    padding: 18px;
  }

  .guide-head {
    gap: 12px;
  }

  .guide-num {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .split-cards,
  .check-list {
    grid-template-columns: 1fr;
  }

  .compat-head {
    align-items: flex-start;
  }

  .search-field {
    min-width: 0;
    width: 100%;
  }

  /* 功能清单在小屏改为卡片流，避免 34 行表格横向拖动 */
  .feature-table {
    border: 0;
    background: transparent;
    border-radius: 0;
    font-size: 13px;
  }

  .feature-table thead {
    display: none;
  }

  .feature-table tbody,
  .feature-table tr,
  .feature-table td {
    display: block;
    width: auto;
  }

  .feature-table .ft-group {
    margin: 18px 0 10px;
  }

  .feature-table .ft-group td {
    padding: 0 2px;
    background: transparent;
  }

  .feature-table tr:not(.ft-group) {
    margin-bottom: 10px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .feature-table tr:not(.ft-group) td {
    border: 0;
    padding: 0;
  }

  .feature-table .ft-name {
    width: auto;
    margin-bottom: 4px;
    font-size: 14px;
  }

  .feature-table .ft-value {
    font-size: 12.5px;
    line-height: 1.6;
  }

  .feature-table tr td.ft-ver {
    display: inline-block;
    width: auto;
    margin-top: 8px;
    margin-right: 14px;
    font-size: 12px;
    text-align: left;
  }

  .feature-table .ft-ver::before {
    content: attr(data-label);
    margin-right: 4px;
    color: var(--muted);
    font-weight: 600;
  }

  /* 高级版专享两行：小屏卡片改用左侧色条 + 浅色底区分 */
  .feature-table tr.ft-adv {
    background: #F5EEFF;
    border-color: #E2D2FA;
    border-left: 3px solid var(--brand);
  }

  .feature-table tr.ft-adv-amber {
    background: var(--accent-l);
    border-color: #F5E3C4;
    border-left-color: var(--accent);
  }

  .feature-table tr.ft-adv td,
  .feature-table tr.ft-adv-amber td {
    background: transparent;
  }

  .feature-table tr.ft-adv td:first-child,
  .feature-table tr.ft-adv-amber td:first-child {
    box-shadow: none;
  }

  .feature-table .ft-badge {
    margin-left: 6px;
    font-size: 10.5px;
  }

  .compat-table {
    min-width: 720px;
  }

  th,
  td {
    padding: 12px 13px;
  }

  .legal-card {
    padding: 24px 18px;
    font-size: 13.5px;
  }

  .legal-card h2 {
    font-size: 17.5px;
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 20px;
  }

  .cta-band h2 {
    font-size: 21px;
  }

  .error-code {
    font-size: 76px;
  }

  .error-page h1 {
    font-size: 28px;
  }

  /* 运营后台 */
  .admin-top {
    padding: 0 16px;
  }

  .admin-top .logo {
    height: 58px;
    font-size: 16px;
  }

  .admin-top-badge {
    display: none;
  }

  .admin-main {
    padding: 22px 16px 64px;
  }

  .admin-heading h1 {
    font-size: 26px;
  }

  .admin-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .admin-tab {
    flex: none;
  }

  .stat-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card b {
    font-size: 25px;
  }

  .stat-card b.stat-top {
    font-size: 18px;
  }

  .admin-card {
    padding: 18px 16px;
  }

  .admin-card-head {
    flex-direction: column;
    gap: 6px;
  }

  .admin-list-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .admin-list-item time {
    justify-self: start;
  }

  .settings-grid,
  .platform-fields {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    bottom: 8px;
  }
}

/* ---------- 430px：超小屏 ---------- */
@media (max-width: 430px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .wrap {
    padding: 0 18px;
  }

  .hero-note {
    gap: 10px;
  }

  .qr {
    width: 150px;
    height: 150px;
  }
}

/* ---------- 480px：扫码下载卡片改为上下堆叠，避免文字与标签被挤压 ---------- */
@media (max-width: 480px) {
  .hero-qr {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 16px;
    text-align: center;
  }

  .hero-qr-info {
    align-items: center;
  }

  .hero-qr-info .hero-qr-tag {
    align-self: center;
  }
}

/* ---------- 联系页列表：小屏收紧图标与行距 ---------- */
@media (max-width: 379px) {
  .contact-tile {
    gap: 10px;
    padding: 11px 8px;
  }

  .contact-tile-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .contact-tile + .contact-tile::before {
    left: 50px;
  }

  .contact-tile-action {
    display: none;
  }
}
