@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');

/* ============================
   CSS 自定义属性
   ============================ */
:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --black: #000000;
  --white: #ffffff;
  --yellow: #ffe94e;
  --bg: #f5f5f0;
  --card-bg: #ffffff;
  --border: 3px solid #000000;
  --shadow: 5px 5px 0px #000000;
  --shadow-lg: 8px 8px 0px #000000;
  --shadow-blue: 5px 5px 0px #3bb1ff;
  --shadow-red: 5px 5px 0px #ff5252;
  --radius: 4px;
  --nav-w: 220px;
  --font-serif: 'Noto Serif TC', 'Georgia', serif;
  --font-sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --fz-base: 17px;
  --lh: 1.7;
  --transition: 0.18s cubic-bezier(.4,0,.2,1);
}

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

html {
  scroll-behavior: smooth;
  font-size: var(--fz-base);
  background: var(--bg);
  color: var(--black);
}

body.nb-body {
  font-family: var(--font-sans);
  line-height: var(--lh);
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

/* scroll-margin for fixed nav */
div[id] {
  scroll-margin-top: 24px;
}

/* ============================
   页面骨架
   ============================ */
.page-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.content-wrap {
  margin-left: var(--nav-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ============================
   左侧固定竖排导航
   ============================ */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--black);
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.side-nav-brand {
  width: 100%;
  padding: 20px 16px 16px;
  border-bottom: var(--border);
  border-color: #333;
  flex-shrink: 0;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--blue);
  border: var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.brand-logo-link:hover {
  box-shadow: 8px 8px 0 var(--red);
  transform: translate(-2px, -2px);
}

.site-logo-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.logo-text-mark {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
  color: var(--black);
  letter-spacing: -0.5px;
  line-height: 1;
}

.side-nav-menu {
  width: 100%;
  padding: 12px 0;
  flex: 1;
}

/* nav > p > a 结构 */
.side-nav-menu .nav-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0;
}

.nav-link {
  display: block;
  width: 100%;
  padding: 13px 20px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
  border-left: 4px solid transparent;
  letter-spacing: 0.02em;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 44px;
  line-height: 1.4;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--blue);
  border-left-color: var(--red);
  color: var(--black);
  outline: none;
}

/* stagger animation */
@media (prefers-reduced-motion: no-preference) {
  .nav-link {
    opacity: 0;
    transform: translateX(-16px);
    animation: navSlideIn 0.4s forwards;
    animation-delay: calc(var(--i, 0) * 0.07s + 0.1s);
  }
  @keyframes navSlideIn {
    to { opacity: 1; transform: translateX(0); }
  }
}

/* 汉堡按钮（移动端） */
.nav-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  width: 44px;
  height: 44px;
  background: var(--blue);
  border: var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px;
}

.toggle-bar {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--black);
  border-radius: 0;
  transition: transform var(--transition), opacity var(--transition);
}

/* ============================
   Hero 区块
   ============================ */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 70vh;
  border-bottom: var(--border);
  overflow: hidden;
}

.hero-figure {
  position: relative;
  background: var(--black);
  border-right: var(--border);
  overflow: hidden;
  min-height: 400px;
  display: flex;
  align-items: stretch;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-placeholder {
  width: 100%;
  min-height: 400px;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-deco-num {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(80px, 12vw, 160px);
  color: var(--blue);
  letter-spacing: -4px;
  line-height: 1;
  user-select: none;
}

.hero-badge {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-tag {
  display: inline-block;
  background: var(--yellow);
  color: var(--black);
  border: 2px solid var(--black);
  box-shadow: 3px 3px 0 var(--black);
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  letter-spacing: 0.05em;
}

.badge-tag.badge-alt {
  background: var(--red);
  color: var(--white);
}

.hero-text-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: clamp(32px, 5vw, 72px) clamp(24px, 4vw, 56px);
  background: var(--white);
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--red);
  padding-bottom: 4px;
}

.hero-h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.2;
  color: var(--black);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 16px;
  line-height: 1.7;
  color: #333;
  max-width: 380px;
  margin-bottom: 32px;
}

.hero-cta-btn {
  display: inline-block;
  background: var(--blue);
  color: var(--black);
  border: var(--border);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 16px;
  padding: 14px 28px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: transform var(--transition), box-shadow var(--transition);
  min-height: 44px;
}

.hero-cta-btn:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-lg);
}

/* ============================
   主内容区：page.content 注入
   ============================ */
.main-content {
  flex: 1;
  padding: 0;
}

/* page.content 里的各 div 样式 */
.main-content > div,
.main-content div {
  padding: clamp(48px, 6vw, 80px) clamp(24px, 5vw, 64px);
  border-bottom: var(--border);
  position: relative;
}

.main-content > div:nth-child(even) {
  background: var(--white);
}

.main-content > div:nth-child(odd) {
  background: var(--bg);
}

/* 确保 div 内有 figure 或 aside 的契约兼容 */
.main-content div figure {
  border: var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--card-bg);
}

