﻿/* ==================================================================
   medtheme 主样式
   - 配色由后台「样式色彩」注入 CSS 变量（header.php 中的 #med-theme-vars）
   - 阶段 2 覆盖：全局基础 / 头部导航 / 底部 / 弹窗 / 灯箱 / 悬浮按钮 / 表单
   - 阶段 6 继续补充：首页板块、内页、列表卡片、分页等完整响应式细节
   ================================================================== */

/* ---------- 1. 变量与基础 ---------- */
:root {
  --med-primary: #6E8CA0;
  --med-accent: #C9B79C;
  --med-bg: #F7F8FA;
  --med-text: #2C3A47;

  /* 派生色默认值（实际由 header.php 按后台配色注入覆盖） */
  --med-primary-dark: #5A7383;
  --med-primary-soft: #EEF1F4;
  --med-accent-soft: #F5F2ED;
  --med-accent-dark: #A99A83;
  --med-primary-shadow: rgba(110, 140, 160, .28);
  --med-primary-ring: rgba(110, 140, 160, .14);
  --med-accent-shadow: rgba(201, 183, 156, .3);
  --med-muted: #7A8794;
  --med-line: #E6EAEE;
  --med-white: #FFFFFF;

  --med-radius: 10px;
  --med-radius-lg: 16px;
  --med-shadow-sm: 0 2px 10px rgba(44, 58, 71, .06);
  --med-shadow: 0 10px 30px rgba(44, 58, 71, .10);

  --med-container: 1200px;
  --med-header-h: 76px;
  --med-ease: cubic-bezier(.22, .61, .36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.med-body {
  margin: 0;
  background: var(--med-bg);
  color: var(--med-text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.med-no-scroll { overflow: hidden; }

img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }
a { color: inherit; text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--med-primary); }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.4; letter-spacing: .01em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; }

.med-container {
  width: 100%;
  max-width: var(--med-container);
  margin: 0 auto;
  padding: 0 24px;
}

.med-main { min-height: 40vh; }

/* 无障碍：跳转到正文 */
.med-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 10px 18px;
  background: var(--med-primary);
  color: #fff;
  border-radius: 0 0 var(--med-radius) 0;
}
.med-skip:focus { left: 0; color: #fff; }

/* 屏幕阅读器专用 */
.med-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- 2. 按钮 ---------- */
.med-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: all .25s var(--ease);
}

.med-btn-primary {
  background: var(--med-primary);
  color: #fff;
  box-shadow: 0 6px 18px var(--med-primary-shadow);
}
.med-btn-primary:hover {
  background: var(--med-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px var(--med-primary-shadow);
}

.med-btn-ghost {
  background: transparent;
  border-color: var(--med-line);
  color: var(--med-text);
}
.med-btn-ghost:hover { border-color: var(--med-primary); color: var(--med-primary); }

.med-btn-accent {
  background: var(--med-accent);
  color: #3C352C;
}
.med-btn-accent:hover { background: var(--med-accent-dark); color: #2E2820; }

/* ---------- 3. 头部 ---------- */
.med-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.med-header.is-scrolled {
  border-bottom-color: var(--med-line);
  box-shadow: var(--med-shadow-sm);
}

.med-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--med-header-h);
}

.med-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}
.med-brand-logo { max-height: 42px; width: auto; display: block; }
.med-brand-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--med-text);
  letter-spacing: .02em;
  white-space: nowrap;
}
.med-brand-sub {
  font-size: 12px;
  color: var(--med-muted);
  letter-spacing: .12em;
  white-space: nowrap;
}

/* 主导航（桌面端横向） */
.med-nav-wrap { flex: 1 1 auto; display: flex; justify-content: center; }
.med-nav-head { display: none; }

.med-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.med-nav > li { position: relative; }

.med-nav > li > a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--med-radius);
  font-size: 15px;
  color: var(--med-text);
  white-space: nowrap;
}
.med-nav > li > a:hover,
.med-nav > li.is-active > a { color: var(--med-primary); background: var(--med-primary-soft); }

.med-nav > li.med-nav-item-has-sub > a { padding-right: 26px; }

/* 子菜单展开箭头 */
.med-subnav-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--med-muted);
}
.med-subnav-toggle::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  margin: 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .25s var(--ease);
}
.med-nav-item.is-open .med-subnav-toggle::before { transform: translateY(2px) rotate(-135deg); }

.med-subnav {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--med-line);
  border-radius: var(--med-radius);
  box-shadow: var(--med-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all .22s var(--ease);
  z-index: 5;
}
.med-nav-item.is-open > .med-subnav,
.med-nav-item:hover > .med-subnav { opacity: 1; visibility: visible; transform: translateY(0); }

