/* ==================== 江南烟雨古风主题 - www.jfsv.cn ==================== */
/* 适配 Halo Theme Cosolar - 2026-11-06 */

:root {
    /* 江南配色：青砖黛瓦 */
    --daiwa-hui: #2F3A45;
    --qingzhuan: #4A5C6A;
    --fenqiang: #F5F5F0;
    --moshui: #1A2332;
    --yanyu: #8B9DAF;
    --shuimo-nong: #2B3A48;
    --shuimo-dan: #7A8A9A;
    --shuimo-qing: #B5C4D3;
    --zhuyeqing: #5D7C66;
    --lianhe: #D4A5A5;
    --meihong: #C44536;
    --liulv: #88B04B;
    --xuanzhi: #FAF9F5;
    --qingshi: #6B7B8C;
}

@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Serif+SC:wght@400;700;900&display=swap');

/* ==================== 全局覆盖 ==================== */
body {
    font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", serif !important;
    background: var(--fenqiang) !important;
    color: var(--moshui) !important;
    line-height: 2 !important;
    letter-spacing: 0.05em !important;
    position: relative;
}

/* 宣纸纹理 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
        repeating-linear-gradient(90deg, transparent 0px, rgba(74,92,106,0.015) 1px, transparent 2px),
        repeating-linear-gradient(0deg, transparent 0px, rgba(74,92,106,0.02) 1px, transparent 2px),
        radial-gradient(circle at 23% 47%, rgba(43,58,72,0.02) 1px, transparent 1px),
        radial-gradient(circle at 67% 73%, rgba(43,58,72,0.015) 1px, transparent 1px);
    background-size: 3px 3px, 3px 3px, 13px 13px, 17px 17px;
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
}

/* ==================== 江南山水背景 ==================== */
.landscape-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    opacity: 0.12;
    pointer-events: none;
}

.mountains {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 400px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 400" preserveAspectRatio="none"><path d="M0,400 L0,200 Q150,120 300,180 Q450,140 600,200 Q750,160 900,220 Q1050,180 1200,240 L1200,400 Z" fill="%234A5C6A" opacity="0.3"/><path d="M0,400 L0,260 Q200,200 400,260 Q600,220 800,280 Q1000,240 1200,300 L1200,400 Z" fill="%234A5C6A" opacity="0.2"/><path d="M0,400 L0,320 Q300,280 600,320 Q900,300 1200,340 L1200,400 Z" fill="%234A5C6A" opacity="0.15"/></svg>') no-repeat bottom center;
    background-size: cover;
}

/* ==================== 江南烟雨效果 ==================== */
.rain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.rain-drop {
    position: absolute;
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, transparent 0%, rgba(139,157,175,0.3) 50%, transparent 100%);
    opacity: 0;
    animation: rainFall 1.5s linear infinite;
}

@keyframes rainFall {
    0% { transform: translateY(-50px); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.3; }
    100% { transform: translateY(100vh); opacity: 0; }
}

.mist {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.mist-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(139,157,175,0.08) 0%, transparent 60%);
    animation: mistDrift 20s ease-in-out infinite;
}

@keyframes mistDrift {
    0%, 100% { transform: translateX(0) translateY(0); opacity: 0.3; }
    50% { transform: translateX(50px) translateY(-20px); opacity: 0.5; }
}

/* ==================== 导航栏：飞檐造型 ==================== */
header, .header, .site-header {
    background: rgba(245,245,240,0.92) !important;
    backdrop-filter: blur(20px) saturate(120%) !important;
    border-bottom: 2px solid var(--qingshi) !important;
    box-shadow: 0 4px 16px rgba(47,58,69,0.15) !important;
    position: relative;
}

/* 飞檐轮廓 */
header::before, .header::before, .site-header::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 15" preserveAspectRatio="none"><path d="M0,15 Q50,5 100,12 Q150,8 200,15 Q250,5 300,12 Q350,8 400,15 Q450,5 500,12 Q550,8 600,15 Q650,5 700,12 Q750,8 800,15 Q850,5 900,12 Q950,8 1000,15 Q1050,5 1100,12 Q1150,8 1200,15 L1200,15 L0,15 Z" fill="%232F3A45" opacity="0.3"/></svg>') repeat-x;
    background-size: 200px 15px;
    z-index: -1;
}

