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

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

:root {
  --c-white: #ffffff;
  --c-light: #f5f5f5;
  --c-ink: #1f1f1f;
  --c-ink-60: rgba(31,31,31,0.6);
  --c-ink-20: rgba(31,31,31,0.12);
  --c-accent: #c8102e;
  --c-accent-dim: #9a0b22;
  --c-accent-light: rgba(200,16,46,0.08);
  --shadow-sm: 0 1px 3px rgba(31,31,31,0.10), 0 1px 2px rgba(31,31,31,0.06);
  --shadow-md: 0 4px 12px rgba(31,31,31,0.12), 0 2px 6px rgba(31,31,31,0.08);
  --shadow-lg: 0 10px 28px rgba(31,31,31,0.14), 0 4px 10px rgba(31,31,31,0.10);
  --shadow-xl: 0 20px 48px rgba(31,31,31,0.18), 0 8px 16px rgba(31,31,31,0.12);
  --nav-h: 60px;
  --font: 'Roboto', system-ui, -apple-system, Arial, sans-serif;
  --radius: 0;
  --max-w: 1180px;
  scroll-behavior: smooth;
}

html {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-light);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ===== 滚动偏移（吸顶导航补偿） ===== */
div[id] {
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

/* ===== 页面包裹 ===== */
.page-wrapper {
  position: relative;
  z-index: 1;
}

/* ===== 导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--c-white);
  border-bottom: 2px solid var(--c-ink);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
}

.brand-mark {
  flex-shrink: 0;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--c-ink);
  position: relative;
  z-index: 2;
  transition: background 0.18s ease, color 0.18s ease;
}
.brand-mark:hover {
  background: var(--c-ink);
  color: var(--c-white);
}

.brand-icon {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--c-accent);
  line-height: 1;
}

.nav-logo-img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* details/summary 导航 */
.nav-details {
  position: relative;
  z-index: 101;
}

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

.nav-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 8px 14px;
  min-height: 44px;
  border: 1.5px solid var(--c-ink-20);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-ink);
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.nav-toggle::-webkit-details-marker { display: none; }
.nav-toggle::marker { display: none; }
.nav-toggle:hover {
  background: var(--c-light);
  border-color: var(--c-ink);
}

.burger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}
.burger span {
  display: block;
  height: 2px;
  background: var(--c-ink);
  transition: transform 0.2s ease;
}
.nav-details[open] .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-details[open] .burger span:nth-child(2) { opacity: 0; }
.nav-details[open] .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-toggle-label {
  font-size: 13px;
  font-weight: 500;
}

.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--c-white);
  border: 2px solid var(--c-ink);
  box-shadow: var(--shadow-lg);
  list-style: none;
  flex-direction: column;
  min-width: 180px;
  z-index: 200;
  padding: 4px 0;
}

.nav-menu li {
  border-bottom: 1px solid var(--c-light);
}
.nav-menu li:last-child { border-bottom: none; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  min-height: 44px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-ink);
  transition: background 0.14s ease, color 0.14s ease, padding-left 0.14s ease;
  white-space: nowrap;
}
.nav-link:hover {
  background: var(--c-accent-light);
  color: var(--c-accent);
  padding-left: 24px;
}

.nav-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--c-accent);
  flex-shrink: 0;
}

/* 桌面：details 改为常驻横排 */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-details { display: flex; align-items: center; flex: 1; }
  .nav-details[open] > .nav-menu,
  .nav-menu {
    display: flex !important;
    position: static;
    flex-direction: row;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
    gap: 2px;
    min-width: unset;
  }
  .nav-menu li { border-bottom: none; }
  .nav-link {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 40px;
    border-bottom: 2px solid transparent;
  }
  .nav-link:hover {
    background: transparent;
    border-bottom-color: var(--c-accent);
    padding-left: 12px;
  }
}

/* 搜索框 */
.header-search {
  margin-left: auto;
  flex-shrink: 0;
}