.med-subnav li a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--med-muted);
  white-space: nowrap;
}
.med-subnav li a:hover { background: var(--med-primary-soft); color: var(--med-primary); }

.med-nav-extra { display: none; }

/* 右侧操作区 */
.med-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.med-tel-btn { font-variant-numeric: tabular-nums; }

.med-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 42px;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--med-line);
  border-radius: var(--med-radius);
  background: #fff;
}
.med-menu-toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--med-text);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.med-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.med-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.med-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.med-nav-mask {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(20, 28, 36, .42);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.med-nav-mask.is-show { opacity: 1; }

/* ---------- 4. 通用区块（供首页与内页复用） ---------- */
.med-section { padding: 84px 0; }
.med-section--tight { padding: 56px 0; }
.med-section--soft { background: #fff; }

.med-section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.med-section-eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--med-accent);
}
.med-section-title { font-size: 30px; font-weight: 600; letter-spacing: .02em; }
.med-section-desc { margin-top: 14px; color: var(--med-muted); font-size: 15px; }

/* ---------- 5. 底部 ---------- */
.med-footer {
  margin-top: 0;
  padding: 64px 0 28px;
  background: #1F2A33;
  color: rgba(255, 255, 255, .66);
  font-size: 13.5px;
  line-height: 1.85;
}
.med-footer a { color: rgba(255, 255, 255, .66); }
.med-footer a:hover { color: #fff; }

.med-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.med-footer-logo { max-height: 40px; filter: brightness(0) invert(1); opacity: .92; }
.med-footer-name { font-size: 17px; font-weight: 600; color: #fff; letter-spacing: .04em; }
.med-footer-sub { margin-top: 8px; color: rgba(255, 255, 255, .5); letter-spacing: .08em; }
.med-footer-line { margin-top: 6px; }

.med-footer-title {
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .06em;
}
.med-footer-links li { margin-bottom: 9px; }
.med-footer-links li:last-child { margin-bottom: 0; }
.med-footer-credential li { word-break: break-all; }
.med-footer-muted { color: rgba(255, 255, 255, .42); font-size: 12.5px; line-height: 1.7; }

.med-credential-img {
  max-width: 160px;
  max-height: 110px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .16);
}

.med-footer-bottom { padding-top: 24px; text-align: center; }
.med-footer-copy { color: rgba(255, 255, 255, .52); }
.med-footer-beian { margin-top: 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.med-footer-disclaimer {
  margin-top: 12px;
  color: rgba(255, 255, 255, .38);
  font-size: 12.5px;
}

/* ---------- 6. 悬浮按钮 ---------- */
.med-float {
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 80;
  display: none;
  flex-direction: column;
  gap: 10px;
}

.med-float-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  box-shadow: 0 8px 22px rgba(31, 42, 51, .28);
  transition: transform .2s var(--ease);
}
.med-float-btn:active { transform: scale(.94); }
.med-float-tel { background: var(--med-primary); color: #fff; }
.med-float-consult { background: var(--med-accent); color: #3C352C; }

/* ---------- 7. 弹窗（咨询预约） ---------- */
.med-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.med-modal[hidden] { display: none; }

.med-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(18, 26, 33, .5);
  backdrop-filter: blur(3px);
}

.med-modal-box {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 34px 32px 30px;
  background: #fff;
  border-radius: var(--med-radius-lg);
  box-shadow: 0 24px 60px rgba(18, 26, 33, .24);
  animation: med-pop .28s var(--ease);
}

@keyframes med-pop {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.med-modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--med-bg);
  color: var(--med-muted);
  font-size: 20px;
  line-height: 1;
}
.med-modal-close:hover { color: var(--med-text); }

.med-modal-title { font-size: 20px; margin-bottom: 18px; }

.med-form .med-field { display: block; margin-bottom: 14px; }
.med-form .med-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--med-muted);
}
.med-form input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--med-line);
  border-radius: var(--med-radius);
  background: #fff;
  color: var(--med-text);
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.med-form input:focus {
  border-color: var(--med-primary);
  box-shadow: 0 0 0 3px var(--med-primary-ring);
}

.med-form-tip {
  margin: 4px 0 16px;
  padding: 10px 12px;
  border-radius: var(--med-radius);
  background: var(--med-bg);
  color: var(--med-muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.med-form-submit { width: 100%; height: 46px; }
.med-form-msg { margin-top: 10px; font-size: 13px; color: var(--med-primary); min-height: 20px; }
.med-form-msg.is-error { color: #B4553F; }

.med-modal-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--med-line);
  font-size: 13px;
  color: var(--med-muted);
}

/* ---------- 8. 灯箱 ---------- */
.med-lightbox {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(12, 18, 24, .9);
}
.med-lightbox[hidden] { display: none; }
.med-lightbox img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}
.med-lightbox-close {
  position: absolute;
  right: 20px;
  top: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}
