@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 {
  --c-white: #ffffff;
  --c-bg: #f5f5f5;
  --c-ink: #1f1f1f;
  --c-ink-60: rgba(31,31,31,0.6);
  --c-ink-20: rgba(31,31,31,0.12);
  --c-accent: #c8102e;
  --c-accent-dark: #9a0c24;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.14), 0 4px 10px rgba(0,0,0,0.10);
  --shadow-xl: 0 20px 48px rgba(0,0,0,0.18), 0 8px 20px rgba(0,0,0,0.12);

  --radius-card: 10px;
  --radius-btn: 6px;

  --ff-body: 'Noto Naskh Arabic', 'Noto Sans Arabic', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

  --nav-height: 60px;
  --header-height: 56px;

  --max-w: 1100px;
  --gap: 24px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-ink);
  background: var(--c-bg);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 8px);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
h1,h2,h3,h4 { line-height: 1.3; font-weight: 700; color: var(--c-ink); }
h1 { font-size: clamp(1.5rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.8rem); }
h3 { font-size: clamp(1rem, 2.5vw, 1.3rem); }
p { margin-bottom: 0.8em; }
p:last-child { margin-bottom: 0; }
time { font-size: 0.85rem; color: var(--c-ink-60); }

hr {
  border: none;
  border-top: 2px solid var(--c-ink-20);
  margin: 0.6em 0 1.2em;
}

/* ===== 页面容器 ===== */
.site-wrapper {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 顶部 Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--c-white);
  box-shadow: var(--shadow-sm);
  height: var(--header-height);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { border-radius: 4px; }
.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-ink);
  white-space: nowrap;
}
.brand-name:hover { text-decoration: none; color: var(--c-accent); }
.breadcrumb {
  font-size: 0.82rem;
  color: var(--c-ink-60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breadcrumb a { color: var(--c-ink-60); }
.breadcrumb a:hover { color: var(--c-accent); }

/* ===== 底部固定导航 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--c-ink);
  box-shadow: 0 -2px 16px rgba(0,0,0,0.18);
  height: var(--nav-height);
}
.bottom-nav > ol {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.bottom-nav > ol::-webkit-scrollbar { display: none; }
.bottom-nav > ol > li {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
}
.bottom-nav > ol > li:last-child > a {
  background: var(--c-accent);
  font-weight: 700;
}
.bottom-nav > ol > li:last-child > a:hover {
  background: var(--c-accent-dark);
}
.bottom-nav > ol > li > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--nav-height);
  padding: 0 8px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.85);
  text-align: center;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s;
  line-height: 1.2;
}
.bottom-nav > ol > li > a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

/* ===== 通用区块 ===== */
article {
  position: relative;
  padding: 32px var(--gap);
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ===== Hero (首页) ===== */
.hero-section {
  min-height: 45vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
  padding-top: 48px;
  padding-bottom: 48px;
}
.hero-text {
  position: relative;
  z-index: 2;
}
.hero-text h1 {
  margin-bottom: 16px;
}
.hero-desc {
  font-size: 1rem;
  color: var(--c-ink-60);
  margin-bottom: 24px;
  max-width: 480px;
}
.hero-aside {
  position: relative;
  z-index: 1;
}
.hero-imgs {
  position: relative;
  height: 42vh;
  min-height: 240px;
}
.hero-fig {
  position: absolute;
  overflow: hidden;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xl);
}
.hero-fig--main {
  top: 0;
  left: 0;
  width: 72%;
  height: 85%;
  z-index: 2;
  transform: translateZ(0);
}
.hero-fig--sub {
  bottom: 0;
  right: 0;
  width: 56%;
  height: 65%;
  z-index: 3;
  transform: translate(-8px, -8px) translateZ(8px);
  box-shadow: var(--shadow-xl);
}
.hero-fig img, .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 按钮 ===== */
.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--c-accent);
  color: #fff;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-md);
  transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
  min-height: 44px;
  line-height: 1.4;
}
.btn-primary:hover {
  background: var(--c-accent-dark);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
  color: #fff;
}
.btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  border: 2px solid var(--c-ink);
  color: var(--c-ink);
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.18s, color 0.18s;
  min-height: 44px;
  line-height: 1.4;
}
.btn-secondary:hover {
  background: var(--c-ink);
  color: var(--c-white);
  text-decoration: none;
}

