/* ==========================================================================
   【风格 07 · 全知之眼】高塔守望风 - 全局样式表
   暗夜褐底 (#14100C) · 烛金主字 (#E8D9BE) · 烈焰金点缀 (#F0A028)
   标题衬线粗体带烛光质感 · 正文黑体 · 卡片深色石塔质感 · 金细边 · 圆角 10px
   符合 WCAG 2.1 AA 对比度 (>= 4.5:1) · 无障碍焦点可见 · 减弱动效适配
   ========================================================================== */

:root {
  --bg-dark: #14100C;
  --bg-stone: #1B1510;
  --bg-stone-alt: #231C16;
  --bg-stone-surface: rgba(35, 27, 20, 0.75);
  
  --text-candle: #E8D9BE;
  --text-candle-muted: #BFA785;
  --text-subtle: #9E876C; /* 提亮至 5.2:1+ 对比度，严格满足 WCAG 4.5:1 要求 */
  
  --flame-gold: #F0A028;
  --flame-gold-glow: rgba(240, 160, 40, 0.45);
  --flame-gold-subtle: rgba(240, 160, 40, 0.15);
  --flame-gold-border: rgba(240, 160, 40, 0.28);
  
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", SimSun, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  
  --radius-card: 10px;
  --radius-btn: 8px;
  --radius-full: 9999px;
  
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-candle);
  line-height: 1.65;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* 无障碍键盘访问：跳到主要内容入口 */
.skip-link {
  position: absolute;
  top: -70px;
  left: 20px;
  background: var(--flame-gold);
  color: #14100C;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: var(--radius-btn);
  z-index: 9999;
  transition: top 0.25s ease;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 15px;
  outline: 3px solid #FFF3D6;
  outline-offset: 2px;
}

/* 无障碍焦点样式支持 */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--flame-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 锚点滚动吸顶留白 (防止 74px 吸顶页眉遮挡目标标题) */
section[id],
article[id],
div[id] {
  scroll-margin-top: 85px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section {
  padding: 85px 0;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 52px auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--flame-gold);
  background: var(--flame-gold-subtle);
  border: 1px solid var(--flame-gold-border);
  border-radius: var(--radius-full);
  margin-bottom: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-candle);
  margin-bottom: 16px;
  text-shadow: 0 0 25px rgba(240, 160, 40, 0.35);
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-candle-muted);
  line-height: 1.7;
}

/* 顶部导航 */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 16, 12, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--flame-gold-border);
  height: 74px;
  display: flex;
  align-items: center;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-candle);
}

.brand-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2a2016 0%, #15100c 100%);
  border: 1px solid var(--flame-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px var(--flame-gold-glow);
}

.brand-text {
  color: var(--text-candle);
  text-shadow: 0 0 15px rgba(240, 160, 40, 0.5);
}

.brand-sub {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--flame-gold);
  margin-left: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-candle-muted);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--flame-gold);
}

.nav-link.highlight {
  color: var(--flame-gold);
  font-weight: 700;
}

.nav-cta {
  display: flex;
  align-items: center;
}

/* 按钮 - 提升特异性避免使用 !important */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.96rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  min-height: 46px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn.btn-primary {
  background: var(--flame-gold);
  color: #14100C;
  border: 1px solid #ffbe4d;
  box-shadow: 0 4px 20px rgba(240, 160, 40, 0.45);
}

.btn.btn-primary::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -80%;
  width: 45px;
  height: 220%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
  opacity: 0;
}