.med-lightbox-close:hover { background: rgba(255, 255, 255, .22); }

/* ---------- 9. 响应式 ---------- */
@media (max-width: 1080px) {
  .med-brand-sub { display: none; }
  .med-consult-btn { display: none; }
  .med-float { display: flex; }
}

@media (max-width: 960px) {
  :root { --med-header-h: 64px; }
  .med-section { padding: 64px 0; }
  .med-section-title { font-size: 25px; }

  .med-container { padding: 0 18px; }

  /* 关键：backdrop-filter 会让 header 成为 fixed 子元素的包含块，
     移动端抽屉必须相对视口定位，所以这里关闭毛玻璃改用实色背景 */
  .med-header {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* 移动端抽屉导航 */
  .med-nav-wrap {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    width: min(84vw, 340px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding: 0 20px 28px;
    background: #fff;
    box-shadow: -12px 0 40px rgba(18, 26, 33, .16);
    transform: translateX(102%);
    visibility: hidden;
    transition: transform .3s var(--ease), visibility .3s var(--ease);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .med-nav-wrap.is-open { transform: translateX(0); visibility: visible; }

  .med-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--med-line);
  }
  .med-nav-title { font-size: 15px; font-weight: 600; }
  .med-nav-close {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--med-muted);
    font-size: 24px;
    line-height: 1;
  }

  .med-nav { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0; }
  .med-nav > li { border-bottom: 1px solid var(--med-line); }
  .med-nav > li > a {
    display: block;
    height: auto;
    padding: 14px 30px 14px 2px;
    border-radius: 0;
    font-size: 15px;
  }
  .med-nav > li > a:hover,
  .med-nav > li.is-active > a { background: transparent; color: var(--med-primary); }

  .med-subnav-toggle { right: 0; top: 14px; margin-top: 0; width: 30px; height: 30px; }

  /* 移动端二级菜单改为折叠展开，不做绝对定位 */
  .med-subnav {
    position: static;
    display: none;
    min-width: 0;
    padding: 0 0 8px 12px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .med-nav-item.is-open > .med-subnav { display: block; }
  .med-nav-item:hover > .med-subnav { opacity: 1; visibility: visible; transform: none; }
  .med-subnav li a { padding: 9px 12px; }

  .med-nav-extra {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 22px;
  }
  .med-nav-tel { text-align: center; font-size: 15px; color: var(--med-primary); }

  .med-menu-toggle { display: flex; }

  .med-footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .med-footer { padding-top: 48px; }
}

@media (max-width: 640px) {
  .med-section { padding: 52px 0; }
  .med-section-head { margin-bottom: 34px; }
  .med-section-title { font-size: 22px; }
  .med-brand-name { font-size: 17px; }
  .med-tel-btn { display: none; }
  .med-header-actions { gap: 8px; }

  .med-footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .med-footer-bottom { text-align: left; }
  .med-footer-beian { justify-content: flex-start; }

  .med-modal { padding: 16px; align-items: flex-end; }
  .med-modal-box { padding: 28px 20px 24px; max-height: calc(100vh - 32px); }

  .med-float { right: 12px; bottom: 18px; gap: 8px; }
  .med-float-btn { width: 50px; height: 50px; font-size: 10px; }
}

/* ==================================================================
   10. 首页板块（阶段 3）
   - hero 轮播 / 机构优势 / 项目分类 / 医生团队 / 资讯 / 环境图集 / 预约
   - 列表页归档卡片与分页
   ================================================================== */

/* ---------- 10.1 轮播 ---------- */
.med-hero {
  position: relative;
  height: 560px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--med-primary-soft), var(--med-bg));
}
.med-hero-track { position: absolute; inset: 0; }

.med-hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity .9s var(--med-ease), transform 1.4s var(--med-ease), visibility .9s var(--med-ease);
}
.med-hero-slide.is-active { opacity: 1; visibility: visible; transform: scale(1); }

.med-hero-slide--img::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 26, 33, .62) 0%, rgba(18, 26, 33, .34) 58%, rgba(18, 26, 33, .12) 100%);
}

.med-hero-inner { position: relative; z-index: 1; }

.med-hero-title {
  max-width: 640px;
  font-size: 44px;
  font-weight: 600;
  line-height: 1.26;
  letter-spacing: .02em;
  color: var(--med-text);
}
.med-hero-sub {
  max-width: 540px;
  margin-top: 20px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--med-muted);
}
.med-hero-slide--img .med-hero-title { color: #fff; }
.med-hero-slide--img .med-hero-sub { color: rgba(255, 255, 255, .82); }

.med-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.med-hero-slide--img .med-btn-ghost {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .45);
  color: #fff;
}
.med-hero-slide--img .med-btn-ghost:hover {
  background: #fff;
  border-color: #fff;
  color: var(--med-text);
}

