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

/* ===== CSS 变量 ===== */
:root {
  --c-primary: #80ff00;
  --c-secondary: #00ff00;
  --c-dark: #1f2617;
  --c-dark2: #2a3320;
  --c-dark3: #161c10;
  --c-text: #e8f5d0;
  --c-text-muted: #a0b870;
  --c-accent: #ccff33;
  --c-warn: #ff6b00;
  --nav-w: 220px;
  --radius: 4px;
  --font-main: 'Noto Naskh Arabic', 'Noto Sans Arabic', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --transition: 0.2s ease;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--c-dark);
  color: var(--c-text);
  font-family: var(--font-main);
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-secondary); text-decoration: underline; }
ul, ol { list-style: none; }

/* ===== Page Shell ===== */
.page-shell {
  display: flex;
  min-height: 100vh;
}

/* ===== Side Nav ===== */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--c-dark3);
  border-right: 2px solid var(--c-primary);
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.brand-icon-wrap {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--c-dark2);
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--c-primary);
  border-radius: var(--radius);
  color: var(--c-dark);
  font-weight: 700;
  transition: transform var(--transition);
}
.brand-icon:hover { transform: rotate(-6deg) scale(1.1); text-decoration: none; }

.brand-glyph {
  font-size: 22px;
  font-weight: 700;
  color: var(--c-dark);
  line-height: 1;
}

.side-nav nav {
  flex: 1;
  padding: 12px 0;
}

.side-nav nav ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}

.side-nav nav ul li a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--c-text-muted);
  line-height: 1.4;
  transition: background var(--transition), color var(--transition);
  border-bottom: 2px solid transparent;
}

.side-nav nav ul li a:hover,
.side-nav nav ul li a[aria-current="page"] {
  background: var(--c-dark2);
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
  text-decoration: none;
}

.nav-cta-btn {
  display: block;
  margin: 12px 12px 20px;
  padding: 12px 16px;
  background: var(--c-primary);
  color: var(--c-dark);
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius);
  text-align: center;
  transition: background var(--transition), transform var(--transition);
  min-height: 44px;
  line-height: 20px;
}
.nav-cta-btn:hover {
  background: var(--c-secondary);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--c-dark);
}

/* ===== Main Wrap ===== */
.main-wrap {
  margin-left: var(--nav-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ===== Hero Section (Home) ===== */
.hero-section {
  display: flex;
  align-items: stretch;
  min-height: 70vh;
  background: var(--c-dark3);
  border-bottom: 4px solid var(--c-primary);
  overflow: hidden;
  position: relative;
}

.hero-media {
  flex: 1 1 45%;
  position: relative;
  overflow: hidden;
  min-height: 300px;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(150%) contrast(1.1);
}

.hero-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--c-dark2) 0%, var(--c-dark3) 60%, #0d1209 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-deco-text {
  font-size: clamp(80px, 15vw, 180px);
  font-weight: 700;
  color: var(--c-primary);
  opacity: 0.15;
  user-select: none;
  filter: blur(1px);
  animation: jitter 4s infinite;
}

.hero-text {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 48px 40px 48px 24px;
  gap: 18px;
}

.hero-eyebrow {
  display: inline-block;
  background: var(--c-primary);
  color: var(--c-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: var(--radius);
  text-transform: uppercase;
}

.hero-text h1 {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-text);
}

.hero-desc {
  font-size: 17px;
  color: var(--c-text-muted);
  max-width: 420px;
  line-height: 1.7;
}

.btn-primary {
  display: inline-block;
  padding: 14px 28px;
  background: var(--c-primary);
  color: var(--c-dark);
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--radius);
  border-bottom: 4px solid rgba(0,0,0,0.35);
  transition: transform var(--transition), background var(--transition);
  min-height: 44px;
  line-height: 16px;
}
.btn-primary:hover {
  background: var(--c-secondary);
  transform: translateY(-3px);
  text-decoration: none;
  color: var(--c-dark);
}

