@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');

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 17px;
  line-height: 1.7;
}

body.body-root {
  background-color: #1f1726;
  color: #e8dff4;
  font-family: 'Noto Naskh Arabic', 'Noto Sans Arabic', 'Georgia', 'STSong', '宋体', serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 滚动对齐 ===== */
article[id] {
  scroll-margin-top: 80px;
}

/* ===== 布局骨架 ===== */
.page-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-wrap {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== 左侧固定导航 ===== */
.site-nav-footer {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: linear-gradient(180deg, #2a1a3a 0%, #1f1726 60%, #2d1505 100%);
  border-right: 1px solid rgba(86,34,139,0.35);
  z-index: 100;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidenav {
  display: flex;
  flex-direction: column;
  padding: 32px 20px 24px;
  height: 100%;
}

.sidenav-brand {
  margin-bottom: 36px;
}

.brand-link {
  text-decoration: none;
  display: block;
  padding: 8px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.brand-text {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #c9a8f0;
  letter-spacing: 0.04em;
  line-height: 1.3;
  display: block;
}

.brand-logo-img {
  max-width: 140px;
  height: auto;
  border-radius: 10px;
}

.nav-dl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
}

.nav-item {
  display: block;
}

.nav-item dd {
  margin: 0;
  padding: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  color: #cbb8e8;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 18px;
  transition: background 0.22s ease, color 0.22s ease, transform 0.18s ease;
  position: relative;
  min-height: 44px;
  line-height: 1.4;
}

.nav-link::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8b4513;
  margin-right: 10px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(86,34,139,0.35);
  color: #e8d5ff;
  transform: translateX(4px);
  outline: none;
}

.nav-link:hover::before,
.nav-link:focus-visible::before {
  background: #c9a8f0;
}

/* ===== Hero 区 ===== */
.hero-section {
  position: relative;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #2d1045 0%, #1f1726 55%, #3a1a08 100%);
}

.hero-blob-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.blob-svg {
  position: absolute;
  top: -40px;
  right: -60px;
  width: 520px;
  height: auto;
  opacity: 0.7;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 56px 48px 28px;
  max-width: 680px;
  text-align: left;
}

.hero-h1 {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #e8d5ff;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.hero-desc {
  font-size: 1rem;
  color: #b89fd4;
  line-height: 1.7;
  max-width: 520px;
}

.hero-divider {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  line-height: 0;
}

.hero-svg {
  width: 100%;
  height: 80px;
  display: block;
}

/* ===== 主内容区 ===== */
.content-main {
  flex: 1;
  padding: 0 40px 40px;
}

.content-section {
  position: relative;
  padding: 40px 0;
}

.content-section--primary {
  display: grid;
  grid-template-columns: 1fr 220px;
  grid-template-rows: auto 1fr;
  gap: 32px;
  align-items: start;
}

.content-figure {
  position: absolute;
  top: 0;
  left: -60px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.section-blob {
  width: 320px;
  height: auto;
}

.page-content {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 1;
}

.content-aside {
  grid-column: 2;
  grid-row: 1 / 3;
  background: linear-gradient(160deg, #2a1a3a 0%, #241630 100%);
  border: 1px solid rgba(86,34,139,0.3);
  border-radius: 20px;
  padding: 24px 20px;
  position: sticky;
  top: 20px;
  box-shadow: 0 8px 32px rgba(31,23,38,0.5);
}

.aside-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #9d72cc;
  margin-bottom: 16px;
  letter-spacing: 0.08em;
}

.aside-title span {
  display: inline;
}

.aside-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-link {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  color: #cbb8e8;
  text-decoration: none;
  font-size: 0.88rem;
  border-radius: 12px;
  transition: background 0.2s, color 0.2s;
  min-height: 40px;
  line-height: 1.5;
}

.aside-link:hover,
.aside-link:focus-visible {
  background: rgba(86,34,139,0.28);
  color: #e0ccff;
  outline: none;
}

/* ===== 正文内容样式 ===== */
.page-content h2 {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #d4b8ff;
  margin: 48px 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(86,34,139,0.4);
  line-height: 1.35;
}

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

.page-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #c4a0f0;
  margin: 32px 0 14px;
}

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

.page-content p {
  color: #d8ccec;
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 16px;
  max-width: 680px;
}

.page-content ul,
.page-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
  color: #d0c2e8;
}

.page-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.page-content a {
  color: #b088e0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.page-content a:hover {
  color: #d4b8ff;
}

.page-content strong {
  color: #e8d5ff;
  font-weight: 600;
}

.page-content article {
  padding: 36px 0;
  border-bottom: 1px solid rgba(86,34,139,0.2);
}

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

/* ===== 卡片样式（正文内可能出现） ===== */
.page-content .card,
.page-content [class*="card"] {
  background: #2a1a3a;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(31,23,38,0.4);
  border: none;
}

/* ===== 页脚 ===== */
.site-footer {
  background: linear-gradient(180deg, #1f1726 0%, #150f1e 100%);
  border-top: 1px solid rgba(86,34,139,0.2);
  margin-top: 48px;
  display: flex;
  flex-direction: column;
}

.footer-contact {
  padding: 28px 40px 20px;
  border-bottom: 1px solid rgba(86,34,139,0.15);
}

.footer-contact-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.footer-contact-item {
  font-size: 0.9rem;
  color: #9d88bb;
}

.footer-email,
.footer-tg {
  color: #b088e0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.footer-email:hover,
.footer-tg:hover {
  color: #d4b8ff;
}

.footer-bottom {
  padding: 16px 40px 24px;
}

.footer-copy {
  font-size: 0.82rem;
  color: #6b5a88;
  line-height: 1.6;
}

/* ===== Scroll Reveal 动效 ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* hover micro-interaction */
.nav-link,
.aside-link,
.footer-email,
.footer-tg {
  will-change: transform, color;
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .nav-link,
  .aside-link {
    transition: none;
  }
}

/* ===== 响应式：平板 ===== */
@media (max-width: 900px) {
  .main-wrap {
    margin-left: 200px;
  }
  .site-nav-footer {
    width: 200px;
  }
  .hero-content {
    padding: 40px 32px 24px;
  }
  .content-main {
    padding: 0 28px 32px;
  }
  .content-section--primary {
    grid-template-columns: 1fr 180px;
    gap: 24px;
  }
}

/* ===== 响应式：移动端 ===== */
@media (max-width: 680px) {
  html {
    scroll-padding-top: 56px;
  }

  article[id] {
    scroll-margin-top: 56px;
  }

  .page-wrapper {
    flex-direction: column;
  }

  .main-wrap {
    margin-left: 0;
  }

  /* 移动端：导航改为顶部横向滚动 */
  .site-nav-footer {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(86,34,139,0.35);
    background: linear-gradient(90deg, #2a1a3a 0%, #1f1726 100%);
  }

  .sidenav {
    flex-direction: row;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidenav-brand {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .brand-link {
    padding: 8px 10px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .brand-text {
    font-size: 0.92rem;
    white-space: nowrap;
  }

  .nav-dl {
    flex-direction: row;
    gap: 4px;
    flex-wrap: nowrap;
  }

  .nav-item {
    flex-shrink: 0;
  }

  .nav-link {
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 0.85rem;
    min-height: 44px;
    border-radius: 22px;
  }

  .nav-link::before {
    display: none;
  }

  .hero-section {
    min-height: 38vh;
  }

  .hero-content {
    padding: 32px 20px 16px;
  }

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

  .blob-svg {
    width: 280px;
    top: -20px;
    right: -30px;
  }

  .content-main {
    padding: 0 16px 24px;
  }

  .content-section--primary {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 24px;
  }

  .content-aside {
    grid-column: 1;
    grid-row: 2;
    position: static;
  }

  .aside-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .aside-link {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 0.83rem;
    border-radius: 20px;
    background: rgba(86,34,139,0.15);
    min-height: 40px;
  }

  .content-figure {
    display: none;
  }

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

  .footer-contact {
    padding: 20px 16px 16px;
  }

  .footer-bottom {
    padding: 12px 16px 20px;
  }

  .footer-contact-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* ===== 图片 ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* ===== 无障碍焦点 ===== */
:focus-visible {
  outline: 2px solid #c9a8f0;
  outline-offset: 3px;
}

/* ===== 滚动条美化（Webkit） ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #1f1726;
}
::-webkit-scrollbar-thumb {
  background: #56228b;
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: #7a35c4;
}
