/* 全局样式 */
:root {
  --primary-color: #228b22;
  --secondary-color: #32cd32;
  --primary-light: rgba(34, 139, 34, 0.8);
  --primary-dark: rgba(0, 100, 0, 0.8);
  --primary-shadow: rgba(34, 139, 34, 0.4);
  --primary-hover-shadow: rgba(34, 139, 34, 0.2);
  --primary-card-shadow: rgba(34, 139, 34, 0.15);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

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

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

/* 首页特有样式 */

/* 英雄区域样式 */
.hero-section {
    background: linear-gradient(var(--primary-light), var(--primary-dark)),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 400"><rect fill="%23f8f9fa" width="1200" height="400"/><g fill="%2328a745" opacity="0.1"><circle cx="100" cy="100" r="50"/><circle cx="500" cy="200" r="80"/><circle cx="900" cy="150" r="60"/><circle cx="1100" cy="300" r="40"/></g></svg>');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 搜索区域样式 */
.search-section {
    max-width: 1000px;
    margin: 40px auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 10px;
}

.search-field {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.search-field label {
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.search-field input,
.search-field select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-field input:focus,
.search-field select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(34, 139, 34, 0.2);
    outline: none;
}

.search-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-search {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-search:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-reset {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.btn-hero {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: #ffcc00;
    color: var(--primary-color);
}

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

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-dark);
    padding: 10px;
    color: #333;
}

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

/* 快速导航区域 */
.quick-nav-section {
    background: white;
    padding: 60px 0;
    position: relative;
    z-index: 1;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 40px;
    position: relative;
}

.section-title:after {
    content: '';
    width: 80px;
    height: 3px;
    background: #ffcc00;
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.quick-nav-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.quick-nav-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--primary-hover-shadow);
    border-color: var(--primary-color);
}

.quick-nav-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.quick-nav-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.quick-nav-desc {
    color: #666;
    font-size: 0.9rem;
}

/* 文章列表区域 */
.posts-section {
    background: white;
    padding: 60px 0;
}

/* 搜索结果区域 */
.search-results-section {
    background: #f5f5f5;
    padding: 40px 0 60px;
    min-height: 70vh;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.search-title {
    font-size: 2rem;
    color: #333;
    margin: 0;
}

.search-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-form-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.search-results-container {
    position: relative;
}

.loading-indicator {
    text-align: center;
    padding: 40px 0;
    color: #666;
    font-size: 1.1rem;
}

.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-link:hover {
    background: #f0f0f0;
    color: var(--primary-color);
}

.pagination-link.active {
    background: var(--primary-color);
    color: white;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: #999;
}

.error-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .search-title {
        font-size: 1.5rem;
    }
    
    .search-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-row {
        grid-template-columns: 1fr;
    }
    
    .pagination-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

.posts-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.posts-title {
    font-size: 1.8rem;
    color: #333;
    position: relative;
    padding-left: 20px;
}

.posts-title:before {
    content: '';
    width: 4px;
    height: 30px;
    background: var(--primary-color);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.view-more-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s ease;
}

.view-more-btn:hover {
    gap: 10px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.post-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--primary-card-shadow);
    border-color: var(--primary-color);
}

.post-card-body {
    padding: 25px;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    display: block;
    margin-bottom: 15px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-title:hover {
    color: var(--primary-color);
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-views {
    display: flex;
    align-items: center;
    gap: 5px;
}

.no-posts {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 60px 0;
    font-size: 1.1rem;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-nav-grid {
        grid-template-columns: 1fr;
    }
    
    .posts-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}