/* ==========================================================================
   搞笑名字生成器 - 主样式表
   优化重点：性能、SEO、可访问性
   ========================================================================== */

/* CSS变量 - 简约大气配色方案 */
:root {
  /* 主色调 - 黑白橙极简配色 */
  --primary-color: #1A1A1A;        /* 深黑 - 主色 */
  --secondary-color: #FF6B35;      /* 活力橙 - 强调色 */
  --accent-color: #FFA500;         /* 亮橙 - 点缀色 */

  /* 文字颜色 */
  --text-color: #1A1A1A;           /* 深黑文字 */
  --text-light: #666666;           /* 浅灰文字 */
  --text-white: #FFFFFF;           /* 白色文字 */

  /* 背景颜色 */
  --bg-color: #FAFAFA;             /* 浅灰背景 */
  --card-bg: #FFFFFF;              /* 白色卡片 */
  --card-hover: #F5F5F5;           /* 卡片悬停 */

  /* 边框和分隔线 */
  --border-color: #E0E0E0;         /* 浅灰边框 */
  --border-dark: #CCCCCC;          /* 深灰边框 */

  /* 阴影 - 更柔和的阴影 */
  --shadow-sm: 0 2px 8px rgba(26, 26, 26, 0.06);
  --shadow: 0 4px 12px rgba(26, 26, 26, 0.08);
  --shadow-lg: 0 8px 24px rgba(26, 26, 26, 0.12);

  /* 圆角和动画 */
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   基础样式重置
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue',
               'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* 无障碍访问 - 跳过链接 */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 9999;
}

.skip-link:focus {
  top: 0;
}

/* 视觉上隐藏但屏幕阅读器可访问 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

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

/* ==========================================================================
   导航栏
   ========================================================================== */

.site-header {
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  /* 性能优化：启用GPU加速 */
  will-change: transform;
  transform: translateZ(0);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}

.logo a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.logo a:hover {
  opacity: 0.8;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
  margin: 0;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-menu a:hover,
.nav-menu a:focus {
  color: var(--primary-color);
}

.nav-menu a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-color);
}

/* 收藏数量徽章 */
#favCount {
  background: var(--accent-color);
  color: var(--text-color);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-left: 5px;
  font-weight: 600;
}

/* 下拉菜单 */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card-bg);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  list-style: none;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  margin-top: 0.5rem;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  padding: 0;
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-color);
}

.dropdown-menu a:hover {
  background: var(--bg-color);
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text-color);
  border-radius: 2px;
  transition: var(--transition);
}

/* ==========================================================================
   面包屑导航
   ========================================================================== */

.breadcrumb {
  background: var(--card-bg);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.breadcrumb li:not(:last-child)::after {
  content: '›';
  margin-left: 0.5rem;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb li:last-child {
  color: var(--text-light);
}

/* ==========================================================================
   Hero区域
   ========================================================================== */

.hero {
  background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
  /* 性能优化 */
  will-change: transform;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
  font-weight: 800;
  line-height: 1.2;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin-bottom: 2.5rem;
  opacity: 0.95;
  line-height: 1.5;
}

/* 快速生成器 */
.quick-generator {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto 1.5rem;
}

.form-select {
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-size: 1rem;
  min-width: 200px;
  background: white;
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.form-select:hover,
.form-select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

/* 按钮样式 */
.btn {
  padding: 12px 30px;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--secondary-color);
  color: white;
}

.btn-primary:hover,
.btn-primary:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-lg {
  padding: 14px 35px;
  font-size: 1.1rem;
}

/* AI模式切换 */
.mode-toggle {
  margin-bottom: 2rem;
}

.mode-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  padding: 10px 18px;
  border-radius: 25px;
  transition: var(--transition);
  font-size: 0.95rem;
}

.mode-toggle label:hover {
  background: rgba(255, 255, 255, 0.3);
}

.mode-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-color);
}

.mode-toggle input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.mode-toggle label:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}

.mode-toggle label:has(input:disabled):hover {
  background: rgba(255, 255, 255, 0.2);
}

