/* 全局样式增强 */
body {
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding-bottom: 40px;
}

/* UI 样式变体 - ui-style-3 */
.ui-style-3 {
  --primary-color: #1a73e8;
  --secondary-color: #34a853;
  --accent-color: #fbbc04;
  --text-color: #333;
  --bg-color: #f5f5f5;
}

/* 容器与布局 */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.2;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 18px;
}

/* 卡片样式 */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 网格布局 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 4px;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: #1557b0;
  text-decoration: none;
}

/* 链接样式 */
a {
  color: var(--primary-color);
  transition: color 0.2s;
}

a:hover {
  color: #1557b0;
}

/* 标签样式 */
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: #e8f0fe;
  color: var(--primary-color);
  border-radius: 4px;
  font-size: 14px;
  margin-right: 8px;
  margin-bottom: 8px;
}

/* 徽章样式 */
.badge {
  display: inline-block;
  padding: 2px 8px;
  background: #ff6b6b;
  color: #fff;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
}

/* Section 间距 */
section {
  margin: 40px 0;
}

section:first-child {
  margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .container {
    padding: 0 15px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 16px;
  }

  .container {
    padding: 0 12px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  section {
    margin: 30px 0;
  }

  .card {
    padding: 15px;
  }

  /* 移动端导航增强 - 确保单行不换行 */
  .site-nav ul {
    width: 100%;
    gap: 2px;
    padding: 0;
  }

  .site-nav li {
    flex: 1 1 0;
    min-width: 0;
  }

  .site-nav a {
    padding: 6px 2px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logo {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .site-nav a {
    font-size: 10px;
    padding: 6px 1px;
  }
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
  z-index: 999;
}

.back-to-top:hover {
  background: #1557b0;
  transform: translateY(-3px);
}

.back-to-top.show {
  display: flex;
}

/* 文章内容样式优化 */
article p {
  margin-bottom: 15px;
  line-height: 1.8;
}

article ul {
  padding-left: 20px;
}

article li {
  margin-bottom: 8px;
}

/* 图片响应式 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 过渡动画 */
* {
  transition: opacity 0.2s ease-in-out;
}

/* 焦点样式优化 */
:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 选择文本样式 */
::selection {
  background: var(--primary-color);
  color: #fff;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}
