/* ============================================================
   火星智阅 · 写作攻略博客（SEO 内容矩阵）
   深空主题阅读版 —— 与落地页同一设计语言
   ============================================================ */
:root {
  --mars: #FF6B35; --mars-deep: #E8552A;
  --nebula: #7B61FF; --gold: #FFC24B;
  --bg-0: #0A0D16; --bg-1: #0E1220; --bg-2: #141A2E;
  --surface: #1A2138; --surface-2: #232C47; --surface-3: #2E3A5C;
  --hairline: rgba(255,255,255,0.08); --hairline-strong: rgba(255,255,255,0.16);
  --text-1: #F2F4FA; --text-2: #C6CCDD; --text-3: #8B94AD; --text-4: #5C6580;
  --success: #34C759;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-mars: 0 8px 32px rgba(255,107,53,0.25);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 980px;
  --ease: cubic-bezier(.16,1,.3,1);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Inter", system-ui, sans-serif;
}
[data-theme="light"] {
  --mars: #E8552A; --nebula: #6B5CF5; --gold: #D99400;
  --bg-0: #F7F7FB; --bg-1: #FFFFFF; --bg-2: #F2F3FA;
  --surface: #FFFFFF; --surface-2: #F0F1F8; --surface-3: #E4E6F2;
  --hairline: rgba(15,20,45,0.08); --hairline-strong: rgba(15,20,45,0.14);
  --text-1: #151A2E; --text-2: #3D4460; --text-3: #6B7390; --text-4: #A0A7BC;
  --shadow-sm: 0 2px 8px rgba(20,25,60,0.06);
  --shadow-md: 0 8px 24px rgba(20,25,60,0.08);
  --shadow-mars: 0 8px 32px rgba(232,85,42,0.18);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-0); color: var(--text-1);
  line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--nebula); text-decoration: none; transition: color 160ms var(--ease); }
a:hover { color: var(--mars); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
::selection { background: rgba(255,107,53,0.3); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .container { padding: 0 20px; } }

/* ---------- 星尘背景 ---------- */
.stardust { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.stardust::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,0.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 62% 58%, rgba(255,255,255,0.2) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 85% 25%, rgba(255,255,255,0.24) 50%, transparent 51%),
    radial-gradient(1px 1px at 38% 82%, rgba(255,255,255,0.18) 50%, transparent 51%);
}
.stardust::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(700px 420px at 15% 0%, rgba(123,97,255,0.1), transparent 60%),
              radial-gradient(620px 380px at 88% 12%, rgba(255,107,53,0.08), transparent 60%);
}
[data-theme="light"] .stardust::before { opacity: 0; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-0) 78%, transparent);
  backdrop-filter: saturate(160%) blur(22px);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-logo { display: flex; align-items: center; gap: 10px; color: var(--text-1); font-weight: 700; font-size: 16px; }
.nav-logo .logo-badge {
  font-size: 10px; font-weight: 700; color: var(--mars);
  border: 1px solid rgba(255,107,53,0.4); border-radius: 6px; padding: 2px 6px;
  background: rgba(255,107,53,0.1);
}
.nav-right { display: flex; align-items: center; gap: 10px; }
.macos-theme-toggle { display: flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: var(--r-pill); padding: 3px; }
.macos-theme-toggle button {
  width: 30px; height: 30px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 13px; transition: background 160ms var(--ease), color 160ms var(--ease);
}
.macos-theme-toggle button:hover { color: var(--text-1); }
.macos-theme-toggle button.active { background: var(--surface-3); color: var(--text-1); }
.nav-cta { height: 36px; padding: 0 16px; font-size: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 12px;
  font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(120deg, var(--mars), var(--mars-deep)); color: #fff; box-shadow: var(--shadow-mars); }
.btn-primary:hover { color: #fff; transform: translateY(-1px); filter: brightness(1.06); }
.btn-outline { border: 1px solid var(--hairline-strong); color: var(--text-1); background: var(--surface); }
.btn-outline:hover { border-color: var(--mars); color: var(--mars); }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 9px; }

/* ---------- 排版 ---------- */
.display-lg { font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; line-height: 1.14; letter-spacing: -0.02em; }
.display-md { font-size: clamp(24px, 3vw, 32px); font-weight: 800; line-height: 1.22; letter-spacing: -0.015em; }
.headline { font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; line-height: 1.3; }
.title { font-size: 18px; font-weight: 700; line-height: 1.35; }
.body-lg { font-size: 17px; line-height: 1.7; color: var(--text-2); }
.body { font-size: 15px; line-height: 1.65; color: var(--text-2); }
.caption { font-size: 13px; color: var(--text-3); }
.micro { font-size: 12px; color: var(--text-4); }
.grad-mars {
  background: linear-gradient(120deg, var(--mars) 0%, var(--gold) 55%, var(--nebula) 130%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--r-pill);
  border: 1px solid rgba(255,107,53,0.35); background: rgba(255,107,53,0.1);
  color: var(--mars); font-size: 13px; font-weight: 600;
}
.chip-nebula { border-color: rgba(123,97,255,0.35); background: rgba(123,97,255,0.1); color: var(--nebula); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-xl); padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--hairline-strong); }

