@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;1,400&display=swap');

/* ==============================
   CSS 变量 & 基础重置
============================== */
:root {
  --blue: #c8e0f4;
  --pink: #f5e0e8;
  --dark: #171f26;
  --blue-light: #e4eff9;
  --blue-dark: #a8c8e8;
  --pink-light: #faf0f4;
  --pink-dark: #e8c8d8;
  --text: #2a3540;
  --text-muted: #5a6978;
  --bg: #d8eaf8;
  --radius-card: 16px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --shadow-out: -5px -5px 15px rgba(255,255,255,0.75), 5px 5px 15px rgba(0,0,0,0.12);
  --shadow-in: inset -3px -3px 8px rgba(255,255,255,0.7), inset 3px 3px 8px rgba(0,0,0,0.1);
  --shadow-press: inset -2px -2px 5px rgba(255,255,255,0.6), inset 2px 2px 6px rgba(0,0,0,0.15);
  --nav-h: 64px;
  --font: 'JetBrains Mono', 'Courier New', Courier, monospace;
  --transition: 150ms ease;
}

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

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

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

ul, ol { list-style: none; }
dl { margin: 0; }
dt, dd { margin: 0; }

/* ==============================
   滚动偏移（固定导航）
============================== */
section[id] {
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

/* ==============================
   Neumorphism 工具类
============================== */
.neu-out {
  background: var(--bg);
  box-shadow: var(--shadow-out);
  border-radius: var(--radius-card);
}

.neu-in {
  background: var(--bg);
  box-shadow: var(--shadow-in);
  border-radius: var(--radius-card);
}

/* ==============================
   全局包裹
============================== */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==============================
   顶部导航
============================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08), 0 -1px 0 rgba(255,255,255,0.6) inset;
  height: var(--nav-h);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: var(--shadow-out);
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--dark);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin-left: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-out);
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

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

.main-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-list dt {
  display: flex;
}

.nav-list dt a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: box-shadow var(--transition), background var(--transition), color var(--transition);
  min-height: 44px;
  box-shadow: var(--shadow-out);
}

.nav-list dt a:hover,
.nav-list dt a:focus-visible {
  color: var(--dark);
  box-shadow: var(--shadow-press);
  background: linear-gradient(145deg, var(--blue-light), var(--blue));
}

/* ==============================
   Hero 区
============================== */
.hero-section {
  min-height: 70vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 40px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}

.hero-badge {
  display: inline-flex;
}

.hero-badge span {
  background: linear-gradient(135deg, var(--pink), var(--blue));
  color: var(--dark);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 20px;
  box-shadow: var(--shadow-out);
}

.hero-h1 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 500;
  line-height: 1.3;
  color: var(--dark);
  letter-spacing: 0.02em;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  background: linear-gradient(145deg, var(--blue-light), var(--blue-dark));
  color: var(--dark);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-out);
  transition: box-shadow var(--transition), transform var(--transition);
  min-height: 44px;
  letter-spacing: 0.03em;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  box-shadow: var(--shadow-press);
  transform: scale(0.98);
}

.hero-cta:active {
  box-shadow: var(--shadow-press);
  transform: scale(0.96);
}

.hero-figure {
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-out);
}

.hero-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  display: block;
  background: linear-gradient(135deg, var(--blue-light), var(--pink-light));
}

/* ==============================
   主内容区
============================== */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 24px 60px;
}

.content-section {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto auto;
  gap: 32px;
  align-items: start;
}

/* aside 在内容左侧 */
.content-aside {
  grid-column: 1;
  grid-row: 1 / 3;
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}

.aside-inner {
  background: var(--bg);
  box-shadow: var(--shadow-out);
  border-radius: var(--radius-card);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aside-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dark);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.aside-title span {
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--blue-dark);
}

.aside-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aside-nav-list li {
  display: flex;
}

.aside-link {
  display: flex;
  width: 100%;
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: box-shadow var(--transition), color var(--transition), background var(--transition);
  letter-spacing: 0.02em;
  line-height: 1.5;
  min-height: 44px;
  align-items: center;
}

.aside-link:hover,
.aside-link:focus-visible {
  box-shadow: var(--shadow-in);
  color: var(--dark);
  background: linear-gradient(145deg, var(--pink-light), var(--blue-light));
}

.aside-tip {
  background: linear-gradient(135deg, var(--pink-light), var(--blue-light));
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: var(--shadow-in);
}

.tip-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.aside-tip p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 装饰终端 figure */
.content-figure {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
}

.decorative-terminal {
  background: var(--dark);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-out);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #232d38;
  padding: 10px 16px;
}