/* ===== Marquee ===== */
.marquee-bar {
  background: var(--c-primary);
  color: var(--c-dark);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  border-bottom: 2px solid var(--c-secondary);
}

.marquee-inner {
  display: inline-flex;
  gap: 40px;
  animation: marqueeScroll 22s linear infinite;
}
.marquee-inner span { padding: 0 8px; }

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== Jitter animation ===== */
@keyframes jitter {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  15% { transform: translate(-2px, 1px) rotate(-0.5deg); }
  30% { transform: translate(2px, -1px) rotate(0.5deg); }
  45% { transform: translate(-1px, 2px) rotate(-0.3deg); }
  60% { transform: translate(1px, -2px) rotate(0.3deg); }
  75% { transform: translate(-2px, 0px) rotate(-0.4deg); }
}

/* ===== Channel Hero ===== */
.channel-hero {
  background: linear-gradient(135deg, var(--c-dark3) 0%, var(--c-dark2) 100%);
  border-bottom: 4px solid var(--c-primary);
  padding: 56px 40px 40px;
  position: relative;
  overflow: hidden;
}
.channel-hero::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 220px; height: 220px;
  background: var(--c-primary);
  opacity: 0.05;
  border-radius: 50%;
  filter: blur(40px);
}
.channel-hero-inner { position: relative; z-index: 1; }
.channel-hero h1 {
  font-size: clamp(26px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.2;
  margin-top: 12px;
}

/* ===== About Banner ===== */
.about-banner {
  background: var(--c-dark3);
  border-bottom: 4px solid var(--c-primary);
  padding: 56px 40px 40px;
}
.about-banner h1 { font-size: clamp(24px, 3.5vw, 42px); font-weight: 700; margin-top: 12px; }

/* ===== Privacy Banner ===== */
.privacy-banner {
  background: var(--c-dark3);
  border-bottom: 4px solid var(--c-primary);
  padding: 48px 40px 36px;
}
.privacy-banner h1 { font-size: clamp(22px, 3vw, 38px); font-weight: 700; }
.privacy-update { margin-top: 10px; color: var(--c-text-muted); font-size: 14px; }

/* ===== Main Content Layout ===== */
main {
  flex: 1;
}

/* 正文容器 main > article.wrap > div > section */
.wrap {
  max-width: 1100px;
  width: 100%;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.content-section {
  width: 100%;
}

.page-content-article {
  width: 100%;
}

/* 侧边栏布局 */
.main-wrap {
  position: relative;
}

/* 文章页：main 与 aside 并排 */
main#main-content {
  display: block;
}

/* ===== Page Aside ===== */
.page-aside {
  width: 260px;
  position: fixed;
  top: 80px;
  right: 16px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  z-index: 50;
}

.aside-inner {
  background: var(--c-dark3);
  border: 1px solid var(--c-dark2);
  border-radius: var(--radius);
  border-bottom: 4px solid var(--c-primary);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.aside-inner h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-primary);
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--c-dark2);
  padding-bottom: 8px;
}

.aside-inner p.subtitle {
  font-size: 12px;
  color: var(--c-text-muted);
  line-height: 1.5;
  margin-top: -8px;
}

.aside-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-links li a {
  display: block;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--c-text-muted);
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  line-height: 1.4;
  min-height: 32px;
}
.aside-links li a:hover {
  background: var(--c-dark2);
  color: var(--c-primary);
  text-decoration: none;
}

/* ===== Heading Styles ===== */
h1, h2, h3 {
  font-family: var(--font-main);
  font-weight: 700;
}

h2 {
  font-size: clamp(20px, 2.5vw, 28px);
  color: var(--c-text);
  line-height: 1.3;
  position: relative;
  padding-left: 14px;
}
h2::before {
  content: '';
  position: absolute;
  left: 0; top: 8%;
  width: 4px;
  height: 84%;
  background: var(--c-primary);
  border-radius: 2px;
}

p.subtitle, p.subhead, p.desc, p.lead {
  color: var(--c-text-muted);
  font-size: 15px;
  line-height: 1.65;
  margin-top: 6px;
  margin-bottom: 4px;
}

