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

/* ===== 基础变量 ===== */
:root {
  --bg: #000000;
  --bg-card: #121212;
  --bg-card2: #1a1a1a;
  --accent: #1e3a5f;
  --accent-mid: #2a5298;
  --accent-bright: #7ba7d4;
  --accent-glow: #4a90d9;
  --neon-blue: #4a90d9;
  --neon-gold: #c9a84c;
  --text-primary: #f0f0f0;
  --text-secondary: #a8a8a8;
  --text-muted: #666;
  --border: #222;
  --border-accent: #1e3a5f;
  --radius-card: 18px;
  --radius-pill: 100px;
  --header-h: 60px;
  --anchor-h: 44px;
  --font-main: 'Noto Naskh Arabic', 'Noto Sans Arabic', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --transition: 0.2s ease;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  color-scheme: dark;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
body.dark-oled {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-bright); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--neon-blue); }
a:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; border-radius: 4px; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

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

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0,0,0,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: var(--header-h);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}
.brand-link { display: flex; align-items: center; flex-shrink: 0; }
.logo-img { height: 36px; width: auto; }
.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  text-shadow: 0 0 10px var(--neon-blue);
  white-space: nowrap;
}

/* 搜索框 */
.header-search { flex: 1; max-width: 320px; margin-left: auto; }
.search-form { display: flex; align-items: center; background: var(--bg-card); border: 1px solid var(--border-accent); border-radius: var(--radius-pill); padding: 0 14px; height: 38px; transition: border-color var(--transition); }
.search-form:focus-within { border-color: var(--accent-bright); box-shadow: 0 0 8px rgba(74,144,217,0.25); }
.search-input { background: none; border: none; outline: none; color: var(--text-primary); font-family: inherit; font-size: 0.875rem; flex: 1; min-width: 0; }
.search-input::placeholder { color: var(--text-muted); }
.search-btn { background: none; border: none; padding: 0; display: flex; align-items: center; flex-shrink: 0; opacity: 0.8; transition: opacity var(--transition); }
.search-btn:hover { opacity: 1; }

/* 移动端汉堡 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  padding: 8px;
  flex-shrink: 0;
}
.nav-toggle span { display: block; width: 100%; height: 2px; background: var(--text-secondary); border-radius: 2px; transition: transform var(--transition), opacity var(--transition); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 锚点药丸导航条 */
.sticky-anchor-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-accent);
  height: var(--anchor-h);
  overflow-x: auto;
  scrollbar-width: none;
}
.sticky-anchor-nav::-webkit-scrollbar { display: none; }
.anchor-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  white-space: nowrap;
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.nav-pill:hover {
  color: var(--accent-bright);
  border-color: var(--accent-bright);
  background: rgba(74,144,217,0.08);
  box-shadow: 0 0 10px rgba(74,144,217,0.15);
}

/* scroll-margin for sticky header */
article[id] { scroll-margin-top: calc(var(--header-h) + var(--anchor-h) + 12px); }

/* ===== MAIN 正文结构 ===== */
main { flex: 1; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ===== HERO ===== */
.hero-section { padding: 0; }
.hero-article {
  position: relative;
  overflow: hidden;
  min-height: 45vh;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.hero-layout {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 40px;
  padding: 48px 0;
  position: relative;
  z-index: 2;
}
.hero-text-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--neon-gold);
  text-transform: uppercase;
}
.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(74,144,217,0.3);
}
.hero-sub {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 480px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  background: var(--accent-mid);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid var(--accent-bright);
  transition: background var(--transition), box-shadow var(--transition);
  align-self: flex-start;
  margin-top: 8px;
}
.hero-cta:hover {
  background: var(--neon-blue);
  color: #fff;
  box-shadow: 0 0 10px rgba(74,144,217,0.4);
}
.hero-img-col { flex: 0 0 40%; max-width: 480px; border-radius: var(--radius-card); overflow: hidden; }
.hero-img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-card); }
.hero-img-placeholder {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-card);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-bg-text {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 700;
  color: rgba(74,144,217,0.07);
  letter-spacing: -0.02em;
  pointer-events: none;
  user-select: none;
}
.hero-bg-number {
  position: absolute;
  right: 0;
  bottom: -0.1em;
  font-size: clamp(6rem, 18vw, 14rem);
  font-weight: 900;
  color: rgba(255,255,255,0.02);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  letter-spacing: -0.05em;
}

/* ===== 内容区 + 侧边栏 ===== */
.content-section { padding: 56px 0; }
.content-article {}
.content-with-aside {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}
.content-main { min-width: 0; }
.content-aside { position: sticky; top: calc(var(--header-h) + var(--anchor-h) + 16px); }

/* 侧边栏样式 */
.aside-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--accent-mid);
  border-radius: var(--radius-card);
  padding: 24px 20px;
}
.aside-eyebrow {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--neon-gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.aside-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.aside-sub-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; margin-top: 0; }
.aside-nav dl { display: flex; flex-direction: column; gap: 2px; }
.aside-nav dt { display: contents; }
.aside-nav dd { margin: 0; }
.aside-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.aside-nav a:hover {
  color: var(--accent-bright);
  background: rgba(74,144,217,0.08);
  border-left-color: var(--accent-bright);
}
.aside-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}
.aside-note { font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; }

