@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+TC:wght@400;500;600;700&display=swap');

/* ===== 基础重置 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: #fafaf8;
  color: #1a1a1a;
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 纸纹叠底 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ===== 容器 ===== */
.page-wrap {
  position: relative;
  z-index: 1;
}

.header-inner,
.hero-inner,
.footer-cols,
.footer-cta-block {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ===== 顶部导航 ===== */
.site-header {
  border-bottom: 1.5px solid #1a1a1a;
  background: #fafaf8;
  position: relative;
  z-index: 100;
}

.header-inner {
  padding-top: 0;
  padding-bottom: 0;
}

/* details/summary 覆盖默认样式 */
.nav-details {
  display: block;
}

.nav-details[open] > .nav-summary {
  display: none;
}

.nav-summary {
  display: none;
  cursor: pointer;
  list-style: none;
  padding: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #4a4a4a;
}

.nav-summary::-webkit-details-marker { display: none; }

/* 桌面：始终展开 */
.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  height: 60px;
  gap: 0;
  padding: 0;
}

.nav-menu > li {
  display: flex;
  align-items: center;
}

.nav-left,
.nav-right {
  flex: 1;
}

.nav-left { justify-content: flex-start; }
.nav-right { justify-content: flex-end; }

.nav-center {
  flex: 0 0 auto;
  padding: 0 2rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-list li a {
  display: block;
  padding: 0.6rem 0.75rem;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.875rem;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: none;
  min-height: 40px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.nav-list li a:hover {
  border-color: #1a1a1a;
  background: rgba(26,26,26,0.04);
  transform: rotate(-0.5deg);
}

/* CTA 按钮 */
.nav-cta {
  background: #1a1a1a !important;
  color: #fafaf8 !important;
  border-color: #1a1a1a !important;
  border-radius: 4px;
  padding: 0.6rem 1rem !important;
  font-weight: 700 !important;
}

.nav-cta:hover {
  background: #4a4a4a !important;
  transform: rotate(0.5deg) !important;
}

/* 品牌 */
.brand-link,
.brand-center {
  text-decoration: none;
  color: #1a1a1a;
  display: flex;
  align-items: center;
}

.logo-text {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #1a1a1a;
}

.site-logo {
  max-height: 40px;
  width: auto;
}

/* ===== 粘性锚点条 ===== */
.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: #1a1a1a;
  border-bottom: 2px solid #4a4a4a;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.sticky-bar::-webkit-scrollbar { display: none; }

.anchor-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 1200px;
  padding-left: 1rem;
  padding-right: 1rem;
}

.anchor-list li a {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  color: #fafaf8;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  min-height: 40px;
  border-right: 1px solid rgba(250,250,248,0.15);
  letter-spacing: 0.02em;
  transition: none;
}

.anchor-list li a:hover {
  background: rgba(250,250,248,0.12);
  color: #fafaf8;
}

.anchor-list li:last-child a { border-right: none; }

/* scroll-margin for sections */
section[id] {
  scroll-margin-top: 80px;
}

/* ===== Hero ===== */
.hero-wrap {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  border-bottom: 1.5px solid #1a1a1a;
  overflow: hidden;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.grid-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-top: 3rem;
  padding-bottom: 3rem;
  width: 100%;
}

.hero-deco {
  flex: 0 0 auto;
  transform: rotate(-2deg);
  opacity: 0.85;
}

.hero-content {
  flex: 1;
  text-align: left;
}

.hero-h1 {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.35;
  color: #1a1a1a;
  margin-bottom: 0.75rem;
  letter-spacing: 0.03em;
}

.hero-desc {
  font-size: 1rem;
  color: #4a4a4a;
  max-width: 560px;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== 按钮 ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.5rem;
  background: #1a1a1a;
  color: #fafaf8;
  border: 1.5px solid #1a1a1a;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  font-family: 'Noto Sans TC', sans-serif;
  cursor: pointer;
  min-height: 44px;
  transition: none;
}

.btn-primary:hover {
  background: #4a4a4a;
  border-color: #4a4a4a;
  transform: rotate(-0.8deg) translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.5rem;
  background: transparent;
  color: #1a1a1a;
  border: 1.5px solid #1a1a1a;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  font-family: 'Noto Sans TC', sans-serif;
  cursor: pointer;
  min-height: 44px;
  transition: none;
}

.btn-ghost:hover {
  background: rgba(26,26,26,0.05);
  transform: rotate(0.6deg) translateY(-1px);
}

.btn-large {
  font-size: 1.1rem;
  padding: 0.85rem 2.5rem;
  min-height: 52px;
}

/* ===== 主内容区 ===== */
.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* 正文主容器：section > aside + figure + div */
.content-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto 1fr;
  gap: 0;
  padding: 3rem 0;
  border-bottom: 1.5px solid #1a1a1a;
  position: relative;
}