h3 {
  font-size: 17px;
  color: var(--c-text);
  line-height: 1.4;
}

/* ===== Prose Content ===== */
.prose-content {
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--c-text);
}
.prose-content h2 { margin: 28px 0 12px; font-size: 22px; }
.prose-content h3 { margin: 20px 0 10px; font-size: 18px; color: var(--c-accent); }
.prose-content p { margin-bottom: 16px; }
.prose-content ul, .prose-content ol {
  padding-left: 20px;
  margin-bottom: 16px;
}
.prose-content ul { list-style: disc; }
.prose-content ol { list-style: decimal; }
.prose-content li { margin-bottom: 6px; }
.prose-content a { color: var(--c-primary); border-bottom: 1px dotted currentColor; }
.prose-content a:hover { color: var(--c-secondary); }
.prose-content strong { color: var(--c-primary); font-weight: 700; }
.prose-content code {
  background: var(--c-dark2);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  color: var(--c-accent);
}
.prose-content pre {
  background: var(--c-dark3);
  border: 1px solid var(--c-dark2);
  border-left: 4px solid var(--c-primary);
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 16px;
}
.prose-content blockquote {
  border-left: 4px solid var(--c-primary);
  background: var(--c-dark2);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 16px 0;
  color: var(--c-text-muted);
}
.prose-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 15px;
}
.prose-content th {
  background: var(--c-dark2);
  color: var(--c-primary);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--c-primary);
}
.prose-content td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--c-dark2);
}
.prose-content tr:hover td { background: rgba(128,255,0,0.04); }

/* ===== Article Meta ===== */
.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 0 20px;
}
.article-meta time {
  font-size: 13px;
  color: var(--c-text-muted);
  background: var(--c-dark2);
  padding: 4px 10px;
  border-radius: var(--radius);
  border-bottom: 2px solid var(--c-primary);
}

.article-h1 {
  font-size: clamp(24px, 3.5vw, 42px);
  line-height: 1.2;
  margin-bottom: 8px;
}

.article-hero-wrap {
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border-bottom: 4px solid var(--c-primary);
}
.article-hero-img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  filter: saturate(130%);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb span[aria-hidden] { margin: 0 6px; }

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.card-grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.sticker-card {
  background: var(--c-dark2);
  border-radius: var(--radius);
  border-bottom: 4px solid var(--c-primary);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
  animation: fadeInUp 0.5s ease both;
}
.sticker-card:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  border-bottom-color: var(--c-secondary);
}
.sticker-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: var(--c-primary);
  opacity: 0.06;
  border-radius: 0 var(--radius) 0 50%;
}

.card-tag {
  display: inline-block;
  background: var(--c-primary);
  color: var(--c-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 0.08em;
  align-self: flex-start;
}

.sticker-card h3 {
  font-size: 16px;
  line-height: 1.4;
}
.sticker-card h3 a { color: var(--c-text); }
.sticker-card h3 a:hover { color: var(--c-primary); text-decoration: none; }

.sticker-card p {
  font-size: 14px;
  color: var(--c-text-muted);
  line-height: 1.55;
}

.card-date {
  font-size: 12px;
  color: var(--c-text-muted);
  border-top: 1px solid var(--c-dark3);
  padding-top: 8px;
  margin-top: auto;
  display: block;
}

.card-cta-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-primary);
  margin-top: auto;
}
.card-cta-link:hover { color: var(--c-secondary); text-decoration: none; }

/* ===== Channel Children DL ===== */
.child-dl {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 20px;
  border: 1px solid var(--c-dark2);
  border-radius: var(--radius);
  overflow: hidden;
}

.child-dl dt {
  background: var(--c-dark2);
  padding: 14px 20px;
  border-bottom: 1px solid var(--c-dark3);
}
.child-dl dt:last-of-type { border-bottom: none; }

.child-dl dt a {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
  display: block;
  min-height: 24px;
  line-height: 1.4;
}
.child-dl dt a:hover { color: var(--c-primary); text-decoration: none; }