/* ===== 正文 page.content 样式 ===== */
.content-main h2 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 2.5em 0 0.75em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--border);
  line-height: 1.35;
}
.content-main h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent-bright);
  margin: 2em 0 0.6em;
  line-height: 1.4;
}
.content-main h4 { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin: 1.5em 0 0.5em; }
.content-main p { font-size: 1rem; line-height: 1.8; color: var(--text-secondary); margin-bottom: 1.2em; }
.content-main strong { color: var(--text-primary); font-weight: 600; }
.content-main em { color: var(--neon-gold); font-style: normal; }
.content-main ul, .content-main ol { margin: 1em 0 1.2em 0; padding-left: 1.5em; }
.content-main ul { list-style: disc; }
.content-main ol { list-style: decimal; }
.content-main li { font-size: 1rem; line-height: 1.75; color: var(--text-secondary); margin-bottom: 0.4em; }
.content-main a { color: var(--accent-bright); border-bottom: 1px solid transparent; transition: border-color var(--transition); }
.content-main a:hover { border-bottom-color: var(--accent-bright); }
.content-main blockquote {
  border-left: 3px solid var(--accent-mid);
  background: var(--bg-card);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 16px 20px;
  margin: 1.5em 0;
  color: var(--text-secondary);
  font-style: italic;
}
.content-main table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.9rem; }
.content-main th { background: var(--bg-card2); color: var(--text-primary); font-weight: 600; padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.content-main td { padding: 9px 14px; border: 1px solid var(--border); color: var(--text-secondary); }
.content-main tr:nth-child(even) td { background: rgba(18,18,18,0.5); }

/* article 区块分隔（page.content 里的 article） */
.content-main article {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}
.content-main article:last-child { border-bottom: none; }

/* small 眉题（h2/h3前） */
.content-main small {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--neon-gold);
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ===== 卡片（通用） ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  border-bottom: 3px solid var(--accent-mid);
  padding: 24px;
  transition: border-bottom-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  border-bottom-color: var(--accent-bright);
  box-shadow: 0 4px 24px rgba(74,144,217,0.12);
  transform: translateY(-2px);
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-accent);
  margin-top: auto;
}
.footer-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.footer-brand-block { text-align: center; }
.footer-brand-large {
  display: block;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 1px rgba(74,144,217,0.4);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 12px;
  user-select: none;
}
.footer-brand-desc { font-size: 0.875rem; color: var(--text-muted); max-width: 480px; margin: 0 auto; line-height: 1.6; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.footer-col-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-bright);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col dl { display: flex; flex-direction: column; gap: 4px; }
.footer-col dt { display: contents; }
.footer-col dd { margin: 0; }
.footer-col a {
  display: block;
  padding: 6px 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--transition);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.footer-col a:hover { color: var(--accent-bright); }
.footer-info-item, .footer-kw-item {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 5px 0;
  line-height: 1.5;
}
.footer-bottom {
  border-top: 1px solid var(--border);
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom-nav dl { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.footer-bottom-nav dt { display: contents; }
.footer-bottom-nav dd { margin: 0; }
.footer-bottom-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-radius: 6px;
  min-height: 40px;
  transition: color var(--transition), background var(--transition);
}
.footer-bottom-nav a:hover { color: var(--accent-bright); background: rgba(74,144,217,0.08); }
.footer-copyright { font-size: 0.75rem; color: var(--text-muted); }

/* ===== 动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .nav-pill { transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
  .card { transition: border-bottom-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease; }
  .hero-cta { transition: background 0.2s ease, box-shadow 0.25s ease; }

  /* stagger list animation */
  .anchor-pills .nav-pill {
    opacity: 0;
    transform: translateY(-6px);
    animation: pillFadeIn 0.3s ease forwards;
  }
  .anchor-pills .nav-pill:nth-child(1) { animation-delay: 0.05s; }
  .anchor-pills .nav-pill:nth-child(2) { animation-delay: 0.10s; }
  .anchor-pills .nav-pill:nth-child(3) { animation-delay: 0.15s; }
  .anchor-pills .nav-pill:nth-child(4) { animation-delay: 0.20s; }
  .anchor-pills .nav-pill:nth-child(5) { animation-delay: 0.25s; }
  .anchor-pills .nav-pill:nth-child(6) { animation-delay: 0.30s; }
  .anchor-pills .nav-pill:nth-child(7) { animation-delay: 0.35s; }

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

  .hero-text-col { animation: heroSlideIn 0.5s ease 0.1s both; }
  .hero-img-col { animation: heroSlideIn 0.5s ease 0.25s both; }
  @keyframes heroSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .content-with-aside { grid-template-columns: 1fr; }
  .content-aside { position: static; }
  .aside-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }
  .header-search { display: none; }
  .nav-toggle { display: flex; }
  .sticky-anchor-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    height: auto;
  }
  .sticky-anchor-nav.open {
    max-height: 200px;
    overflow-x: auto;
  }
  .anchor-pills { padding: 10px 16px; gap: 6px; }
  .wrap { padding: 0 16px; }
  .hero-layout { flex-direction: column; padding: 32px 0; gap: 24px; }
  .hero-img-col { width: 100%; max-width: 100%; flex: none; }
  .hero-img-placeholder { min-height: 180px; }
  .hero-h1 { font-size: 1.75rem; }
  .hero-eyebrow { font-size: 0.6875rem; }
  .hero-cta { height: 44px; }
  .hero-bg-number { font-size: 5rem; }
  .content-section { padding: 32px 0; }
  .aside-inner { grid-template-columns: 1fr; }
  .footer-top { padding: 40px 16px 28px; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .footer-bottom-nav dl { gap: 2px; }
}

@media (max-width: 480px) {
  .footer-cols { grid-template-columns: 1fr; }
  .footer-brand-large { font-size: 2.5rem; }
  .content-main h2 { font-size: 1.25rem; }
  .anchor-pills .nav-pill { padding: 0 12px; font-size: 0.75rem; }
}

/* ===== 滚动条样式 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-accent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-mid); }

/* ===== 选中色 ===== */
::selection { background: rgba(74,144,217,0.3); color: var(--text-primary); }

/* ===== focus 环 ===== */
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }
