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

/* ============================================================
   CSS 自定义属性
   ============================================================ */
:root {
  --c-primary:   #eb879c;
  --c-secondary: #ffb6c1;
  --c-dark:      #26171a;
  --c-dark2:     #341e23;
  --c-dark3:     #42252b;
  --c-dark4:     #1a0e11;
  --c-text:      #f5e6ea;
  --c-text-muted:#c9a0ab;
  --c-border:    rgba(235,135,156,0.25);
  --c-card-bg:   rgba(52,30,35,0.85);
  --c-hero-bg:   #2e1820;

  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-pill: 999px;

  --shadow-soft: 0 2px 4px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.2);
  --shadow-card: 0 2px 4px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);

  --transition: 220ms cubic-bezier(0.4,0,0.2,1);

  --font-body:   'Archivo', 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-head:   'Space Grotesk', 'Archivo', system-ui, sans-serif;

  --max-w: 1200px;
  --nav-h: 108px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::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-body);
  background-color: var(--c-dark);
  color: var(--c-text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover {
  color: var(--c-secondary);
}

a:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: 3px;
}

ul {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  line-height: 1.3;
  font-weight: 700;
  color: var(--c-text);
}

/* ============================================================
   scroll-margin for nav sections
   ============================================================ */
section[id] {
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

/* ============================================================
   Container
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* ============================================================
   Page Wrapper
   ============================================================ */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   Header — 两行布局
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--c-dark4);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-soft);
}

/* 品牌行 */
.header-brand-row {
  background-color: var(--c-dark4);
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--c-border);
}

.header-brand-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-primary);
  letter-spacing: -0.02em;
}

.header-contact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contact-label {
  font-size: 0.875rem;
  color: var(--c-text-muted);
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1.5px solid var(--c-primary);
  border-radius: var(--radius-pill);
  color: var(--c-primary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  min-height: 40px;
}

.contact-btn:hover {
  background: var(--c-primary);
  color: var(--c-dark);
}

/* 菜单行 */
.header-nav-row {
  background-color: var(--c-dark2);
  padding-block: 0.6rem;
}

.nav-aside {
  width: 100%;
}

.nav-pills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--c-border);
  background: transparent;
  color: var(--c-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  min-height: 40px;
}

.nav-pill:hover,
.nav-pill--active {
  background: var(--c-primary);
  color: var(--c-dark);
  border-color: var(--c-primary);
}

.nav-pill:focus-visible {
  outline: 2px solid var(--c-secondary);
  outline-offset: 2px;
}

/* ============================================================
   Hero
   ============================================================ */
.hero-wrap {
  position: relative;
  min-height: 45vh;
  background: linear-gradient(135deg, var(--c-dark4) 0%, var(--c-hero-bg) 50%, var(--c-dark3) 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-inner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-block: clamp(2.5rem, 6vh, 4rem);
}

.hero-copy {
  max-width: 560px;
  text-align: right;
}

.hero-h1 {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: clamp(0.95rem, 2vw, 1.125rem);
  color: var(--c-text-muted);
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 2rem;
  background: var(--c-primary);
  color: var(--c-dark);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 16px rgba(235,135,156,0.35);
  min-height: 48px;
}

.btn-primary:hover {
  background: var(--c-secondary);
  color: var(--c-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(235,135,156,0.45);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--c-secondary);
  outline-offset: 3px;
}

/* 圆弧底边 */
.hero-arc {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--c-dark);
  border-radius: 50% 50% 0 0 / 60px 60px 0 0;
  transform: scaleX(1.05);
}

/* ============================================================
   Main Content Layout（侧边栏在左）
   ============================================================ */
.site-main {
  flex: 1;
  padding-block: 3rem 4rem;
}

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

/* ============================================================
   侧边栏
   ============================================================ */
.content-aside {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  background: var(--c-card-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.sidebar-nav {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--c-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  min-height: 40px;
  line-height: 40px;
  padding-block: 0;
}

.sidebar-link:hover {
  background: rgba(235,135,156,0.12);
  color: var(--c-primary);
}

.sidebar-tip {
  border-top: 1px solid var(--c-border);
  padding-top: 1rem;
}

.sidebar-tip-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-primary);
  margin-bottom: 0.5rem;
}

.sidebar-tip .subtitle {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  line-height: 1.6;
}

