/* =============================================================================
   Category m3 — 手机端改版第 3 步：国家分类页套餐选择器
   只在 body.etd-cat-m3 上生效，文件也只在开关打开或预览时入队。
   手机 <700：选择器在第一屏，完整卡片网格默认收起，底部固定栏，下方区块折叠。
   平板 700–1099：选择器 + 网格和区块照常展开，没有固定栏。
   桌面 ≥1100：选择器放在网格上方（方案「桌面同步三件事」之一），其余不变。
   主按钮 #EA580C，文字 700 字重、19px（白字 3.56:1，靠大号文字标准过 3:1）。
   ============================================================================= */

body.etd-cat-m3 {
  --m3-ground: #f4f8f7;
  --m3-mint: #d6ece5;
}

body.etd-cat-m3 .m3-pick {
  display: grid;
  gap: 16px;
  margin: 8px 0 28px;
  padding: 18px 16px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(23, 32, 51, 0.06);
  max-width: 720px;
}
body.etd-cat-m3 .m3-pick__h { margin: 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.02em; }
body.etd-cat-m3 .m3-pick__note { margin: -8px 0 0; font-size: 14px; color: var(--muted); }
body.etd-cat-m3 .m3-pick__lab { margin: 0 0 8px; font-weight: 700; font-size: 16px; color: var(--ink); }
body.etd-cat-m3 .m3-opts { display: flex; flex-wrap: wrap; gap: 8px; }
body.etd-cat-m3 .m3-o {
  display: inline-grid;
  justify-items: center;
  align-content: center;
  min-width: 64px;
  min-height: 48px;
  padding: 6px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
body.etd-cat-m3 .m3-o small { font-size: 12px; font-weight: 500; color: var(--muted); }
body.etd-cat-m3 .m3-o[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: #004d47; box-shadow: inset 0 0 0 1px var(--accent); }
body.etd-cat-m3 .m3-o[aria-pressed="true"] small { color: #2d5e58; }
body.etd-cat-m3 .m3-o:disabled { border-style: dashed; background: #fafbfb; color: #9aa3ad; cursor: not-allowed; }
body.etd-cat-m3 .m3-o:disabled small { color: #aab2ba; }

body.etd-cat-m3 .m3-best { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: var(--m3-mint); }
body.etd-cat-m3 .m3-best__pill { justify-self: start; margin: 0; padding: 3px 10px; border-radius: 999px; background: #fff; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
body.etd-cat-m3 .m3-best__name { margin: 0; font-weight: 700; font-size: 18px; line-height: 1.25; }
body.etd-cat-m3 .m3-best__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
body.etd-cat-m3 .m3-best__tags li { padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.75); font-size: 13px; }
body.etd-cat-m3 .m3-best__tags li:first-child { font-weight: 600; }
body.etd-cat-m3 .m3-best__note { margin: 0; font-size: 13px; color: #2f4a45; }
body.etd-cat-m3 .m3-best__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
body.etd-cat-m3 .m3-best__price { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
body.etd-cat-m3 .m3-best__price small { display: block; margin-top: 5px; font-family: var(--font-ui); font-size: 13px; font-weight: 500; letter-spacing: 0; color: #40524e; }
body.etd-cat-m3 .m3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 13px;
  background: var(--brand);
  color: #fff !important;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
}
body.etd-cat-m3 .m3-btn:hover { background: var(--brand-ink); }
body.etd-cat-m3 .m3-more-plans summary { cursor: pointer; font-size: 14px; color: #2f4a45; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
body.etd-cat-m3 .m3-more-plans ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
body.etd-cat-m3 .m3-more-plans a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; font-size: 14px; }
body.etd-cat-m3 .m3-more-plans a small { display: block; color: var(--muted); font-size: 12px; }
body.etd-cat-m3 .m3-more-plans a b { font-variant-numeric: tabular-nums; }
body.etd-cat-m3 .m3-empty { margin: 0; color: var(--muted); }
body.etd-cat-m3 .m3-seeall { display: none; }
body.etd-cat-m3 .m3-sticky { display: none; }
body.etd-cat-m3 .m3-fold__btn { all: unset; display: block; width: 100%; cursor: text; }
body.etd-cat-m3 .etd-dest-block .m3-fold__body { display: block; }

/* ---------------------------------------------------------------- 手机 */
@media (max-width: 699.98px) {
  body.etd-cat-m3 { --header-h: 56px; background: var(--m3-ground); }
  body.etd-cat-m3 .site-header .brand-mark-img { width: 40px; height: 40px; }
  body.etd-cat-m3 .site-header .brand-name { font-size: 1rem; }
  body.etd-cat-m3 .site-header .brand-easy { font-size: 23px; }
  body.etd-cat-m3 .site-header .brand-sub { display: none; }

  /* 第一屏就是选择器：统计块、供应商 logo、页头上方的介绍收起（仍在 HTML 里） */
  body.etd-cat-m3 .etd-page-head { padding-bottom: 8px; }
  body.etd-cat-m3 .etd-dest-eyebrow,
  body.etd-cat-m3 .etd-dest-stats,
  body.etd-cat-m3 .etd-dest-providers,
  body.etd-cat-m3 .etd-page-head .etd-dest-intro { display: none; }
  body.etd-cat-m3 .etd-page-head h1 { font-size: 26px; line-height: 1.15; }
  /* 说明句收起、选择器标题只留给读屏：第一屏要放得下「最划算」卡和 Get plan */
  body.etd-cat-m3 .etd-dest-standfirst { display: none; }
  body.etd-cat-m3 .m3-pick__h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.etd-cat-m3 .etd-dest-crumb { margin-bottom: 6px; }

  body.etd-cat-m3 .m3-pick { margin: 4px 0 12px; }
  body.etd-cat-m3 .m3-seeall {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
  }

  /* 完整卡片网格默认收起 */
  body.etd-cat-m3:not(.m3-all-open) .m3-sticky ~ .etd-band-tabs,
  body.etd-cat-m3:not(.m3-all-open) .m3-sticky ~ .etd-plan-grid { display: none; }

  /* 区块折叠 */
  body.etd-cat-m3 .etd-dest-block.m3-fold { margin-top: 10px; padding: 0; border: 0; background: #fff; border-radius: 14px; }
  body.etd-cat-m3 .etd-dest-block.m3-fold > h2 { margin: 0; padding: 0; font-size: 16px; font-weight: 600; }
  body.etd-cat-m3 .etd-dest-block.m3-fold > h2::before { display: none; }
  body.etd-cat-m3 .m3-fold__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 54px;
    padding: 0 16px;
    box-sizing: border-box;
    cursor: pointer;
  }
  body.etd-cat-m3 .m3-fold__btn::after { content: "+"; font-size: 22px; line-height: 1; color: var(--muted); }
  body.etd-cat-m3 .m3-fold.is-open .m3-fold__btn::after { content: "\2013"; }
  body.etd-cat-m3 .m3-fold__btn:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 14px; }
  body.etd-cat-m3 .etd-dest-block.m3-fold:not(.is-open) .m3-fold__body { display: none; }
  body.etd-cat-m3 .etd-dest-block.m3-fold .m3-fold__body { padding: 0 16px 16px; }
  body.etd-cat-m3 .etd-dest-block:not(.m3-fold) { margin-top: 10px; padding: 4px 16px; border: 0; background: #fff; border-radius: 14px; }

  /* 底部固定栏 */
  body.etd-cat-m3 .m3-sticky {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 20px rgba(23, 32, 51, 0.08);
  }
  body.etd-cat-m3 .m3-sticky[hidden] { display: none; }
  body.etd-cat-m3 .m3-sticky__t { flex: 1; min-width: 0; line-height: 1.25; }
  body.etd-cat-m3 .m3-sticky__t b { display: block; font-family: var(--font-display); font-size: 21px; font-variant-numeric: tabular-nums; }
  body.etd-cat-m3 .m3-sticky__t span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; color: var(--muted); }
  body.etd-cat-m3 .site-footer { padding-bottom: 80px; }
}

/* ---------------------------------------------------------------- 平板 / 桌面 */
@media (min-width: 700px) {
  body.etd-cat-m3 .m3-pick { padding: 22px; }
}
@media (min-width: 1100px) {
  body.etd-cat-m3 .m3-pick { max-width: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
  body.etd-cat-m3 .m3-pick__h { grid-column: 1 / -1; }
  body.etd-cat-m3 .m3-pick__q { grid-column: 1; }
  body.etd-cat-m3 .m3-best { grid-column: 2; grid-row: 2 / span 2; }
}
