/* ============================================================
   LanHai 个人网站 · Apple 风格设计系统
   纯视觉层：所有 class 名与功能语义保持不变
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --bg-soft-hover: #ececee;
  --bg-nav: rgba(251, 251, 253, 0.82);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: #d2d2d7;
  --line-soft: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-lift: 0 12px 32px rgba(0, 0, 0, 0.10);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .2s ease;
}
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

.container { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* 背景层已弃用：兜底隐藏旧页面可能残留的节点 */
.bg, .bg-overlay { display: none !important; }

/* ---------- 导航 ---------- */
nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  max-width: 880px; margin: 0 auto; padding: 0 24px;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-left { display: flex; align-items: center; gap: 14px; }
.brand {
  font-size: 19px; font-weight: 600; color: var(--text);
  letter-spacing: -0.02em;
}
.brand span { color: var(--accent); }
.nav-admin {
  font-size: 12px; padding: 4px 11px; border-radius: 980px;
  background: var(--bg-soft); color: var(--text-2);
  transition: background .2s ease, color .2s ease;
}
.nav-admin:hover { background: var(--bg-soft-hover); color: var(--text); text-decoration: none; }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { color: var(--text-2); font-size: 14px; letter-spacing: -0.01em; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--text); font-weight: 500; }

/* ---------- Hero ---------- */
.hero {
  padding: 88px 24px 56px;
  display: flex; align-items: center; justify-content: center;
}
.hero-panel {
  max-width: 720px; width: 100%;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 28px;
}
.avatar {
  width: 124px; height: 124px; border-radius: 50%;
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.10);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-text h1 {
  font-size: 48px; font-weight: 600; line-height: 1.08;
  letter-spacing: -0.025em; margin-bottom: 12px;
}
.hero-text h1 .dot { color: var(--accent); }
.hero-text .tagline {
  font-size: 21px; color: var(--text-2); font-weight: 400;
  letter-spacing: -0.01em; margin-bottom: 14px;
}
.hero-text .intro {
  font-size: 17px; color: var(--text-2); max-width: 520px;
  margin: 0 auto 22px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  font-size: 13px; padding: 5px 14px; border-radius: 980px;
  background: var(--bg-soft); color: var(--text-2);
}

.hero-social { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }
.hero-social a {
  padding: 9px 20px; border-radius: 980px;
  background: var(--bg-soft); color: var(--text);
  font-size: 14px;
  transition: background .2s ease, transform .2s ease;
}
.hero-social a:hover {
  background: var(--bg-soft-hover); color: var(--text);
  text-decoration: none; transform: translateY(-1px);
}

/* ---------- 分区 ---------- */
.section {
  padding: 44px 40px;
  margin-bottom: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
}
.section-title {
  font-size: 28px; font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 24px;
}

/* ---------- 卡片 ---------- */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  transition: box-shadow .3s ease, transform .3s ease;
}
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 8px; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card p { color: var(--text-2); font-size: 15px; line-height: 1.5; }
.card .meta {
  margin-top: 14px; font-size: 13px; color: var(--text-3);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.tag {
  font-size: 12px; padding: 3px 11px; border-radius: 980px;
  background: var(--accent-soft); color: var(--accent);
}
a.card { display: block; }
a.card:hover { text-decoration: none; }

/* ---------- 项目网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.project { display: flex; flex-direction: column; }
.project .desc { flex: 1; }
.project .links { margin-top: 16px; font-size: 14px; display: flex; gap: 18px; }
.project .links a { color: var(--accent); }
.project-icon {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px;
  background: var(--bg-soft); display: grid; place-items: center; font-size: 21px;
}

/* ---------- 文章页 ---------- */
article {
  margin: 48px 0 24px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 56px 52px;
  box-shadow: var(--shadow-card);
}
article h1 {
  font-size: 36px; font-weight: 600; line-height: 1.15;
  letter-spacing: -0.025em; margin-bottom: 14px;
}
article .post-meta {
  color: var(--text-3); font-size: 14px; margin-bottom: 36px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
article .post-body { color: var(--text); font-size: 17px; }
article .post-body p, article .post-body pre,
article .post-body h2, article .post-body ul, article .post-body ol,
article .post-body blockquote { margin-bottom: 22px; }
article .post-body h2 {
  font-size: 25px; font-weight: 600; letter-spacing: -0.02em;
  margin-top: 40px; margin-bottom: 16px;
}
article .post-body h3 { font-size: 20px; font-weight: 600; margin: 30px 0 12px; }
article .post-body ul, article .post-body ol { padding-left: 26px; color: var(--text-2); }
article .post-body li { margin-bottom: 8px; }
article .post-body strong { font-weight: 600; }
article .post-body code {
  font-family: var(--mono); font-size: 14.5px;
  background: var(--bg-soft); padding: 2px 7px; border-radius: 6px;
}
article .post-body pre {
  background: var(--bg-soft); border-radius: 12px;
  padding: 20px; overflow-x: auto;
  font-size: 14px; line-height: 1.6;
}
article .post-body pre code { background: none; padding: 0; }
article .post-body blockquote {
  border-left: 3px solid var(--line);
  padding-left: 18px; color: var(--text-2);
}
article .post-body img { max-width: 100%; height: auto; border-radius: 12px; }

/* ---------- 联系方式 ---------- */
.contact-links {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 12px;
}
.contact-item {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow .3s ease, transform .3s ease;
}
.contact-item:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.contact-item .label { color: var(--text-3); font-size: 13px; margin-bottom: 4px; }
.contact-item .value { font-size: 15px; word-break: break-all; }

/* ---------- 页脚 ---------- */
footer {
  margin-top: 64px; padding: 32px 0;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  color: var(--text-3); font-size: 13px;
  background: var(--bg-soft);
}
footer .heart { color: var(--accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 734px) {
  body { font-size: 16px; }
  .hero { padding: 56px 20px 40px; }
  .hero-text h1 { font-size: 32px; }
  .hero-text .tagline { font-size: 18px; }
  .hero-text .intro { font-size: 16px; }
  .avatar { width: 104px; height: 104px; }
  .section { padding: 32px 22px; border-radius: 22px; }
  .section-title { font-size: 23px; }
  .nav-inner { height: 48px; padding: 0 20px; }
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 13px; }
  .grid { grid-template-columns: 1fr; }
  article { padding: 32px 22px; border-radius: 22px; }
  article h1 { font-size: 27px; }
  article .post-body h2 { font-size: 21px; }
  .contact-links { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .contact-links { grid-template-columns: 1fr; }
  .hero-social a { padding: 8px 16px; font-size: 13px; }
}
