@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;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, .nb-body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #000;
  background: #f5f5f5;
  overflow-x: hidden;
}

/* ===== 颜色变量 ===== */
:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --black: #000;
  --white: #fff;
  --bg: #f5f5f5;
  --border: 3px solid #000;
  --shadow: 5px 5px 0 #000;
  --shadow-sm: 3px 3px 0 #000;
  --radius: 4px;
}

/* ===== 滚动边距（粘性锚点条高度约 44px + 顶栏约 56px） ===== */
div[id] {
  scroll-margin-top: 104px;
}

/* ===== 页面容器 ===== */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 顶部横向导航 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--blue);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 56px;
}

/* details/summary 导航结构 */
.nav-details {
  position: relative;
  flex: 1;
  min-width: 0;
}

.nav-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  min-height: 56px;
}

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

.brand-icon {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  background: var(--white);
}

.logo-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--black);
  background: var(--white);
  border: 2px solid var(--black);
  padding: 2px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
}

.menu-toggle-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--black);
  flex: 1;
}

.menu-toggle-icon {
  font-size: 1.3rem;
  color: var(--black);
  font-weight: 700;
}

/* 展开后菜单 */
.nav-details[open] .menu-toggle-icon::after {
  content: '';
}

.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 300;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  list-style: none;
  padding: 8px 0;
  min-width: 200px;
  border-radius: var(--radius);
}

.nav-menu li {
  border-bottom: 1px solid #eee;
}

.nav-menu li:last-child {
  border-bottom: none;
}

.nav-menu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  text-decoration: none;
  color: var(--black);
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
  min-height: 44px;
}

.nav-menu li a:hover {
  background: var(--blue);
  color: var(--white);
}

.nav-icon {
  font-style: normal;
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* 搜索框 */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 16px 8px 8px;
  flex-shrink: 0;
}

.search-input {
  height: 36px;
  padding: 0 10px;
  border: 2px solid var(--black);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  background: var(--white);
  width: 140px;
}

.search-input:focus {
  background: #fffde7;
}

.search-btn {
  height: 36px;
  padding: 0 10px;
  border: 2px solid var(--black);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--red);
  color: var(--white);
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.15s;
  min-width: 40px;
}

.search-btn:hover {
  background: var(--black);
}

/* ===== 粘性锚点条 ===== */
.anchor-bar {
  position: sticky;
  top: 56px;
  z-index: 150;
  background: var(--black);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  min-height: 44px;
}

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

.anchor-link {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  min-height: 44px;
  border-right: 1px solid #333;
  transition: background 0.15s, color 0.15s;
}

.anchor-link:hover {
  background: var(--blue);
  color: var(--black);
}

/* ===== Hero 区 ===== */
.hero-section {
  position: relative;
  min-height: 45vh;
  background: var(--black);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.hero-bg-text {
  position: absolute;
  top: 50%;
  left: -20px;
  transform: translateY(-50%);
  font-size: clamp(80px, 18vw, 200px);
  font-weight: 700;
  color: rgba(59,177,255,0.12);
  letter-spacing: -0.05em;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.hero-content {
  position: relative;
  z-index: 2;
  text-align: right;
  padding: 40px 40px 80px 40px;
  max-width: 600px;
}

.hero-h1 {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 16px;
  text-shadow: 3px 3px 0 var(--black);
}

.hero-desc {
  font-size: 1rem;
  color: #eee;
  margin-bottom: 24px;
  line-height: 1.6;
}

.hero-cta {
  display: inline-block;
  padding: 14px 32px;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
}

.hero-cta:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--blue);
}

.hero-cta:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

/* 斜切底边 */
.hero-bottom-cut {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  z-index: 3;
}

/* ===== 主体区 ===== */
.main-area {
  flex: 1;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

.content-section {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* ===== 侧边栏（内容左侧） ===== */
.sidebar-left {
  flex: 0 0 220px;
  position: sticky;
  top: 108px;
}

.aside-inner {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0;
  overflow: hidden;
}

.aside-title {
  background: var(--blue);
  color: var(--black);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 16px;
  border-bottom: var(--border);
  letter-spacing: 0.05em;
}

.aside-nav-list {
  list-style: none;
  padding: 8px 0;
}

.aside-nav-list li {
  border-bottom: 1px solid #eee;
}

.aside-nav-list li:last-child {
  border-bottom: none;
}

.aside-nav-list li a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--black);
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 40px;
  line-height: 1.5;
  transition: background 0.12s, color 0.12s;
}

.aside-nav-list li a:hover {
  background: var(--blue);
  color: var(--white);
}

