/* ==================== Node.js 风格主题 ==================== */

/* ==================== 全局样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 明亮 2D 游戏风格配色 */
  --node-green: #e8a020;
  --node-green-dark: #c07810;
  --node-green-light: #f5b840;
  --node-green-glow: rgba(232, 160, 32, 0.3);

  /* 明亮主题 */
  --bg-primary: #fdf6e3;
  --bg-secondary: #f5eedc;
  --bg-card: #ffffff;
  --bg-hover: #fef0c8;

  /* 文字颜色 */
  --text-primary: #2c1810;
  --text-secondary: #5c3820;
  --text-muted: #9a7050;

  /* 其他颜色 */
  --placeholder-bg: #e8d8b8;
  --border-color: #d4b880;
  --shadow-color: rgba(120, 80, 20, 0.15);

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* 间距 */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ==================== 内容区半透明背景 ==================== */
section,
main > div.search-results,
main > div.toolbar,
main > div.category-header,
main > div.detail-header,
main > div.detail-tags,
main > div.detail-content,
main > div.related-entries,
main > div.game-detail,
main > div.game-header,
main > div.game-section {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

/* ==================== 导航栏 ==================== */
.navbar {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--node-green);
  box-shadow: 0 2px 8px var(--shadow-color);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  min-height: 60px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--node-green) !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Courier New', Courier, monospace;
}

.logo:hover {
  color: var(--node-green-light) !important;
}

.menu-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.menu-toggle:hover {
  background: var(--bg-hover);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 1rem 1.25rem;
  transition: all 0.2s;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.search-form {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
}

.search-form input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  outline: none;
  width: 160px;
  padding: 0.4rem;
  font-size: 0.9rem;
}

.search-form input::placeholder {
  color: var(--text-muted);
}

.search-form button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
}

.search-form button:hover {
  color: var(--node-green);
}

