@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

/* =============================================
   CSS 变量 & 基础重置
   ============================================= */
:root {
  --c-primary:   #56228b;
  --c-earth:     #8b4513;
  --c-dark:      #1f1726;
  --c-dark2:     #2a1d35;
  --c-dark3:     #342444;
  --c-accent:    #9b59d0;
  --c-earth-lt:  #c4855a;
  --c-text:      #e8dff5;
  --c-text-mute: #a891c4;
  --c-border:    rgba(86,34,139,0.35);
  --c-white:     #fff;
  --radius-sm:   12px;
  --radius-md:   18px;
  --radius-lg:   24px;
  --radius-xl:   32px;
  --nav-w:       220px;
  --font-mono:   'Share Tech Mono', 'Fira Code', 'Consolas', monospace;
  --font-body:   'Fira Code', 'Share Tech Mono', monospace;
  --shadow-soft: 0 4px 24px rgba(31,23,38,0.55);
  --shadow-card: 0 2px 12px rgba(31,23,38,0.4);
  --transition:  0.28s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--c-dark);
  color: var(--c-text);
}

body.body-root {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  background: var(--c-dark);
  color: var(--c-text);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--c-accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover, a:focus {
  color: var(--c-earth-lt);
  outline: none;
}
a:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol { list-style: none; }

/* =============================================
   页面骨架：左侧固定 nav + 右侧内容
   ============================================= */
.page-shell {
  display: flex;
  min-height: 100vh;
}

/* 左侧竖排导航（footer 语义，nav 行为） */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: linear-gradient(180deg, var(--c-dark2) 0%, var(--c-dark) 100%);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidenav nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem 2rem;
}

.nav-dl {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.nav-brand-dt {
  margin-bottom: 1.5rem;
}

.nav-brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--c-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.nav-brand-link:hover {
  transform: scale(1.08);
  box-shadow: 0 0 18px rgba(86,34,139,0.6);
}

.nav-logo-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.nav-logo-text {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-white);
  letter-spacing: 0.05em;
}

/* 药丸胶囊按钮 */
.nav-pill {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-xl);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--c-text-mute);
  background: transparent;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 40px;
  line-height: 1.2;
  display: flex;
  align-items: center;
}
.nav-pill:hover,
.nav-pill:focus {
  background: rgba(86,34,139,0.25);
  color: var(--c-text);
  border-color: var(--c-border);
}

.nav-pill--contact {
  margin-top: auto;
  background: linear-gradient(135deg, var(--c-earth) 0%, #a05220 100%);
  color: var(--c-white);
  border-color: transparent;
  font-weight: 600;
}
.nav-pill--contact:hover {
  background: linear-gradient(135deg, #a05220 0%, var(--c-earth) 100%);
  color: var(--c-white);
}

.nav-contact-dt {
  margin-top: auto;
  padding-top: 1rem;
}

/* =============================================
   主内容区
   ============================================= */
.main-wrap {
  margin-left: var(--nav-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* =============================================
   Hero 区
   ============================================= */
.hero-section {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c-dark2) 0%, var(--c-primary) 60%, var(--c-earth) 100%);
  scroll-margin-top: 0;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(31,23,38,0.72) 0%,
    rgba(86,34,139,0.55) 50%,
    rgba(31,23,38,0.8) 100%
  );
  z-index: 1;
}

.hero-blob {
  position: absolute;
  bottom: -20px;
  right: 5%;
  width: 420px;
  height: 280px;
  z-index: 2;
  pointer-events: none;
}

.hero-body {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 680px;
  width: 100%;
}

.hero-h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.25;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
  text-shadow: 0 2px 16px rgba(31,23,38,0.7);
}

.hero-sub {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--c-text-mute);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-cta {
  display: inline-block;
  padding: 0.85rem 2.2rem;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  color: var(--c-white);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-xl);
  border: none;
  letter-spacing: 0.06em;
  transition: transform var(--transition), box-shadow var(--transition);
  min-height: 48px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(86,34,139,0.55);
  color: var(--c-white);
}

/* =============================================
   正文主容器：main > article > section（契约）
   ============================================= */
.content-main {
  flex: 1;
  padding: 3rem 2rem 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.content-article {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2.5rem;
  align-items: start;
}

/* =============================================
   页面正文内容
   ============================================= */
.page-content-section {
  min-width: 0;
}

/* 正文区 section（由 page.content 注入）样式 */
.page-content-section section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--c-dark2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  position: relative;
  overflow: hidden;
  scroll-margin-top: 88px;
}