.aside-brand-block {
  border-top: var(--border);
  padding: 14px 16px;
  background: #f9f9f9;
}

.aside-brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--black);
}

.aside-brand-desc {
  font-size: 0.8rem;
  color: #444;
  line-height: 1.5;
}

/* ===== 正文主内容 ===== */
.main-content {
  flex: 1;
  min-width: 0;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 8px;
}

.title-hr {
  border: none;
  border-top: 3px solid var(--blue);
  margin-bottom: 24px;
}

/* 正文内容样式 */
.main-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 8px;
  color: var(--black);
  line-height: 1.3;
}

.main-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 8px;
  color: var(--black);
}

.main-content h2 + hr,
.main-content h3 + hr {
  border: none;
  border-top: 2px solid var(--black);
  margin-bottom: 16px;
}

.main-content p {
  margin-bottom: 14px;
  font-size: 1rem;
  line-height: 1.75;
  color: #111;
}

.main-content ul,
.main-content ol {
  padding-left: 1.6em;
  margin-bottom: 14px;
}

.main-content li {
  margin-bottom: 6px;
  line-height: 1.7;
}

.main-content a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.12s;
}

.main-content a:hover {
  color: var(--red);
}

.main-content div {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 2px dashed #ddd;
}

.main-content div:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.main-content img {
  max-width: 100%;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: block;
  margin: 16px 0;
}

.main-content blockquote {
  border-left: 5px solid var(--blue);
  background: #f0f8ff;
  padding: 12px 20px;
  margin: 20px 0;
  font-style: italic;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.main-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

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

.main-content td {
  border: 1px solid #ccc;
  padding: 8px 12px;
}

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

/* ===== 页脚 ===== */
.site-footer {
  background: var(--black);
  border-top: var(--border);
  padding: 24px 20px;
  text-align: center;
}

.site-footer p.footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 8px;
  letter-spacing: 0.08em;
}

.site-footer small.footer-copy {
  font-size: 0.82rem;
  color: #aaa;
  line-height: 1.6;
  display: block;
}

/* ===== 卡片（正文内可能出现） ===== */
.card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

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

/* ===== 动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .nb-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.4s ease forwards;
  }

  .nb-stagger > *:nth-child(1) { animation-delay: 0.05s; }
  .nb-stagger > *:nth-child(2) { animation-delay: 0.12s; }
  .nb-stagger > *:nth-child(3) { animation-delay: 0.19s; }
  .nb-stagger > *:nth-child(4) { animation-delay: 0.26s; }
  .nb-stagger > *:nth-child(5) { animation-delay: 0.33s; }
  .nb-stagger > *:nth-child(6) { animation-delay: 0.40s; }
  .nb-stagger > *:nth-child(7) { animation-delay: 0.47s; }

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

  .hero-content {
    animation: slideInRight 0.5s ease both;
  }

  @keyframes slideInRight {
    from {
      opacity: 0;
      transform: translateX(30px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .nav-menu li a,
  .anchor-link,
  .aside-nav-list li a {
    transition: background 0.15s, color 0.15s, padding-left 0.15s;
  }

  .nav-menu li a:hover {
    padding-left: 28px;
  }

  .aside-nav-list li a:hover {
    padding-left: 24px;
  }

  .hero-cta {
    transition: transform 0.12s, box-shadow 0.12s;
  }

  .main-content div {
    animation: fadeUp 0.35s ease both;
  }
}

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

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .content-section {
    flex-direction: column;
    gap: 20px;
  }

  .sidebar-left {
    flex: none;
    width: 100%;
    position: static;
  }

  .aside-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 8px;
  }

  .aside-nav-list li {
    border: none;
    flex: 1 1 calc(50% - 4px);
  }

  .aside-nav-list li a {
    border: 1px solid #ddd;
    border-radius: var(--radius);
    margin: 2px;
    text-align: center;
    justify-content: center;
  }

  .hero-section {
    min-height: 45vh;
    justify-content: center;
  }

  .hero-content {
    text-align: center;
    padding: 32px 20px 72px;
    max-width: 100%;
  }

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

  .main-content {
    padding: 20px 16px;
  }

  .topbar-search {
    padding: 8px 10px 8px 4px;
  }

  .search-input {
    width: 100px;
  }

  .anchor-bar {
    top: 56px;
  }

  .wrap {
    padding: 24px 12px;
  }
}

@media (max-width: 480px) {
  .menu-toggle-label {
    display: none;
  }

  .search-input {
    width: 80px;
    font-size: 0.85rem;
  }

  .anchor-link {
    font-size: 0.78rem;
    padding: 0 10px;
  }

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

  .hero-bg-text {
    font-size: 22vw;
  }
}

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