﻿/* ============================================================
   青山共风雨 CMS 样式表
   命理风水 · 国学经典 · 易经智慧
   ============================================================ */

/* ---------- 变量与重置 ---------- */
:root {
    --primary: #8B4513;        /* 檀木棕 */
    --primary-dark: #5D2E0C;   /* 深褐色 */
    --secondary: #C19A6B;     /* 金沙色 */
    --accent: #D4AF37;        /* 金色 */
    --bg-main: #FDF8F0;        /* 米白底 */
    --bg-dark: #2C1810;       /* 深褐底 */
    --text: #3D2914;           /* 深棕文字 */
    --text-light: #7A6852;     /* 浅棕文字 */
    --border: #E8DCC8;        /* 边框色 */
    --white: #FFFFFF;
    --shadow: rgba(139, 69, 19, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg-main);
    color: var(--text);
    line-height: 1.8;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent);
}

img { max-width: 100%; height: auto; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 头部导航 ---------- */
.header {
    background: var(--bg-dark);
    color: var(--secondary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(193,154,107,0.2);
}

.logo-area { display: flex; align-items: center; gap: 12px; }

.logo-icon {
    font-size: 2rem;
}

.logo-text h1 {
    font-size: 1.5rem;
    color: var(--secondary);
    font-weight: 700;
    letter-spacing: 4px;
}

.logo-text span {
    font-size: 0.7rem;
    color: var(--text-light);
    letter-spacing: 2px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-actions a {
    color: var(--secondary);
    font-size: 0.85rem;
}

.header-actions a:hover {
    color: var(--accent);
}

/* 导航 */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 5px;
    padding: 10px 0;
}

.main-nav a {
    display: block;
    padding: 8px 20px;
    color: var(--secondary);
    border-radius: 4px;
    font-size: 0.95rem;
    transition: all 0.3s;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 60%;
}

.main-nav a:hover,
.main-nav a.active {
    background: rgba(193,154,107,0.1);
    color: var(--accent);
}

/* 移动端菜单 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* ---------- Banner ---------- */
.banner {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #3D1F10 100%);
    color: var(--secondary);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.banner::before {
    content: '☯';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20rem;
    opacity: 0.03;
    color: var(--accent);
    pointer-events: none;
}

.banner h2 {
    font-size: 2.5rem;
    letter-spacing: 8px;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.banner p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    letter-spacing: 2px;
}

/* ---------- 精选内容区 ---------- */
.featured-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 1.8rem;
    color: var(--primary-dark);
    letter-spacing: 4px;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
}

.section-title p {
    color: var(--text-light);
    margin-top: 10px;
    font-size: 0.95rem;
}

/* ---------- 文章卡片网格 ---------- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

.article-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.4s ease;
    border: 1px solid var(--border);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(139,69,19,0.15);
    border-color: var(--secondary);
}

.article-card.featured {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.article-card.featured .card-image {
    height: 100%;
    min-height: 300px;
}

.card-image {
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.article-card:hover .card-image img {
    transform: scale(1.05);
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent);
    color: var(--bg-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.card-badge.sticky {
    background: #c0392b;
    color: white;
}

.card-body {
    padding: 25px;
}

.card-category {
    display: inline-block;
    background: rgba(139,69,19,0.08);
    color: var(--primary);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.article-card:hover .card-category {
    background: var(--primary);
    color: white;
}

.card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    line-height: 1.5;
    color: var(--text);
}

.card-body h3 a {
    color: inherit;
}

.card-body h3 a:hover {
    color: var(--primary);
}

.card-excerpt {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 15px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #999;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.card-meta .author {
    color: var(--primary);
}

/* ---------- 分类列表页 ---------- */
.page-header {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #3D1F10 100%);
    color: var(--secondary);
    padding: 50px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.breadcrumb a { color: var(--secondary); }
.breadcrumb span { color: #666; }

/* ---------- 文章详情页 ---------- */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.article-detail .article-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border);
}

.article-detail .article-title {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
    letter-spacing: 2px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: #999;
    font-size: 0.9rem;
}

.article-meta span { display: flex; align-items: center; gap: 5px; }

.article-cover {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px var(--shadow);
}

.article-cover img {
    width: 100%;
    display: block;
}

.article-content {
    font-size: 1.05rem;
    line-height: 2;
    color: #444;
}

.article-content p {
    margin-bottom: 1.5em;
    text-indent: 2em;
}

.article-content h2 {
    color: var(--primary-dark);
    margin: 2em 0 1em;
    padding-left: 15px;
    border-left: 4px solid var(--accent);
    font-size: 1.4rem;
}

.article-content h3 {
    color: var(--primary);
    margin: 1.5em 0 0.8em;
    font-size: 1.2rem;
}

.article-tags {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.article-tags a {
    display: inline-block;
    background: rgba(139,69,19,0.08);
    padding: 4px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 4px;
    color: var(--primary);
    transition: all 0.3s;
}

.article-tags a:hover {
    background: var(--primary);
    color: white;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
    margin-top: 30px;
}

.widget {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px var(--shadow);
}

.widget-title {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
    letter-spacing: 2px;
}

.widget-categories li {
    list-style: none;
    border-bottom: 1px dashed var(--border);
}

.widget-categories a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    color: var(--text);
    font-size: 0.95rem;
}

.widget-categories a:hover {
    color: var(--primary);
    padding-left: 8px;
}

.widget-categories .count {
    background: rgba(139,69,19,0.1);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--primary);
}

.recent-post-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border);
}