/* ===== 内容区 + aside 双栏 ===== */
.content-section,
.channel-content-section,
.article-related-section,
.about-intro-section,
.privacy-section,
.default-section {
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-rows: auto auto;
  gap: var(--gap);
  align-items: start;
}
.content-section h2,
.channel-content-section h2,
.article-related-section h2,
.about-intro-section h1,
.privacy-section h1,
.default-section h1 {
  grid-column: 1 / -1;
}
.content-section > hr,
.channel-content-section > hr,
.article-related-section > hr,
.about-intro-section > hr,
.privacy-section > hr,
.default-section > hr {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.content-figure,
.channel-content-fig,
.related-figure,
.about-fig,
.privacy-fig,
.default-fig,
.about-content-fig {
  position: relative;
  z-index: 1;
}

/* ===== aside 样式 ===== */
.content-aside,
.channel-aside,
.article-aside,
.about-aside,
.privacy-aside,
.default-aside {
  position: sticky;
  top: calc(var(--header-height) + 12px);
  background: var(--c-white);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-md);
  z-index: 2;
}
.content-aside h3,
.channel-aside h3,
.article-aside h3,
.about-aside h3,
.privacy-aside h3,
.default-aside h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}
.aside-nav { display: flex; flex-direction: column; gap: 4px; }
.aside-nav li a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--c-ink);
  transition: background 0.15s;
  min-height: 40px;
  line-height: 1.3;
  display: flex;
  align-items: center;
}
.aside-nav li a:hover {
  background: var(--c-bg);
  text-decoration: none;
  color: var(--c-accent);
}
.aside-parent { margin-top: 16px; }

/* ===== 层叠卡片 ===== */
.layer-card {
  background: var(--c-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: box-shadow 0.22s, transform 0.22s;
}
.layer-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px) translateZ(0);
  z-index: 3;
}

/* ===== 频道卡片网格 ===== */
.channels-section { padding-top: 16px; }
.channels-section h2 { margin-bottom: 6px; }
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--gap);
  margin-top: 8px;
}
.channels-figure { grid-column: 1 / -1; }
.ch-card { display: flex; flex-direction: column; }
.card-fig { margin: 0; overflow: hidden; aspect-ratio: 16/9; }
.card-fig img, .card-img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-body h3 { font-size: 1rem; }
.card-body p { font-size: 0.85rem; color: var(--c-ink-60); flex: 1; }
.card-link {
  align-self: flex-start;
  padding: 8px 16px;
  background: var(--c-accent);
  color: #fff;
  border-radius: var(--radius-btn);
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: background 0.15s;
}
.card-link:hover { background: var(--c-accent-dark); text-decoration: none; color: #fff; }

/* ===== 文章卡片网格 ===== */
.articles-section {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--gap);
  align-items: start;
  padding-top: 16px;
}
.articles-section h2 { grid-column: 1 / -1; }
.articles-section > hr { grid-column: 1 / -1; margin-bottom: 0; }
.articles-figure { }
.articles-aside {
  position: sticky;
  top: calc(var(--header-height) + 12px);
  background: var(--c-white);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-md);
}
.articles-aside h3 { margin-bottom: 6px; font-size: 1rem; }
.articles-aside p { font-size: 0.85rem; color: var(--c-ink-60); }
.articles-aside a { font-size: 0.85rem; }
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--gap);
}
.art-card {
  padding: 18px;
}
.art-card__meta { margin-bottom: 6px; }
.art-card h3 { font-size: 0.95rem; margin-bottom: 6px; }
.art-card h3 a { color: var(--c-ink); }
.art-card h3 a:hover { color: var(--c-accent); text-decoration: none; }
.art-card p { font-size: 0.82rem; color: var(--c-ink-60); }

/* ===== 频道页 ===== */
.channel-hero-section {
  background: var(--c-white);
  border-radius: var(--radius-card);
  padding: 40px var(--gap);
  box-shadow: var(--shadow-md);
  max-width: var(--max-w);
  margin: 24px auto 0;
}
.channel-h1 { margin-bottom: 12px; }
.channel-desc { color: var(--c-ink-60); font-size: 1rem; margin-bottom: 8px; }
.channel-date { display: block; font-size: 0.82rem; color: var(--c-ink-60); }

.child-list-section { padding-top: 8px; }
.child-list-fig { overflow-x: auto; }
.child-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.child-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--c-ink);
  color: var(--c-white);
  font-weight: 600;
}
.child-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-ink-20);
  vertical-align: top;
}
.child-table tr:nth-child(even) td { background: rgba(245,245,245,0.6); }
.child-table tr:hover td { background: rgba(200,16,46,0.06); }
.child-table td a { color: var(--c-ink); font-weight: 500; }
.child-table td a:hover { color: var(--c-accent); }

/* ===== 文章页 ===== */
.article-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: var(--max-w);
  margin: 24px auto 0;
  padding: 0 var(--gap);
}
.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.article-hero-fig {
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  max-height: 420px;
}
.article-hero-img { width: 100%; object-fit: cover; }
.article-placeholder-aside {
  display: none;
}
.article-body {
  background: var(--c-white);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

/* ===== 相关文章 ===== */
.related-list { display: flex; flex-direction: column; gap: 8px; }
.related-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--c-bg);
  border-radius: 6px;
  flex-wrap: wrap;
}
.related-list li a { color: var(--c-ink); font-size: 0.9rem; font-weight: 500; }
.related-list li a:hover { color: var(--c-accent); }

