/* =========================================================
 * klpzjy888.com 根域名静态主页样式表
 * 设计原则：纯静态零外链、高可读性、支持浅色/深色系统主题
 * ========================================================= */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  --max-width: 880px;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111827;
    --surface-subtle: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --accent: #60a5fa;
    --accent-soft: rgba(59, 130, 246, 0.12);
    --accent-border: rgba(96, 165, 250, 0.3);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.7;
}

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

a:hover {
  text-decoration: underline;
}

/* 顶部导航栏 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.95rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  font-size: 0.94rem;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

/* 主体容器 */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.75rem 1.25rem 4rem;
}

/* Hero 首屏区 */
.hero {
  padding: 1rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.78rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.1rem;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  line-height: 1.22;
  letter-spacing: -0.025em;
}

.hero-lead {
  margin: 0;
  max-width: 660px;
  color: var(--text-muted);
  font-size: 1.06rem;
}

.hero-meta {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.pill {
  font-size: 0.84rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

/* 内容区块 */
.section {
  padding: 2.4rem 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-header {
  margin-bottom: 1.35rem;
}

.section-title {
  margin: 0 0 0.35rem;
  font-size: 1.32rem;
  letter-spacing: -0.015em;
}

.section-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.96rem;
}

/* 卡片网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
}

.card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.35;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

/* 列表式工程笔记 */
.note-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.note-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.note-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.note-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.note-date {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.note-summary {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text-muted);
}

/* 说明提示块 */
.info-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.info-box strong {
  color: var(--text);
}

/* 长文页面（About / Privacy） */
.prose h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.7rem, 3.5vw, 2.2rem);
  letter-spacing: -0.02em;
}

.prose .updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.prose h2 {
  margin: 2rem 0 0.65rem;
  font-size: 1.2rem;
}

.prose p,
.prose li {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.prose ul {
  padding-left: 1.25rem;
}

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.8rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text);
}

@media (max-width: 600px) {
  .header-inner {
    flex-wrap: wrap;
  }
  .container {
    padding-top: 2rem;
  }
}