/* ---------- 博客首页 ---------- */
.blog-hero { padding: 88px 0 56px; text-align: center; }
.blog-hero h1 { margin: 18px 0 14px; }
.blog-hero p { max-width: 620px; margin: 0 auto; }

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 48px 0; }
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cat-grid { grid-template-columns: 1fr; } }
.cat-card { text-align: center; padding: 26px 20px; }
.cat-card .cat-ico {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.cat-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.cat-card p { font-size: 13px; color: var(--text-3); line-height: 1.55; }
.cat-card .cat-count { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--mars); }

.section-title { display: flex; align-items: center; gap: 12px; margin: 56px 0 24px; }
.section-title h2 { font-size: 22px; font-weight: 800; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--hairline); }

.article-list { display: grid; grid-template-columns: 1fr; gap: 14px; }
.article-item {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--hairline);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.article-item:hover { transform: translateX(4px); border-color: var(--hairline-strong); box-shadow: var(--shadow-sm); }
.article-item .ai-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; color: var(--text-1); }
.article-item .ai-cat { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--nebula); border: 1px solid rgba(123,97,255,0.3); border-radius: var(--r-pill); padding: 3px 10px; background: rgba(123,97,255,0.08); }
.article-item .ai-date { flex-shrink: 0; font-size: 12px; color: var(--text-4); white-space: nowrap; }

/* ---------- 文章页 ---------- */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 56px 24px 80px; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 18px 0 28px; }
.article-meta .sep { color: var(--text-4); }
.article-title { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; line-height: 1.25; letter-spacing: -0.015em; }
.article-body { font-size: 16px; line-height: 1.85; color: var(--text-2); }
.article-body h2 { font-size: 22px; font-weight: 700; color: var(--text-1); margin: 40px 0 16px; padding-top: 8px; }
.article-body h3 { font-size: 18px; font-weight: 700; color: var(--text-1); margin: 28px 0 12px; }
.article-body p { margin: 0 0 16px; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body ul li { list-style: disc; }
.article-body ol li { list-style: decimal; }
.article-body strong { color: var(--text-1); font-weight: 600; }
.article-body a { color: var(--nebula); text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote {
  border-left: 3px solid var(--mars); background: rgba(255,107,53,0.07);
  padding: 14px 18px; border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: 20px 0; color: var(--text-2); font-size: 15px;
}
.article-body .tip-box {
  background: rgba(123,97,255,0.08); border: 1px solid rgba(123,97,255,0.25);
  border-radius: var(--r-md); padding: 16px 18px; margin: 20px 0;
}
.article-body .tip-box strong { color: var(--nebula); }

/* 文末 CTA */
.article-cta {
  margin: 48px 0 0; padding: 30px;
  border-radius: var(--r-xl); text-align: center;
  border: 1px solid rgba(255,107,53,0.3);
  background: linear-gradient(160deg, var(--surface) 0%, rgba(255,107,53,0.07) 100%);
}
.article-cta h3 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.article-cta p { font-size: 14px; color: var(--text-2); margin-bottom: 20px; }

/* 相关文章 */
.related { margin-top: 48px; }
.related h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 560px) { .related-grid { grid-template-columns: 1fr; } }
.related-item { padding: 16px 18px; border-radius: var(--r-lg); font-size: 14px; font-weight: 600; color: var(--text-1); display: block; }
.related-item:hover { color: var(--mars); }
.related-item .ri-cat { display: block; font-size: 11px; color: var(--text-4); font-weight: 500; margin-top: 4px; }

/* 面包屑 */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); margin-bottom: 24px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--mars); }
.breadcrumb .sep { color: var(--text-4); }

/* ---------- 分类页 ---------- */
.cat-hero { padding: 72px 0 32px; }
.cat-hero h1 { margin-bottom: 12px; }
.cat-hero p { color: var(--text-2); max-width: 640px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--hairline); padding: 48px 0 40px; background: var(--bg-1); margin-top: 80px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; margin-bottom: 40px; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: repeat(2, 1fr); } }
.foot-brand p { font-size: 13px; color: var(--text-3); max-width: 280px; margin-top: 10px; line-height: 1.7; }
.foot-col h4 { font-size: 13px; font-weight: 700; color: var(--text-1); margin-bottom: 14px; }
.foot-col a { display: block; font-size: 13px; color: var(--text-3); padding: 5px 0; }
.foot-col a:hover { color: var(--mars); }
.foot-bottom {
  border-top: 1px solid var(--hairline); padding-top: 26px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.foot-bottom p { font-size: 12px; color: var(--text-4); }

/* ---------- 入场动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.a-fade { opacity: 0; animation: fadeUp .6s var(--ease) forwards; }
.a-d1 { animation-delay: .08s; } .a-d2 { animation-delay: .16s; } .a-d3 { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
