/* ===== 全局重置与变量 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --glass-bg: rgba(160, 160, 170, 0.35); /* 毛玻璃调灰一点 */
  --glass-border: rgba(255, 255, 255, 0.35);
  --text-color: #3a3a3f;
  --accent: #6b6b76;
  --radius: 16px;
  --gray-bg: #f7f7f8; /* 灰色区域调白一点 */
  --wave-2: #f7f7f8;   /* 波浪前层 */
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: var(--text-color);
  background: var(--gray-bg);
  line-height: 1.6;
  font-size: 15px; /* 整体字号调小 */
}

/* ===== 背景大图（占 60% 屏，固定） ===== */
.banner-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60vh;
  background: url("image/banner.webp") center / cover no-repeat;
  z-index: -1;
}

/* ===== 顶部导航栏（贴边，毛玻璃灰色） ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--glass-border);
  padding: 8px 24px;
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  letter-spacing: 1px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 26px;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== 内容区（从 60% 处开始） ===== */
.content-wrap {
  position: relative;
  background: var(--gray-bg);
  z-index: 1;
  min-height: 100vh;
  padding-top: 80px;
}

/* 只有带背景大图的首页才留出 60vh 的顶部空间 */
.content-wrap.has-banner {
  margin-top: 60vh;
  padding-top: 0;
}

/* 波浪顶部装饰 */
.wave-wrap {
  position: absolute;
  top: -60px; /* 向上探出，覆盖在背景图上形成波浪边界 */
  left: 0;
  width: 100%;
  height: 60px;
  pointer-events: none;
}

.wave {
  position: absolute;
  left: 0;
  width: 100%;
  height: 60px;
}

.wave-front {
  fill: var(--wave-2);
  opacity: 1;
}

/* 内容容器（窄卡片，居中） */
.container {
  max-width: 620px; /* 中间半个屏幕左右的宽度 */
  margin: 0 auto;
  padding: 40px 16px 0;
}

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 20px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  min-height: 200px;
}

/* 个人信息卡片 */
.profile-card {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.avatar {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.intro p {
  color: #5c5c63;
  font-size: 0.95rem;
}

.card h2 {
  color: var(--accent);
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.card p {
  font-size: 0.95rem;
}

.footer {
  text-align: center;
  padding: 28px 16px;
  color: #9a9aa0;
  font-size: 0.85rem;
}

/* ===== 响应式（手机适配） ===== */
@media (max-width: 768px) {
  .banner-bg {
    height: 60vh;
  }

  .content-wrap {
    padding-top: 70px;  /* 手机端留出导航栏高度，内容不被遮住 */
  }

  .content-wrap.has-banner {
    margin-top: 60vh;
    padding-top: 0;  /* 首页不需要，因为已经有 60vh 空白 */
  }

  .container {
    max-width: 100%;
    padding: 30px 14px 0;
  }

  .card {
    padding: 24px 18px;
    min-height: 170px;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 58px;
    right: 0;
    background: rgba(240, 240, 242, 0.95);
    backdrop-filter: blur(18px);
    padding: 16px;
    gap: 14px;
    border-bottom-left-radius: 12px;
  }

  .nav-links.open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .profile-card {
    flex-direction: column;
    text-align: center;
  }

  .avatar {
    width: 88px;
    height: 88px;
  }

  .intro h1 {
    font-size: 1.25rem;
  }
}

/* ===== 文章列表页样式 ===== */
.page-title {
  font-size: 1.8rem;
  margin-bottom: 24px;
  color: var(--text-color);
}

.post-item {
  display: block;
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 16px;
  text-decoration: none;
  color: var(--text-color);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12);
}

.post-title {
  font-size: 1.2rem;
  margin-bottom: 6px;
  color: var(--text-color);
}

.post-date {
  font-size: 0.85rem;
  color: #9a9aa0;
  display: block;
  margin-bottom: 8px;
}

.post-excerpt {
  font-size: 0.95rem;
  color: #5c5c63;
}

/* ===== 文章详情页样式 ===== */
.article {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 40px 36px;
  margin-top: 32px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.article-title {
  font-size: 1.7rem;
  margin-bottom: 10px;
}

.article-meta {
  color: #9a9aa0;
  font-size: 0.9rem;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.article-body {
  font-size: 1rem;
  line-height: 1.8;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body h2 {
  font-size: 1.3rem;
  margin: 24px 0 12px;
  color: var(--accent);
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* 手机端适配 */
@media (max-width: 768px) {
  .page-title {
    font-size: 1.5rem;
  }

  .post-item {
    padding: 20px 18px;
  }

  .article {
    padding: 24px 20px;
    margin-top: 20px;
  }

  .article-title {
    font-size: 1.4rem;
  }
}

/* ===== 代码块样式 ===== */
.article-body pre {
  background: #2d2d33;
  color: #e8e8ec;
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 16px 0 24px;
  line-height: 1.6;
}

.article-body pre code {
  font-family: "SF Mono", "Consolas", "Menlo", "Courier New", monospace;
  font-size: 0.88rem;
  white-space: pre;
}

/* 行内代码 */
.article-body code {
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "SF Mono", "Consolas", "Menlo", monospace;
  font-size: 0.88em;
}
