/* 全局样式 */
:root {
  /* 主色调 */
  --primary-color: #2c3e50;
  --primary-light: #3498db;
  --primary-dark: #1a252f;
  
  /* 辅助色 */
  --secondary-color: #e74c3c;
  --secondary-light: #ec7063;
  
  /* 背景色 */
  --bg-color: #f5f6fa;
  --bg-white: #ffffff;
  --bg-dark: #2c3e50;
  
  /* 文字颜色 */
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --text-light: #bdc3c7;
  --text-white: #ffffff;
  
  /* 边框颜色 */
  --border-color: #dcdde1;
  --border-light: #ecf0f1;
  
  /* 阴影 */
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
  
  /* 圆角 */
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 20px;
  
  /* 过渡 */
  --transition: all 0.3s ease;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-color);
}

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

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

img {
  max-width: 100%;
  height: auto;
}

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

/* 头部导航 */
header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: var(--text-white);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo h1 span {
  color: var(--secondary-light);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav ul li a {
  color: var(--text-white);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

nav ul li a:hover,
nav ul li a.active {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--text-white);
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 1.5rem;
  cursor: pointer;
}

/* 主要内容区 */
main {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* 页面标题 */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: var(--text-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.page-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.page-header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* 卡片样式 */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

/* 网格布局 */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
  color: var(--text-white);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--text-white);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--primary-color);
  border: 2px solid var(--primary-light);
}

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

/* 表单样式 */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* 搜索框 */
.search-box {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-box .form-control {
  flex: 1;
}

/* 标签/徽章 */
.badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--primary-light);
  color: var(--text-white);
  border-radius: 20px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* 文章列表 */
.article-list {
  list-style: none;
}

.article-item {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.article-item:hover {
  background-color: var(--bg-color);
}

.article-item:last-child {
  border-bottom: none;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.article-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.article-title a {
  color: var(--text-primary);
}

.article-title a:hover {
  color: var(--primary-light);
}

.article-summary {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 图片画廊 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.gallery-caption {
  padding: 1rem;
  background: var(--bg-white);
}

.gallery-caption h4 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.gallery-caption p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* 视频容器 */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 留言板 */
.留言-list {
  list-style: none;
}

.留言-item {
  padding: 1.5rem;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.留言-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.留言-author {
  font-weight: 600;
  color: var(--primary-color);
}

.留言-time {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.留言-content {
  color: var(--text-primary);
  line-height: 1.6;
}

.留言-email {
  font-size: 0.85rem;
}

/* 链接列表 */
.link-list {
  list-style: none;
}

.link-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.link-item:hover {
  transform: translateX(10px);
  box-shadow: var(--shadow-md);
}

.link-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  color: var(--text-white);
  font-size: 1.2rem;
}

.link-info h4 {
  margin-bottom: 0.3rem;
  color: var(--primary-color);
}

.link-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* 广告区域 */
.ad-section {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: var(--text-white);
  padding: 3rem;
  border-radius: var(--radius-md);
  margin: 2rem 0;
  text-align: center;
}

.ad-section h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.ad-section p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* 广告图片轮播区域 */
.ad-banner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.ad-banner-item {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.ad-banner-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.ad-banner-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.ad-banner-caption {
  padding: 1rem;
  text-align: center;
}

.ad-banner-caption h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.ad-banner-caption p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.ad-banner-caption .badge {
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .ad-banner-grid {
    grid-template-columns: 1fr;
  }
}

/* 图片预览模态框 */
.image-preview-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.image-preview-overlay.active {
  display: flex;
}

/* 侧边栏 */
.sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-widget {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-widget h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
}

/* 页脚 */
footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

footer .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-section h3 {
  color: var(--text-white);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-section p,
.footer-section li {
  margin-bottom: 0.5rem;
}

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

.footer-section a {
  color: var(--text-light);
}

.footer-section a:hover {
  color: var(--text-white);
}

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

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

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in {
  animation: slideIn 0.5s ease forwards;
}

/* 提示消息 */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary-color);
  color: var(--text-white);
  padding: 1rem 2rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: #27ae60;
}

.toast.error {
  background: var(--secondary-color);
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 2rem;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 响应式设计 */
@media (max-width: 992px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  footer .container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-color);
    padding: 1rem;
    box-shadow: var(--shadow-md);
  }
  
  nav.active {
    display: block;
  }
  
  nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  nav ul li a {
    display: block;
    padding: 0.8rem 1rem;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .page-header h2 {
    font-size: 2rem;
  }
  
  .search-box {
    flex-direction: column;
  }
  
  footer .container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .page-header {
    padding: 1.5rem;
  }
  
  .page-header h2 {
    font-size: 1.8rem;
  }
}

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

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex {
  display: flex;
}

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

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

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }