/* 
Theme ID: ecms205-modern 
Author: 墨鱼 (优化版)
*/

/* ===== 基础重置 ===== */
:root {
  --primary-color: #1487f4;
  --secondary-color: #0976dc;
  --accent-color: #ff6600;
  --text-color: #333;
  --light-text: #888;
  --bg-color: #f8f9fa;
  --card-bg: #fff;
  --border-color: #eaeaea;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
}

ul, ol {
  list-style: none;
}

/* ===== 工具类 ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

.hidden {
  display: none;
}

.text-center {
  text-align: center;
}

/* ===== 头部样式 ===== */
.header {
  background: var(--card-bg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  background: #f8f8f8;
  padding: 8px 0;
  border-bottom: 1px solid #ddd;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.search-box {
  position: relative;
  flex-grow: 1;
  max-width: 500px;
}

.search-box input {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid var(--primary-color);
  border-radius: 4px;
}

/* ===== 导航栏 ===== */
.navbar {
  background: var(--primary-color);
}

.nav-menu {
  display: flex;
  justify-content: center;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: white;
  padding: 15px 20px;
  display: block;
}

.nav-link:hover {
  background: var(--secondary-color);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--secondary-color);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
}

/* ===== 主要内容区 ===== */
.main-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding: 30px 0;
}

@media (min-width: 992px) {
  .main-content {
    grid-template-columns: 2fr 1fr;
  }
}

/* ===== 卡片样式 ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-img {
  height: 200px;
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-img img {
  transform: scale(1.05);
}

.card-body {
  padding: 20px;
}

.card-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.card-text {
  color: var(--light-text);
  margin-bottom: 15px;
}

/* ===== 页脚 ===== */
.footer {
  background: #333;
  color: #777;
  padding: 40px 0;
  position: relative;
}

.footer::before {
  content: "";
  background: linear-gradient(to left, #1487f4, #5ac8fa, #007aff, #5ac8fa);
  height: 10px;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
}

.footer-title {
  color: #34aadc;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }
  
  .nav-menu {
    flex-direction: column;
  }
  
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    display: none;
  }
  
  .nav-item:hover .dropdown-menu {
    display: block;
  }
}

/* ===== 动画效果 ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

/* ===== 按钮样式 ===== */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  text-align: center;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--secondary-color);
  color: white;
}

.btn-outline {
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* ===== 特色组件 ===== */
/* 标签云 */
.tag-cloud a {
  display: inline-block;
  padding: 5px 10px;
  margin: 0 5px 5px 0;
  background: #f1f1f1;
  border-radius: 3px;
  font-size: 0.9rem;
}

.tag-cloud a:hover {
  background: var(--primary-color);
  color: white;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 30px;
}

.page-item {
  display: inline-block;
}

.page-link {
  padding: 8px 15px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
}

.page-link.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}