/* ══════════════════════════════════════════════
   AI 學習寶庫 — Shared Stylesheet v2.0
   https://openclaw-ai-tracker.inariglobal.workers.dev/Openclaw/
══════════════════════════════════════════════ */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Tokens ── */
:root {
  --primary:      #2563eb;
  --primary-h:    #1d4ed8;
  --secondary:    #7c3aed;
  --teal:         #0891b2;

  --bg:           #f8fafc;
  --bg-2:         #f1f5f9;
  --bg-3:         #e2e8f0;
  --card:         #ffffff;
  --border:       rgba(0,0,0,0.07);

  --text:         #0f172a;
  --text-2:       #475569;
  --text-3:       #94a3b8;

  --nav-bg:       rgba(248,250,252,0.92);
  --nav-border:   #e2e8f0;

  --r:            14px;
  --r-sm:         8px;
  --r-xs:         4px;
  --shadow:       0 1px 3px rgba(0,0,0,0.06),0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.08),0 2px 8px rgba(0,0,0,0.05);
}

[data-theme="dark"] {
  --bg:           #0f172a;
  --bg-2:         #1e293b;
  --bg-3:         #334155;
  --card:         #1e293b;
  --border:       rgba(255,255,255,0.07);
  --text:         #f1f5f9;
  --text-2:       #94a3b8;
  --text-3:       #64748b;
  --nav-bg:       rgba(15,23,42,0.94);
  --nav-border:   rgba(255,255,255,0.07);
  --shadow:       0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.4);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.7; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* ── Layout ── */
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.page-wrap { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* ── Navbar ── */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--nav-border);
}
.nav-inner {
  max-width: 960px; margin: 0 auto; padding: 0 24px;
  height: 58px; display: flex; align-items: center; gap: 8px;
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 15px; color: var(--text);
  flex-shrink: 0; margin-right: 8px;
}
.nav-brand .brand-emoji { font-size: 18px; }
.nav-links { display: flex; gap: 2px; margin: 0 auto; }
.nav-link {
  font-size: 13px; font-weight: 500; color: var(--text-2);
  padding: 6px 12px; border-radius: var(--r-sm);
  transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.nav-link:hover { background: var(--bg-2); color: var(--primary); }
.nav-link.active {
  background: rgba(37,99,235,0.08); color: var(--primary); font-weight: 600;
}
.nav-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.theme-btn {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 6px 10px; cursor: pointer;
  font-size: 14px; transition: background 0.2s; line-height: 1;
}
.theme-btn:hover { background: var(--bg-3); }
.nav-burger {
  display: none; background: none; border: none;
  color: var(--text-2); cursor: pointer; font-size: 20px; padding: 4px;
}
@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .site-nav.open .nav-links {
    display: flex; flex-direction: column; gap: 2px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--nav-bg); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--nav-border);
    padding: 12px; z-index: 99;
  }
  .nav-brand { margin-right: auto; }
}

/* ── Hero ── */
.hero {
  text-align: center; padding: 72px 24px 56px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
.hero-badge {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  color: var(--primary); background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.2); padding: 4px 14px;
  border-radius: 100px; margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 16px; line-height: 1.15;
}
.hero-sub {
  font-size: 16px; color: var(--text-2);
  max-width: 500px; margin: 0 auto 32px; line-height: 1.75;
}
.hero-stats {
  display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; margin-top: 32px;
}
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 22px; font-weight: 800; color: var(--text); }
.hero-stat-label { font-size: 12px; color: var(--text-3); }

/* ── Section ── */
.section { padding: 48px 0; }
.section + .section { padding-top: 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 8px;
}
.section-title {
  font-size: 18px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.see-all {
  font-size: 13px; font-weight: 500; color: var(--primary);
  transition: gap 0.2s;
}
.see-all:hover { text-decoration: underline; }

/* ── Category cards ── */
.cat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.cat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 22px 18px;
  text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); transition: all 0.2s;
  display: flex; flex-direction: column; gap: 8px;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(37,99,235,0.2); }
