@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600;700&family=EB+Garamond:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg-0: #000000;
  --bg-1: #121212;
  --bg-2: #1a1a1a;
  --bg-3: #242424;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #606060;
  --accent-gold: #c9a84c;
  --accent-blue: #4a9eff;
  --accent-green: #39d353;
  --accent-purple: #b06aff;
  --accent-red: #ff4f6a;
  --glow-gold: 0 0 10px rgba(201,168,76,0.6);
  --glow-blue: 0 0 10px rgba(74,158,255,0.5);
  --sidebar-w: 210px;
  --radius: 0px;
  --font-serif: 'EB Garamond', 'Crimson Text', 'Noto Serif SC', Georgia, serif;
  --font-sans: system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

body.oled-body {
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── 滚动边距 ── */
section[id] {
  scroll-margin-top: 1.5rem;
}

/* ── 布局外壳 ── */
.page-shell {
  display: flex;
  min-height: 100vh;
}

/* ── 侧边栏 ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-1);
  border-right: 1px solid #1e1e1e;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem 0;
}

.sidebar-brand {
  padding: 0 1.1rem 1.5rem;
  border-bottom: 1px solid #222;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  max-width: 110px;
  height: auto;
}

.brand-text span {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: var(--glow-gold);
  letter-spacing: 0.03em;
}

/* 侧边导航 */
.sidebar nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.65rem;
}

.sidebar nav ul li {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border-radius: 50px;
  text-decoration: none;
  color: var(--text-secondary);
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
  min-height: 42px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(201,168,76,0.1);
  color: var(--accent-gold);
  text-shadow: var(--glow-gold);
  outline: none;
}

.nav-link:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-gold);
}

.sidebar-footer-note {
  padding: 1.1rem 1.1rem 0;
  border-top: 1px solid #1e1e1e;
  margin-top: auto;
}

.sidebar-tagline {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.65rem;
}

.sidebar-contact {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent-blue);
  text-decoration: none;
  border: 1px solid rgba(74,158,255,0.3);
  padding: 0.32rem 0.8rem;
  border-radius: 50px;
  transition: background 0.2s, color 0.2s;
}

.sidebar-contact:hover {
  background: rgba(74,158,255,0.12);
}

/* ── 主区域 ── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-w));
  overflow-x: hidden;
}

/* ── Hero ── */
.hero-section {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg-0);
  border-bottom: 1px solid #1a1a1a;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
}

.hero-grid-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 70% at 30% 50%, rgba(201,168,76,0.06) 0%, transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
  gap: 2rem;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-eyebrow {
  margin-bottom: 0.6rem;
}

.hero-eyebrow span {
  display: inline-block;
  font-size: 0.72rem;
  font-family: var(--font-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-gold);
  border: 1px solid rgba(201,168,76,0.35);
  padding: 0.18rem 0.65rem;
}

.hero-h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 0.9rem;
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 380px;
  margin-bottom: 1.6rem;
}