/* ===== About / Privacy 页 ===== */
.about-intro-section {
  margin-top: 24px;
}
.about-quote {
  font-size: 1.05rem;
  border-left: 4px solid var(--c-accent);
  padding: 12px 16px;
  background: var(--c-white);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  box-shadow: var(--shadow-sm);
  color: var(--c-ink);
  font-style: normal;
  margin: 0;
}
.about-content-section,
.about-links-section { padding-top: 0; }
.about-content-fig,
.about-links-fig { background: var(--c-white); border-radius: var(--radius-card); padding: 24px; box-shadow: var(--shadow-sm); }
.about-links { display: flex; flex-wrap: wrap; gap: 10px; }
.about-links li a {
  display: block;
  padding: 10px 18px;
  background: var(--c-bg);
  border-radius: 6px;
  color: var(--c-ink);
  font-size: 0.9rem;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}
.about-links li a:hover { background: var(--c-accent); color: #fff; text-decoration: none; }

.privacy-section { margin-top: 24px; }
.privacy-date { display: block; margin-bottom: 12px; font-size: 0.85rem; color: var(--c-ink-60); }
.privacy-body { background: var(--c-white); border-radius: var(--radius-card); padding: 24px; box-shadow: var(--shadow-sm); }

/* ===== 正文 HTML 样式 ===== */
.page-content h2,
.page-content h3 { margin: 1.4em 0 0.4em; }
.page-content p { margin-bottom: 0.8em; }
.page-content ul, .page-content ol { padding-left: 1.4em; margin-bottom: 0.8em; list-style: disc; }
.page-content ol { list-style: decimal; }
.page-content li { margin-bottom: 0.3em; line-height: 1.6; }
.page-content a { color: var(--c-accent); }
.page-content a:hover { text-decoration: underline; }
.page-content table { width: 100%; border-collapse: collapse; margin-bottom: 1em; font-size: 0.9rem; }
.page-content th { background: var(--c-ink); color: #fff; padding: 8px 12px; text-align: left; }
.page-content td { border-bottom: 1px solid var(--c-ink-20); padding: 8px 12px; }
.page-content img { border-radius: 6px; margin: 1em 0; box-shadow: var(--shadow-sm); }
.page-content blockquote { border-left: 4px solid var(--c-accent); padding: 10px 16px; margin: 1em 0; background: var(--c-bg); border-radius: 0 6px 6px 0; }
.page-content hr { border: none; border-top: 2px solid var(--c-ink-20); margin: 1.5em 0; }
.page-content strong { font-weight: 700; }
.page-content em { font-style: italic; }
.page-content code { background: var(--c-bg); padding: 2px 6px; border-radius: 4px; font-size: 0.88em; font-family: monospace; }
.page-content pre { background: var(--c-ink); color: #f5f5f5; padding: 16px; border-radius: 6px; overflow-x: auto; margin-bottom: 1em; }

/* ===== 页脚 ===== */
.site-footer {
  max-width: var(--max-w);
  margin: 32px auto 0;
  padding: 20px var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--c-ink-20);
}
.footer-copyright { font-size: 0.82rem; color: var(--c-ink-60); }
.footer-links { font-size: 0.82rem; }
.footer-links a { color: var(--c-ink-60); margin: 0 4px; }
.footer-links a:hover { color: var(--c-accent); }

/* ===== Scroll Reveal ===== */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  [data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  :root { --gap: 16px; }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 24px;
    padding-bottom: 24px;
  }
  .hero-aside { order: -1; }
  .hero-imgs { height: 40vw; min-height: 180px; }

  .content-section,
  .channel-content-section,
  .article-related-section,
  .about-intro-section,
  .privacy-section,
  .default-section,
  .articles-section {
    grid-template-columns: 1fr;
  }
  .content-aside,
  .channel-aside,
  .article-aside,
  .about-aside,
  .privacy-aside,
  .articles-aside,
  .default-aside {
    position: static;
  }

  .channels-grid { grid-template-columns: 1fr 1fr; }
  .articles-grid { grid-template-columns: 1fr; }

  .bottom-nav > ol > li > a { font-size: 0.62rem; padding: 0 4px; }

  .article-section { padding: 0 var(--gap); }
  .article-body { padding: 16px; }

  .child-table { font-size: 0.8rem; }
  .child-table th, .child-table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
  .channels-grid { grid-template-columns: 1fr; }
  .hero-imgs { height: 50vw; }
  h1 { font-size: 1.35rem; }
  .brand-name { font-size: 0.9rem; }
}
