/* ============================================================
   三睿顾问 · 全站统一主题层 theme.css
   设计令牌与全站共享组件（页头导航 / 页脚 / 按钮 / 面包屑 / 移动快捷栏）
   所有页面在本文件之后加载自己的页面样式；本层是"同一个网站"的视觉底座。
   ============================================================ */

:root {
  --paper: #f6f1e8;
  --paper-strong: #fffaf1;
  --ink: #211b18;
  --muted: #6c625b;
  --line: #ded2c2;
  --red: #8c2721;
  --red-dark: #631b18;
  --gold: #b58a3d;
  --teal: #2e6d68;
  --mist: #e8f0ed;
  --white: #fffdf8;
  --shadow: 0 18px 48px rgba(44, 32, 22, 0.12);
  --serif: 'Sanrui Serif SC', 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

@font-face {
  font-family: 'Sanrui Serif SC';
  src: url('/assets/fonts/sanrui-serif-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--sans);
  line-height: 1.65;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.header-cta:focus-visible,
.mobile-sticky a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(46, 109, 104, 0.42);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
.eyebrow,
.section-index,
.panel-title,
.brand strong {
  font-family: var(--serif);
}

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-weight: 800;
  letter-spacing: .14em;
}

/* ---------- 跳转链接 ---------- */

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  border-radius: 6px;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- 页头 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(222, 210, 194, 0.76);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 72px;
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.brand > span:last-child {
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 6px;
  color: var(--paper-strong);
  background: var(--red-dark);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  color: #4c4039;
  font-size: 14px;
}

.nav-links a {
  padding: 8px 0;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--red);
}

.nav-links a[aria-current="page"] {
  color: var(--red);
  font-weight: 700;
}

.nav-toggle {
  position: relative;
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 10px 24px rgba(44, 32, 22, 0.08);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .22s ease, opacity .18s ease;
}

body.nav-open .nav-toggle {
  gap: 0;
}

body.nav-open .nav-toggle span {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -9px;
}

body.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(-50%) rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-50%) rotate(-45deg);
}

/* ---------- 按钮 ---------- */

.header-cta,
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.header-cta,
.btn.primary {
  color: white;
  background: var(--red);
}

.header-cta:hover,
.btn.primary:hover {
  background: var(--red-dark);
}

.btn.secondary {
  color: var(--red-dark);
  background: var(--paper-strong);
  border-color: var(--line);
}

.btn.tertiary {
  color: var(--teal);
  background: var(--mist);
  border-color: rgba(46, 109, 104, 0.18);
}

/* ---------- 阅读路径（面包屑） ---------- */

.reading-trail {
  border-bottom: 1px solid rgba(67, 78, 72, 0.12);
  background: #f7f4ec;
}

.reading-trail-inner {
  width: min(1160px, calc(100% - 40px));
  min-height: 42px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #68716d;
  font-size: 13px;
}

.reading-trail-path {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}

.reading-trail-path a {
  color: #2e6d68;
}

.reading-trail-path strong {
  overflow: hidden;
  color: #403832;
  font-weight: 700;
  text-overflow: ellipsis;
}

.reading-trail-next {
  flex: 0 0 auto;
  color: #8c2f39;
  font-weight: 800;
}

/* ---------- 页脚 ---------- */

.site-footer {
  padding: 46px 0 48px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: #d9d0c5;
  background: #1c1715;
}

.footer-inner {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 26px;
}

.footer-inner p {
  margin: 8px 0 0;
  color: #bfb2a8;
}

.footer-inner > div:first-child > strong,
.footer-contact-title {
  display: block;
  margin: 0 0 10px;
  color: #fffdf8;
  font-size: 15px;
}

.footer-reading {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 7px;
}

.footer-reading strong {
  margin-bottom: 3px;
  color: #fffdf8;
}

.footer-reading a {
  color: #d9d0c5;
}

.footer-reading a:hover {
  color: #fffdf8;
}

.footer-reading a,
.footer-contact a,
.footer-contact span {
  line-height: 1.65;
}

.footer-contact {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.footer-contact a {
  color: #f6e7d6;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: rgba(246, 231, 214, .52);
  text-underline-offset: 3px;
}

.footer-contact span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.site-footer .footer-inner.footer-layout-three,
.site-footer .footer-inner:has(.footer-reading) {
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, .55fr) minmax(260px, .75fr);
}

.footer-inner.footer-layout-three {
  gap: clamp(34px, 4vw, 68px);
  align-items: start;
}

.footer-inner.footer-layout-two {
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: clamp(34px, 5vw, 72px);
  align-items: start;
}

/* ---------- 移动快捷栏 ---------- */

.mobile-sticky {
  display: none;
}

/* ---------- 工具页统一钩子 ---------- */

body.tool-page {
  background: var(--white);
}