.search-form {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--c-ink-20);
  background: var(--c-light);
  overflow: hidden;
  transition: border-color 0.15s;
}
.search-form:focus-within {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 2px var(--c-accent-light);
}

.search-input {
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  color: var(--c-ink);
  padding: 8px 12px;
  width: 140px;
  min-height: 40px;
  outline: none;
}
.search-input::placeholder { color: var(--c-ink-60); }

.search-btn {
  border: none;
  background: var(--c-ink);
  color: var(--c-white);
  padding: 0 12px;
  min-height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.search-btn:hover { background: var(--c-accent); }

@media (max-width: 480px) {
  .search-input { width: 90px; font-size: 12px; }
  .header-search { margin-left: auto; }
}

/* ===== Hero ===== */
.hero-section {
  position: relative;
  min-height: 100vh;
  background: var(--c-ink);
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 1;
}

/* 斜切色带 */
.hero-skew {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, var(--c-accent) 0%, #7a0919 45%, var(--c-ink) 100%);
  clip-path: polygon(0 0, 60% 0, 38% 100%, 0 100%);
}
.hero-skew::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(255,255,255,0.03) 8px,
    rgba(255,255,255,0.03) 9px
  );
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 100px 20px 80px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-text {
  flex: 1;
  max-width: 520px;
  text-align: right;
  margin-left: auto;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-accent);
  background: rgba(200,16,46,0.15);
  border: 1px solid rgba(200,16,46,0.3);
  padding: 4px 12px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.2;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

.hero-sub {
  font-size: 16px;
  font-weight: 300;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  background: var(--c-accent);
  color: var(--c-white);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 36px;
  text-decoration: none;
  letter-spacing: 0.5px;
  min-height: 48px;
  border: 2px solid transparent;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
  box-shadow: var(--shadow-md);
}
.hero-cta:hover {
  background: var(--c-accent-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Hero 装饰卡片 */
.hero-deco {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}

.deco-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 80px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.deco-card:hover {
  transform: translateY(-4px) translateZ(8px);
  box-shadow: var(--shadow-xl);
}
.deco-card--1 {
  transform: translateX(12px);
  z-index: 3;
  box-shadow: var(--shadow-lg);
}
.deco-card--2 {
  transform: translateX(0px);
  z-index: 2;
  box-shadow: var(--shadow-md);
}
.deco-card--3 {
  transform: translateX(8px);
  z-index: 1;
  box-shadow: var(--shadow-sm);
}

.deco-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-white);
  line-height: 1;
}
.deco-label {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column;
    text-align: left;
    padding: 80px 20px 60px;
  }
  .hero-text { text-align: left; margin-left: 0; max-width: 100%; }
  .hero-deco {
    flex-direction: row;
    width: 100%;
    justify-content: center;
  }
  .deco-card { width: 90px; height: 68px; }
  .deco-card--1, .deco-card--2, .deco-card--3 { transform: none; }
  .hero-skew { clip-path: polygon(0 0, 100% 0, 100% 38%, 0 55%); }
}

/* ===== 主体布局 ===== */
.body-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 20px 64px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .body-layout {
    grid-template-columns: 1fr;
  }
  .sidebar { order: -1; }
}

/* ===== 主内容 ===== */
.main-content {
  min-width: 0;
}

.wrap {
  width: 100%;
}

.content-section {
  background: var(--c-white);
  border: 2px solid var(--c-ink);
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 2;
}

.content-article {
  padding: 40px 36px;
}

/* 正文内容样式 */
.content-article h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-ink);
  margin: 36px 0 8px;
  line-height: 1.3;
  border-left: 4px solid var(--c-accent);
  padding-left: 14px;
}
.content-article h2:first-child { margin-top: 0; }

.content-article h2 + hr {
  border: none;
  border-top: 1.5px solid var(--c-ink-20);
  margin: 0 0 20px;
}

.content-article h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-ink);
  margin: 28px 0 6px;
}
.content-article h3 + hr {
  border: none;
  border-top: 1px solid var(--c-ink-20);
  margin: 0 0 16px;
}