.med-hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .86);
  color: var(--med-text);
  box-shadow: 0 6px 20px rgba(18, 26, 33, .16);
  transition: background .25s var(--med-ease), transform .25s var(--med-ease);
}
.med-hero-arrow:hover { background: #fff; transform: scale(1.06); }
.med-hero-prev { left: 24px; }
.med-hero-next { right: 24px; }

.med-hero-dots {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(18, 26, 33, .32);
  transform: translateX(-50%);
}
.med-hero-dot {
  width: 24px;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, .45);
  transition: background .25s var(--med-ease), width .25s var(--med-ease);
}
.med-hero-dot.is-active { width: 34px; background: #fff; }

/* ---------- 10.2 机构优势 ---------- */
.med-adv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.med-adv {
  padding: 32px 26px;
  background: #fff;
  border: 1px solid var(--med-line);
  border-radius: var(--med-radius-lg);
  transition: border-color .3s var(--med-ease), box-shadow .3s var(--med-ease), transform .3s var(--med-ease);
}
.med-adv:hover {
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow: var(--med-shadow);
}
.med-adv-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: var(--med-primary-soft);
  color: var(--med-primary);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  overflow: hidden;
}
.med-adv-icon img { width: 28px; height: 28px; object-fit: contain; }
.med-adv-title { margin-top: 22px; font-size: 17px; }
.med-adv-desc { margin-top: 10px; color: var(--med-muted); font-size: 14px; line-height: 1.85; }

/* ---------- 10.3 卡片网格通用 ---------- */
.med-grid { display: grid; gap: 24px; }
.med-grid--4 { grid-template-columns: repeat(4, 1fr); }
.med-grid--3 { grid-template-columns: repeat(3, 1fr); }
.med-grid--2 { grid-template-columns: repeat(2, 1fr); }

.med-tile {
  display: block;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--med-line);
  border-radius: var(--med-radius-lg);
  transition: transform .3s var(--med-ease), box-shadow .3s var(--med-ease), border-color .3s var(--med-ease);
}
.med-tile:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: var(--med-shadow);
}

.med-tile-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, var(--med-primary-soft), var(--med-accent-soft));
}
.med-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--med-ease);
}
.med-tile:hover .med-tile-media img { transform: scale(1.05); }

.med-tile--doctor .med-tile-media { aspect-ratio: 3 / 4; }
.med-tile--post .med-tile-media { aspect-ratio: 16 / 10; }

.med-tile-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--med-primary);
  opacity: .42;
}

.med-tile-body { display: block; padding: 20px 22px 22px; }
.med-tile-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--med-text);
  transition: color .25s var(--med-ease);
}
.med-tile-title a { color: inherit; }
.med-tile:hover .med-tile-title { color: var(--med-primary); }

.med-tile-job {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  letter-spacing: .08em;
  color: var(--med-accent-dark);
}
.med-tile-desc {
  display: -webkit-box;
  margin-top: 9px;
  overflow: hidden;
  color: var(--med-muted);
  font-size: 13.5px;
  line-height: 1.75;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.med-tile-more {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--med-primary);
}
.med-tile-more::after { content: " →"; }

.med-tile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--med-muted);
}
.med-tile-cat {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--med-primary-soft);
  color: var(--med-primary);
}

.med-section-note {
  margin-top: 28px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--med-muted);
}
.med-section-more { margin-top: 26px; text-align: center; }

/* ---------- 10.4 环境图集 ---------- */
.med-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.med-gallery-item {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--med-radius);
  background: #E9EDF0;
}
.med-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s var(--med-ease);
}
.med-gallery-item:hover img { transform: scale(1.06); }
.med-gallery-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 16px 14px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(180deg, rgba(18, 26, 33, 0) 0%, rgba(18, 26, 33, .68) 100%);
}