.child-dl dd {
  background: var(--c-dark3);
  padding: 10px 20px 14px;
  border-bottom: 2px solid var(--c-primary);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.child-dl dd:last-child { border-bottom: none; }

.child-desc {
  font-size: 14px;
  color: var(--c-text-muted);
  line-height: 1.6;
}

.child-dl dd time {
  font-size: 12px;
  color: var(--c-text-muted);
}

/* ===== About / Privacy ===== */
.about-article, .privacy-article {
  max-width: 760px;
}
.about-date {
  margin-top: 28px;
  font-size: 13px;
  color: var(--c-text-muted);
  border-top: 1px solid var(--c-dark2);
  padding-top: 12px;
}

/* ===== Footer ===== */
footer {
  background: var(--c-dark3);
  border-top: 4px solid var(--c-primary);
  padding: 36px 40px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.footer-brand {
  font-size: clamp(28px, 5vw, 64px);
  font-weight: 700;
  color: var(--c-primary);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  animation: jitter 8s infinite;
}

footer p {
  font-size: 15px;
  color: var(--c-text-muted);
  line-height: 1.6;
}

footer small {
  display: block;
  font-size: 13px;
  color: var(--c-text-muted);
  opacity: 0.7;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.channels-section .sticker-card:nth-child(1) { animation-delay: 0.05s; }
.channels-section .sticker-card:nth-child(2) { animation-delay: 0.12s; }
.channels-section .sticker-card:nth-child(3) { animation-delay: 0.19s; }
.channels-section .sticker-card:nth-child(4) { animation-delay: 0.26s; }
.articles-section .sticker-card:nth-child(1) { animation-delay: 0.08s; }
.articles-section .sticker-card:nth-child(2) { animation-delay: 0.16s; }
.articles-section .sticker-card:nth-child(3) { animation-delay: 0.24s; }
.articles-section .sticker-card:nth-child(4) { animation-delay: 0.32s; }
.articles-section .sticker-card:nth-child(5) { animation-delay: 0.40s; }
.articles-section .sticker-card:nth-child(6) { animation-delay: 0.48s; }

/* ===== Sections Spacing ===== */
.content-section, .channels-section, .articles-section, .children-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--c-dark3); }
::-webkit-scrollbar-thumb { background: var(--c-dark2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-primary); }

/* ===== 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;
  }
  .marquee-inner { animation: none; }
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .page-aside {
    position: static;
    width: 100%;
    max-height: none;
    padding: 0 32px 20px;
  }
  .aside-inner {
    border-radius: var(--radius);
  }
}

@media (max-width: 900px) {
  :root { --nav-w: 0px; }

  .side-nav {
    position: fixed;
    top: 0; left: -240px;
    width: 240px;
    transition: left 0.28s ease;
    z-index: 200;
  }
  .side-nav.open { left: 0; }

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

  .hero-section {
    flex-direction: column;
    min-height: auto;
  }
  .hero-media { min-height: 220px; flex: none; }
  .hero-text {
    align-items: flex-start;
    text-align: left;
    padding: 32px 24px;
  }

  .wrap { padding: 24px 16px; }

  footer { padding: 28px 20px 20px; }

  .mobile-nav-toggle {
    position: fixed;
    top: 12px; left: 12px;
    z-index: 300;
    background: var(--c-primary);
    color: var(--c-dark);
    border: none;
    border-radius: var(--radius);
    width: 44px; height: 44px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .channel-hero, .about-banner, .privacy-banner { padding: 56px 20px 28px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }

  .card-grid, .card-grid-3 {
    grid-template-columns: 1fr;
  }

  .article-meta { gap: 8px; }

  .child-dl dt { padding: 12px 14px; }
  .child-dl dd { padding: 8px 14px 12px; }

  .hero-text h1 { font-size: 26px; }

  footer { padding: 24px 16px 16px; }
  .footer-brand { font-size: 32px; }
}

@media (max-width: 375px) {
  .wrap { padding: 16px 12px; }
  .hero-text { padding: 24px 14px; }
}
