/**
 * 开山村乡村非遗网站 - 主样式文件
 */

/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #C41E3A;
    --secondary-color: #D4A76A;
    --accent-color: #3A4F7A;
    --text-color: #333333;
    --text-light: #666666;
    --bg-light: #F5F5DC;
    --bg-white: #FFFFFF;
    --border-color: #E5E5E5;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
}

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

ul {
    list-style: none;
}

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

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

/* ========== 头部样式 ========== */
.site-header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

.logo-text {
    font-size: 22px;
    font-weight: bold;
    color: #5D4037;
}

.main-nav ul {
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: #5D4037;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #5D4037;
    transition: var(--transition);
}

/* ========== 主内容区域 ========== */
.main-content {
    min-height: calc(100vh - 200px);
    padding-top: 80px;
}

/* ========== 轮播图 ========== */
.hero-section {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.carousel {
    position: relative;
    height: 100%;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-item.active {
    opacity: 1;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 10;
}

.carousel-content h2 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-content p {
    font-size: 20px;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.carousel-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 5px;
    font-weight: 500;
}

.carousel-btn:hover {
    background: #a01830;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.carousel-dot.active {
    background: white;
}

/* ========== 快速导航 ========== */
.quick-nav {
    background: white;
    margin-top: -50px;
    position: relative;
    z-index: 20;
    padding: 30px 0;
    box-shadow: var(--shadow);
}

.quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 20px;
}

.quick-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background: var(--bg-light);
    transition: var(--transition);
}

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

.quick-nav-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 10px;
    color: white;
}

.quick-nav-item:nth-child(1) .quick-nav-icon { background: var(--primary-color); }
.quick-nav-item:nth-child(2) .quick-nav-icon { background: var(--secondary-color); }
.quick-nav-item:nth-child(3) .quick-nav-icon { background: var(--accent-color); }
.quick-nav-item:nth-child(4) .quick-nav-icon { background: #4CAF50; }
.quick-nav-item:nth-child(5) .quick-nav-icon { background: #5D4037; }
.quick-nav-item:nth-child(6) .quick-nav-icon { background: var(--primary-color); }
.quick-nav-item:nth-child(7) .quick-nav-icon { background: var(--secondary-color); }

.quick-nav-item h3 {
    font-size: 14px;
    color: #5D4037;
}

/* ========== 通用区块 ========== */
.section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 36px;
    color: #5D4037;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

.section-title p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* ========== 卡片样式 ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    font-size: 20px;
    color: #5D4037;
    margin-bottom: 10px;
}

.card-content p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
}

.card-link {
    color: var(--primary-color);
    font-weight: 500;
}

/* ========== 新闻列表 ========== */
.news-list {
    background: white;
}

.news-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.news-item:hover {
    background: var(--bg-light);
}

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

.news-item-image {
    width: 200px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.news-item-content {
    flex: 1;
}

.news-item-content h3 {
    font-size: 18px;
    color: #5D4037;
    margin-bottom: 10px;
}

.news-item-content .meta {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 10px;
}

.news-item-content p {
    color: var(--text-light);
    font-size: 14px;
}

/* ========== 表格样式 ========== */
.data-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: #5D4037;
}

.data-table tr:hover {
    background: #fafafa;
}

/* ========== 表单样式 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #5D4037;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: #a01830;
}

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

.btn-secondary:hover {
    background: #c4965a;
}

/* ========== 页面标题 ========== */
.page-header {
    background: linear-gradient(135deg, #5D4037, #8D6E63);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 42px;
    margin-bottom: 15px;
}

.page-header p {
    font-size: 18px;
    opacity: 0.9;
}

/* ========== 底部样式 ========== */
.site-footer {
    background: #5D4037;
    color: white;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    opacity: 0.8;
}

.footer-section a:hover {
    opacity: 1;
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
}

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

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: #5D4037;
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .main-nav {
        display: none;
        width: 100%;
        padding-top: 20px;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 15px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .quick-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-item {
        flex-direction: column;
    }
    
    .news-item-image {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .quick-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}