/* ---------- 10.5 预约区块 ---------- */
.med-booking-panel {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 48px;
  align-items: center;
  padding: 54px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--med-primary-dark) 0%, var(--med-primary) 100%);
  box-shadow: 0 24px 60px var(--med-primary-shadow);
}
.med-booking-title { font-size: 30px; color: #fff; letter-spacing: .02em; }
.med-booking-desc {
  max-width: 460px;
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.9;
  color: rgba(255, 255, 255, .78);
}
.med-booking-contact {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 28px;
  font-size: 14px;
  color: rgba(255, 255, 255, .88);
}
.med-booking-contact a { color: #fff; }
.med-booking-contact a:hover { color: var(--med-accent-soft); }

.med-form-card {
  padding: 28px 26px;
  background: #fff;
  border-radius: var(--med-radius-lg);
  box-shadow: 0 20px 50px rgba(18, 26, 33, .18);
}
.med-form-card .med-form-tip { background: #F2F5F7; }

/* ---------- 10.6 列表页 ---------- */
.med-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--med-muted);
}
.med-crumb a:hover { color: var(--med-primary); }
.med-crumb-sep { color: #C8D2DB; }

.med-archive-head { margin-bottom: 36px; }
.med-archive-title { font-size: 30px; letter-spacing: .02em; }

.med-empty {
  padding: 72px 0;
  text-align: center;
  color: var(--med-muted);
  font-size: 14px;
}

.med-pagebar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 46px;
}
.med-pagebar > a,
.med-pagebar > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--med-line);
  border-radius: 10px;
  background: #fff;
  font-size: 13.5px;
  color: var(--med-muted);
  transition: border-color .2s var(--med-ease), color .2s var(--med-ease);
}
.med-pagebar > a:hover { border-color: var(--med-primary); color: var(--med-primary); }
.med-pagebar > .now-page {
  border-color: var(--med-primary);
  background: var(--med-primary);
  color: #fff;
}

/* ---------- 10.7 首页板块响应式 ---------- */
@media (max-width: 1080px) {
  .med-adv-grid { grid-template-columns: repeat(2, 1fr); }
  .med-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .med-booking-panel { grid-template-columns: 1fr 360px; gap: 32px; padding: 42px; }
}

@media (max-width: 960px) {
  .med-hero { height: 460px; }
  .med-hero-title { font-size: 34px; }
  .med-hero-sub { margin-top: 16px; font-size: 15px; }
  .med-hero-arrow { display: none; }

  .med-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .med-gallery-grid { grid-template-columns: repeat(2, 1fr); }

  .med-booking-panel { grid-template-columns: 1fr; gap: 30px; padding: 34px 28px; }
  .med-booking-title { font-size: 24px; }
  .med-booking-contact { margin-top: 20px; }

  .med-archive-title { font-size: 25px; }
}

@media (max-width: 640px) {
  .med-hero { height: 400px; }
  .med-hero-title { font-size: 26px; line-height: 1.35; }
  .med-hero-sub { margin-top: 12px; font-size: 14px; }
  .med-hero-actions { margin-top: 22px; }
  .med-hero-dots { bottom: 18px; padding: 8px 12px; }

  .med-section-head { margin-bottom: 28px; }

  .med-adv-grid { grid-template-columns: 1fr; gap: 14px; }
  .med-adv { padding: 24px 20px; }
  .med-adv-icon { width: 46px; height: 46px; border-radius: 12px; font-size: 13px; }
  .med-adv-title { margin-top: 16px; font-size: 16px; }
  .med-adv-desc { margin-top: 8px; font-size: 13.5px; }

  .med-grid { gap: 12px; }
  .med-grid--4,
  .med-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .med-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .med-tile-body { padding: 14px 14px 16px; }
  .med-tile-title { font-size: 14px; line-height: 1.5; }
  .med-tile-desc { margin-top: 6px; font-size: 12.5px; -webkit-line-clamp: 2; }
  .med-tile-more { margin-top: 10px; font-size: 12px; }
  .med-tile-ph { font-size: 22px; }
  .med-tile--doctor .med-tile-media { aspect-ratio: 3 / 4; }
  .med-gallery-cap { padding: 24px 12px 10px; font-size: 12px; }

  .med-booking-panel { padding: 26px 20px; border-radius: 18px; }
  .med-booking-title { font-size: 22px; }
  .med-booking-desc { margin-top: 12px; font-size: 13.5px; }
  .med-form-card { padding: 20px 16px; }
  .med-section-note { margin-top: 20px; font-size: 12px; }

  .med-archive-title { font-size: 22px; }
  .med-pagebar > a,
  .med-pagebar > span { min-width: 34px; height: 34px; font-size: 13px; }
}

/* ==================================================================
   11. 详情页（阶段 4）：项目详情 / 医生详情 / 侧栏
   ================================================================== */

/* ---------- 11.1 双栏骨架 ---------- */
.med-single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 44px;
  align-items: start;
}
.med-single-main { min-width: 0; }

.med-eyebrow {
  margin-bottom: 12px;
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--med-primary);
}

/* ---------- 11.2 项目详情头部 ---------- */
.med-single-head { margin-bottom: 30px; }
.med-single-title {
  font-size: 32px;
  line-height: 1.4;
  letter-spacing: .01em;
  word-break: break-word;
}
.med-single-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--med-muted);
}
.med-single-lead {
  margin-top: 22px;
  padding: 18px 20px;
  background: #fff;
  border-left: 3px solid var(--med-accent);
  border-radius: 0 var(--med-radius) var(--med-radius) 0;
  font-size: 14.5px;
  line-height: 1.85;
  color: #4A5967;
}