.btn.btn-primary:hover::after {
  left: 150%;
  opacity: 1;
  transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.btn.btn-primary:hover {
  background: #ffab33;
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(240, 160, 40, 0.7);
  color: #0c0907;
}

.btn.btn-secondary {
  background: var(--bg-stone);
  border: 1px solid var(--flame-gold-border);
  color: var(--text-candle);
}

.btn.btn-secondary:hover {
  background: var(--bg-stone-alt);
  border-color: var(--flame-gold);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-lg {
  padding: 14px 34px;
  font-size: 1.05rem;
  min-height: 52px;
}

.btn-block {
  width: 100%;
}

/* 文章与石塔卡片通用规范 */
.subpage-hero {
  padding: 68px 0 44px 0;
  text-align: center;
  border-bottom: 1px solid var(--flame-gold-border);
  background: radial-gradient(circle at 50% 0%, rgba(240, 160, 40, 0.14) 0%, transparent 60%);
}

.subpage-title {
  font-family: var(--font-serif);
  font-size: 2.7rem;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--text-candle);
  text-shadow: 0 0 25px rgba(240, 160, 40, 0.4);
}

.text-gradient, .text-flame {
  color: var(--flame-gold);
  text-shadow: 0 0 20px var(--flame-gold-glow);
}

.subpage-desc {
  font-size: 1.06rem;
  color: var(--text-candle-muted);
  max-width: 650px;
  margin: 0 auto;
}

.article-content {
  max-width: 880px;
  margin: 50px auto 80px auto;
  background: var(--bg-stone);
  background-image: linear-gradient(180deg, rgba(38, 28, 20, 0.85) 0%, rgba(20, 16, 12, 0.95) 100%);
  border: 1px solid var(--flame-gold-border);
  border-radius: var(--radius-card);
  padding: 48px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
}

.article-section {
  margin-bottom: 38px;
}

.article-section:last-child {
  margin-bottom: 0;
}

.article-heading {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-candle);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-heading svg {
  color: var(--flame-gold);
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.article-text {
  font-size: 1.02rem;
  color: var(--text-candle-muted);
  line-height: 1.8;
  margin-bottom: 14px;
}

.article-list {
  padding-left: 20px;
  color: var(--text-candle-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.article-list li {
  margin-bottom: 8px;
}

.info-box {
  background: rgba(240, 160, 40, 0.08);
  border-left: 4px solid var(--flame-gold);
  padding: 16px 22px;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  margin: 22px 0;
}

.info-box p {
  color: var(--text-candle);
  font-size: 0.96rem;
  margin: 0;
  line-height: 1.7;
}

.danger-box {
  background: rgba(239, 68, 68, 0.09);
  border-left: 4px solid #ef4444;
  padding: 16px 22px;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  margin: 22px 0;
}

.danger-box p {
  color: #fca5a5;
  font-size: 0.96rem;
  margin: 0;
  line-height: 1.7;
}

.node-grid, .sitemap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 18px 0;
}

.node-card, .sitemap-box {
  background: rgba(20, 16, 12, 0.85);
  border: 1px solid var(--flame-gold-border);
  padding: 18px 20px;
  border-radius: var(--radius-card);
}

.node-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.node-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-candle);
}

.node-badge {
  font-size: 0.76rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--flame-gold-subtle);
  color: var(--flame-gold);
  border: 1px solid var(--flame-gold-border);
}

.sitemap-box h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin-bottom: 14px;
  color: var(--text-candle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sitemap-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sitemap-links a {
  color: var(--text-candle-muted);
  font-size: 0.94rem;
  transition: var(--transition);
}

.sitemap-links a:hover {
  color: var(--flame-gold);
}

/* FAQ 折叠组件样式 */
.article-faq-wrap, .faq-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-faq-item, .faq-item {
  background: rgba(20, 16, 12, 0.85);
  border: 1px solid var(--flame-gold-border);
  border-radius: 8px;
  overflow: hidden;
  transition: var(--transition);
}

.article-faq-item[open], .faq-item[open] {
  border-color: rgba(240, 160, 40, 0.55);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.article-faq-question, .faq-question {
  padding: 14px 18px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-candle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
  background: rgba(35, 27, 20, 0.4);
}

.article-faq-question::-webkit-details-marker,
.faq-question::-webkit-details-marker {
  display: none;
}

.article-faq-q-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-faq-q-text svg {
  color: var(--flame-gold);
  flex-shrink: 0;
}

.article-faq-icon, .faq-icon {
  width: 16px;
  height: 16px;
  color: var(--flame-gold);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.article-faq-item[open] .article-faq-icon,
.faq-item[open] .faq-icon {
  transform: rotate(180deg);
}

.article-faq-answer, .faq-answer {
  padding: 14px 18px 16px 18px;
  font-size: 0.94rem;
  color: var(--text-candle-muted);
  line-height: 1.75;
  border-top: 1px solid rgba(240, 160, 40, 0.12);
  background: rgba(14, 11, 8, 0.6);
}

/* 页脚 */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--flame-gold-border);
  background: #0E0B08;
  padding: 44px 0 36px 0;
}

.footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-candle-muted);
  padding: 6px 14px;
  border-radius: 6px;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--flame-gold);
  background: var(--flame-gold-subtle);
}

.footer-copy {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-subtle);
}

/* 响应式 */
@media (max-width: 768px) {
  .article-content {
    padding: 26px 20px;
  }
  .node-grid, .sitemap-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
  .subpage-title {
    font-size: 2rem;
  }
  .footer-nav {
    flex-direction: column;
    gap: 14px;
  }
}

/* 无障碍系统动效减弱偏好 (Prefers-Reduced-Motion) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #watchtowerCanvas {
    display: none !important;
  }
}
