/* =====================================================================
   王知之自习室 · 子页面共享样式
   被 space.html / smart.html / news.html / about.html / contact.html 引用
   ===================================================================== */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: #f7f4ee;
  color: #1c1612;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button {
  border: 0;
  font: inherit;
  cursor: pointer;
  background: none;
}

/* ============ 顶部导航（固定，浅色玻璃，子页面通用） ============ */
.nav-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 68px;
  background: rgba(247, 244, 238, .9);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid rgba(36, 22, 18, .06);
  transition: background .3s ease;
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
}

.nav-inner {
  width: min(1280px, calc(100% - 48px));
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  height: 100%;
  position: relative;
  z-index: 2;
}

.brand-logo {
  width: 300px;
  height: 60px;
  object-fit: contain;
  object-position: left center;
}

.brand-fallback {
  display: none;
  color: #1c1612;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .02em;
}

.brand.logo-error .brand-logo { display: none; }
.brand.logo-error .brand-fallback { display: block; }

.nav-links {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(34px, 3.2vw, 58px);
  font-size: 14px;
  font-weight: 560;
  white-space: nowrap;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
  color: rgba(36, 22, 18, .82);
  transition: color .2s ease, opacity .2s ease;
}

.nav-item:hover {
  color: #1c1612;
}

.nav-item.is-active {
  color: #1c1612;
}

.reserve-button {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 22px;
  border-radius: 999px;
  background: #1c1612;
  color: #fff8e8;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
  position: relative;
  z-index: 2;
}

.reserve-button:hover {
  background: #2e221a;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(20, 10, 4, .18);
}

.nav-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* ============ 页面 hero（每个子页面顶部） ============ */
.page-hero {
  position: relative;
  padding: clamp(140px, 18vh, 200px) 0 clamp(80px, 12vh, 140px);
  overflow: hidden;
  background: #f7f4ee;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 90% 0%, rgba(213, 160, 109, .14), transparent 50%),
    radial-gradient(ellipse at 0% 100%, rgba(166, 121, 77, .08), transparent 55%);
}

/* Hero with background image — dark overlay for text readability */
.page-hero.dark {
  background: #15120f;
  color: #fff6e8;
}
.page-hero.dark::before {
  background:
    radial-gradient(ellipse at 80% 0%, rgba(213, 160, 109, .14), transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(0, 0, 0, .3), transparent 50%);
}
.page-hero.dark .hero-title { color: #fff6e8; }
.page-hero.dark .hero-lead { color: rgba(255, 244, 230, .65); }
.page-hero.dark .breadcrumb { color: rgba(255, 244, 230, .5); }
.page-hero.dark .breadcrumb a:hover { color: #fff6e8; }
.page-hero.dark .breadcrumb-sep { color: rgba(255, 244, 230, .25); }
.page-hero.dark .hero-eyebrow { color: rgba(213, 160, 109, .85); }

.hero-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(24px, 6vw, 100px);
}

.breadcrumb {
  font-size: 13px;
  color: rgba(36, 22, 18, .5);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .04em;
}

.breadcrumb a {
  text-decoration: none;
  transition: color .2s ease;
}

.breadcrumb a:hover {
  color: #1c1612;
}

.breadcrumb-sep {
  color: rgba(36, 22, 18, .25);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: #a6794d;
  margin-bottom: 22px;
}

.hero-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.hero-title {
  margin: 0;
  font-size: clamp(46px, 5.5vw, 84px);
  font-weight: 640;
  line-height: 1.04;
  letter-spacing: -.034em;
  color: #1c1612;
  max-width: 880px;
}

.hero-title .calm {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.04em;
}

.hero-title .em {
  font-weight: 760;
}

.hero-lead {
  margin: 32px 0 0;
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.85;
  color: rgba(36, 22, 18, .68);
  max-width: 560px;
}

/* ============ 内容板块通用 ============ */
.content-section {
  position: relative;
  padding: clamp(80px, 12vh, 130px) 0;
}

.content-section.alt {
  background: #ffffff;
}

.content-section.dark {
  background: #15120f;
  color: #fff6e8;
}

.section-shell {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(24px, 6vw, 100px);
}

.section-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 4vw, 64px);
  align-items: end;
  margin-bottom: clamp(40px, 6vh, 64px);
}