/* ============================================================
   Article & Section
   ============================================================ */
.content-article {
  min-width: 0;
}

.content-section {
  width: 100%;
}

/* ============================================================
   正文内部样式（page.content 输出的 HTML）
   ============================================================ */
.page-content h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  color: var(--c-primary);
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--c-border);
}

.page-content h2:first-child {
  margin-top: 0;
}

.page-content .subtitle,
.page-content p.subhead,
.page-content p.desc,
.page-content p.lead {
  color: var(--c-text-muted);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.page-content h3 {
  font-size: 1.125rem;
  color: var(--c-secondary);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

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

.page-content ul,
.page-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.1rem;
  color: var(--c-text);
}

.page-content ul {
  list-style: disc;
}

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

.page-content li {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 0.4rem;
}

.page-content a {
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-content a:hover {
  color: var(--c-secondary);
}

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

.page-content em {
  color: var(--c-text-muted);
  font-style: italic;
}

.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

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

.page-content th {
  background: var(--c-dark3);
  color: var(--c-primary);
  font-weight: 600;
}

.page-content td {
  background: var(--c-card-bg);
  color: var(--c-text);
}

.page-content blockquote {
  border-left: 3px solid var(--c-primary);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(235,135,156,0.07);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--c-text-muted);
  font-style: italic;
}

.page-content section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--c-border);
}

.page-content section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* ============================================================
   Footer：极简 p + small
   ============================================================ */
.site-footer {
  background: var(--c-dark4);
  border-top: 1px solid var(--c-border);
  padding-block: 1.5rem;
  text-align: center;
}

.footer-brand {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  margin-bottom: 0.4rem;
}

.footer-copy {
  display: block;
  font-size: 0.8rem;
  color: rgba(201,160,171,0.6);
}

/* ============================================================
   Micro-interactions & Stagger（prefers-reduced-motion 安全）
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .nav-pill {
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), transform 200ms ease;
  }
  .nav-pill:hover {
    transform: translateY(-1px);
  }

  .sidebar-link {
    transition: background var(--transition), color var(--transition),
                transform 200ms ease;
  }
  .sidebar-link:hover {
    transform: translateX(3px);
  }

  /* 侧边栏链接错落入场 */
  .sidebar-nav li {
    opacity: 0;
    transform: translateX(-8px);
    animation: slideInLeft 280ms ease forwards;
  }
  .sidebar-nav li:nth-child(1) { animation-delay: 60ms; }
  .sidebar-nav li:nth-child(2) { animation-delay: 100ms; }
  .sidebar-nav li:nth-child(3) { animation-delay: 140ms; }
  .sidebar-nav li:nth-child(4) { animation-delay: 180ms; }
  .sidebar-nav li:nth-child(5) { animation-delay: 220ms; }
  .sidebar-nav li:nth-child(6) { animation-delay: 260ms; }
  .sidebar-nav li:nth-child(7) { animation-delay: 300ms; }

  @keyframes slideInLeft {
    to { opacity: 1; transform: translateX(0); }
  }

  /* Hero 文案入场 */
  .hero-copy {
    animation: fadeUp 320ms 80ms ease both;
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* 卡片 hover 提升 */
  .page-content section {
    transition: box-shadow 220ms ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   响应式
   ============================================================ */

/* 中等屏幕 */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .content-aside {
    position: static;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5rem;
  }

  .sidebar-link {
    text-align: center;
    line-height: 1.4;
    height: auto;
    padding-block: 0.5rem;
  }

  :root {
    --nav-h: 56px;
  }
}

/* 移动端 */
@media (max-width: 600px) {
  .hero-inner {
    justify-content: center;
  }
  .hero-copy {
    text-align: center;
    max-width: 100%;
  }

  .nav-pills-list {
    gap: 0.375rem;
  }

  .nav-pill {
    font-size: 0.8rem;
    padding: 0.4rem 0.85rem;
  }

  .header-contact {
    display: none;
  }

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

  .content-layout {
    gap: 1.5rem;
  }

  .site-main {
    padding-block: 2rem 3rem;
  }

  .hero-arc {
    height: 36px;
  }
}

/* 超小屏 */
@media (max-width: 400px) {
  .nav-pills-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .nav-pills-list::-webkit-scrollbar {
    display: none;
  }
  .nav-pill {
    flex-shrink: 0;
  }
}
