/* ==========================================================================
   军事观察工作室 · Military Watch Studio
   全局样式（明暗主题）
   ========================================================================== */

:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #efede5;
  --ink: #1f2430;
  --ink-soft: #4b5263;
  --ink-faint: #8a90a0;
  --accent: #4a5a2a;          /* 橄榄绿 */
  --accent-ink: #3c4a22;
  --accent-soft: rgba(74, 90, 42, 0.12);
  --line: #e2dfd5;
  --line-strong: #cbc7b9;
  --hero-bg: #1b2233;         /* 深海军蓝 */
  --hero-ink: #f2f0e9;
  --hero-soft: #b9c0cf;
  --shadow: 0 1px 2px rgba(20, 22, 30, 0.06), 0 6px 20px rgba(20, 22, 30, 0.06);
  --radius: 12px;
  --serif: "Songti SC", "SimSun", "Noto Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html[data-theme="dark"] {
  --bg: #14161c;
  --surface: #1c1f28;
  --surface-2: #232734;
  --ink: #e8e6df;
  --ink-soft: #b6bcc9;
  --ink-faint: #7d8394;
  --accent: #9fb46a;
  --accent-ink: #b8cc82;
  --accent-soft: rgba(159, 180, 106, 0.16);
  --line: #2b2f3a;
  --line-strong: #3a3f4d;
  --hero-bg: #0f1218;
  --hero-ink: #eef0f4;
  --hero-soft: #9aa2b5;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

.container { width: min(1080px, 92%); margin: 0 auto; }

/* ---------- 顶部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #f2f0e9;
  background: var(--accent);
}

.brand-text {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.5px;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: 0.4px;
}

.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a {
  color: var(--ink-soft);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  text-decoration: none;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle:active { transform: scale(0.94); }

/* ---------- 焦点 Hero ---------- */
.hero { margin: 28px 0 8px; }

.hero-card {
  display: block;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(122, 134, 92, 0.35), transparent 55%),
    var(--hero-bg);
  color: var(--hero-ink);
  border-radius: var(--radius);
  padding: clamp(28px, 6vw, 56px);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-card:hover { text-decoration: none; }

.hero-kicker {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--hero-soft);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(24px, 4.6vw, 38px);
  line-height: 1.3;
  margin: 0 0 14px;
  max-width: 22em;
}
.hero-excerpt { color: var(--hero-soft); max-width: 46em; margin: 0 0 18px; font-size: 15.5px; }
.hero-meta { color: var(--hero-soft); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- 区块 ---------- */
.section { padding: 32px 0 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: 0.3px; }

/* ---------- 工具条：筛选 + 搜索 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.search {
  margin-left: auto;
  min-width: 220px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- 卡片网格 ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }

.card-top { display: flex; align-items: center; gap: 10px; }
.card-category {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 9px;
  letter-spacing: 0.5px;
}
.card-date { font-size: 12.5px; color: var(--ink-faint); margin-left: auto; }

.card-title { font-size: 17px; font-weight: 700; line-height: 1.45; margin: 0; }
.card-excerpt { font-size: 14px; color: var(--ink-soft); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.tag { font-size: 12px; color: var(--ink-faint); background: var(--surface-2); border-radius: 6px; padding: 2px 8px; }

.empty { text-align: center; color: var(--ink-faint); padding: 40px 0; }

/* ---------- 文章详情 ---------- */
.back-link { display: inline-block; margin: 24px 0 8px; font-size: 14px; color: var(--ink-soft); }
.back-link:hover { color: var(--accent-ink); }

.article { padding-bottom: 48px; }

.article-head { border-bottom: 1px solid var(--line); padding: 8px 0 24px; margin-bottom: 8px; }
.article-category {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 3px 10px;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.article-title { font-family: var(--serif); font-size: clamp(26px, 5vw, 40px); line-height: 1.28; margin: 0 0 16px; }
.article-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-faint); font-size: 13.5px; }
.article-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.article-body { max-width: 720px; margin: 0 auto; padding-top: 8px; font-size: 16.5px; }
.article-body h2 { font-size: 22px; margin: 34px 0 12px; letter-spacing: 0.3px; }
.article-body h3 { font-size: 18px; margin: 26px 0 10px; }
.article-body p { margin: 0 0 18px; }
.article-body blockquote {
  margin: 18px 0;
  padding: 4px 18px;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
}
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 24px; }
.article-body li { margin-bottom: 6px; }
.article-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.9em;
}
.article-body hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 关于页 ---------- */
.page { padding: 32px 0 56px; }
.page-title { font-family: var(--serif); font-size: clamp(26px, 5vw, 38px); margin: 8px 0 20px; }
.prose { max-width: 720px; font-size: 16px; }
.prose h2 { font-size: 20px; margin: 28px 0 10px; }
.prose ul { padding-left: 24px; }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding: 28px 0 36px;
  color: var(--ink-faint);
  font-size: 13.5px;
  text-align: center;
}
.footer-brand { color: var(--ink-soft); font-weight: 600; margin: 0 0 6px; }
.footer-note { margin: 0 0 6px; }
.footer-copy { margin: 0; font-size: 12.5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .nav a { padding: 8px 8px; font-size: 14px; }
  .brand-sub { display: none; }
  .search { margin-left: 0; width: 100%; min-width: 0; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .filters { gap: 6px; }
}
