/**
 * 水墨风格中国风主题样式
 * Chinese Ink Wash Painting Style
 */

/* ====================
   配色方案
   ==================== */
:root {
    --ink-black: #1a1a1a;
    --ink-light: #2d2d2d;
    --ink-gray: #5a5a5a;
    --ink-wash: #8b8b8b;
    --rice-paper: #f5f0e6;
    --rice-paper-dark: #e8e4d9;
    --cinnabar-red: #b22222;
    --gold-accent: #d4af37;
    --jade-green: #5a8f7b;
    --porcelain-blue: #2b5797;
}

/* ====================
   全局样式
   ==================== */
body {
    background-color: var(--rice-paper);
    background-image: 
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.08"/></svg>');
    font-family: 'Noto Serif SC', 'Source Han Serif SC', '思源宋体', 'STSong', serif;
    color: var(--ink-black);
    line-height: 1.8;
}

/* 加载书法字体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700;900&display=swap');

/* ====================
   标题样式 - 书法字体效果
   ==================== */
h1, h2, h3, h4, h5, h6,
.site-header .site-title,
.site-header .main-navigation a,
.ast-header-break-point .main-navigation a {
    font-family: 'Noto Serif SC', 'Ma Shan Zheng', cursive, serif;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

h1 {
    font-size: 2.8em;
    border-bottom: 3px solid var(--cinnabar-red);
    padding-bottom: 0.5em;
    display: inline-block;
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gold-accent);
}

h2 {
    font-size: 2.2em;
    color: var(--ink-black);
    position: relative;
    padding-left: 20px;
}

h2::before {
    content: '◆';
    position: absolute;
    left: 0;
    color: var(--cinnabar-red);
    font-size: 0.8em;
    top: 50%;
    transform: translateY(-50%);
}

/* ====================
   导航栏 - 中式窗棂风格
   ==================== */
.site-header {
    background: linear-gradient(180deg, var(--ink-black) 0%, var(--ink-light) 100%);
    border-bottom: 4px solid var(--cinnabar-red);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        var(--gold-accent) 0px,
        var(--gold-accent) 2px,
        transparent 2px,
        transparent 8px
    );
    animation: shimmer 3s linear infinite;
}

.main-navigation a {
    color: var(--rice-paper) !important;
    padding: 15px 25px !important;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.main-navigation a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--gold-accent);
    transition: all 0.4s ease;
    transform: translateX(-50%);
}

.main-navigation a:hover {
    color: var(--gold-accent) !important;
    background: rgba(212, 175, 55, 0.1);
}

.main-navigation a:hover::before {
    width: 80%;
}

/* ====================
   按钮 - 印章风格
   ==================== */
button, .button, input[type="submit"], .wp-element-button {
    background: linear-gradient(135deg, var(--cinnabar-red) 0%, #8b1a1a 100%);
    color: var(--rice-paper);
    border: 2px solid var(--cinnabar-red);
    border-radius: 8px;
    padding: 12px 30px;
    font-family: 'Noto Serif SC', serif;
    font-weight: 600;
    letter-spacing: 0.1em;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(178, 34, 34, 0.3);
    position: relative;
    overflow: hidden;
}

button::before, .button::before, input[type="submit"]::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
}

button:hover, .button:hover, input[type="submit"]:hover {
    background: linear-gradient(135deg, #8b1a1a 0%, var(--cinnabar-red) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(178, 34, 34, 0.5);
}

button:hover::before, .button:hover::before, input[type="submit"]:hover::before {
    left: 100%;
}

/* ====================
   卡片/容器 - 卷轴风格
   ==================== */
.ast-container,
.site-content .ast-container,
.ast-row {
    background: rgba(245, 240, 230, 0.95);
    border: 1px solid var(--rice-paper-dark);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(212, 175, 55, 0.1);
    border-radius: 4px;
    position: relative;
}

/* 四角装饰 */
.ast-container::before,
.ast-container::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--gold-accent);
    transition: all 0.5s ease;
}

.ast-container::before {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.ast-container::after {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

/* ====================
   分隔线 - 回纹装饰
   ==================== */
hr {
    border: none;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        var(--cinnabar-red) 0px,
        var(--cinnabar-red) 20px,
        var(--gold-accent) 20px,
        var(--gold-accent) 22px,
        transparent 22px,
        transparent 40px
    );
    margin: 40px 0;
    position: relative;
}

hr::before {
    content: '❖';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--cinnabar-red);
    font-size: 1.5em;
    background: var(--rice-paper);
    padding: 0 15px;
}

/* ====================
   链接样式
   ==================== */
