/* ===== 清泉安全 · 江南烟雨 ===== */

:root {
    --ink-deep: #2a3440;
    --ink: #384a58;
    --ink-light: #5a7080;
    --ink-mist: #8a9aaa;
    --rice: #fafcfd;
    --rice-warm: #f0f6fa;
    --rice-dark: #dce6ee;
    --gold: #d4e5ef;
    --gold-dim: #b0c8d8;
    --gold-bright: #e8f0f8;
    --jade: #a8c8d8;
    --jade-light: #c0dce8;
    --cinnabar: #b84840;
    --cinnabar-dim: #883830;
    --mist: rgba(250, 252, 253, 0.96);
    --ink-wash: rgba(56, 74, 88, 0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Serif SC', 'SimSun', serif;
    background: var(--rice);
    color: var(--ink);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ===== 宣纸纹理背景 ===== */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(56,74,88,0.009) 2px, rgba(56,74,88,0.009) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(56,74,88,0.008) 3px, rgba(56,74,88,0.008) 6px);
    pointer-events: none;
    z-index: 0;
}

/* ===== 烟雨蒙蒙背景层 ===== */
.mist-layer {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at 15% 30%, rgba(138,154,170,0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 60%, rgba(138,154,170,0.045) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(168,200,216,0.035) 0%, transparent 40%);
}

/* ===== 雨丝动画 ===== */
.rain-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}
.raindrop {
    position: absolute;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(138,154,170,0.18));
    animation: rain-fall linear infinite;
}
@keyframes rain-fall {
    0% { transform: translateY(-100vh) rotate(5deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 0.6; }
    100% { transform: translateY(100vh) rotate(5deg); opacity: 0; }
}

/* ===== 水墨飞溅粒子 ===== */
.ink-particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
}
.ink-dot {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56,74,88,0.07), transparent 70%);
    animation: ink-drift ease-in-out infinite;
}
@keyframes ink-drift {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.2; }
    33% { transform: translate(15px, -20px) scale(1.2); opacity: 0.5; }
    66% { transform: translate(-10px, 10px) scale(0.9); opacity: 0.3; }
}

/* ===== 游龙泼墨装饰 ===== */
.dragon-ink { display: none; }

/* ===== 古筝弦装饰 ===== */
.guqin-strings {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.025;
}
.guqin-string {
    position: absolute;
    height: 100%;
    width: 1px;
    background: linear-gradient(180deg, transparent 5%, rgba(138,154,170,0.5) 30%, rgba(138,154,170,0.5) 70%, transparent 95%);
}

/* ===== 顶部导航 ===== */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(212,229,239,0.97), rgba(200,220,235,0.95));
    backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid rgba(255,255,255,0.45);
    box-shadow:
        0 2px 30px rgba(160,196,221,0.3),
        0 1px 0 rgba(255,255,255,0.5) inset;
}
.top-nav::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 50%),
        linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 40%, rgba(255,255,255,0.15) 60%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}
.top-nav::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 300%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 25%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.15) 75%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    animation: nav-shine 8s ease-in-out infinite;
}
@keyframes nav-shine {
    0%, 100% { transform: translateX(-20%); }
    50% { transform: translateX(20%); }
}
.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 30px 0 14px;
    height: 56px;
    overflow-x: auto;
    scrollbar-width: none;
    position: relative;
    z-index: 1;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav-logo {
    font-family: 'Noto Serif SC', 'SimSun', serif;
    font-size: 24px;
    color: var(--ink);
    white-space: nowrap;
    margin-right: 30px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.6);
    position: relative;
    z-index: 1;
    position: relative;
}
.nav-logo::after {
    content: '\00b7';
    position: absolute;
    right: -18px;
    color: rgba(176,200,216,0.3);
}
.nav-links {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
}
.nav-links a {
    color: var(--ink-light);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 3px;
    white-space: nowrap;
    transition: all 0.4s;
    position: relative;
    letter-spacing: 1px;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--ink);
    background: rgba(56,74,88,0.06);
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--ink-light), transparent);
    transition: all 0.4s;
    transform: translateX(-50%);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 70%; }

/* ===== 水墨山水画背景 ===== */
.shanshui-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 30%;
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}

