/* ═══════════════════════════════════════════════════════════════
   PeregrineSec — Awwwards-Level Dark Theme
   Brand: #10b981 (Emerald)
   ═══════════════════════════════════════════════════════════════ */

/* ── 变量 ── */
:root {
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --bg-card: rgba(255,255,255,0.03);
  --bg-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --text: #e2e8f0;
  --text-dim: #64748b;
  --accent: #10b981;
  --accent-dim: rgba(16,185,129,0.08);
  --ease: cubic-bezier(0.4,0,0.2,1);
}

* { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── 容器 ── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── 导航栏 ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11,17,32,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}
.navbar-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.navbar-brand span { color: var(--accent); }
.navbar-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.navbar-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s var(--ease);
  position: relative;
}
.navbar-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s var(--ease);
}
.navbar-nav a:hover { color: var(--text); }
.navbar-nav a:hover::after { width: 100%; }
.navbar-nav a.active { color: var(--accent); }

/* ── 区块 ── */
.section { padding: 5rem 0; }

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding: 4px 12px;
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 100px;
  background: rgba(16,185,129,0.06);
}
.section-title {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.section-desc {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}
.section-footer {
  text-align: center;
  margin-top: 3rem;
}

/* ── 工具卡片 ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.tool-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.tool-card:hover::before { opacity: 1; }
.tool-card-icon { font-size: 2rem; margin-bottom: 1rem; }
.tool-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.tool-card-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.tool-tags { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.tool-tag {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(16,185,129,0.08);
  color: var(--accent);
  border: 1px solid rgba(16,185,129,0.15);
}
.tool-card-cta {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}

/* ── 统计 ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}
.stat-item {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.stat-number {
  display: block;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* ── 文章列表 ── */
.article-list {
  display: grid;
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto;
}
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 2rem;
  transition: all 0.3s var(--ease);
}
.article-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}
.article-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.article-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.article-title a:hover { color: var(--accent); }
.article-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}
.meta-sep { margin: 0 0.3rem; }
.article-excerpt {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 0.6rem;
}
.article-tags { display: flex; gap: 0.4rem; }
.article-tag {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ── 分类云 ── */
.categories-cloud {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 600px;
  margin: 0 auto;
}
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 6px 16px;
  border-radius: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.3s var(--ease);
}
.category-chip:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}
.chip-name {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}
.chip-count {
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  padding: 1px 7px;
  border-radius: 100px;
}

/* ── 按钮 ── */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
}
.btn-primary:hover { opacity: 0.85; }
.btn-outline {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--text);
}
.section-footer .btn { padding: 0.75rem 2rem; }

/* ── 页脚 ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem 2rem;
  margin-top: 3rem;
}
.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-brand {
  font-size: 0.85rem;
  color: var(--text-dim);
}
.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-links a {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.footer-links a:hover { color: var(--accent); }
.footer-icp {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.footer-icp a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.footer-icp a:hover { color: var(--accent); }

/* ── 响应式 ── */
@media (max-width: 768px) {
  .container { padding: 0 1.25rem; }
  .navbar-inner { padding: 0 1.25rem; }
  .section { padding: 3rem 0; }
  .tools-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .article-card { padding: 1.25rem; }
  .section-title { font-size: 1.5rem; }
  .categories-cloud { gap: 0.5rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stat-number { font-size: 1.8rem; }
  .navbar-nav { gap: 1.2rem; }
  .navbar-nav a { font-size: 0.8rem; }
}

/* ═══════════════════════════════════════════════
   文章详情页 — 设计感文本容器
   ═══════════════════════════════════════════════ */

.post-article { padding: 8rem 0 4rem; }

.post-container {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── 面包屑 ── */
.post-breadcrumb {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}
.post-breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.post-breadcrumb a:hover { color: var(--accent); }
.post-breadcrumb .sep { margin: 0 0.4rem; color: #334155; }

/* ── 标题区 ── */
.post-head { margin-bottom: 3rem; }
.post-title {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1rem;
}
.post-meta-row {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.meta-dot { color: #334155; }
.meta-cat { color: var(--accent); }

/* ── 正文容器（带设计感） ── */
.post-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem 3rem;
  font-size: 1rem;
  line-height: 1.85;
  color: #cbd5e1;
}
.post-body > * + * { margin-top: 1.2em; }
.post-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.post-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 1.6rem 0 0.6rem;
}
.post-body h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #94a3b8;
  margin: 1.2rem 0 0.4rem;
}
.post-body p {
  margin: 0;
  color: #cbd5e1;
}
.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(16,185,129,0.3);
  transition: text-decoration-color 0.2s var(--ease);
}
.post-body a:hover { text-decoration-color: var(--accent); }
.post-body strong { color: #f1f5f9; font-weight: 600; }
.post-body em { color: #94a3b8; }
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.8rem 1.2rem;
  margin: 1.5rem 0;
  background: rgba(16,185,129,0.04);
  border-radius: 0 8px 8px 0;
  color: #94a3b8;
  font-style: italic;
}
.post-body ul, .post-body ol {
  padding-left: 1.5rem;
  margin: 0.8rem 0;
}
.post-body li { margin-bottom: 0.4rem; }
.post-body hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}
.post-body img {
  max-width: 100%;
  border-radius: 10px;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}
.post-body code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: rgba(255,255,255,0.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: #e2e8f0;
}
.post-body pre {
  display: none;
}
.post-body .highlight {
  display: none;
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.post-body th, .post-body td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}
.post-body th {
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-weight: 600;
}
.post-body td { color: #94a3b8; }

/* ── 尾部 ── */
.post-foot { margin-top: 3rem; }
.post-tags-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.post-tag-pill {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.78rem;
  text-decoration: none;
  transition: all 0.2s var(--ease);
}
.post-tag-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(16,185,129,0.06);
}

/* ── 上下篇导航 ── */
.post-nav-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.pn-item { min-height: 60px; }
.pn-prev { text-align: left; }
.pn-next { text-align: right; }
.pn-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}
.pn-link {
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s var(--ease);
  line-height: 1.4;
}
.pn-link:hover { color: var(--accent); }
.pn-empty {
  font-size: 0.85rem;
  color: #334155;
}

/* ── 文章详情页响应式 ── */
@media (max-width: 768px) {
  .post-article { padding: 6rem 0 3rem; }
  .post-container { padding: 0 1.25rem; }
  .post-title { font-size: 1.6rem; }
  .post-body { padding: 1.5rem; font-size: 0.95rem; }
  .post-nav-row { grid-template-columns: 1fr; gap: 1rem; }
  .pn-next { text-align: left; }
}

@media (max-width: 480px) {
  .post-title { font-size: 1.3rem; }
  .post-body { padding: 1rem; border-radius: 10px; }
}