.t-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.t-red { background: #ff5f57; }
.t-yellow { background: #febc2e; }
.t-green { background: #28c840; }

.t-label {
  font-family: var(--font);
  font-size: 0.72rem;
  color: #7a8e9e;
  margin-left: 8px;
  letter-spacing: 0.04em;
}

.terminal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.t-line {
  font-family: var(--font);
  font-size: 0.82rem;
  color: #a8c8e8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.t-prompt {
  color: #f5e0e8;
  font-weight: 500;
}

.t-ok {
  color: #28c840;
}

.t-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: #c8e0f4;
  opacity: 0.8;
  animation: blink 1.1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0; }
}

/* ==============================
   page.content 正文区
============================== */
.page-content-body {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* 正文里的各 section 样式 */
.page-content-body section {
  background: var(--bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-out);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.page-content-body section:hover {
  box-shadow: -7px -7px 20px rgba(255,255,255,0.8), 7px 7px 20px rgba(0,0,0,0.14);
}

.page-content-body section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-dark), var(--pink-dark));
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.page-content-body h2 {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--dark);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.page-content-body h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--dark);
  margin: 20px 0 10px;
}

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

.page-content-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 12px;
}

.page-content-body ul,
.page-content-body ol {
  padding-left: 1.2em;
  margin-bottom: 12px;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.page-content-body li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}

.page-content-body a {
  color: #4a7a9e;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.page-content-body a:hover {
  color: var(--dark);
}

.page-content-body blockquote {
  border-left: 3px solid var(--blue-dark);
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: var(--shadow-in);
  margin: 16px 0;
  font-style: italic;
  color: var(--text-muted);
}

.page-content-body strong {
  color: var(--dark);
  font-weight: 500;
}

.page-content-body em {
  color: var(--text-muted);
}

.page-content-body time {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ==============================
   页脚
============================== */
.site-footer {
  background: linear-gradient(180deg, var(--bg) 0%, var(--blue-light) 100%);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  padding: 48px 24px 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-brand-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--dark);
  letter-spacing: 0.04em;
}

.footer-brand-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.footer-contact a {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-nav-cols nav {
  display: flex;
  gap: 32px;
}

.footer-dl {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-dl-title {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--dark);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--blue-dark);
}

.footer-dl dd {
  display: flex;
}

.footer-dl dd a,
.footer-dl dd span {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 6px 0;
  transition: color var(--transition);
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.footer-dl dd a:hover,
.footer-dl dd a:focus-visible {
  color: var(--dark);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 0;
  border-top: 1px solid var(--blue-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy,
.footer-slogan {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ==============================
   视差 & 微交互
============================== */
@media (prefers-reduced-motion: no-preference) {
  .hero-section {
    animation: fadeUp 0.6s ease both;
  }

  .content-section {
    animation: fadeUp 0.7s 0.1s ease both;
  }

  @keyframes fadeUp {
    from {
      opacity: 0;
      transform: translateY(24px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .page-content-body section {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .page-content-body section:hover {
    transform: translateY(-2px);
  }

  .aside-link:active,
  .hero-cta:active {
    transform: scale(0.97);
  }

  .nav-list dt a:active {
    transform: scale(0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ==============================
   响应式 — 平板
============================== */
@media (max-width: 1024px) {
  .content-section {
    grid-template-columns: 180px 1fr;
    gap: 24px;
  }

  .hero-section {
    gap: 28px;
    padding: 40px 24px 32px;
  }
}

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

  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200;
    padding: 16px;
  }

  .main-nav.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    gap: 8px;
  }

  .nav-list dt {
    width: 100%;
  }

  .nav-list dt a {
    width: 100%;
    padding: 12px 16px;
    min-height: 48px;
    font-size: 0.9rem;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 32px 16px 24px;
    gap: 24px;
  }

  .hero-figure {
    order: -1;
    max-height: 240px;
    overflow: hidden;
  }

  .hero-h1 {
    font-size: 1.5rem;
  }

  .hero-desc {
    font-size: 0.92rem;
  }

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

  .content-aside {
    grid-column: 1;
    grid-row: auto;
    position: static;
  }

  .content-figure {
    grid-column: 1;
    grid-row: auto;
  }

  .page-content-body {
    grid-column: 1;
    grid-row: auto;
  }

  .main-content {
    padding: 0 16px 40px;
  }

  .page-content-body section {
    padding: 24px 18px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-nav-cols nav {
    flex-direction: column;
    gap: 20px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 375px) {
  .header-inner {
    padding: 0 12px;
  }

  .brand-name {
    font-size: 0.95rem;
  }

  .hero-section {
    padding: 24px 12px 20px;
  }

  .main-content {
    padding: 0 12px 32px;
  }

  .page-content-body h2 {
    font-size: 1.05rem;
  }

  .site-footer {
    padding: 32px 12px 0;
  }
}

/* ==============================
   焦点可访问性
============================== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--blue-dark);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

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