.section-eyebrow-row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: #a6794d;
  margin-bottom: 18px;
}

.section-eyebrow-row .num {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 14px;
  letter-spacing: .04em;
}

.section-eyebrow-row .bar {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: currentColor;
}

.content-section.dark .section-eyebrow-row {
  color: rgba(213, 160, 109, .85);
}

.big-title {
  margin: 0;
  font-size: clamp(32px, 3.6vw, 54px);
  font-weight: 640;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: #1c1612;
}

.content-section.dark .big-title {
  color: #fff6e8;
}

.big-title .calm {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.04em;
}

.big-title .em {
  font-weight: 760;
}

.big-lead {
  margin: 0;
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.85;
  color: rgba(36, 22, 18, .65);
  max-width: 480px;
  justify-self: end;
}

.content-section.dark .big-lead {
  color: rgba(255, 244, 230, .65);
}

/* ============ 滚动入场（reveal） ============ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .18s; }
.reveal.delay-3 { transition-delay: .28s; }
.reveal.delay-4 { transition-delay: .38s; }

/* ============ 页脚（与主页一致） ============ */
.site-footer {
  background: #0d0a08;
  color: rgba(255, 244, 230, .55);
  padding: 64px 0 36px;
  font-size: 13px;
}

.footer-shell {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(24px, 6vw, 100px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr) 1.1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 244, 230, .06);
}

.footer-brand {
  font-size: 18px;
  font-weight: 700;
  color: #fff6e8;
  letter-spacing: -.01em;
  margin-bottom: 14px;
}

.footer-tag {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 13px;
  color: rgba(255, 244, 230, .45);
  max-width: 260px;
  line-height: 1.7;
  margin: 0;
}

.footer-col h4 {
  margin: 0 0 18px;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 244, 230, .92);
  letter-spacing: .04em;
}

.footer-col a {
  display: block;
  padding: 6px 0;
  color: rgba(255, 244, 230, .5);
  text-decoration: none;
  transition: color .2s ease;
  font-size: 13px;
}

.footer-col a:hover {
  color: rgba(255, 244, 230, .92);
}

.footer-contact-row {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.footer-contact-row a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 244, 230, .18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 244, 230, .65);
  padding: 0;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.footer-contact-row a:hover {
  border-color: rgba(255, 244, 230, .55);
  color: #fff6e8;
  background: rgba(255, 244, 230, .04);
}

.footer-contact-row svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-contact-tip {
  display: block;
  font-size: 12px;
  color: rgba(255, 244, 230, .35);
  margin-top: 16px;
  line-height: 1.7;
}

.footer-bottom {
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: rgba(255, 244, 230, .35);
}

/* ============ 超级下拉菜单 (Mega Menu) - 子页面通用 ============ */
.nav-shell {
  overflow: visible;
}

.mega-menu {
  position: absolute;
  z-index: 125;
  top: 68px;
  left: 0;
  width: 100%;
  height: 255px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, .96) 0%,
      rgba(255, 255, 255, .88) 30%,
      rgba(255, 255, 255, .65) 66%,
      rgba(255, 255, 255, .15) 100%
    );
  backdrop-filter: blur(12px) saturate(125%);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
  box-shadow: 0 26px 70px rgba(40, 24, 10, .06);
  border-bottom: 1px solid rgba(36, 22, 18, .06);
}

.nav-shell.is-open .mega-menu {
  opacity: 1;
  pointer-events: auto;
}

.mega-panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity .2s ease,
    transform .28s cubic-bezier(.22, 1, .36, 1);
}

.mega-panel.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mega-inner {
  width: 100%;
  height: 100%;
  color: #2e2b2a;
  position: relative;
}

.mega-content {
  position: absolute;
  top: 38px;
  left: var(--menu-left);
  width: 260px;
  transform: translateX(0);
  will-change: opacity, transform;
  transition: left .28s cubic-bezier(.22, 1, .36, 1);
  text-align: left;
}

.mega-primary {
  display: grid;
  gap: 16px;
}

.mega-link {
  display: block;
  color: #241d18;
  text-decoration: none;
  transition: opacity .18s ease, transform .18s ease;
}

.mega-link:hover {
  opacity: .76;
  transform: translateX(4px);
}