.page-content-section section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-earth), var(--c-accent));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.page-content-section h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  color: var(--c-white);
  margin-bottom: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.page-content-section h2 span {
  color: var(--c-accent);
}

.page-content-section h3 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--c-text);
  margin: 1.4rem 0 0.7rem;
  font-weight: 500;
}

.page-content-section h3 span {
  border-bottom: 1px solid var(--c-earth);
  padding-bottom: 2px;
}

.page-content-section p {
  margin-bottom: 1rem;
  line-height: 1.75;
  color: var(--c-text);
  font-size: 1rem;
}

.page-content-section ul,
.page-content-section ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
  list-style: disc;
}

.page-content-section ol {
  list-style: decimal;
}

.page-content-section li {
  margin-bottom: 0.4rem;
  line-height: 1.65;
  color: var(--c-text);
}

.page-content-section a {
  color: var(--c-earth-lt);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.page-content-section a:hover {
  color: var(--c-accent);
}

.page-content-section strong {
  color: var(--c-white);
  font-weight: 600;
}

.page-content-section em {
  color: var(--c-earth-lt);
  font-style: normal;
}

.page-content-section blockquote {
  border-left: 3px solid var(--c-primary);
  padding: 0.8rem 1.2rem;
  margin: 1rem 0;
  background: rgba(86,34,139,0.12);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--c-text-mute);
  font-style: italic;
}

.page-content-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.9rem;
}

.page-content-section th,
.page-content-section td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--c-border);
  text-align: left;
}

.page-content-section th {
  background: rgba(86,34,139,0.25);
  color: var(--c-white);
  font-weight: 600;
}

.page-content-section td {
  background: rgba(31,23,38,0.4);
}

.page-content-section img {
  border-radius: var(--radius-md);
  max-width: 100%;
  margin: 1rem 0;
}

/* =============================================
   侧边栏 aside（内容右侧）
   ============================================= */
.content-aside {
  position: sticky;
  top: 2rem;
}

.aside-inner {
  background: var(--c-dark2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.2rem;
  position: relative;
  overflow: hidden;
}

.aside-blob {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  pointer-events: none;
  opacity: 0.7;
}

.aside-title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--c-text-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  font-weight: 500;
}

.aside-title span {
  border-bottom: 1px solid var(--c-earth);
  padding-bottom: 2px;
}

.aside-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.aside-links li a {
  display: block;
  padding: 0.45rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--c-text-mute);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  min-height: 36px;
  line-height: 1.3;
  display: flex;
  align-items: center;
}

.aside-links li a:hover {
  background: rgba(86,34,139,0.2);
  color: var(--c-text);
}

/* =============================================
   页脚（site-footer）：footer > section×n
   ============================================= */
.site-footer {
  background: var(--c-dark2);
  border-top: 1px solid var(--c-border);
  padding: 0;
}

.footer-brand-section {
  padding: 3.5rem 3rem 2.5rem;
  background: linear-gradient(135deg, var(--c-dark) 0%, var(--c-dark2) 100%);
  border-bottom: 1px solid var(--c-border);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 1rem;
}

.footer-brand-word {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 0 40px rgba(86,34,139,0.35);
}

.footer-slogan {
  font-size: 0.88rem;
  color: var(--c-text-mute);
  max-width: 320px;
  text-align: right;
  line-height: 1.5;
}

/* 页脚三栏区 */
.footer-nav-section,
.footer-info-section {
  display: inline-block;
  vertical-align: top;
  width: calc(50% - 2px);
  padding: 2rem 3rem;
  border-bottom: 1px solid var(--c-border);
}

.footer-nav-section {
  border-right: 1px solid var(--c-border);
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--c-text-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.2rem;
  font-weight: 500;
}

.footer-col-title span {
  border-bottom: 1px solid var(--c-earth);
  padding-bottom: 2px;
}

.footer-nav-dl {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.footer-nav-dl dt a,
.footer-nav-dl dd a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--c-text-mute);
  transition: color var(--transition);
  display: inline-block;
  padding: 0.25rem 0;
  min-height: 32px;
  line-height: 1.3;
  display: flex;
  align-items: center;
}