/* ==================== 面包屑 ==================== */
.breadcrumbs {
  background: var(--bg-secondary);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumbs .container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.breadcrumbs a {
  color: var(--node-green);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: var(--node-green-light);
}

.breadcrumbs .separator {
  color: var(--text-muted);
  margin: 0 0.5rem;
}

.breadcrumbs .current {
  color: var(--text-secondary);
}

/* ==================== 主内容区 ==================== */
main {
  padding: var(--space-lg) 0;
  min-height: calc(100vh - 200px);
}

/* ==================== 分类卡片 ==================== */
.categories {
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  font-weight: 600;
  border-left: 4px solid var(--node-green);
  padding: 0.4rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: inline-block;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.category-card:hover {
  border-color: var(--node-green);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.category-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.category-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.category-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.category-arrow {
  margin-left: auto;
  color: var(--node-green);
  font-size: 1.25rem;
  transition: transform 0.2s;
}

.category-card:hover .category-arrow {
  transform: translateX(4px);
}

/* ==================== 词条卡片 ==================== */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.entry-card,
.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

.entry-card:hover,
.item-card:hover {
  border-color: var(--node-green);
  transform: translateY(-4px);
  box-shadow: 0 6px 16px var(--shadow-color);
}

/* ==================== 图片样式 ==================== */
.image-placeholder {
  width: 100%;
  height: 180px;
  background-color: var(--placeholder-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.image-placeholder.detail {
  height: 350px;
}

.image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.placeholder-icon {
  font-size: 3rem;
  opacity: 0.5;
  z-index: 1;
}

.placeholder-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  z-index: 1;
}

/* 详情页占位符 */
.image-placeholder.detail .placeholder-icon {
  font-size: 4rem;
}

.entry-content,
.item-content {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.entry-content h3,
.item-content h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.4;
}

.entry-description,
.item-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* ==================== 标签 ==================== */
.tag {
  display: inline-block;
  background: var(--node-green);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: var(--space-sm);
}

.item-tags .tag {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* ==================== 游戏列表 ==================== */
.games-section {
  margin-bottom: var(--space-xl);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  position: relative;
}

.game-card:hover {
  border-color: var(--node-green);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.game-image-container {
  width: 100%;
  aspect-ratio: 16/9;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.game-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.game-icon {
  font-size: 2.5rem;
  opacity: 0.7;
}

.game-info {
  width: 100%;
}

.game-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.game-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.game-arrow {
  margin-left: auto;
  color: var(--node-green);
  font-size: 1.25rem;
  transition: transform 0.2s;
}

.game-card:hover .game-arrow {
  transform: translateX(4px);
}

/* ==================== 最新词条 ==================== */
.latest {
  margin-bottom: var(--space-xl);
}

/* ==================== 详情页面 ==================== */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  background: var(--bg-card);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.detail-header h1 {
  font-size: 1.5rem;
  color: var(--text-primary);
  font-weight: 700;
}

.back-link {
  color: var(--node-green);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--node-green);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.back-link:hover {
  background: var(--node-green);
  color: white;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
}

.detail-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.detail-image-wrapper {
  width: 100%;
}

.detail-text h2 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  border-left: 3px solid var(--node-green);
  padding-left: var(--space-sm);
  font-weight: 600;
}

.detail-text-content {
  background: var(--bg-card);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.detail-section-title {
  font-size: 1.1rem;
  margin: var(--space-lg) 0 var(--space-sm);
  color: var(--text-primary);
}

.detail-tagline {
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-sm);
  font-size: 0.95rem;
}

/* 详情页信息表 */
.detail-table {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.detail-row {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  width: 140px;
  flex-shrink: 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-overlay);
  color: var(--text-muted);
  font-weight: 600;
  border-right: 1px solid var(--border-color);
}

.detail-value {
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary);
  flex: 1;
}

/* 能力条 */
.ability-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.ability-bar-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.ability-bar-label {
  width: 160px;
  flex-shrink: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.ability-bar {
  flex: 1;
  height: 12px;
  background: var(--bg-overlay);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.ability-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--node-green), #5a9e6a);
  border-radius: 6px;
  transition: width 0.6s ease;
}

.ability-bar-fill.affinity {
  background: linear-gradient(90deg, #e67e22, #f39c12);
}

.ability-bar-value {
  width: 30px;
  text-align: right;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* 能力文本预格式 */
.abilities-text {
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 0.88rem;
}

/* ==================== 搜索结果 ==================== */
.search-header {
  background: var(--bg-card);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-md);
  text-align: center;
}

.search-header h1 {
  font-size: 1.35rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.search-header p {
  color: var(--text-muted);
}

.search-results {
  display: grid;
  gap: var(--space-sm);
}

.search-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  gap: var(--space-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
}

.search-result-card:hover {
  border-color: var(--node-green);
  transform: translateX(4px);
}

.search-result-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.search-result-description {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-category {
  display: inline-block;
  background: var(--node-green);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
}

/* ==================== 分类页头部 ==================== */
.category-header {
  background: var(--bg-card);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.category-header h1 {
  font-size: 1.5rem;
  color: var(--text-primary);
  font-weight: 700;
}

.category-header p {
  color: var(--text-muted);
}

/* ==================== 工具栏 ==================== */
.toolbar {
  background: var(--bg-card);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-md);
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.filter-input {
  flex: 1;
  min-width: 180px;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.filter-input:focus {
  outline: none;
  border-color: var(--node-green);
}

.filter-select {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--node-green);
}

.btn-filter,
.btn-reset {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-filter {
  background: var(--node-green);
  color: white;
  border: none;
}

.btn-filter:hover {
  background: var(--node-green-dark);
}

.btn-reset {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-reset:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ==================== 分页 ==================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.page-link {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.page-link:hover:not(.disabled) {
  background: var(--node-green);
  border-color: var(--node-green);
}

.page-link.disabled,
.page-link.disabled:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
}

.page-info {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0 0.75rem;
}

/* ==================== 相关词条 ==================== */
.related-entries {
  margin-top: var(--space-xl);
}

/* ==================== 无结果 ==================== */
.no-results {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.no-results h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
  color: var(--text-muted);
}

.no-results p {
  color: var(--text-muted);
}

/* ==================== 错误页面 ==================== */
.error-page {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
}

.error-number {
  font-size: 6rem;
  font-weight: bold;
  color: var(--node-green);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.error-page h1 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.error-page p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.btn {
  display: inline-block;
  background: var(--node-green);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--node-green-dark);
  text-decoration: none;
}

/* ==================== 页脚 ==================== */
.footer {
  background: var(--bg-card);
  color: var(--text-muted);
  padding: var(--space-lg) 0;
  text-align: center;
  margin-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
}

.footer p {
  font-size: 0.85rem;
}

.footer-links {
  margin-top: var(--space-sm);
  display: flex;
  justify-content: center;
  gap: var(--space-md);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

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

/* ==================== 响应式设计 ==================== */

/* 平板 */
@media (max-width: 1024px) {
  .detail-content {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* 手机横屏 */
@media (max-width: 768px) {
  :root {
    --space-md: 1rem;
    --space-lg: 1.5rem;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: var(--space-sm);
    border-top: 1px solid var(--border-color);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .nav-link {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
  }
  
  .search-form {
    margin-top: var(--space-xs);
    width: 100%;
    justify-content: center;
  }
  
  .search-form input {
    width: 100%;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
  
  .category-grid,
  .entry-grid,
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-sm);
  }
  
  .category-card,
  .game-card {
    padding: var(--space-sm);
    flex-direction: column;
    text-align: center;
  }
  
  .category-arrow,
  .game-arrow {
    display: none;
  }

  .game-image-container {
    aspect-ratio: 16/9;
  }

  .image-placeholder {
    height: 140px;
  }
  
  .image-placeholder.detail {
    height: 220px;
  }
  
  .entry-content,
  .item-content {
    padding: var(--space-sm);
  }
  
  .entry-content h3,
  .item-content h3 {
    font-size: 0.9rem;
  }
  
  .detail-header {
    flex-direction: column;
    text-align: center;
  }
  
  .detail-header h1 {
    font-size: 1.25rem;
  }
  
  .detail-text h2 {
    font-size: 1.1rem;
  }
  
  .toolbar {
    padding: var(--space-sm);
  }
  
  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-input,
  .filter-select,
  .btn-filter,
  .btn-reset {
    width: 100%;
  }
  
  .pagination {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .page-link {
    width: 100%;
    text-align: center;
  }
  
  .category-header {
    flex-direction: column;
    text-align: center;
    padding: var(--space-md);
  }
  
  .category-header h1 {
    font-size: 1.25rem;
  }
  
  .search-result-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-sm);
  }
  
  .error-number {
    font-size: 4rem;
  }
}

/* 小屏手机 */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-sm);
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .category-grid,
  .entry-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  
  .image-placeholder,
  .game-image-container {
    height: 110px;
  }
  
  .placeholder-icon {
    font-size: 1.5rem;
  }
  
  .entry-content,
  .item-content {
    padding: 0.5rem;
  }
  
  .entry-content h3,
  .item-content h3 {
    font-size: 0.8rem;
  }
  
  .entry-description,
  .item-description {
    font-size: 0.75rem;
    -webkit-line-clamp: 1;
  }
  
  .tag {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
  }
  
  .detail-header h1 {
    font-size: 1.1rem;
  }
  
  .pagination {
    padding: var(--space-sm);
  }
  
  .page-info {
    font-size: 0.75rem;
  }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-card,
.entry-card,
.item-card,
.search-result-card {
  animation: fadeIn 0.3s ease-out;
  animation-fill-mode: both;
}

.category-card:nth-child(1),
.entry-card:nth-child(1) { animation-delay: 0.03s; }
.category-card:nth-child(2),
.entry-card:nth-child(2) { animation-delay: 0.06s; }
.category-card:nth-child(3),
.entry-card:nth-child(3) { animation-delay: 0.09s; }
.category-card:nth-child(4),
.entry-card:nth-child(4) { animation-delay: 0.12s; }
.category-card:nth-child(5),
.entry-card:nth-child(5) { animation-delay: 0.15s; }
.category-card:nth-child(6),
.entry-card:nth-child(6) { animation-delay: 0.18s; }

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--node-green-dark);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--node-green);
}

/* ==================== 辅助类 ==================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }

.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }

.hidden { display: none; }
.visible { visibility: visible; }

/* ==================== 语言下拉选择 ==================== */
.lang-dropdown {
  display: flex;
  align-items: center;
}

.lang-select {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.lang-select:hover {
  border-color: var(--node-green);
}

.lang-select:focus {
  outline: none;
  border-color: var(--node-green);
}

.lang-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ==================== 语言链接切换 ==================== */
.lang-links {
  display: flex;
  gap: 0.25rem;
}

.lang-links .nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  opacity: 0.7;
}

.lang-links .nav-link:hover {
  opacity: 1;
}

.lang-links .nav-link.active {
  background: var(--node-green);
  color: white;
  opacity: 1;
}

.nav-link.disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

/* 响应式语言链接 */
@media (max-width: 768px) {
  .lang-links {
    width: 100%;
    justify-content: center;
  }
  
  .lang-links .nav-link {
    flex: 1;
    text-align: center;
  }
}

/* ==================== 首页小精灵 ==================== */
.home-sprite {
  position: fixed;
  bottom: 16px;
  z-index: 9999;
  pointer-events: none;
  user-select: none;
  /* 初始位置 */
  left: 10%;
  transition: left var(--move-duration, 2.5s) cubic-bezier(0.45, 0, 0.55, 1);
}

.home-sprite-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  transform-origin: bottom center;
}

.home-sprite-inner img {
  width: 100%;
  height: auto;
  display: block;
}

/* 向左时翻转图片 */
.home-sprite.flip-left .home-sprite-inner {
  transform: scaleX(-1);
}

/* 摇晃动画 - 速度由 JS 动态设置 animation-duration */
.home-sprite.sway .home-sprite-inner {
  animation: sprite-sway var(--sway-duration, 1s) ease-in-out infinite;
}

@keyframes sprite-sway {
  0%, 100% { transform: rotate(-6deg); }
  50%       { transform: rotate(6deg); }
}

/* 向左时摇晃也要翻转 */
.home-sprite.flip-left.sway .home-sprite-inner {
  animation-name: sprite-sway-flipped;
}

@keyframes sprite-sway-flipped {
  0%, 100% { transform: scaleX(-1) rotate(-6deg); }
  50%       { transform: scaleX(-1) rotate(6deg); }
}

/* 移动端小精灵稍小 */
@media (max-width: 768px) {
  .home-sprite-inner {
    width: 60px;
  }
}