body.tool-page::before {
  display: none;
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 6px 12px;
  border: 1px solid rgba(46, 109, 104, 0.28);
  border-radius: 999px;
  color: var(--teal);
  background: var(--mist);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.service-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8a9a94;
}

.service-state.is-online i {
  background: #2e9e6b;
}

/* ---------- 响应式：页头 ---------- */

@media (min-width: 981px) and (max-width: 1320px) {
  .header-inner {
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
  }

  .brand {
    min-width: 0;
  }

  .brand small {
    max-width: min(42vw, 280px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-toggle {
    display: inline-flex;
    justify-self: end;
    margin-right: 6px;
  }

  .header-cta,
  .service-state {
    display: none;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    right: 20px;
    bottom: auto;
    z-index: 15;
    width: min(420px, calc(100vw - 40px));
    max-height: calc(100vh - 96px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 12px 18px;
    border: 1px solid rgba(222, 210, 194, 0.82);
    border-radius: 8px;
    color: #4c4039;
    background: rgba(255, 253, 248, 0.98);
    box-shadow: -18px 0 42px rgba(44, 32, 22, 0.18);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform .22s ease, opacity .18s ease, visibility .18s ease;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .site-header {
    z-index: 30;
  }

  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 12;
    background: rgba(24, 20, 18, 0.34);
  }

  body.nav-open .nav-links {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }

  .nav-links a {
    padding: 14px 0;
    border-bottom: 1px solid rgba(222, 210, 194, 0.72);
  }
}

@media (max-width: 980px) {
  .header-inner {
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
  }

  .brand {
    min-width: 0;
  }

  .brand small {
    max-width: min(42vw, 280px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-toggle {
    display: inline-flex;
    justify-self: end;
    margin-right: 6px;
  }

  .header-cta,
  .service-state {
    display: none;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    bottom: auto;
    z-index: 15;
    width: min(86vw, 320px);
    max-height: calc(100vh - 96px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 12px 18px;
    border: 1px solid rgba(222, 210, 194, 0.82);
    border-radius: 8px;
    color: #4c4039;
    background: rgba(255, 253, 248, 0.98);
    box-shadow: -18px 0 42px rgba(44, 32, 22, 0.18);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform .22s ease, opacity .18s ease, visibility .18s ease;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .site-header {
    z-index: 30;
  }

  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 12;
    background: rgba(24, 20, 18, 0.34);
  }

  body.nav-open .nav-links {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }

  .nav-links a {
    padding: 14px 0;
    border-bottom: 1px solid rgba(222, 210, 194, 0.72);
  }
}

@media (max-width: 680px) {
  .header-inner,
  .section-inner,
  .hero-inner,
  .footer-inner {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
  }

  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    width: auto;
    max-width: none;
    margin: 0 14px;
  }

  .site-header {
    position: sticky;
    top: 0;
  }

  .brand {
    min-width: 0;
  }

  .brand small {
    max-width: calc(100vw - 146px);
  }

  .site-footer {
    padding: 38px 0 112px;
  }

  .mobile-sticky {
    position: fixed;
    left: 8px;
    right: auto;
    bottom: 0;
    z-index: 12;
    display: grid;
    width: min(374px, calc(100% - 16px));
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    border-top: 1px solid rgba(222, 210, 194, 0.9);
    border-radius: 8px 8px 0 0;
    background: var(--white);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-sticky a {
    min-width: 0;
    min-height: 58px;
    display: grid;
    place-items: center;
    font-weight: 900;
    padding: 0 8px;
    text-align: center;
    line-height: 1.25;
    white-space: normal;
  }

  .mobile-sticky a:first-child {
    color: var(--red-dark);
    background: var(--paper-strong);
  }

  .mobile-sticky a:last-child {
    color: white;
    background: var(--red);
  }
}

/* ---------- 响应式：页脚 ---------- */

@media (min-width: 901px) and (max-width: 1120px) {
  .site-footer .footer-inner.footer-layout-three {
    grid-template-columns: minmax(0, 1fr) minmax(250px, .7fr);
  }

  .footer-layout-three > div:first-child {
    grid-column: 1 / -1;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
  }
}

@media (max-width: 900px) {
  .reading-trail-next {
    display: none;
  }

  .site-footer .footer-inner.footer-layout-three,
  .site-footer .footer-inner.footer-layout-two,
  .site-footer .footer-inner:has(.footer-reading) {
    grid-template-columns: 1fr;
  }

  .footer-contact span {
    display: grid;
    gap: 7px;
  }

  .footer-inner.footer-layout-three,
  .footer-inner.footer-layout-two {
    gap: 28px;
  }

  .footer-inner.footer-layout-three > * + *,
  .footer-inner.footer-layout-two > * + * {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, .12);
  }
}

/* 卡片内主按钮 */
.delivery-card .btn { margin-top: 16px; }

/* 首页免费工具区四列 */
.tools-free-section .delivery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .tools-free-section .delivery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .tools-free-section .delivery-grid { grid-template-columns: 1fr; } }