.mega-link-title {
  display: block;
  font-size: clamp(18px, 1.35vw, 23px);
  font-weight: 720;
  line-height: 1.16;
  letter-spacing: -.02em;
}

.mega-panel .mega-link {
  opacity: 0;
  transform: translateY(-14px);
  transition:
    opacity .34s ease,
    transform .44s cubic-bezier(.22, 1, .36, 1);
}

.mega-panel.is-restarting .mega-link {
  opacity: 0;
  transform: translateY(-14px);
}

.mega-panel.is-active.is-ready .mega-link {
  opacity: 1;
  transform: translateY(0);
}

.mega-panel.is-active.is-ready .mega-link:nth-child(1) { transition-delay: .08s; }
.mega-panel.is-active.is-ready .mega-link:nth-child(2) { transition-delay: .12s; }
.mega-panel.is-active.is-ready .mega-link:nth-child(3) { transition-delay: .16s; }
.mega-panel.is-active.is-ready .mega-link:nth-child(4) { transition-delay: .20s; }

.panel-ip {
  position: absolute;
  left: calc(var(--menu-left) - 300px);
  bottom: 0;
  width: 250px;
  height: 250px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-18px) scale(.96);
  transition:
    left .28s cubic-bezier(.22, 1, .36, 1),
    opacity .38s ease,
    transform .52s cubic-bezier(.22, 1, .36, 1);
}

.panel-ip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  display: block;
  filter: drop-shadow(0 18px 34px rgba(64, 37, 16, .12));
}

.mega-panel.is-restarting .panel-ip {
  opacity: 0;
  transform: translateY(-18px) scale(.96);
}

.mega-panel.is-active.is-ready .panel-ip {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: .18s;
}

.mega-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgba(0, 0, 0, .22);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s ease;
}

.nav-shell.is-open ~ .mega-backdrop {
  opacity: 1;
}

/* ============ 响应式 ============ */
@media (max-width: 1020px) {
  .nav-links {
    gap: 18px;
    font-size: 13px;
  }
  .section-header {
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
  }
  .big-lead {
    justify-self: start;
    max-width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-grid > div:first-child,
  .footer-col--contact {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .nav-shell { height: 58px; }
  .nav { height: 58px; }
  .nav-inner { width: calc(100% - 32px); }
  .nav-links { display: none; }
  .brand-logo { width: 235px; height: 47px; }
  .reserve-button { height: 36px; padding: 0 16px; font-size: 13px; }

  /* 移动端隐藏下拉菜单 */
  .nav-shell.is-open .mega-menu {
    opacity: 0;
    pointer-events: none;
  }

  /* Footer 移动端：压缩为品牌 + 三列导航 + 联系方式，避免纵向过长 */
  .site-footer {
    padding: 44px 0 26px;
  }
  .footer-shell {
    padding: 0 28px;
  }
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 18px;
    padding-bottom: 26px;
  }
  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
  .footer-col--contact {
    grid-column: 1 / -1;
    padding-top: 2px;
  }
  .footer-brand {
    font-size: 16px;
    margin-bottom: 8px;
  }
  .footer-tag {
    font-size: 12.5px;
    max-width: 100%;
    line-height: 1.55;
  }
  .footer-col h4 {
    margin: 0 0 10px;
    font-size: 12px;
  }
  .footer-col a {
    padding: 3px 0;
    font-size: 12.5px;
    line-height: 1.45;
  }
  .footer-contact-row {
    gap: 10px;
    margin-top: 0;
  }
  .footer-contact-row a {
    width: 32px;
    height: 32px;
  }
  .footer-contact-row svg {
    width: 15px;
    height: 15px;
  }
  .footer-contact-tip {
    font-size: 11.5px;
    margin-top: 10px;
    line-height: 1.55;
    word-break: break-word;
  }
  .footer-bottom {
    padding-top: 18px;
    font-size: 11px;
    gap: 8px;
  }

  .page-hero { padding: 100px 0 60px; }
  .content-section { padding: 60px 0; }
}

@media (max-width: 380px) {
  .footer-shell {
    padding: 0 22px;
  }
  .footer-grid {
    gap: 22px 12px;
  }
  .footer-col h4 {
    font-size: 11.5px;
  }
  .footer-col a {
    font-size: 12px;
  }
}