/* aside 在内容左侧 */
.content-aside {
  grid-column: 1;
  grid-row: 1 / 3;
  border-right: 1.5px solid #1a1a1a;
  padding-right: 1.5rem;
  padding-top: 0.5rem;
}

.aside-inner {
  position: sticky;
  top: 88px;
}

.aside-label {
  font-family: 'Noto Serif TC', serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #4a4a4a;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #4a4a4a;
  text-transform: uppercase;
}

.aside-nav {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.aside-nav li {
  margin-bottom: 0.1rem;
}

.aside-nav li a {
  display: block;
  padding: 0.4rem 0.5rem;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.5;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: none;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.aside-nav li a:hover {
  border-color: #1a1a1a;
  background: rgba(26,26,26,0.04);
  transform: translateX(2px);
}

.aside-deco {
  opacity: 0.4;
  margin-top: 1rem;
  text-align: center;
}

/* figure 装饰 */
.content-figure {
  grid-column: 2;
  grid-row: 1;
  padding-left: 2rem;
  padding-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
  opacity: 0.6;
}

.sketch-frame {
  transform: rotate(1.5deg);
}

/* 正文 body */
.content-body {
  grid-column: 2;
  grid-row: 2;
  padding-left: 2rem;
  padding-top: 1rem;
}

/* ===== 正文内容样式（page.content 注入） ===== */
.content-body h2,
.content-body h3 {
  font-family: 'Noto Serif TC', serif;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.4;
  padding-bottom: 0.4rem;
  border-bottom: 1.5px dashed #4a4a4a;
}

.content-body h2 { font-size: 1.5rem; }
.content-body h3 { font-size: 1.2rem; }

.content-body h2 span,
.content-body h3 span {
  display: inline;
}

.content-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: #1a1a1a;
  margin-bottom: 1.2rem;
}

.content-body ul,
.content-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}

.content-body li {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 0.4rem;
  color: #1a1a1a;
}

.content-body a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-style: dashed;
}

.content-body a:hover {
  color: #4a4a4a;
  text-decoration-style: solid;
}

.content-body section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px dotted #4a4a4a;
}

.content-body section:last-child {
  border-bottom: none;
}

.content-body strong {
  font-weight: 700;
  color: #1a1a1a;
}

.content-body blockquote {
  border-left: 3px solid #1a1a1a;
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(26,26,26,0.03);
  font-style: italic;
  color: #4a4a4a;
}

.content-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1.5px solid #1a1a1a;
}

/* ===== 页脚 ===== */
.site-footer {
  background: #1a1a1a;
  color: #fafaf8;
  border-top: 2px solid #4a4a4a;
  margin-top: 0;
}

.footer-cta-block {
  text-align: center;
  padding: 3rem 1.5rem;
  border-bottom: 1px solid #4a4a4a;
}