/* ---------- 11.3 医生详情头部 ---------- */
.med-doctor-hero {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  margin-bottom: 34px;
}
.med-doctor-photo {
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--med-radius-lg);
  background: linear-gradient(160deg, var(--med-primary-soft), #E7EDF1);
  box-shadow: var(--med-shadow-sm);
}
.med-doctor-photo img { width: 100%; height: 100%; object-fit: cover; }
.med-doctor-ph {
  font-size: 46px;
  letter-spacing: .1em;
  color: #AFC0CC;
}
.med-doctor-info { padding-top: 4px; }
.med-doctor-job {
  margin-top: 10px;
  font-size: 15px;
  color: var(--med-primary);
}
.med-doctor-goodat {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.8;
  color: #4A5967;
}
.med-doctor-goodat span {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--med-accent-soft);
  color: var(--med-accent-dark);
  font-size: 12px;
}
.med-doctor-license {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--med-muted);
}
.med-doctor-intro {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.9;
  color: #4A5967;
}
.med-doctor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* ---------- 11.4 正文排版（Z-Blog 文章内容原样输出） ---------- */
.med-post-body {
  font-size: 15px;
  line-height: 1.95;
  color: #3B4A57;
  word-break: break-word;
}
.med-post-body p { margin: 0 0 18px; }
.med-post-body h2 { margin: 38px 0 16px; font-size: 23px; }
.med-post-body h3 { margin: 30px 0 12px; font-size: 19px; }
.med-post-body h4 { margin: 24px 0 10px; font-size: 16.5px; }
.med-post-body h5 { margin: 20px 0 8px; font-size: 15px; }
.med-post-body a {
  color: var(--med-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.med-post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  border-radius: var(--med-radius);
}
.med-post-body ul {
  margin: 0 0 18px;
  padding-left: 22px;
  list-style: disc;
}
.med-post-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
  list-style: decimal;
}
.med-post-body li { margin: 6px 0; }
.med-post-body blockquote {
  margin: 24px 0;
  padding: 16px 22px;
  background: #fff;
  border-left: 3px solid var(--med-primary);
  border-radius: 0 var(--med-radius) var(--med-radius) 0;
  color: #4A5967;
}
.med-post-body table {
  width: 100%;
  margin: 22px 0;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}
.med-post-body th,
.med-post-body td {
  padding: 10px 12px;
  border: 1px solid var(--med-line);
  text-align: left;
}
.med-post-body th {
  background: var(--med-primary-soft);
  font-weight: 600;
}
.med-post-body hr {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid var(--med-line);
}

/* ---------- 11.5 合规提示与上下篇 ---------- */
.med-single-note {
  margin-top: 34px;
  padding: 16px 18px;
  border-radius: var(--med-radius);
  background: #F2F5F7;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--med-muted);
}

.med-post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--med-line);
}
.med-post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--med-line);
  border-radius: var(--med-radius);
  background: #fff;
  transition: border-color .2s var(--med-ease), box-shadow .2s var(--med-ease);
}
.med-post-nav-item:hover {
  border-color: var(--med-primary);
  color: inherit;
  box-shadow: var(--med-shadow-sm);
}
.med-post-nav-label {
  font-size: 12px;
  color: var(--med-muted);
  letter-spacing: .08em;
}
.med-post-nav-title {
  font-size: 14px;
  line-height: 1.6;
  color: var(--med-text);
}
.med-post-nav-item:hover .med-post-nav-title { color: var(--med-primary); }
.med-post-next { text-align: right; }