.ai-quota-info {
  font-size: 0.85rem;
  margin-left: 0.5rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  transition: var(--transition);
}

/* 统计数据 */
.stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  opacity: 0.9;
  font-size: 0.9rem;
}

/* ==========================================================================
   结果区域
   ========================================================================== */

.results-section {
  padding: 60px 0;
  min-height: 400px;
}

.loading-indicator {
  text-align: center;
  padding: 3rem;
}

.spinner {
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--secondary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hint {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  padding: 3rem 1rem;
}

/* 名字网格 */
.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.name-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.name-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.name-main {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  word-break: break-word;
  line-height: 1.3;
}

.name-explanation {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  min-height: 40px;
  line-height: 1.5;
}

.name-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-copy,
.btn-favorite,
.btn-share {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: white;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  font-family: inherit;
}

.btn-copy:hover {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.btn-copy.copied {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.btn-favorite:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

.btn-favorite.active {
  color: #e74c3c;
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

.tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.tag {
  background: var(--bg-color);
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.75rem;
  color: var(--text-light);
}

/* ==========================================================================
   分类卡片
   ========================================================================== */

.categories {
  padding: 60px 0;
  background: var(--card-bg);
}

.section-title {
  text-align: center;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 2.5rem;
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 2rem;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 2px solid transparent;
}

.category-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-card:hover,
.category-card:focus-within {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.category-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.category-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.category-card p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ==========================================================================
   热门名字滚动
   ========================================================================== */

.trending {
  padding: 60px 0;
}

.trending-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--bg-color);
  -webkit-overflow-scrolling: touch;
}

.trending-scroll::-webkit-scrollbar {
  height: 8px;
}

.trending-scroll::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 4px;
}

.trending-scroll::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.trending-item {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
  color: white;
  padding: 1rem 2rem;
  border-radius: 25px;
  white-space: nowrap;
  font-weight: 600;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  transition: var(--transition);
}

.trending-item:hover {
  transform: scale(1.05);
}

/* ==========================================================================
   SEO内容区域
   ========================================================================== */

.seo-content {
  padding: 60px 0;
  background: var(--card-bg);
}

.seo-content article {
  max-width: 800px;
  margin: 0 auto;
}

.seo-content h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.seo-content h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.seo-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.seo-content ul {
  margin: 1rem 0 1rem 2rem;
  line-height: 1.8;
}

.seo-content li {
  margin-bottom: 0.5rem;
}

.seo-content a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px solid var(--primary-color);
}

.seo-content a:hover {
  opacity: 0.8;
}

/* ==========================================================================
   页面内容区（用于分类页面）
   ========================================================================== */

.page-content {
  padding: 40px 0;
}

.page-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.page-meta {
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.intro {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
  margin-bottom: 3rem;
  border-left: 4px solid var(--primary-color);
}

.intro p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.intro p:last-child {
  margin-bottom: 0;
}

/* 生成器盒子 */
.generator-box {
  background: var(--card-bg);
  color: var(--text-color);
  padding: 2rem;
  border-radius: var(--radius);
  margin-bottom: 3rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.generator-box h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.generator-box p {
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

.generator-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.generated-results {
  margin-top: 2rem;
}

/* 目录 */
.toc {
  background: var(--bg-color);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 3rem;
}

.toc h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.toc ol {
  margin-left: 1.5rem;
  line-height: 2;
}

.toc a {
  color: var(--primary-color);
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

/* 名字分类区域 */
.name-section {
  margin-bottom: 4rem;
}

.name-section h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.name-section > p {
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.names-list {
  display: grid;
  gap: 1.5rem;
}

.name-item {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.name-item:hover {
  box-shadow: var(--shadow);
  transform: translateX(5px);
}

.name-item h3 {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.name-item p {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* FAQ区域 */
.faq-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 2px solid var(--border-color);
}

.faq-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.faq-item {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.faq-item h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.faq-item p {
  color: var(--text-light);
  line-height: 1.7;
}

.faq-item a {
  color: var(--primary-color);
}

/* 相关链接 */
.related {
  margin-top: 4rem;
  padding: 3rem 0;
  background: var(--bg-color);
  border-radius: var(--radius);
}

.related h2 {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 2rem;
}

.related-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 1.5rem;
  padding: 0 2rem;
}

.related-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.related-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.related-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.related-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.related-card p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ==========================================================================
   页脚
   ========================================================================== */

.footer {
  background: var(--primary-color);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.footer-section ul {
  list-style: none;
  line-height: 2;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
}

.footer-section a:hover {
  color: white;
  text-decoration: underline;
}

.footer-links {
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  margin: 0 0.5rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: white;
  text-decoration: underline;
}

.footer-links .separator {
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0.25rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

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

@media (max-width: 768px) {
  .hero {
    padding: 40px 0;
  }

  .quick-generator {
    flex-direction: column;
  }

  .form-select,
  .btn {
    width: 100%;
  }

  .stats {
    flex-direction: column;
    gap: 1.5rem;
  }

  .nav-menu {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* 移动端菜单展开状态 */
  body.menu-open .nav-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--card-bg);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .names-grid {
    grid-template-columns: 1fr;
  }

  .trending-scroll {
    padding-left: 20px;
    padding-right: 20px;
  }

  .generator-controls {
    flex-direction: column;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .name-card {
    padding: 1rem;
  }

  .name-actions {
    flex-direction: column;
  }

  .btn-copy,
  .btn-favorite,
  .btn-share {
    width: 100%;
  }
}

/* ==========================================================================
   打印样式
   ========================================================================== */

@media print {
  .navbar,
  .mobile-menu-toggle,
  .quick-generator,
  .footer,
  .btn,
  .name-actions {
    display: none;
  }

  body {
    background: white;
  }

  .name-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid var(--border-color);
  }
}

/* ==========================================================================
   深色模式支持（可选）
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #ECECEC;
    --text-light: #AAAAAA;
    --bg-color: #0D0D0D;
    --card-bg: #1A1A1A;
    --card-hover: #242424;
    --border-color: #333333;
    --border-dark: #404040;
  }

  .form-select,
  .btn-copy,
  .btn-favorite,
  .btn-share {
    background: var(--card-bg);
    color: var(--text-color);
  }
}

/* ==========================================================================
   性能优化
   ========================================================================== */

/* 减少重绘 */
.name-card,
.category-card,
.trending-item {
  will-change: transform;
}

/* 懒加载图片占位 */
img[loading="lazy"] {
  background: var(--bg-color);
}

/* ==========================================================================
   语言切换器样式
   ========================================================================== */

.language-menu {
  min-width: 250px;
}

.language-group-title {
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  pointer-events: none;
}

.language-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.5rem 0;
}

.language-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.language-menu a:hover {
  background: var(--bg-color);
}

/* 当前选中的语言 */
#currentLanguage {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

/* 移动端语言切换器优化 */
@media (max-width: 768px) {
  .language-menu {
    max-height: 400px;
    overflow-y: auto;
  }
}

/* ==========================================================================
   SEO优化区域样式
   ========================================================================== */

/* 热门搜索关键词 */
.popular-keywords {
  padding: 4rem 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, #2D2D2D 100%);
  color: white;
}

.popular-keywords .section-title {
  color: white;
  margin-bottom: 2rem;
}

.keywords-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.keyword-tag {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.keyword-tag:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* SEO内容区 */
.seo-content {
  padding: 4rem 0;
  background: white;
}

.seo-content article {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
}

.seo-content h2 {
  font-size: 2rem;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.seo-content h3 {
  font-size: 1.5rem;
  color: var(--text-color);
  margin: 2rem 0 1rem;
  font-weight: 600;
}

.seo-content p {
  margin-bottom: 1.25rem;
  color: var(--text-light);
  font-size: 1.05rem;
}

.seo-content strong {
  color: var(--primary-color);
  font-weight: 600;
}

.seo-content ul,
.seo-content ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.seo-content li {
  margin-bottom: 1rem;
  color: var(--text-light);
}

.seo-content li strong {
  color: var(--text-color);
}

/* FAQ区域 */
.faq-section {
  padding: 4rem 0;
  background: var(--bg-color);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}

.faq-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.faq-item summary {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--primary-color);
  font-weight: 700;
  transition: var(--transition);
}

.faq-item[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  margin-top: 1rem;
  color: var(--text-light);
  line-height: 1.8;
  padding-left: 0;
}

.faq-item strong {
  color: var(--primary-color);
}

/* 移动端优化 */
@media (max-width: 768px) {
  .popular-keywords {
    padding: 3rem 0;
  }

  .keywords-grid {
    gap: 0.5rem;
  }

  .keyword-tag {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
  }

  .seo-content,
  .faq-section {
    padding: 3rem 0;
  }

  .seo-content h2 {
    font-size: 1.5rem;
  }

  .seo-content h3 {
    font-size: 1.25rem;
  }

  .seo-content p,
  .seo-content li {
    font-size: 1rem;
  }

  .faq-item {
    padding: 1.25rem;
  }

  .faq-item summary {
    font-size: 1rem;
  }
}

/* Examples Section */
.examples-section {
  padding: 4rem 0;
  background: var(--bg-color);
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.example-category {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.example-category:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.example-category h3 {
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary-color);
}

.example-category p {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.examples-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.examples-list li {
  padding: 0.75rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-light);
  line-height: 1.6;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.examples-list li:last-child {
  border-bottom: none;
}

.examples-list li::before {
  content: '✨';
  position: absolute;
  left: 0;
  top: 0.75rem;
}

.examples-list li strong {
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.05rem;
}

.cta-box {
  margin-top: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
}

.cta-box p {
  color: white;
  font-size: 1.25rem;
  margin: 0;
  line-height: 1.6;
}

.cta-box strong {
  font-weight: 700;
}

/* 移动端优化 - Examples */
@media (max-width: 768px) {
  .examples-section {
    padding: 3rem 0;
  }

  .examples-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .example-category {
    padding: 1.5rem;
  }

  .example-category h3 {
    font-size: 1.25rem;
  }

  .examples-list li {
    font-size: 0.95rem;
  }

  .cta-box {
    padding: 1.5rem;
  }

  .cta-box p {
    font-size: 1.1rem;
  }
}

/* ==========================================================================
   留言板样式
   ========================================================================== */

/* 留言板区域 - 精美设计 */
.guestbook-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, #FAFAFA 0%, #F5F5F5 50%, #FAFAFA 100%);
  border-top: 1px solid var(--border-color);
  position: relative;
}

.guestbook-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--secondary-color) 50%,
    transparent 100%
  );
}

/* 留言板头部 */
.guestbook-header-wrapper {
  text-align: center;
  margin-bottom: 3.5rem;
}

.guestbook-header-wrapper .section-title {
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.guestbook-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.125rem;
  margin: 0 auto;
  line-height: 1.7;
  max-width: 650px;
  font-weight: 500;
}

/* 留言表单 - 精美卡片 */
.guestbook-form {
  background: linear-gradient(135deg, #FFFFFF 0%, #FAFAFA 100%);
  padding: 2.5rem 3rem;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(26, 26, 26, 0.08);
  max-width: 850px;
  margin: 0 auto 4rem;
  border: 2px solid transparent;
  transition: var(--transition);
  will-change: transform;
  position: relative;
  overflow: hidden;
}

.guestbook-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--primary-color) 0%,
    var(--secondary-color) 50%,
    var(--accent-color) 100%
  );
}

.guestbook-form:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 48px rgba(26, 26, 26, 0.12);
  border-color: var(--border-color);
}

/* 表单标题 */
.form-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

/* 表单输入 - 精致现代 */
.form-input,
.form-textarea {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1.05rem;
  font-family: inherit;
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
  background: white;
  color: var(--text-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-light);
  opacity: 0.6;
  font-weight: 400;
}

.form-input:hover,
.form-textarea:hover {
  border-color: var(--border-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  background: white;
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1),
              0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.8;
  font-size: 1.05rem;
}

.guestbook-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.char-count {
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 600;
  padding: 8px 16px;
  background: var(--bg-color);
  border-radius: 20px;
  border: 2px solid var(--border-color);
  transition: var(--transition);
}

.char-count.warning {
  color: var(--secondary-color);
  border-color: var(--secondary-color);
  background: rgba(255, 107, 53, 0.05);
}

/* 提交按钮美化 */
#submitGuestbook {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 14px 32px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
  transition: all 0.3s ease;
}

#submitGuestbook:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.4);
}

#submitGuestbook:active {
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.btn-text {
  letter-spacing: 0.02em;
}

/* 留言列表包装器 */
.guestbook-list-wrapper {
  max-width: 1000px;
  margin: 0 auto;
}

.list-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 2rem;
  padding-left: 1rem;
  border-left: 4px solid var(--secondary-color);
  display: inline-block;
}

/* 留言列表 */
.guestbook-list {
  max-width: 100%;
  margin: 0;
}

.guestbook-item {
  background: white;
  padding: 2rem 2.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
  border: 2px solid transparent;
  border-left: 5px solid var(--secondary-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  position: relative;
  overflow: hidden;
}

.guestbook-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg,
    var(--secondary-color) 0%,
    var(--accent-color) 100%
  );
  transition: width 0.3s ease;
}

.guestbook-item:hover::before {
  width: 8px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.guestbook-item:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transform: translateY(-6px);
  border-color: var(--border-color);
}

.guestbook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.guestbook-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 作者信息 - 精致设计 */
.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
  border: 3px solid white;
  transition: all 0.3s ease;
}