.footer-cta-title {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 700;
  color: #fafaf8;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.footer-cta-title span {
  display: inline;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.footer-dl {
  padding: 0 2rem;
  border-right: 1px solid rgba(250,250,248,0.15);
}

.footer-dl:first-child { padding-left: 0; }
.footer-dl:last-child {
  border-right: none;
  padding-right: 0;
}

.footer-dl dt {
  font-family: 'Noto Serif TC', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fafaf8;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed rgba(250,250,248,0.3);
  letter-spacing: 0.05em;
}

.footer-dl dd {
  font-size: 0.85rem;
  color: rgba(250,250,248,0.7);
  margin-bottom: 0.6rem;
  line-height: 1.6;
}

.footer-dl dd a {
  color: rgba(250,250,248,0.7);
  text-decoration: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0;
}

.footer-dl dd a:hover {
  color: #fafaf8;
  text-decoration: underline dashed;
  text-underline-offset: 3px;
}

.footer-bottom {
  border-top: 1px solid rgba(250,250,248,0.15);
  padding: 1rem 1.5rem;
  text-align: center;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(250,250,248,0.5);
  line-height: 1.6;
}

/* ===== Scroll Reveal 动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s cubic-bezier(.4,0,.2,1), transform 0.5s cubic-bezier(.4,0,.2,1);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  .stagger-list li {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  .stagger-list li.is-visible {
    opacity: 1;
    transform: none;
  }

  .stagger-list li:nth-child(2) { transition-delay: 0.08s; }
  .stagger-list li:nth-child(3) { transition-delay: 0.16s; }
  .stagger-list li:nth-child(4) { transition-delay: 0.24s; }
  .stagger-list li:nth-child(5) { transition-delay: 0.32s; }
  .stagger-list li:nth-child(6) { transition-delay: 0.40s; }
  .stagger-list li:nth-child(7) { transition-delay: 0.48s; }

  .hero-content {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 0.7s cubic-bezier(.4,0,.2,1) 0.1s forwards;
  }

  @keyframes heroReveal {
    to {
      opacity: 1;
      transform: none;
    }
  }

  .hero-deco {
    opacity: 0;
    animation: decoReveal 0.6s ease 0.3s forwards;
  }

  @keyframes decoReveal {
    to { opacity: 0.85; }
  }
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .content-section {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .content-aside {
    grid-column: 1;
    grid-row: 1;
    border-right: none;
    border-bottom: 1.5px dashed #4a4a4a;
    padding-right: 0;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .aside-inner {
    position: static;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
  }

  .aside-label { margin-bottom: 0; border-bottom: none; }

  .aside-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0;
  }

  .aside-deco { display: none; }

  .content-figure {
    grid-column: 1;
    grid-row: 2;
    padding-left: 0;
    justify-content: flex-start;
    padding-bottom: 0.5rem;
  }

  .content-body {
    grid-column: 1;
    grid-row: 3;
    padding-left: 0;
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .footer-dl {
    padding: 1.5rem 0;
    border-right: none;
    border-bottom: 1px solid rgba(250,250,248,0.15);
  }

  .footer-dl:last-child { border-bottom: none; }
}

@media (max-width: 768px) {
  /* 移动端导航改用 details 展开 */
  .nav-details[open] > .nav-summary {
    display: flex;
  }

  .nav-menu {
    display: none;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    border-top: 1px solid #4a4a4a;
  }

  .nav-details[open] .nav-menu {
    display: flex;
  }

  .nav-left,
  .nav-right,
  .nav-center {
    flex: none;
    width: 100%;
    justify-content: flex-start;
    padding: 0;
  }

  .nav-center { display: none; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-list li a {
    border-radius: 0;
    border-color: transparent;
    border-bottom: 1px solid rgba(26,26,26,0.1);
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .nav-summary {
    display: flex !important;
  }

  .nav-details:not([open]) .nav-menu {
    display: none;
  }

  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .hero-deco { display: none; }

  .sticky-bar {
    top: 0;
  }

  article[id] {
    scroll-margin-top: 80px;
  }
}

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

  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .footer-cta-block { padding: 2rem 1rem; }

  .anchor-list li a {
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
  }
}

/* ===== 工具类 ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