.content-article p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-ink);
  margin-bottom: 16px;
}

.content-article ul, .content-article ol {
  padding-left: 24px;
  margin-bottom: 16px;
}
.content-article li {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 6px;
}

.content-article a {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.content-article a:hover { color: var(--c-accent-dim); }

.content-article strong { font-weight: 700; }

.content-article div {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--c-light);
}
.content-article div:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.content-article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 15px;
}
.content-article th {
  background: var(--c-ink);
  color: var(--c-white);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}
.content-article td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--c-light);
}
.content-article tr:nth-child(even) td { background: var(--c-light); }

.content-article blockquote {
  border-left: 4px solid var(--c-accent);
  background: var(--c-accent-light);
  padding: 14px 20px;
  margin: 20px 0;
  font-style: italic;
  color: var(--c-ink);
}

@media (max-width: 600px) {
  .content-article { padding: 24px 18px; }
  .content-article h2 { font-size: 1.25rem; }
}

/* ===== 侧边栏 ===== */
.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  z-index: 3;
}

.sidebar-inner {
  background: var(--c-white);
  border: 2px solid var(--c-ink);
  box-shadow: var(--shadow-lg);
  padding: 24px 20px;
  position: relative;
}
.sidebar-inner::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  right: -6px;
  bottom: -6px;
  background: var(--c-ink);
  z-index: -1;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--c-ink);
  margin-bottom: 8px;
}

.sidebar-inner > hr {
  border: none;
  border-top: 2px solid var(--c-ink);
  margin-bottom: 16px;
}

.sidebar-index {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}

.sidebar-index-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--c-ink);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.14s, border-color 0.14s, padding-left 0.14s;
  min-height: 40px;
}
.sidebar-index-link:hover {
  background: var(--c-light);
  border-color: var(--c-ink-20);
  padding-left: 16px;
  color: var(--c-accent);
}

.sidebar-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-accent);
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  flex-shrink: 0;
}

.sidebar-name { flex: 1; }

.sidebar-badge {
  background: var(--c-ink);
  color: var(--c-white);
  text-align: center;
  padding: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.badge-text::before {
  content: '● ';
  color: #4caf50;
}

@media (max-width: 900px) {
  .sidebar { position: static; }
  .sidebar-inner::before { display: none; }
  .sidebar-index {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--c-ink);
  color: var(--c-white);
  margin-top: 0;
}

.footer-cta-block {
  background: var(--c-accent);
  padding: 48px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-cta-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-white);
  letter-spacing: 0.3px;
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  background: var(--c-white);
  color: var(--c-accent);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 40px;
  text-decoration: none;
  min-height: 48px;
  border: 2px solid var(--c-white);
  letter-spacing: 0.5px;
  transition: background 0.18s, color 0.18s;
}
.footer-cta-btn:hover {
  background: var(--c-ink);
  color: var(--c-white);
  border-color: var(--c-white);
}

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-dl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}

.footer-dl dt {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
}

.footer-dl dd {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
}

.footer-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  transition: color 0.15s, border-color 0.15s;
  display: inline-block;
  padding-top: 10px;
  padding-bottom: 10px;
  min-height: 40px;
  line-height: 1.4;
}
.footer-link:hover {
  color: var(--c-white);
  border-bottom-color: var(--c-white);
}

@media (max-width: 600px) {
  .footer-bottom { flex-direction: column; gap: 16px; }
  .footer-dl { min-width: unset; }
}

/* ===== 通用工具 ===== */
img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

::selection {
  background: var(--c-accent);
  color: var(--c-white);
}

/* 层叠深度辅助 */
.elevation-1 { box-shadow: var(--shadow-sm); }
.elevation-2 { box-shadow: var(--shadow-md); }
.elevation-3 { box-shadow: var(--shadow-lg); }
.elevation-4 { box-shadow: var(--shadow-xl); }