/* ===== Hero 区域 ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(180deg, #D4E5EF 0%, #c8dce8 25%, #bcd2e2 50%, #dce8f0 75%, var(--rice-warm) 100%);
}
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 150px;
    background: linear-gradient(180deg, transparent 0%, rgba(250,252,253,0.6) 40%, var(--rice) 100%);
    z-index: 3;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.hero-landscape {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: none;
    z-index: 2;
}
.hero-content {
    position: relative;
    z-index: 10;
    padding: 20px;
}

/* 安字效果 */
.hero-title {
    font-family: 'Noto Serif SC', 'SimSun', serif;
    font-size: clamp(140px, 28vw, 280px);
    color: transparent;
    background: linear-gradient(180deg, #6a5e54 0%, #7a6e62 50%, #8a7e70 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: none;
    animation: title-reveal 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    line-height: 1;
    opacity: 0;
}
@keyframes title-reveal {
    0% { opacity: 0; transform: scale(0.85); filter: blur(8px); }
    60% { filter: blur(0); }
    100% { opacity: 0.45; transform: scale(1); filter: blur(0); }
}

.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    animation: scroll-bounce 2.5s ease-in-out infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.scroll-hint-text {
    font-size: 11px;
    color: var(--ink-light);
    letter-spacing: 3px;
    writing-mode: vertical-rl;
}
.scroll-hint svg {
    width: 24px; height: 24px;
    stroke: var(--ink-light);
    fill: none;
    stroke-width: 1.5;
}
@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ===== 主内容 ===== */
.main-content {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 30px 80px;
}

/* ===== 分类区块 ===== */
.category-section {
    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.category-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(56,74,88,0.08);
    position: relative;
}
.section-header::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 60px; height: 2px;
    background: linear-gradient(90deg, var(--ink-light), transparent);
}

.section-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--ink), var(--ink-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 3px 12px rgba(56,74,88,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
    flex-shrink: 0;
    position: relative;
}
.section-icon::after {
    content: '';
    position: absolute;
    top: -2px; right: -2px;
    width: 6px; height: 6px;
    background: var(--cinnabar);
    border-radius: 50%;
    opacity: 0.6;
}

.section-title-group { flex: 1; }
.section-title {
    font-family: 'Noto Serif SC', 'SimSun', serif;
    font-size: 26px;
    color: var(--ink);
    letter-spacing: 3px;
}
.section-desc {
    font-size: 12px;
    color: var(--ink-mist);
    margin-top: 2px;
    letter-spacing: 2px;
    font-family: 'Noto Serif SC', 'SimSun', serif;
}

/* ===== 资源卡片网格 ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.resource-card {
    background: var(--mist);
    border: 1px solid rgba(56,74,88,0.06);
    border-radius: 8px;
    padding: 16px 18px;
    text-decoration: none;
    color: var(--ink);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
}
.resource-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 2px; height: 100%;
    background: linear-gradient(180deg, var(--ink), var(--ink-light));
    opacity: 0;
    transition: opacity 0.3s;
}
.resource-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(176,200,216,0.03), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(56,74,88,0.1);
    border-color: rgba(56,74,88,0.12);
    background: rgba(245,240,232,0.95);
}
.resource-card:hover::before { opacity: 1; }
.resource-card:hover::after { opacity: 1; }

.card-favicon {
    width: 34px; height: 34px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--rice-warm), var(--rice));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    border: 1px solid rgba(56,74,88,0.06);
    position: relative;
    z-index: 1;
}
.card-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.card-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.card-url {
    font-size: 11px;
    color: var(--ink-mist);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.6;
}
.card-arrow {
    color: rgba(56,74,88,0.2);
    transition: all 0.3s;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    font-size: 14px;
}
.resource-card:hover .card-arrow {
    color: var(--ink);
    transform: translateX(3px);
}

/* ===== 关于我 ===== */
.about-section {
    background: linear-gradient(135deg, rgba(212,229,239,0.97), rgba(200,220,235,0.95));
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 50px;
}
.admin-entry {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(56,74,88,0.08);
    color: rgba(56,74,88,0.35);
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
}
.admin-entry:hover {
    background: rgba(56,74,88,0.15);
    color: rgba(56,74,88,0.7);
    transform: rotate(45deg);
}
.about-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(176,200,216,0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(168,200,216,0.05) 0%, transparent 50%);
}
.about-section::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(245,240,232,0.008) 3px, rgba(245,240,232,0.008) 6px);
    pointer-events: none;
}