.hero-cta-group {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.2rem;
  background: var(--accent-gold);
  color: #000;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border-radius: 0;
  border: none;
  min-height: 44px;
  transition: box-shadow 0.2s, opacity 0.2s;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.btn-primary:hover {
  box-shadow: var(--glow-gold);
  opacity: 0.9;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.2rem;
  background: transparent;
  color: var(--accent-gold);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid var(--accent-gold);
  border-radius: 0;
  min-height: 44px;
  transition: background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-outline:hover {
  background: rgba(201,168,76,0.08);
  box-shadow: var(--glow-gold);
}

/* Hero 视觉装饰 */
.hero-visual {
  flex: 0 0 160px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-card-mock {
  width: 148px;
  height: 148px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.hcm-dot {
  position: absolute;
  top: 0.7rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.hcm-dot--1 { left: 0.7rem; background: #ff4f6a; }
.hcm-dot--2 { left: 1.45rem; background: #c9a84c; }
.hcm-dot--3 { left: 2.2rem; background: #39d353; }

.hcm-bar {
  margin-top: 1.8rem;
  height: 7px;
  background: rgba(201,168,76,0.3);
  animation: shimmer 2.5s ease-in-out infinite;
}

.hcm-bar--2 {
  width: 70%;
  background: rgba(74,158,255,0.25);
  animation-delay: 0.4s;
}

.hcm-bar--3 {
  width: 50%;
  background: rgba(176,106,255,0.25);
  animation-delay: 0.8s;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

/* ── 正文 main ── */
main {
  flex: 1;
  padding: 0;
  min-width: 0;
  overflow-x: hidden;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.content-sections {
  width: 100%;
}

.page-content {
  width: 100%;
  overflow-x: hidden;
}

/* ── 正文内容全局样式 ── */
.page-content h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 3rem 0 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #222;
  letter-spacing: 0.01em;
}

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

.page-content h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-gold);
  margin: 2rem 0 0.75rem;
}

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

.page-content p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

.page-content a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-decoration-color: rgba(74,158,255,0.35);
  transition: text-shadow 0.2s;
  word-break: break-all;
}

.page-content a:hover {
  text-shadow: var(--glow-blue);
}

.page-content ul,
.page-content ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.page-content li {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 0.35rem;
  word-break: break-word;
}

.page-content strong {
  color: var(--text-primary);
  font-weight: 700;
}

.page-content em {
  color: var(--accent-gold);
  font-style: italic;
}

.page-content blockquote {
  border-left: 3px solid var(--accent-gold);
  padding: 0.75rem 1.1rem;
  margin: 1.5rem 0;
  background: rgba(201,168,76,0.05);
  color: var(--text-secondary);
  font-style: italic;
}

.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.88rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.page-content th {
  background: var(--bg-2);
  color: var(--accent-gold);
  padding: 0.55rem 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid #333;
  white-space: nowrap;
}

.page-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #1e1e1e;
  color: var(--text-secondary);
  white-space: nowrap;
}

.page-content tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* 玻璃拟态卡片 */
.page-content .card,
.glass-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.page-content .card:hover,
.glass-card:hover {
  border-color: rgba(201,168,76,0.25);
  box-shadow: 0 0 20px rgba(201,168,76,0.08);
}

/* section 区块分隔 */
.page-content section {
  padding: 2.5rem 0;
  border-bottom: 1px solid #181818;
}

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

/* ── 页脚 ── */
footer {
  background: var(--bg-1);
  border-top: 1px solid #1e1e1e;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  overflow-x: hidden;
}

footer > section {
  display: flex;
  align-items: center;
}

footer > section.footer-copy {
  flex: 1;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-family: var(--font-sans);
  min-width: 0;
  overflow: hidden;
}

footer > section.footer-copy span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

footer > section.footer-links {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  min-width: 0;
}

.footer-disclaimer {
  line-height: 1.5;
  word-break: break-word;
}

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hcm-bar {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ── 图片通用 ── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── 移动端：900px 以下切换为顶栏 ── */
@media (max-width: 899px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #1e1e1e;
    overflow-y: visible;
    overflow-x: hidden;
  }

  .sidebar-inner {
    padding: 0.6rem 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .sidebar-brand {
    padding: 0 0 0.35rem;
    border-bottom: none;
  }

  .sidebar nav {
    flex: none;
    padding: 0;
    width: 100%;
  }

  .sidebar nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 0;
  }

  .sidebar nav ul li {
    width: auto;
    flex-shrink: 0;
  }

  .nav-link {
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
    min-height: 40px;
    white-space: nowrap;
  }

  .sidebar-footer-note {
    display: none;
  }

  .main-area {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }

  .hero-inner {
    flex-direction: column;
    padding: 1.25rem 0.9rem;
    gap: 0.9rem;
    max-width: 100%;
  }

  .hero-visual {
    display: none;
  }

  .hero-section {
    min-height: auto;
    overflow: hidden;
  }

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

  .hero-sub {
    font-size: 0.9rem;
    max-width: 100%;
  }

  .wrap {
    padding: 1.25rem 0.9rem;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.8rem 0.9rem;
    gap: 0.3rem;
  }

  footer > section.footer-copy span {
    white-space: normal;
  }

  .page-content p {
    max-width: 100%;
  }

  section[id] {
    scroll-margin-top: 0.5rem;
  }
}

/* ── 小屏补丁 ── */
@media (max-width: 480px) {
  :root {
    --sidebar-w: 0px;
  }

  body.oled-body {
    font-size: 1rem;
  }

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

  .hero-sub {
    font-size: 0.86rem;
  }

  .btn-primary,
  .btn-outline {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    min-height: 44px;
  }

  .hero-cta-group {
    gap: 0.4rem;
  }

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

  .page-content h3 {
    font-size: 0.98rem;
  }

  .hero-inner {
    padding: 1rem 0.75rem;
  }

  .wrap {
    padding: 1rem 0.75rem;
  }

  footer {
    padding: 0.7rem 0.75rem;
  }

  .page-content table {
    font-size: 0.82rem;
  }

  .page-content th,
  .page-content td {
    padding: 0.4rem 0.55rem;
  }
}

/* ── 焦点可见性 ── */
:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* ── 滚动条美化 ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-0);
}
::-webkit-scrollbar-thumb {
  background: #333;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

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