/* ---------- 11.6 侧栏卡片 ---------- */
.med-single-aside {
  position: sticky;
  top: calc(var(--med-header-h) + 18px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* 侧栏总高度超过可视区时，在内部滚动，避免底部内容无法到达 */
  max-height: calc(100vh - var(--med-header-h) - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #D6DDE4 transparent;
}
.med-single-aside::-webkit-scrollbar { width: 5px; }
.med-single-aside::-webkit-scrollbar-thumb {
  background: #D6DDE4;
  border-radius: 3px;
}
.med-single-aside::-webkit-scrollbar-track { background: transparent; }
.med-aside-card {
  padding: 22px;
  border: 1px solid var(--med-line);
  border-radius: var(--med-radius-lg);
  background: #fff;
  box-shadow: var(--med-shadow-sm);
}
.med-aside-title {
  position: relative;
  padding-left: 12px;
  margin-bottom: 12px;
  font-size: 16px;
}
.med-aside-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
  background: var(--med-primary);
}
.med-aside-desc {
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--med-muted);
}
.med-aside-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
}
.med-aside-contact li {
  display: flex;
  gap: 10px;
  line-height: 1.7;
}
.med-aside-contact span {
  flex: 0 0 36px;
  color: var(--med-muted);
}
.med-aside-contact em { font-style: normal; }
.med-aside-contact a:hover { color: var(--med-primary); }
.med-aside-btn {
  width: 100%;
  margin-top: 18px;
}
.med-aside-booking {
  background: linear-gradient(160deg, var(--med-primary-soft), #fff 68%);
}

/* 相关推荐列表 */
.med-rel-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.med-rel-link {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.med-rel-media {
  flex: 0 0 84px;
  width: 84px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--med-primary-soft);
}
.med-rel-media img { width: 100%; height: 100%; object-fit: cover; }
.med-rel-ph { font-size: 16px; color: #AFC0CC; }
.med-rel-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.med-rel-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--med-text);
}
.med-rel-link:hover .med-rel-title { color: var(--med-primary); }
.med-rel-date { font-size: 12px; color: var(--med-muted); }

/* 资质公示 */
.med-credential-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--med-muted);
}
.med-credential-link img {
  border: 1px solid var(--med-line);
  border-radius: 8px;
  background: #fff;
}

/* ---------- 11.7 详情页响应式 ---------- */
@media (max-width: 1080px) {
  .med-single-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; }
  .med-doctor-hero { grid-template-columns: 240px minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 960px) {
  .med-single-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .med-single-aside { position: static; max-height: none; overflow: visible; }
  .med-single-title { font-size: 28px; }
  .med-doctor-hero { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 640px) {
  .med-single-title { font-size: 24px; }
  .med-single-meta { gap: 6px 14px; font-size: 12.5px; }
  .med-single-lead { margin-top: 18px; padding: 14px 16px; font-size: 13.5px; }

  .med-doctor-hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .med-doctor-photo { max-width: 220px; aspect-ratio: 4 / 5; }
  .med-doctor-ph { font-size: 34px; }
  .med-doctor-actions .med-btn { flex: 1 1 auto; }

  .med-post-body { font-size: 14.5px; line-height: 1.9; }
  .med-post-body h2 { margin: 30px 0 12px; font-size: 20px; }
  .med-post-body h3 { margin: 24px 0 10px; font-size: 17px; }
  .med-post-body img { margin: 18px auto; }
  .med-post-body table { display: block; overflow-x: auto; }

  .med-single-note { margin-top: 26px; padding: 14px; font-size: 12px; }

  .med-post-nav { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 30px; padding-top: 22px; }
  .med-post-next { text-align: left; }

  .med-aside-card { padding: 18px; }
  .med-aside-title { font-size: 15px; }
}

/* ==================================================================
   12. 归档 / 搜索 / 404 / 分页器 / 侧栏模块（阶段 5）
   ================================================================== */

/* ---------- 12.1 面包屑补充 ---------- */
.med-crumb-cur,
.med-crumb-now { color: var(--med-text); }
.med-crumb-now {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* ---------- 12.2 归档双栏布局 ---------- */
.med-archive-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
  margin-top: 30px;
}
.med-archive-main { min-width: 0; }
.med-archive-head { margin-bottom: 32px; }
.med-archive-desc {
  max-width: 760px;
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--med-muted);
}
.med-archive-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.med-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--med-line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  color: var(--med-text);
  transition: border-color .2s var(--med-ease), color .2s var(--med-ease);
}
.med-chip:hover { border-color: var(--med-primary); color: var(--med-primary); }
.med-chip em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--med-muted);
}

/* ---------- 12.3 分页器（PageBar 按钮为 .med-pagebar 的直接子元素） ---------- */
.med-pagebar { margin: 44px 0 8px; }
.med-pagebar > .is-now {
  border-color: var(--med-primary);
  background: var(--med-primary);
  color: #fff;
}

/* ---------- 12.4 侧栏模块 ---------- */
.med-module-body,
.med-module-list {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--med-muted);
}
.med-module-list,
.med-module-body ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.med-module-list li,
.med-module-body li {
  padding: 7px 0;
  border-bottom: 1px dashed var(--med-line);
}
.med-module-list li:last-child,
.med-module-body li:last-child { border-bottom: 0; padding-bottom: 0; }
.med-module-list li:first-child,
.med-module-body li:first-child { padding-top: 0; }
.med-module-body a,
.med-module-list a { color: var(--med-muted); }
.med-module-body a:hover,
.med-module-list a:hover { color: var(--med-primary); }