.about-pipa-bg {
    position: absolute;
    top: -20px; left: -30px;
    width: 280px;
    height: auto;
    opacity: 0.15;
    filter: blur(3px) grayscale(50%) sepia(15%);
    transform: rotate(25deg);
    pointer-events: none;
    object-fit: contain;
    mix-blend-mode: multiply;
    animation: pipa-float 8s ease-in-out infinite;
}
.about-guzheng-bg {
    position: absolute;
    top: 10px; right: -20px;
    width: 300px;
    height: auto;
    opacity: 0.12;
    filter: blur(3px) grayscale(50%) sepia(15%);
    transform: rotate(-12deg);
    pointer-events: none;
    object-fit: contain;
    mix-blend-mode: multiply;
    animation: guzheng-float 10s ease-in-out infinite;
}
@keyframes pipa-float {
    0%, 100% { transform: rotate(25deg) translateY(0); }
    50% { transform: rotate(25deg) translateY(-5px); }
}
@keyframes guzheng-float {
    0%, 100% { transform: rotate(-12deg) translateY(0); }
    50% { transform: rotate(-12deg) translateY(-5px); }
}

.about-name {
    font-family: 'Noto Serif SC', 'SimSun', serif;
    font-size: 52px;
    color: var(--ink-deep);
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.6);
}
.about-verse {
    font-family: 'Zhi Mang Xing', 'Noto Serif SC', serif;
    font-size: 15px;
    color: var(--ink-light);
    letter-spacing: 5px;
    margin-bottom: 35px;
    position: relative;
    z-index: 1;
}

.about-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    position: relative;
    z-index: 1;
}
.about-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 14px;
    letter-spacing: 1px;
}
.about-item-icon {
    width: 36px; height: 36px;
    background: rgba(176,200,216,0.1);
    border: 1px solid rgba(176,200,216,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.about-realm {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(176,200,216,0.1);
    position: relative;
    z-index: 1;
    text-align: center;
}
.realm-desc {
    font-size: 14px;
    color: var(--ink);
    letter-spacing: 2px;
    line-height: 2;
}
.realm-desc em {
    color: var(--ink-deep);
    font-style: normal;
    border-bottom: 1px dashed rgba(56,74,88,0.3);
}

/* ===== 页脚 ===== */
footer {
    background: var(--ink-deep);
    color: rgba(245,240,232,0.3);
    text-align: center;
    padding: 30px;
    font-size: 12px;
    letter-spacing: 2px;
    position: relative;
    z-index: 10;
}
footer .footer-poem {
    font-family: 'Noto Serif SC', 'SimSun', serif;
    font-size: 15px;
    color: rgba(176,200,216,0.35);
    margin-bottom: 10px;
    letter-spacing: 4px;
}
footer .footer-instruments {
    margin-top: 8px;
    font-size: 18px;
    opacity: 0.2;
    letter-spacing: 8px;
}

/* ===== 回到顶部 ===== */
.back-top {
    position: fixed;
    bottom: 28px; right: 28px;
    width: 46px; height: 46px;
    background: rgba(56,74,88,0.8);
    border: 1px solid rgba(176,200,216,0.15);
    border-radius: 50%;
    color: var(--gold-dim);
    font-size: 18px;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    text-decoration: none;
}
.back-top.show { opacity: 1; transform: translateY(0); }
.back-top:hover { background: rgba(56,74,88,0.95); color: var(--gold); }

/* ===== 花纹角饰 ===== */
.corner-pattern {
    position: absolute;
    width: 30px; height: 30px;
    border-color: rgba(176,200,216,0.15);
    border-style: solid;
    border-width: 0;
    pointer-events: none;
}
.corner-pattern.tl { top: 12px; left: 12px; border-top-width: 1px; border-left-width: 1px; }
.corner-pattern.tr { top: 12px; right: 12px; border-top-width: 1px; border-right-width: 1px; }
.corner-pattern.bl { bottom: 12px; left: 12px; border-bottom-width: 1px; border-left-width: 1px; }
.corner-pattern.br { bottom: 12px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; }


/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .nav-inner { padding: 0 12px; }
    .nav-logo { font-size: 20px; margin-right: 16px; }
    .nav-links a { font-size: 12px; padding: 5px 8px; letter-spacing: 0; }
    .hero-title { font-size: 120px; }
    .main-content { padding: 0 14px 60px; }
    .cards-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 22px; }
    .about-section { padding: 40px 20px; }
    .about-name { font-size: 38px; }
    .about-info { flex-direction: column; align-items: center; }
    .about-pipa-bg { width: 160px; left: -20px; top: -10px; }
    .about-guzheng-bg { width: 180px; right: -15px; }
}