.cat-icon { font-size: 26px; line-height: 1; }
.cat-card h3 { font-size: 15px; font-weight: 700; }
.cat-card p { font-size: 12px; color: var(--text-2); line-height: 1.55; }
.cat-count { font-size: 11px; color: var(--text-3); font-weight: 600; margin-top: auto; padding-top: 4px; }

/* ── Article cards (grid) ── */
.article-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.article-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px 20px;
  box-shadow: var(--shadow); transition: all 0.2s;
  display: flex; flex-direction: column; gap: 8px;
}
.article-card:hover { box-shadow: var(--shadow-lg); border-color: rgba(37,99,235,0.15); transform: translateY(-2px); }
.article-cat-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase;
  color: var(--primary); background: rgba(37,99,235,0.08);
  padding: 3px 9px; border-radius: 100px; align-self: flex-start;
}
.article-card h3 { font-size: 14px; font-weight: 600; line-height: 1.45; }
.article-card h3 a { color: var(--text); transition: color 0.15s; }
.article-card h3 a:hover { color: var(--primary); }
.article-card .excerpt {
  font-size: 12px; color: var(--text-2); line-height: 1.65;
  flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-3); margin-top: auto; }
.article-meta .sep { color: var(--bg-3); }

/* ── Article list (category pages) ── */
.art-list { list-style: none; }
.art-item {
  display: block; padding: 22px 0;
  border-bottom: 1px solid var(--nav-border);
  color: inherit; text-decoration: none;
  transition: background 0.15s;
}
.art-item:first-child { border-top: 1px solid var(--nav-border); }
.art-item:hover h3 { color: var(--primary); }
.art-item h3 {
  font-size: 16px; font-weight: 700; margin-bottom: 7px; line-height: 1.45;
  color: var(--text); transition: color 0.15s;
}
.art-item p {
  font-size: 13px; color: var(--text-2); line-height: 1.65; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.art-item-badge {
  display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: 0.4px;
  padding: 2px 9px; border-radius: var(--r-xs); margin-bottom: 8px;
  background: var(--bg-2); color: var(--primary); border: 1px solid var(--border);
}
.art-item-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-3);
}
.art-item-meta .sep { opacity: 0.4; }
.art-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block; font-size: 10px; font-weight: 500;
  padding: 2px 8px; border-radius: var(--r-xs);
  background: var(--bg-2); color: var(--text-2); border: 1px solid var(--border);
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3); margin-bottom: 24px;
}
.breadcrumb a { color: var(--primary); transition: text-decoration 0.15s; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep, .breadcrumb .bc-sep { opacity: 0.5; }

/* ── Page header ── */
.page-header { padding: 36px 0 28px; }
.page-header-icon { font-size: 36px; margin-bottom: 10px; }
.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.5px;
  margin-bottom: 8px; line-height: 1.2;
}
.page-header p { font-size: 15px; color: var(--text-2); max-width: 560px; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--nav-border); margin: 0; }

