/* ===== 全局重置 & 基础 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #faf9f7;
  color: #1e1e1e;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

ul {
  list-style: none;
}

/* ===== 导航栏 - logo 紧贴最左边，且始终与菜单同行 ===== */
nav {
  background-color: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  padding: 0.75rem 2rem 0.75rem 0;        /* 左内边距为0，logo贴左 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;                      /* 强制不换行，保证同行 */
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(6px);
  background-color: rgba(255, 255, 255, 0.88);
  overflow-x: auto;                       /* 万一内容溢出可滚动，但我们会尽量缩小 */
}

nav div:first-child {
  display: flex;
  align-items: center;
  flex-shrink: 0;                         /* logo 不收缩 */
  margin-left: 0;
}

nav img {
  height: 40px;
  width: auto;
  display: block;
  border-radius: 8px;
  transition: transform 0.25s ease;
}

nav img:hover {
  transform: scale(1.04);
}

.wrapper {
  display: flex;
  gap: 2rem;
  align-items: center;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 1;                         /* 允许菜单收缩 */
  white-space: nowrap;                    /* 防止链接文字换行 */
}

.wrapper li a {
  position: relative;
  color: #3d3d3d;
  padding: 0.35rem 0;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.wrapper li a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: #b88a6b;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.wrapper li a:hover::after,
.wrapper li a:focus::after {
  width: 100%;
}

.wrapper li a:hover {
  color: #b88a6b;
}

/* ===== 主内容 ===== */
main {
  flex: 1;
  max-width: 1000px;
  margin: 3.5rem auto 2.5rem;
  padding: 0 2rem;
  width: 100%;
}

/* ===== 文章卡片 ===== */
article {
  background: #ffffff;
  border-radius: 24px;
  padding: 2.5rem 3rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03), 0 2px 8px rgba(0, 0, 0, 0.02);
  margin-bottom: 2.5rem;
  border: 1px solid rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.3s ease;
}

article:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.05);
}

article h2 {
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1a1a1a;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

article h2::before {
  content: '✦ ';
  color: #b88a6b;
  font-weight: 300;
}

article p {
  font-size: 1.15rem;
  color: #4a4a4a;
  max-width: 80%;
  line-height: 1.7;
}

/* ===== 最新文章区块 ===== */
section {
  background: #ffffff;
  border-radius: 24px;
  padding: 2.25rem 3rem 2.75rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03), 0 2px 8px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.02);
}

section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

section h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, #e0d6cc, transparent);
  margin-left: 0.75rem;
}

section ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 2rem;
}

section ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0ede8;
  display: flex;
  align-items: center;
}

section ul li:last-child {
  border-bottom: none;
}

section ul li a {
  color: #2c2c2c;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: color 0.2s ease, transform 0.2s ease;
  width: 100%;
}

section ul li a::before {
  content: '📄';
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

section ul li a:hover {
  color: #b88a6b;
  transform: translateX(4px);
}

section ul li a:hover::before {
  opacity: 1;
}

/* ===== 页脚 ===== */
footer {
  background-color: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  padding: 1.75rem 2rem;
  text-align: center;
  color: #7a7a7a;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  margin-top: 1rem;
}

footer p {
  opacity: 0.7;
}

footer p::before {
  content: '· ';
  opacity: 0.4;
}

footer p::after {
  content: ' ·';
  opacity: 0.4;
}

/* ===== 响应式 - 始终保持同行 ===== */
@media (max-width: 768px) {
  nav {
    padding: 0.5rem 1rem 0.5rem 0;        /* 适当减小左右内边距 */
    flex-wrap: nowrap;                    /* 确保不换行 */
    overflow-x: auto;                     /* 如果太挤允许水平滚动（但我们会压缩） */
    -webkit-overflow-scrolling: touch;
  }

  /* logo 保持靠左 */
  nav div:first-child {
    flex-shrink: 0;
  }

  nav img {
    height: 32px;                         /* 小屏缩小logo */
  }

  .wrapper {
    gap: 1rem;                            /* 缩小间距 */
    font-size: 0.85rem;                   /* 缩小字体 */
    flex-shrink: 1;
    white-space: nowrap;
  }

  .wrapper li a {
    padding: 0.25rem 0;
    font-size: 0.85rem;
  }

  main {
    padding: 0 1.25rem;
    margin: 2rem auto 1.5rem;
  }

  article {
    padding: 1.75rem 1.5rem;
  }

  article h2 {
    font-size: 1.7rem;
  }

  article p {
    max-width: 100%;
    font-size: 1rem;
  }

  section {
    padding: 1.75rem 1.5rem 2.25rem;
  }

  section ul {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  section ul li a {
    padding: 0.3rem 0;
  }

  footer {
    padding: 1.25rem 1.25rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 0.4rem 0.5rem 0.4rem 0;
  }

  .wrapper {
    gap: 0.6rem;
    font-size: 0.75rem;
  }

  .wrapper li a {
    font-size: 0.75rem;
    padding: 0.2rem 0;
  }

  nav img {
    height: 28px;
  }

  article h2 {
    font-size: 1.4rem;
  }

  article {
    padding: 1.25rem 1rem;
  }

  section {
    padding: 1.25rem 1rem 1.75rem;
  }

  section h3 {
    font-size: 1.2rem;
  }
}

/* ===== 滚动条 & 选中样式 ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f2efea;
}

::-webkit-scrollbar-thumb {
  background: #d5c9bc;
  border-radius: 12px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b88a6b;
}

::selection {
  background: #e8ddd2;
  color: #1e1e1e;
}