/* 儿童绘本阅读网站 - 全局样式 By HAISNAP */

/* 导入Google字体 */
@import url('https://fonts.loli.net/css2?family=Comic+Neue:wght@400;700&display=swap');

/* CSS变量定义 - 色彩系统 */
:root {
  --primary-color: #ff6b9d;
  --secondary-color: #667eea;
  --accent-color: #feca57;
  --light-pink: #ffd6e7;
  --light-blue: #b5f0ff;
  --light-yellow: #fff3cd;
  --text-dark: #333333;
  --text-light: #666666;
  --text-lighter: #999999;
  --background-light: #ffffff;
  --background-pink: #fff5f5;
  --shadow-soft: 0 4px 20px rgba(255, 107, 157, 0.15);
  --shadow-hover: 0 8px 30px rgba(255, 107, 157, 0.25);
  --border-radius-small: 10px;
  --border-radius-medium: 15px;
  --border-radius-large: 20px;
  --border-radius-circle: 50%;
}

/* 全局重置和基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Comic Neue', cursive, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: linear-gradient(135deg, #fff5f5 0%, #f0f9ff 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

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

.section {
  padding: 60px 0;
}

/* 通用文本样式 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 15px;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 15px;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
}

/* 按钮基础样式 */
.btn {
  display: inline-block;
  padding: 12px 25px;
  border: none;
  border-radius: var(--border-radius-medium);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: white;
  box-shadow: var(--shadow-soft);
}

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

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #764ba2 100%);
  color: white;
  box-shadow: var(--shadow-soft);
}

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

/* 卡片基础样式 */
.card {
  background: var(--background-light);
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
  overflow: hidden;
}

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

/* 导航横幅基础样式 - 与首页保持一致 */
.nav-banner {
  background: linear-gradient(135deg, #ffd6e7 0%, #b5f0ff 100%);
  padding: 15px 0;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid #fff;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ff6b9d 0%, #667eea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-item {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid transparent;
  border-radius: 25px;
  text-decoration: none;
  color: #333;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ff6b9d 0%, #feca57 100%);
  transition: left 0.3s ease;
  z-index: -1;
}

.nav-item:hover::before {
  left: 0;
}

.nav-item:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 107, 157, 0.3);
}

.nav-item.active {
  background: linear-gradient(135deg, #ff6b9d 0%, #feca57 100%);
  color: white;
}

/* 响应式导航栏 */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 15px;
  }

  .nav-menu {
    justify-content: center;
  }

  .nav-item {
    padding: 8px 15px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .nav-logo {
    font-size: 1.5rem;
  }

  .nav-menu {
    width: 100%;
    justify-content: space-between;
  }

  .nav-item {
    padding: 6px 12px;
    font-size: 0.85rem;
    flex: 1;
    text-align: center;
  }
}

/* 页脚样式 */
footer {
  background: linear-gradient(135deg, var(--light-pink) 0%, var(--light-blue) 100%);
  padding: 40px 0 20px;
  margin-top: 60px;
  border-top: 3px solid white;
}

.footer-content {
  text-align: center;
  margin-bottom: 30px;
}

.footer-logo {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 15px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.social-link {
  position: relative;
  display: inline-block;
  width: 80px;
  height: 80px;
  background: white;
  border-radius: var(--border-radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.social-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.qr-code {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  background: white;
  padding: 10px;
  border-radius: var(--border-radius-medium);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.social-link:hover .qr-code {
  opacity: 1;
  visibility: visible;
  bottom: 60px;
}

.footer-copyright {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* 工具类 */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.d-flex {
  display: flex;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-10 {
  gap: 10px;
}

.gap-15 {
  gap: 15px;
}

.gap-20 {
  gap: 20px;
}

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

.mt-30 {
  margin-top: 30px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mb-30 {
  margin-bottom: 30px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .section {
    padding: 40px 0;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.8rem;
  }
  
  h3 {
    font-size: 1.3rem;
  }
  
  .footer-links {
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }
  
  .section {
    padding: 30px 0;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.2rem;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .footer-links {
    gap: 15px;
  }
}

/* 加载动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

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

::-webkit-scrollbar-track {
  background: var(--light-pink);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-radius: var(--border-radius-circle);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

/* 选择文本样式 */
::selection {
  background: var(--light-pink);
  color: var(--text-dark);
}

::-moz-selection {
  background: var(--light-pink);
  color: var(--text-dark);
}

/* 焦点样式 */
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 隐藏元素 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 关键词Tab切换模块 */
.keywords-tabs {
  margin-top: 30px;
  background: white;
  border-radius: var(--border-radius-large);
  padding: 25px;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
}

.keywords-tabs:hover {
  box-shadow: var(--shadow-hover);
}

.keywords-tab-header {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--light-pink);
  padding-bottom: 10px;
}

.keywords-tab-button {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--light-pink);
  border-radius: 20px 20px 0 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-light);
  transition: all 0.3s ease;
  position: relative;
}

.keywords-tab-button:hover {
  background: var(--light-pink);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.keywords-tab-button.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.keywords-tab-pane {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.keywords-tab-pane.active {
  display: block;
}

.keywords-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keywords-list li {
  padding: 8px 16px;
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--light-pink);
}

.keywords-list li:hover {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.keywords-tab-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.keywords-tab-title::before {
  content: '🏷️';
  font-size: 1.3rem;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .keywords-tabs {
    padding: 20px;
  }
  
  .keywords-tab-header {
    gap: 8px;
  }
  
  .keywords-tab-button {
    padding: 8px 15px;
    font-size: 0.9rem;
  }
  
  .keywords-list {
    gap: 8px;
  }
  
  .keywords-list li {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .keywords-tabs {
    padding: 15px;
  }
  
  .keywords-tab-button {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  
  .keywords-list li {
    padding: 5px 10px;
    font-size: 0.8rem;
  }
  
  .keywords-tab-title {
    font-size: 1.1rem;
  }
}