.main-content div figure img {
  width: 100%;
  height: auto;
  display: block;
}

.main-content div figure figcaption {
  padding: 10px 14px;
  font-size: 13px;
  border-top: 2px solid var(--black);
  background: var(--yellow);
  font-weight: 600;
}

.main-content div aside {
  background: var(--blue);
  border: var(--border);
  box-shadow: var(--shadow-blue);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.main-content div aside p,
.main-content div aside li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--black);
}

/* h1 in content */
.main-content h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(26px, 3.5vw, 42px);
  line-height: 1.25;
  margin-bottom: 20px;
  color: var(--black);
}

/* h2 标题 + subtitle/desc/lead 副标题 */
.main-content h2,
h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(22px, 2.8vw, 34px);
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--black);
  border-left: 6px solid var(--blue);
  padding-left: 16px;
}

.main-content h2 + .subtitle,
.main-content h2 + .subhead,
.main-content h2 + .desc,
.main-content h2 + .lead,
h2 + .subtitle,
h2 + .subhead,
h2 + .desc,
h2 + .lead {
  font-size: 15px;
  color: #555;
  margin-bottom: 24px;
  padding-left: 22px;
  font-weight: 400;
  line-height: 1.6;
}

h2 + p:not([class]) {
  font-size: 15px;
  color: #555;
  margin-bottom: 24px;
}

.main-content h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(18px, 2vw, 24px);
  margin-bottom: 12px;
  margin-top: 28px;
  color: var(--black);
}

.main-content p {
  font-size: var(--fz-base);
  line-height: var(--lh);
  margin-bottom: 16px;
  color: #1a1a1a;
}

.main-content ul,
.main-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.main-content li {
  margin-bottom: 8px;
  font-size: var(--fz-base);
  line-height: var(--lh);
}

.main-content strong {
  font-weight: 700;
  color: var(--black);
}

.main-content a {
  color: var(--black);
  font-weight: 700;
  border-bottom: 2px solid var(--blue);
  transition: border-color var(--transition), background var(--transition);
  padding: 0 2px;
}

.main-content a:hover {
  background: var(--blue);
  border-bottom-color: var(--black);
}

/* 卡片样式（content 内可能生成的卡片） */
.main-content .card,
.card {
  background: var(--card-bg);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  border-bottom: 5px solid var(--blue);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

/* 表格 */
.main-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  border: var(--border);
}

.main-content th {
  background: var(--black);
  color: var(--white);
  font-weight: 700;
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
}

.main-content td {
  padding: 10px 16px;
  border: 1px solid #ccc;
  font-size: 15px;
}

.main-content tr:nth-child(even) td {
  background: #f9f9f5;
}

/* blockquote */
.main-content blockquote {
  border-left: 5px solid var(--red);
  margin: 20px 0;
  padding: 16px 20px;
  background: #fff5f5;
  font-style: normal;
  font-weight: 500;
  box-shadow: 4px 4px 0 var(--red);
}

/* ============================
   页脚
   ============================ */
.site-footer {
  border-top: var(--border);
  background: var(--black);
  color: var(--white);
}

/* footer > div×n */
.footer-cta-section {
  padding: clamp(40px, 5vw, 64px) clamp(24px, 5vw, 64px);
  border-bottom: 3px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-cta-inner {
  text-align: center;
  max-width: 560px;
}

.footer-cta-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-cta-btn {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  border: 3px solid var(--white);
  box-shadow: 6px 6px 0px var(--red);
  font-weight: 700;
  font-size: 18px;
  padding: 18px 40px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  min-height: 56px;
}

.footer-cta-btn:hover {
  background: var(--blue);
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0px #fff;
  color: var(--black);
  border-color: var(--black);
}

.footer-copy-section {
  padding: 16px clamp(24px, 5vw, 64px);
}

.footer-copy {
  font-size: 13px;
  color: #888;
  text-align: center;
  line-height: 1.5;
}

/* ============================
   通用工具
   ============================ */
.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;
}

/* ============================
   移动端响应式
   ============================ */
@media (max-width: 768px) {
  :root {
    --nav-w: 0px;
  }

  .side-nav {
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  }

  .side-nav.is-open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: flex;
  }

  .content-wrap {
    margin-left: 0;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-figure {
    min-height: 240px;
    border-right: none;
    border-bottom: var(--border);
  }

  .hero-text-aside {
    align-items: flex-start;
    text-align: left;
    padding: 32px 20px;
  }

  .hero-desc {
    max-width: 100%;
  }

  .main-content > div,
  .main-content div {
    padding: 40px 20px;
  }

  .footer-cta-section {
    padding: 40px 20px;
  }

  .footer-copy-section {
    padding: 14px 20px;
  }

  div[id] {
    scroll-margin-top: 16px;
  }
}

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

  .hero-cta-btn {
    width: 100%;
    text-align: center;
  }

  .footer-cta-btn {
    width: 100%;
    text-align: center;
    font-size: 16px;
    padding: 16px 20px;
  }
}

/* ============================
   减少动效偏好
   ============================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

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