.guestbook-item:hover .author-avatar {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.35);
}

.author-name {
  font-weight: 700;
  color: var(--text-color);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.guestbook-time {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 4px 12px;
  background: var(--bg-color);
  border-radius: 12px;
}

/* 留言内容 - 精致阅读体验 */
.guestbook-content {
  color: var(--text-color);
  line-height: 1.9;
  font-size: 1.05rem;
  word-wrap: break-word;
  white-space: pre-wrap;
  letter-spacing: 0.02em;
  padding: 1rem 0 0.5rem;
}

/* 空状态提示 - 吸引人的设计 */
.guestbook-empty {
  text-align: center;
  padding: 5rem 2rem;
  background: white;
  border-radius: var(--radius);
  margin: 2rem 0;
  border: 2px dashed var(--border-color);
}

.guestbook-empty .icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  opacity: 0.4;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.guestbook-empty p {
  color: var(--text-light);
  font-size: 1.125rem;
  font-weight: 500;
}

/* 移动端适配 - 精致响应式 */
@media (max-width: 768px) {
  .guestbook-section {
    padding: 3.5rem 0;
  }

  .guestbook-header-wrapper {
    margin-bottom: 2.5rem;
  }

  .guestbook-subtitle {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .guestbook-form {
    padding: 2rem 1.75rem;
    margin-bottom: 3rem;
  }

  .form-title {
    font-size: 1.1rem;
  }

  .form-input,
  .form-textarea {
    padding: 14px 16px;
    font-size: 1rem;
  }

  .guestbook-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .char-count {
    text-align: center;
    order: 2;
    margin-top: 0;
  }

  #submitGuestbook {
    width: 100%;
    order: 1;
    justify-content: center;
    padding: 16px 24px;
  }

  .list-title {
    font-size: 1.3rem;
  }

  .guestbook-item {
    padding: 1.75rem 1.5rem;
  }

  .guestbook-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .author-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }

  .author-name {
    font-size: 1.05rem;
  }

  .guestbook-time {
    font-size: 0.875rem;
  }

  .guestbook-content {
    font-size: 1rem;
    line-height: 1.8;
  }
}

@media (max-width: 480px) {
  .guestbook-section {
    padding: 3rem 0;
  }

  .guestbook-form {
    padding: 1.75rem 1.5rem;
  }

  .form-title {
    font-size: 1.05rem;
  }

  .list-title {
    font-size: 1.2rem;
  }

  .guestbook-item {
    padding: 1.5rem 1.25rem;
  }

  .author-avatar {
    width: 40px;
    height: 40px;
  }
}

/* Toast 消息动画 */
@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}
