/**
 * 天绘阁自定义样式
 * 古典中式风格，宣纸纹理，朱红配色
 */

/* 宣纸纹理背景 */
body {
    background-color: hsl(48 33% 94%);
    background-image: url('https://www.transparenttextures.com/patterns/rice-paper.png');
    background-attachment: fixed;
}

/* 导航激活状态 */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: hsl(5, 70%, 45%);
    transition: width 0.3s ease;
}

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

/* 标题装饰 */
.section-title {
    position: relative;
    display: inline-block;
}

.section-title::before,
.section-title::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, hsl(5, 70%, 45%), transparent);
}

.section-title::before {
    right: calc(100% + 20px);
}

.section-title::after {
    left: calc(100% + 20px);
    background: linear-gradient(90deg, transparent, hsl(5, 70%, 45%));
}

/* 卡片悬浮效果 */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

/* 按钮样式 */
.btn-primary {
    background-color: hsl(5, 70%, 45%);
    color: hsl(40, 30%, 96%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: hsl(5, 70%, 40%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(180, 50, 35, 0.3);
}

/* 边框装饰 */
.border-decoration {
    border: 2px solid hsl(5, 70%, 45%);
    position: relative;
}

.border-decoration::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: -4px;
    bottom: -4px;
    border: 1px solid hsl(5, 70%, 45%);
    opacity: 0.5;
    pointer-events: none;
}

/* 文字渐变装饰 */
.gradient-text {
    background: linear-gradient(135deg, hsl(5, 70%, 45%), hsl(30, 60%, 40%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 新闻卡片日期样式 */
.news-date {
    font-family: 'SourceHanSerifCN', serif;
    color: hsl(5, 70%, 45%);
    font-weight: bold;
}

/* 分割线样式 */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, hsl(222, 10%, 75%), transparent);
}

/* 响应式容器 */
.container-x {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container-x {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container-x {
        padding: 0 2rem;
    }
}

/* 富文本内容样式 */
.prose-content {
    line-height: 1.8;
    letter-spacing: 0.05em;
}

.prose-content p {
    margin-bottom: 1.5em;
    text-indent: 2em;
}

.prose-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5em auto;
    display: block;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* 页面切换动画 */
.page-enter {
    opacity: 0;
    transform: translateY(10px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid hsl(222, 10%, 75%);
    border-top-color: hsl(5, 70%, 45%);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: hsl(219, 10%, 45%);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

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

::-webkit-scrollbar-track {
    background: hsl(44, 27%, 92%);
}

::-webkit-scrollbar-thumb {
    background: hsl(222, 10%, 75%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(219, 10%, 45%);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .section-title::before,
    .section-title::after {
        width: 30px;
    }
    
    .section-title::before {
        right: calc(100% + 10px);
    }
    
    .section-title::after {
        left: calc(100% + 10px);
    }
}