a {
    color: var(--cinnabar-red);
    transition: all 0.3s ease;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold-accent);
    transition: width 0.3s ease;
}

a:hover {
    color: var(--gold-accent);
}

a:hover::after {
    width: 100%;
}

/* ====================
   页脚 - 中式波浪纹
   ==================== */
.site-footer {
    background: linear-gradient(180deg, var(--ink-light) 0%, var(--ink-black) 100%);
    color: var(--rice-paper);
    border-top: 4px solid var(--gold-accent);
    position: relative;
    padding: 60px 0 30px;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 60" preserveAspectRatio="none"><path d="M0,30 C150,60 300,0 450,30 C600,60 750,0 900,30 C1050,60 1200,0 1200,30 L1200,60 L0,60 Z" fill="%231a1a1a"/></svg>');
    background-size: cover;
}

.site-footer a {
    color: var(--gold-accent);
}

/* ====================
   动态效果
   ==================== */

/* 水墨晕染动画 */
@keyframes ink-spread {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 0.1;
    }
}

.ink-blob {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(26, 26, 26, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: ink-spread 2s ease-out forwards;
    filter: blur(20px);
}

/* 飘落花瓣/叶片动画 */
@keyframes petal-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg) translateX(0);
        opacity: 1;
    }
    25% {
        transform: translateY(-25vh) rotate(90deg) translateX(50px);
    }
    50% {
        transform: translateY(50vh) rotate(180deg) translateX(-30px);
    }
    75% {
        transform: translateY(75vh) rotate(270deg) translateX(40px);
    }
    100% {
        transform: translateY(100vh) rotate(360deg) translateX(0);
        opacity: 0;
    }
}

.falling-petal {
    position: fixed;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--cinnabar-red), transparent);
    border-radius: 50% 0 50% 0;
    pointer-events: none;
    z-index: 9998;
    animation: petal-fall 8s linear infinite;
    opacity: 0.6;
}

.falling-petal:nth-child(2) { animation-delay: 2s; left: 20%; }
.falling-petal:nth-child(3) { animation-delay: 4s; left: 40%; }
.falling-petal:nth-child(4) { animation-delay: 1s; left: 60%; }
.falling-petal:nth-child(5) { animation-delay: 3s; left: 80%; }

/* 导航栏金光闪烁 */
@keyframes shimmer {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.3;
    }
}

/* 云雾飘动动画 */
@keyframes cloud-drift {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    20% {
        opacity: 0.3;
    }
    80% {
        opacity: 0.3;
    }
    100% {
        transform: translateX(100vw);
        opacity: 0;
    }
}

.cloud {
    position: fixed;
    width: 400px;
    height: 100px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 100"><ellipse cx="200" cy="50" rx="150" ry="40" fill="rgba(255,255,255,0.1)"/><ellipse cx="100" cy="60" rx="80" ry="30" fill="rgba(255,255,255,0.08)"/><ellipse cx="300" cy="60" rx="80" ry="30" fill="rgba(255,255,255,0.08)"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1;
    animation: cloud-drift 60s linear infinite;
}

.cloud:nth-child(2) { animation-delay: -20s; top: 100px; }
.cloud-cloud:nth-child(3) { animation-delay: -40s; top: 200px; }

/* 标题浮现动画 */
@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

h1, h2, h3, h4, h5, h6 {
    animation: fade-in-up 0.8s ease-out;
}

/* 卡片悬浮效果 */
.ast-container:hover,
.site-content .ast-container:hover {
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(212, 175, 55, 0.3);
    transform: translateY(-5px);
    transition: all 0.4s ease;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--rice-paper-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--cinnabar-red), var(--ink-black));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--gold-accent), var(--cinnabar-red));
}

/* ====================
   Hero 区域特殊样式
   ==================== */
.ast-hero-section,
.hero-section,
header .ast-container:first-child {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9) 0%, rgba(45, 45, 45, 0.8) 100%),
                url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><path d="M0,400 C300,350 400,450 600,400 C800,350 900,450 1200,380 L1200,600 L0,600 Z" fill="rgba(139,139,139,0.3)"/><path d="M0,450 C250,400 350,500 550,450 C750,400 850,500 1200,430 L1200,600 L0,600 Z" fill="rgba(139,139,139,0.2)"/></svg>');
    background-size: cover;
    position: relative;
    overflow: hidden;
}

/* ====================
   响应式适配
   ==================== */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    
    h2 {
        font-size: 1.6em;
    }
    
    .main-navigation a {
        padding: 12px 15px !important;
    }
    
    .ast-container::before,
    .ast-container::after {
        width: 20px;
        height: 20px;
    }
}
