/* ============================================
   碑文网 - 主样式表
   ============================================ */

/* CSS 变量 */
:root {
    --primary-color: #8B4513;
    --primary-dark: #6B3410;
    --primary-light: #A0522D;
    --secondary-color: #D4A574;
    --accent-color: #C41E3A;
    --text-color: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --bg-color: #FDF8F3;
    --bg-light: #FFF9F2;
    --border-color: #E8DDD3;
    --white: #FFFFFF;
    --shadow: 0 2px 10px rgba(139, 69, 19, 0.1);
    --shadow-hover: 0 5px 20px rgba(139, 69, 19, 0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
}

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

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

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

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

ul, ol {
    list-style: none;
}

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

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

/* 顶部栏 */
.top-bar {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: var(--white);
    padding: 8px 0;
    font-size: 13px;
}

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

.top-bar-left span {
    margin-right: 20px;
}

.top-bar-left i,
.top-bar-right i {
    margin-right: 5px;
}

/* 头部 */
.header {
    background: var(--white);
    padding: 20px 0;
    box-shadow: var(--shadow);
}

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

.logo a {
    display: flex;
    align-items: flex-end;
    text-decoration: none;
}

.logo img {
    height: 50px;
    max-width: 200px;
    width: auto;
    margin-right: 15px;
    vertical-align: middle;
    object-fit: contain;
}

.logo h1 {
    font-size: 32px;
    color: var(--primary-color);
    font-weight: bold;
    letter-spacing: 3px;
}

.logo p {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

.header-search {
    display: flex;
    align-items: center;
}

.header-search form {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    overflow: hidden;
    transition: var(--transition);
}

.header-search form:focus-within {
    border-color: var(--primary-color);
}

.header-search input {
    width: 280px;
    padding: 10px 20px;
    border: none;
    outline: none;
    font-size: 14px;
}

.header-search button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.header-search button:hover {
    background: var(--primary-dark);
}

/* 主导航 */
.main-nav {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.main-nav .container {
    margin: 0 auto;
    padding-left: 15px;
}

.nav-list {
    display: flex;
    justify-content: flex-start;
}

.nav-list li {
    position: relative;
}

.nav-list li a {
    display: block;
    padding: 15px 22px;
    color: var(--white);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 1px;
    transition: var(--transition);
}

.nav-list li a:hover,
.nav-list li.active a {
    background: rgba(255,255,255,0.15);
}

.nav-list li a i {
    margin-right: 5px;
}

.mobile-menu-toggle {
    display: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

/* Banner区域 */
.banner {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
    padding: 60px 0;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="80" opacity="0.05">碑</text></svg>') repeat;
    background-size: 150px;
}

.banner-content {
    position: relative;
    z-index: 1;
}

.banner h2 {
    font-size: 42px;
    margin-bottom: 15px;
    letter-spacing: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.banner p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.banner-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.banner-btn {
    display: inline-block;
    padding: 12px 35px;
    background: var(--accent-color);
    color: var(--white);
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
}

.banner-btn:hover {
    background: #A01830;
    transform: translateY(-2px);
    color: var(--white);
}

.banner-btn-outline {
    background: transparent;
    border: 2px solid var(--white);
}

.banner-btn-outline:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* 特色服务 */
.features {
    padding: 50px 0;
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.feature-item {
    text-align: center;
    padding: 30px 20px;
    border-radius: var(--radius);
    transition: var(--transition);
    background: var(--bg-light);
}

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

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 28px;
}

.feature-item h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.feature-item p {
    color: var(--text-light);
    font-size: 13px;
}

/* 内容区块 */
.section {
    padding: 50px 0;
}

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

.section-header h2 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.section-header p {
    color: var(--text-light);
    margin-top: 15px;
}

/* 文章卡片 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

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

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

.article-card .card-image {
    height: 180px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 48px;
    position: relative;
}

.article-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-card .card-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-color);
    color: var(--white);
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 12px;
}

.article-card .card-body {
    padding: 20px;
}

.article-card .card-title {
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.article-card .card-desc {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
}

.article-card .card-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-lighter);
    font-size: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.article-card .card-meta span i {
    margin-right: 3px;
}

/* 文章列表样式 */
.article-list {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

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

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

.article-list-item .item-image {
    width: 200px;
    height: 130px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-right: 20px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 36px;
}

.article-list-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-list-item .item-content {
    flex: 1;
}

.article-list-item .item-title {
    font-size: 18px;
    margin-bottom: 10px;
}

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

.article-list-item .item-desc {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-list-item .item-meta {
    display: flex;
    gap: 20px;
    color: var(--text-lighter);
    font-size: 12px;
}

.article-list-item .item-meta span i {
    margin-right: 3px;
}

/* 文章导航 */
.article-nav {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.article-nav > div {
    display: flex;
}

.article-nav a, .nav-disabled {
    flex: 1;
    padding: 15px 20px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.article-nav a:hover {
    border-color: var(--primary-color);
    background: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.nav-label {
    font-size: 12px;
    color: var(--text-lighter);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.nav-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f9f9f9;
}

.nav-disabled .nav-title {
    color: #999;
    font-weight: normal;
}

@media (max-width: 576px) {
    .article-nav {
        grid-template-columns: 1fr;
    }
}

/* 侧边栏 */
.sidebar {
}

.sidebar-widget {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 25px;
}

.sidebar-widget:first-child {
    margin-top: 0;
}

.sidebar-widget h3 {
    font-size: 18px;
    color: var(--primary-color);
    padding-bottom: 12px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.sidebar-widget h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--primary-color);
}

.sidebar-widget ul.article-list {
    counter-reset: item;
}

.sidebar-widget ul.article-list li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
    counter-increment: item;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.sidebar-widget ul.article-list li::before {
    content: counter(item);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    border-radius: 3px;
    margin-right: 10px;
    flex-shrink: 0;
}

.sidebar-widget ul.article-list li:nth-child(n+4)::before {
    background: var(--text-lighter);
}

.sidebar-widget ul.article-list li:last-child {
    border-bottom: none;
}

.sidebar-widget ul li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

.sidebar-widget ul li:last-child {
    border-bottom: none;
}

.sidebar-widget ul li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-widget ul li a span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.sidebar-widget ul li a:hover {
    color: var(--primary-color);
}

.sidebar-widget ul li .count {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-lighter);
}

/* 文章详情页 */
.article-detail {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
}

.article-detail .detail-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.article-detail .detail-title {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.4;
}

.article-detail .detail-meta {
    display: flex;
    justify-content: center;
    gap: 25px;
    color: var(--text-lighter);
    font-size: 13px;
}

.article-detail .detail-meta span i {
    margin-right: 5px;
}

.article-detail .detail-content {
    font-size: 16px;
    line-height: 2;
    color: var(--text-color);
}

.article-detail .detail-content p {
    margin-bottom: 15px;
    text-indent: 2em;
}

.article-detail .detail-content h2,
.article-detail .detail-content h3 {
    color: var(--primary-color);
    margin: 25px 0 15px;
}

/* 面包屑导航 */
.breadcrumb {
    padding: 15px 0;
    font-size: 13px;
    color: var(--text-lighter);
}

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

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span {
    margin: 0 8px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination .page-link {
    display: inline-block;
    padding: 8px 15px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    transition: var(--transition);
    white-space: nowrap;
    min-width: 40px;
    text-align: center;
}

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

/* 商家卡片 */
.merchant-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.merchant-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    text-align: center;
    transition: var(--transition);
}

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

.merchant-card .merchant-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary-color);
}

.merchant-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

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

.merchant-card .merchant-info {
    font-size: 13px;
    color: var(--text-lighter);
}

.merchant-card .merchant-info i {
    margin-right: 5px;
    color: var(--primary-color);
}

/* 定制表单 */
.custom-form {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    max-width: 700px;
    margin: 0 auto;
}

.custom-form h3 {
    font-size: 22px;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group label .required {
    color: var(--accent-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

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

.form-submit {
    text-align: center;
    margin-top: 30px;
}

.form-submit button {
    padding: 12px 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.form-submit button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

/* 页脚 */
.footer {
    background: linear-gradient(135deg, #2C1810, #3D2317);
    color: var(--white);
    padding: 50px 0 0;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

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

.footer-col p {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    line-height: 1.8;
}

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

.footer-col ul li a {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-info li i {
    color: var(--secondary-color);
    width: 16px;
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
}

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

@media (max-width: 768px) {
    .top-bar {
        display: none;
    }
    
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .header-search {
        margin-top: 15px;
    }
    
    .header-search input {
        width: 200px;
    }
    
    .nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-color);
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-nav .container {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .banner h2 {
        font-size: 28px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .article-list-item {
        flex-direction: column;
    }
    
    .article-list-item .item-image {
        width: 100%;
        height: 180px;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .merchant-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-top {
        grid-template-columns: 1fr;
    }
    
    .article-detail {
        padding: 20px;
    }
    
    .article-detail .detail-title {
        font-size: 22px;
    }
    
    .custom-form {
        padding: 20px;
    }
}

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.clearfix::after {
    content: '';
    display: table;
    clear: both;
}