/* Logo 样式 */
.site-title, .site-name, h1.site-title {
    font-family: "Ma Shan Zheng", "STXingkai", "KaiTi", serif !important;
    color: var(--moshui) !important;
    letter-spacing: 0.15em !important;
    position: relative;
}

.site-title:hover, .site-name:hover {
    color: var(--meihong) !important;
    filter: drop-shadow(2px 4px 8px rgba(196,69,54,0.4));
}

/* 导航链接 */
nav a, .nav-link, .menu-item a {
    color: var(--shuimo-nong) !important;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

nav a:hover, .nav-link:hover, .menu-item a:hover {
    color: var(--meihong) !important;
    background: rgba(196,69,54,0.05) !important;
}

/* ==================== 文章卡片：古建窗格 ==================== */
.post-card, .article-card, article {
    background: linear-gradient(145deg, rgba(250,249,245,0.98) 0%, rgba(245,245,240,0.95) 100%) !important;
    border: 3px solid var(--qingshi) !important;
    border-radius: 8px !important;
    box-shadow: 0 6px 24px rgba(47,58,69,0.15) !important;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

/* 窗棂纹样背景 */
.post-card::before, .article-card::before, article::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 250px;
    height: 250px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><rect x="10" y="10" width="180" height="180" fill="none" stroke="%234A5C6A" stroke-width="2" opacity="0.08"/><line x1="10" y1="100" x2="190" y2="100" stroke="%234A5C6A" stroke-width="2" opacity="0.08"/><line x1="100" y1="10" x2="100" y2="190" stroke="%234A5C6A" stroke-width="2" opacity="0.08"/><circle cx="100" cy="100" r="40" fill="none" stroke="%234A5C6A" stroke-width="2" opacity="0.08"/></svg>') no-repeat;
    background-size: contain;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.post-card:hover, .article-card:hover, article:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(47,58,69,0.25) !important;
    border-color: var(--meihong) !important;
}

/* 文章标题 */
h1, h2, h3, h4, h5, h6 {
    font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif !important;
    color: var(--moshui) !important;
    letter-spacing: 0.1em !important;
}

h1 { font-size: clamp(2rem, 6vw, 3rem) !important; }
h2 { font-size: clamp(1.5rem, 4vw, 2rem) !important; }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem) !important; }

/* ==================== 按钮：梅红样式 ==================== */
button, .btn, .button, a.button {
    background: linear-gradient(135deg, var(--meihong), #A23628) !important;
    color: var(--fenqiang) !important;
    border: 2px solid var(--meihong) !important;
    border-radius: 6px !important;
    font-family: "STKaiti", "KaiTi", serif !important;
    padding: 0.75rem 1.5rem !important;
    letter-spacing: 0.2em !important;
    transition: all 0.4s ease !important;
    box-shadow: 0 6px 20px rgba(196,69,54,0.35) !important;
    position: relative;
    overflow: hidden;
}

button:hover, .btn:hover, .button:hover, a.button:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 30px rgba(196,69,54,0.5) !important;
}

/* 次要按钮 */
button.secondary, .btn-secondary {
    background: transparent !important;
    color: var(--qingzhuan) !important;
    border: 2px solid var(--qingzhuan) !important;
}

button.secondary:hover, .btn-secondary:hover {
    background: var(--qingzhuan) !important;
    color: var(--fenqiang) !important;
}

/* ==================== 代码块：宣纸风格 ==================== */
pre, code {
    background: rgba(250,249,245,0.8) !important;
    border: 1px solid var(--qingshi) !important;
    border-radius: 4px !important;
    font-family: "Source Code Pro", "Consolas", monospace !important;
}

pre {
    padding: 1.5rem !important;
    box-shadow: 0 4px 16px rgba(47,58,69,0.1) !important;
}

code {
    padding: 0.2rem 0.5rem !important;
    color: var(--meihong) !important;
}

/* ==================== 引用块：诗词样式 ==================== */
blockquote {
    background: rgba(255,255,255,0.4) !important;
    border-left: 4px solid var(--meihong) !important;
    padding: 1.5rem 2rem !important;
    margin: 2rem 0 !important;
    font-family: "STKaiti", "KaiTi", serif !important;
    line-height: 2.5 !important;
    color: var(--shuimo-nong) !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 16px rgba(47,58,69,0.08) !important;
    position: relative;
}

blockquote::before {
    content: '"';
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 4rem;
    color: var(--shuimo-qing);
    opacity: 0.2;
    font-family: Georgia, serif;
}