/* ── Article body (for article pages) ── */
.article-wrap { max-width: 740px; margin: 0 auto; padding: 36px 24px 80px; }
.article-header { margin-bottom: 32px; }
.article-title {
  font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800;
  letter-spacing: -0.5px; line-height: 1.25; margin-bottom: 14px;
}
.article-info {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-size: 13px; color: var(--text-3);
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.article-body { font-size: 16px; line-height: 1.85; color: var(--text); }
.article-body h2 { font-size: 1.4rem; font-weight: 700; margin: 2rem 0 0.7rem; letter-spacing: -0.3px; color: var(--text); }
.article-body h3 { font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 0.5rem; color: var(--text); }
.article-body h4 { font-size: 1rem; font-weight: 600; margin: 1.2rem 0 0.4rem; }
.article-body p { margin-bottom: 1rem; }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.article-body li { margin-bottom: 0.4rem; font-size: 15px; }
.article-body a { color: var(--primary); text-decoration: underline; text-decoration-color: rgba(37,99,235,0.3); }
.article-body a:hover { text-decoration-color: var(--primary); }
.article-body strong { font-weight: 600; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 14px; }
.article-body th { background: var(--bg-2); font-weight: 600; }
.article-body th, .article-body td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.article-body tr:hover td { background: var(--bg-2); }
.article-body pre {
  background: #1e293b; color: #e2e8f0;
  padding: 18px 20px; border-radius: var(--r-sm);
  overflow-x: auto; margin: 1.5rem 0; font-size: 13px; line-height: 1.7;
}
.article-body code { background: var(--bg-2); color: var(--primary); padding: 2px 6px; border-radius: 4px; font-size: 0.88em; }
.article-body pre code { background: transparent; color: inherit; padding: 0; }
.article-body blockquote {
  border-left: 3px solid var(--primary); padding: 12px 18px;
  background: rgba(37,99,235,0.04); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: 1.5rem 0; color: var(--text-2);
}
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* Reading progress bar */
.read-progress {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform-origin: left; transform: scaleX(0);
  transition: transform 0.1s linear;
}

/* ── Footer ── */
.site-footer {
  padding: 36px 0; border-top: 1px solid var(--nav-border); margin-top: 48px;
}
.footer-inner {
  max-width: 960px; margin: 0 auto; padding: 0 24px;
  display: flex; flex-wrap: wrap; gap: 20px;
  justify-content: space-between; align-items: center;
}
.footer-brand { font-weight: 800; font-size: 14px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.footer-nav a { font-size: 12px; color: var(--text-2); padding: 4px 10px; border-radius: var(--r-xs); transition: color 0.15s; }
.footer-nav a:hover { color: var(--primary); }
.footer-copy { font-size: 11px; color: var(--text-3); }

/* ── Image Wall Hero ── */
.wall-hero {
  position: relative; overflow: hidden;
  min-height: 60vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 80px 24px 60px;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #0f172a 100%);
}
.wall-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(37,99,235,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(124,58,237,0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(8,145,178,0.1) 0%, transparent 50%);
  animation: heroPulse 8s ease-in-out infinite alternate;
}
@keyframes heroPulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}
.wall-hero .hero-content { position: relative; z-index: 2; max-width: 700px; }
.wall-hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -1.5px;
  color: #f1f5f9; line-height: 1.1; margin-bottom: 16px;
}
.wall-hero h1 span {
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #34d399 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.wall-hero .hero-sub {
  font-size: 17px; color: #94a3b8; max-width: 520px; margin: 0 auto 28px; line-height: 1.7;
}
.wall-hero .hero-stats {
  display: flex; justify-content: center; gap: 40px; flex-wrap: wrap;
}
.wall-hero .hero-stat-num {
  font-size: 28px; font-weight: 800; color: #f1f5f9;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.wall-hero .hero-stat-label { font-size: 12px; color: #64748b; letter-spacing: 0.5px; }

/* ── Grid dots background ── */
.wall-hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background-image: radial-gradient(circle, rgba(148,163,184,0.08) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── Image Wall Grid ── */
.wall-section { padding: 56px 0; }
.wall-section .section-title {
  font-size: 20px; font-weight: 700; margin-bottom: 24px; text-align: center;
  color: var(--text);
}
.wall-grid {
  display: grid; gap: 16px; max-width: 1200px; margin: 0 auto; padding: 0 24px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.wall-card {
  position: relative; overflow: hidden;
  border-radius: 16px; aspect-ratio: 16/10;
  display: flex; flex-direction: column; justify-content: flex-end;
  text-decoration: none; color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.wall-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.wall-card .wall-bg {
  position: absolute; inset: 0; z-index: 0;
  transition: transform 0.5s ease;
}
.wall-card:hover .wall-bg { transform: scale(1.08); }
.wall-card .wall-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
}
.wall-card .wall-info {
  position: relative; z-index: 2; padding: 20px;
}
.wall-card .wall-tag {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 10px; border-radius: 100px; margin-bottom: 8px;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
}
.wall-card h3 { font-size: 16px; font-weight: 700; line-height: 1.35; margin-bottom: 4px; }
.wall-card .wall-count { font-size: 11px; opacity: 0.7; }
.wall-card .wall-emoji {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  font-size: 28px; opacity: 0.9;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Category-specific gradients */
.wall-bg-prompts { background: linear-gradient(135deg, #1e3a5f 0%, #0ea5e9 40%, #7c3aed 100%); }
.wall-bg-configs { background: linear-gradient(135deg, #064e3b 0%, #059669 40%, #0891b2 100%); }
.wall-bg-tutorials { background: linear-gradient(135deg, #3b0764 0%, #7c3aed 40%, #2563eb 100%); }
.wall-bg-workflows { background: linear-gradient(135deg, #78350f 0%, #f59e0b 40%, #ef4444 100%); }
.wall-bg-articles { background: linear-gradient(135deg, #1e1b4b 0%, #6366f1 40%, #ec4899 100%); }

/* Topic card gradients */
.wall-bg-claude { background: linear-gradient(135deg, #451a03 0%, #ea580c 40%, #f59e0b 100%); }
.wall-bg-chatgpt { background: linear-gradient(135deg, #052e16 0%, #16a34a 40%, #22d3ee 100%); }
.wall-bg-agent { background: linear-gradient(135deg, #172554 0%, #2563eb 40%, #8b5cf6 100%); }
.wall-bg-security { background: linear-gradient(135deg, #450a0a 0%, #dc2626 40%, #f97316 100%); }
.wall-bg-rag { background: linear-gradient(135deg, #1a2e05 0%, #65a30d 40%, #0d9488 100%); }
.wall-bg-opensource { background: linear-gradient(135deg, #0c4a6e 0%, #0ea5e9 40%, #a855f7 100%); }

/* SVG pattern overlay for depth */
.wall-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ── Latest Articles Wall ── */
.wall-articles-grid {
  display: grid; gap: 12px; max-width: 1200px; margin: 0 auto; padding: 0 24px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.wall-article {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  transition: all 0.25s ease; display: flex; flex-direction: column;
}
.wall-article:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.wall-article .wall-article-visual {
  height: 120px; position: relative; overflow: hidden;
}
.wall-article .wall-article-body {
  padding: 16px 18px; flex: 1; display: flex; flex-direction: column;
}
.wall-article h3 { font-size: 14px; font-weight: 600; line-height: 1.45; margin-bottom: 6px; }
.wall-article h3 a { color: var(--text); transition: color 0.15s; }
.wall-article h3 a:hover { color: var(--primary); }
.wall-article .excerpt {
  font-size: 12px; color: var(--text-2); line-height: 1.6; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wall-article .wall-article-meta {
  display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-3); margin-top: 10px;
}

/* ── Scroll reveal ── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.06s; }
.reveal-d2 { transition-delay: 0.12s; }
.reveal-d3 { transition-delay: 0.18s; }
.reveal-d4 { transition-delay: 0.24s; }
.reveal-d5 { transition-delay: 0.30s; }
.reveal-d6 { transition-delay: 0.36s; }

/* ── Utility ── */
@media (max-width: 680px) {
  .hero { padding: 48px 24px 36px; }
  .wall-hero { min-height: 50vh; padding: 60px 20px 40px; }
  .wall-hero h1 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .wall-grid { grid-template-columns: 1fr; gap: 12px; padding: 0 16px; }
  .wall-card { aspect-ratio: 16/9; }
  .wall-articles-grid { grid-template-columns: 1fr; padding: 0 16px; }
  .section { padding: 32px 0; }
  .wall-section { padding: 36px 0; }
  .article-wrap { padding: 24px 16px 60px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-stats { gap: 20px; }
}
@media (min-width: 681px) and (max-width: 960px) {
  .wall-grid { grid-template-columns: repeat(2, 1fr); }
  .wall-articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 961px) {
  .wall-grid { grid-template-columns: repeat(3, 1fr); }
  .wall-articles-grid { grid-template-columns: repeat(3, 1fr); }
}