.recent-post-item:last-child { border-bottom: none; }

.recent-post-item .thumb {
    width: 70px;
    height: 55px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
}

.recent-post-item .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-item h4 {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text);
}

.recent-post-item h4 a {
    color: inherit;
}

.recent-post-item h4 a:hover { color: var(--primary); }

.recent-post-item .date {
    font-size: 0.75rem;
    color: #999;
    margin-top: 4px;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    font-size: 0.9rem;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .prev,
.pagination .next {
    padding: 0 15px;
    font-size: 0.85rem;
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .dot {
    border: none;
    background: transparent;
    color: #999;
}

/* ---------- 联系表单 ---------- */
.contact-section {
    padding: 60px 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 50px;
    align-items: start;
}

.contact-info {
    background: var(--bg-dark);
    border-radius: 16px;
    padding: 40px;
    color: var(--secondary);
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    letter-spacing: 3px;
}

.contact-info p {
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.8;
}

.contact-form {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-group label .required {
    color: #e74c3c;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg-main);
    color: var(--text);
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139,69,19,0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    letter-spacing: 2px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139,69,19,0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--bg-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ---------- 底部 ---------- */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-brand h3 {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-bottom: 8px;
    letter-spacing: 3px;
}

.footer-brand p:first-of-type {
    font-size: 0.75rem;
    color: #8a7a6a;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.footer-brand p:last-of-type {
    font-size: 0.85rem;
    line-height: 1.9;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer h4 {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.footer p,
.footer a {
    font-size: 0.9rem;
    color: #8a7a6a;
    line-height: 2;
}

.footer a:hover {
    color: var(--accent);
}

.footer-links li {
    list-style: none;
    padding: 4px 0;
}

.footer-links li::before {
    content: '◈ ';
    color: var(--accent);
    font-size: 0.7rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
}

.footer-bottom .links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.footer-bottom .links a {
    color: var(--secondary);
}

/* ---------- 留言卡片 ---------- */
.message-board {
    padding: 60px 0;
}

.message-list {
    margin-top: 40px;
}

.message-item {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px var(--shadow);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.message-author {
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-author .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.message-date {
    color: #999;
    font-size: 0.85rem;
}

.message-content {
    color: #555;
    line-height: 1.8;
}

.message-reply {
    margin-top: 15px;
    padding: 15px;
    background: rgba(139,69,19,0.04);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
    color: #666;
    font-size: 0.9rem;
}

/* ---------- 工具提示 ---------- */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* ---------- 加载动画 ---------- */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .article-card.featured {
        grid-column: span 1;
        display: block;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    
    .header-top {
        flex-wrap: wrap;
    }
    
    .main-nav {
        display: none;
        width: 100%;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 2px;
    }
    
    .main-nav a {
        padding: 10px 15px;
        border-radius: 0;
    }
    
    .banner {
        padding: 50px 0;
    }
    
    .banner h2 {
        font-size: 1.6rem;
        letter-spacing: 4px;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .article-detail .article-title {
        font-size: 1.5rem;
    }
    
    .article-meta {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text);
}

.empty-state p {
    font-size: 0.95rem;
}

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ========== 导航下拉菜单 ========== */
.nav-dropdown-trigger {
    position: relative;
    cursor: pointer;
}
.nav-dropdown-trigger > a {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-dropdown-trigger > a .caret {
    font-size: 0.7rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: rgba(26, 16, 8, 0.72);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(193, 154, 107, 0.25);
    border-radius: 14px;
    padding: 8px;
    min-width: 210px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(193, 154, 107, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}
.nav-dropdown-trigger:hover .nav-dropdown-menu,
.nav-dropdown-trigger:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-trigger:hover .caret {
    transform: rotate(180deg);
}
.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px !important;
    font-size: 0.88rem !important;
    color: rgba(212, 175, 55, 0.85) !important;
    border-radius: 8px !important;
    margin: 1px 3px !important;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}
.nav-dropdown-menu a:hover {
    background: rgba(193, 154, 107, 0.2) !important;
    color: #D4AF37 !important;
    padding-left: 18px !important;
}
.nav-dropdown-divider {
    height: 1px;
    background: rgba(193, 154, 107, 0.18);
    margin: 5px 8px;
}
.nav-dropdown-cta {
    background: rgba(233, 30, 99, 0.15) !important;
    color: #f8bbd0 !important;
    border: 1px solid rgba(244, 143, 177, 0.3) !important;
    border-radius: 10px !important;
    margin: 6px 4px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
}
.nav-dropdown-cta:hover {
    background: rgba(233, 30, 99, 0.28) !important;
    color: #fff !important;
    padding-left: 14px !important;
}