/* ==================== 页脚：石桥廊道 ==================== */
footer, .footer, .site-footer {
    background: linear-gradient(180deg, transparent 0%, rgba(250,249,245,0.5) 15%, rgba(245,245,240,0.8) 60%, var(--qingshi) 100%) !important;
    border-top: 4px solid var(--daiwa-hui) !important;
    color: var(--fenqiang) !important;
    padding: 3rem 1rem !important;
    position: relative;
}

/* 石桥栏杆装饰 */
footer::before, .footer::before, .site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 80px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 80"><ellipse cx="200" cy="40" rx="80" ry="30" fill="none" stroke="%234A5C6A" stroke-width="3" opacity="0.15"/><ellipse cx="600" cy="40" rx="80" ry="30" fill="none" stroke="%234A5C6A" stroke-width="3" opacity="0.15"/><ellipse cx="1000" cy="40" rx="80" ry="30" fill="none" stroke="%234A5C6A" stroke-width="3" opacity="0.15"/><line x1="0" y1="20" x2="1200" y2="20" stroke="%234A5C6A" stroke-width="2" opacity="0.2"/><line x1="0" y1="60" x2="1200" y2="60" stroke="%234A5C6A" stroke-width="2" opacity="0.2"/></svg>') no-repeat center top;
    opacity: 0.6;
    pointer-events: none;
}

footer a, .footer a, .site-footer a {
    color: rgba(250,249,245,0.9) !important;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
}

footer a::after, .footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--fenqiang);
    transition: width 0.3s ease;
}

footer a:hover, .footer a:hover {
    color: var(--fenqiang) !important;
}

footer a:hover::after, .footer a:hover::after {
    width: 100%;
}

/* ==================== 侧边栏 ==================== */
.sidebar, aside {
    background: rgba(250,249,245,0.95) !important;
    border: 2px solid var(--qingshi) !important;
    border-radius: 8px !important;
    padding: 1.5rem !important;
    box-shadow: 0 4px 16px rgba(47,58,69,0.1) !important;
}

/* ==================== 标签/分类 ==================== */
.tag, .tags a, .category {
    background: rgba(74,92,106,0.1) !important;
    color: var(--shuimo-nong) !important;
    border: 1px solid var(--qingzhuan) !important;
    border-radius: 4px !important;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.875rem !important;
    transition: all 0.3s ease !important;
}

.tag:hover, .tags a:hover, .category:hover {
    background: var(--meihong) !important;
    color: var(--fenqiang) !important;
    border-color: var(--meihong) !important;
}

/* ==================== 分页 ==================== */
.pagination a, .page-numbers {
    background: var(--fenqiang) !important;
    border: 2px solid var(--qingzhuan) !important;
    color: var(--shuimo-nong) !important;
    border-radius: 4px !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease !important;
}

.pagination a:hover, .page-numbers:hover,
.pagination .current, .page-numbers.current {
    background: var(--qingzhuan) !important;
    color: var(--fenqiang) !important;
    border-color: var(--qingzhuan) !important;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    body {
        font-size: 16px !important;
    }
    
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    
    .post-card::before, .article-card::before, article::before {
        display: none;
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== 特殊元素覆盖 ==================== */
/* 确保所有链接在悬停时有过渡 */
a {
    transition: all 0.3s ease !important;
}

/* 图片圆角 */
img {
    border-radius: 8px !important;
}

/* 表格样式 */
table {
    border-collapse: collapse !important;
    width: 100% !important;
    background: var(--fenqiang) !important;
}

th, td {
    border: 1px solid var(--qingshi) !important;
    padding: 0.75rem !important;
    text-align: left !important;
}

th {
    background: rgba(74,92,106,0.1) !important;
    font-weight: 700 !important;
}

/* 输入框 */
input, textarea, select {
    background: var(--fenqiang) !important;
    border: 2px solid var(--qingshi) !important;
    border-radius: 4px !important;
    padding: 0.75rem !important;
    font-family: inherit !important;
    transition: all 0.3s ease !important;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--meihong) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(196,69,54,0.1) !important;
}

/* 水平分割线 */
hr {
    border: none !important;
    height: 2px !important;
    background: linear-gradient(90deg, transparent 0%, var(--qingshi) 50%, transparent 100%) !important;
    margin: 2rem 0 !important;
}