.footer-nav-dl dt a:hover,
.footer-nav-dl dd a:hover {
  color: var(--c-accent);
}

.footer-about-text {
  font-size: 0.88rem;
  color: var(--c-text-mute);
  line-height: 1.65;
  margin-bottom: 1.2rem;
}

.footer-texture {
  opacity: 0.6;
  margin-top: 1rem;
}

.footer-texture svg {
  width: 100%;
  height: 60px;
}

.footer-copy-section {
  padding: 1.2rem 3rem;
  background: var(--c-dark);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c-text-mute);
  letter-spacing: 0.05em;
}

/* =============================================
   Scroll margin for sticky nav
   ============================================= */
section[id] {
  scroll-margin-top: 80px;
}

/* =============================================
   Parallax / 动效
   ============================================= */
@keyframes float-blob {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-12px) scale(1.03); }
}

.hero-blob {
  animation: float-blob 7s ease-in-out infinite;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-body {
  animation: fade-in-up 0.8s ease-out both;
}

/* 滚动触发淡入（利用 IntersectionObserver + CSS class） */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-blob { animation: none; }
  .hero-body { animation: none; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =============================================
   响应式断点
   ============================================= */

/* 中等屏：隐藏侧边栏右侧 aside，缩小 nav */
@media (max-width: 1024px) {
  :root { --nav-w: 64px; }

  .nav-pill {
    font-size: 0;
    padding: 0.6rem;
    justify-content: center;
  }
  .nav-pill::before {
    content: attr(data-icon);
    font-size: 1rem;
  }

  .content-article {
    grid-template-columns: 1fr;
  }

  .content-aside {
    position: static;
    order: -1;
  }

  .aside-inner {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem 1.2rem;
  }

  .aside-title { margin-bottom: 0; }
  .aside-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  .aside-links li a {
    padding: 0.3rem 0.6rem;
    min-height: 36px;
  }
  .aside-blob { display: none; }

  .footer-nav-section,
  .footer-info-section {
    width: 100%;
    display: block;
    border-right: none;
  }

  .footer-brand-section {
    grid-template-columns: 1fr;
  }
  .footer-slogan {
    text-align: left;
  }
}

/* 移动端：nav 变顶部横排 */
@media (max-width: 768px) {
  :root { --nav-w: 0px; }

  .page-shell {
    flex-direction: column;
  }

  .sidenav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    border-right: none;
    border-top: 1px solid var(--c-border);
    background: var(--c-dark2);
    z-index: 300;
    flex-direction: row;
  }

  .sidenav nav {
    padding: 0.5rem 0.75rem;
    width: 100%;
  }

  .nav-dl {
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    flex-wrap: nowrap;
  }

  .nav-brand-dt {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .nav-brand-link {
    width: 40px;
    height: 40px;
  }

  .nav-contact-dt {
    margin-top: 0;
    padding-top: 0;
    flex-shrink: 0;
  }

  .nav-pill {
    font-size: 0.72rem;
    padding: 0.55rem 0.75rem;
    min-height: 40px;
    white-space: nowrap;
  }

  .main-wrap {
    margin-left: 0;
    margin-bottom: 70px;
  }

  .hero-section {
    height: 65vh;
    min-height: 380px;
  }

  .content-main {
    padding: 1.5rem 1rem 1rem;
  }

  .page-content-section section {
    padding: 1.4rem 1.2rem;
    scroll-margin-top: 24px;
  }

  .footer-brand-section {
    padding: 2.5rem 1.5rem 1.5rem;
  }

  .footer-nav-section,
  .footer-info-section {
    padding: 1.5rem 1.5rem;
  }

  .footer-copy-section {
    padding: 1rem 1.5rem;
  }

  .footer-brand-word {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .hero-blob {
    width: 260px;
    height: 180px;
  }
}

@media (max-width: 480px) {
  .hero-h1 {
    font-size: 1.5rem;
  }

  .hero-sub {
    font-size: 0.88rem;
  }

  .hero-cta {
    padding: 0.75rem 1.6rem;
    font-size: 0.9rem;
  }

  .page-content-section h2 {
    font-size: 1.1rem;
  }

  .page-content-section section {
    padding: 1.2rem 1rem;
  }

  .nav-pill {
    font-size: 0.68rem;
    padding: 0.5rem 0.6rem;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