/* ---------- 12.5 搜索页 ---------- */
.med-search-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--med-muted);
}
.med-search-meta strong { color: var(--med-text); font-weight: 600; }
.med-search-form {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  max-width: 620px;
}
.med-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--med-line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: var(--med-text);
  transition: border-color .2s var(--med-ease), box-shadow .2s var(--med-ease);
}
.med-search-input:focus {
  outline: none;
  border-color: var(--med-primary);
  box-shadow: 0 0 0 3px var(--med-primary-ring);
}
.med-search-form .med-btn { flex: 0 0 auto; height: 46px; }
.med-hl {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--med-primary-soft);
  color: inherit;
}

/* ---------- 12.6 404 ---------- */
.med-404 { padding: 84px 0 96px; }
.med-404-inner {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}
.med-404-code {
  font-size: clamp(72px, 12vw, 132px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--med-primary-soft);
}
.med-404-title {
  margin-top: 10px;
  font-size: 28px;
  letter-spacing: .02em;
}
.med-404-desc {
  margin-top: 16px;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--med-muted);
}
.med-404-search { margin: 30px auto 0; }
.med-404-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}
.med-404-note {
  margin-top: 26px;
  font-size: 12px;
  color: var(--med-muted);
}

/* ---------- 12.7 响应式 ---------- */
@media (max-width: 1080px) {
  .med-archive-layout { grid-template-columns: minmax(0, 1fr) 258px; gap: 30px; }
}

@media (max-width: 960px) {
  .med-archive-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .med-404 { padding: 60px 0 72px; }
}

@media (max-width: 640px) {
  .med-archive-head { margin-bottom: 24px; }
  .med-archive-desc { font-size: 13.5px; }
  .med-search-form { flex-direction: column; }
  .med-search-form .med-btn { width: 100%; }
  .med-404-title { font-size: 23px; }
  .med-404-desc { font-size: 13.5px; }
  .med-404-actions .med-btn { flex: 1 1 auto; }
}

/* ==================================================================
   13. 回到顶部 / 键盘焦点 / 动效降级 / 超小屏细节（阶段 6）
   ================================================================== */

/* ---------- 13.1 桌面端回到顶部 ---------- */
.med-totop {
  position: fixed;
  right: 28px;
  bottom: 32px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--med-line);
  border-radius: 50%;
  background: #fff;
  color: var(--med-muted);
  box-shadow: var(--med-shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s var(--med-ease), transform .25s var(--med-ease),
              visibility .25s var(--med-ease), color .2s var(--med-ease),
              border-color .2s var(--med-ease);
}
.med-totop.is-show { opacity: 1; visibility: visible; transform: translateY(0); }
.med-totop:hover { color: var(--med-primary); border-color: var(--med-primary); }

/* 窄屏改由悬浮组内的「顶部」按钮承担，避免两个按钮重叠 */
@media (max-width: 1080px) {
  .med-totop { display: none; }
}

/* ---------- 13.2 移动端悬浮组里的回到顶部 ---------- */
.med-float-top {
  background: rgba(255, 255, 255, .96);
  color: var(--med-text);
  border: 1px solid var(--med-line);
  box-shadow: 0 6px 18px rgba(31, 42, 51, .16);
  -webkit-tap-highlight-color: transparent;
}
.med-float-top:hover { color: var(--med-primary); }

/* ---------- 13.3 键盘焦点可见（不影响鼠标点击） ---------- */
.med-body a:focus-visible,
.med-body button:focus-visible,
.med-body input:focus-visible,
.med-body textarea:focus-visible,
.med-body select:focus-visible,
.med-skip:focus-visible {
  outline: 2px solid var(--med-primary);
  outline-offset: 2px;
}
/* 输入框已用 box-shadow 表达焦点，避免双重描边 */
.med-form input:focus-visible,
.med-search-input:focus-visible { outline: none; }

/* ---------- 13.4 尊重系统「减少动态效果」 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .med-body *,
  .med-body *::before,
  .med-body *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .med-totop { transform: none; }
  .med-btn-primary:hover { transform: none; }
  .med-float-btn:active { transform: none; }
}

/* ---------- 13.5 超小屏（≤400px）细节 ---------- */
@media (max-width: 400px) {
  .med-container { padding: 0 14px; }
  .med-section { padding: 52px 0; }
  .med-section-title { font-size: 22px; }
  .med-section-head { margin-bottom: 34px; }

  .med-btn { height: 40px; padding: 0 16px; font-size: 13.5px; }

  .med-float { right: 10px; bottom: 14px; gap: 7px; }
  .med-float-btn { width: 46px; height: 46px; }
  .med-float-btn span { font-size: 9.5px; }

  .med-modal { padding: 12px; }
  .med-modal-box { padding: 28px 20px 24px; }

  .med-footer { padding: 48px 0 24px; }
  .med-footer-grid { gap: 26px; }
}

