/* ===================================
   伊藤润二风格 - 恐怖漫画美学
   =================================== */

:root {
    /* 色彩系统 */
    --color-void: #0a0a0a;
    --color-void-light: #1a1a1a;
    --color-charcoal: #2d2d2d;
    --color-gray: #6a6a6a;
    --color-text: #c0c0c0;
    --color-text-bright: #e8e8e8;
    --color-paper: #f0f0f0;
    --color-paper-light: #ffffff;
    --color-blood: #8b0000;
    --color-blood-bright: #dc143c;
    --color-blood-dark: #5c0000;

    /* 字体 */
    --font-display: 'Creepster', 'SimSun', 'STSong', serif;
    --font-body: 'Georgia', 'Songti SC', 'SimSun', serif;
    --font-mono: 'Courier New', monospace;

    /* 间距 */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 40px;
    --space-xl: 60px;
    --space-2xl: 100px;

    /* 动画 */
    --transition-slow: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-medium: 0.3s ease-out;
    --transition-fast: 0.15s ease-out;
}

/* ===================================
   全局样式与重置
   =================================== */

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-text-bright);
    background-color: var(--color-void);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* 噪点纹理覆盖层 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* 晕影效果 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.4) 100%);
}

/* ===================================
   螺旋背景图案
   =================================== */

.spiral-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.spiral {
    position: absolute;
    opacity: 0.03;
    animation: rotate 60s linear infinite;
}

.spiral-1 {
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
}

.spiral-2 {
    bottom: -300px;
    left: -200px;
    width: 800px;
    height: 800px;
    animation-direction: reverse;
    animation-duration: 80s;
}

.spiral-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1200px;
    height: 1200px;
    animation-duration: 100s;
}

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

/* ===================================
   容器
   =================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 1;
}

/* ===================================
   头部区域 - 恐怖标题
   =================================== */

header {
    background: linear-gradient(180deg, var(--color-void) 0%, transparent 100%);
    color: var(--color-text-bright);
    padding: var(--space-2xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(139, 0, 0, 0.3);
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--color-blood) 20%,
        var(--color-blood-bright) 50%,
        var(--color-blood) 80%,
        transparent 100%);
    box-shadow: 0 0 20px var(--color-blood);
}

header h1 {
    font-family: var(--font-display);
    font-size: 4rem;
    margin-bottom: var(--space-sm);
    font-weight: 700;
    letter-spacing: 8px;
    color: var(--color-text-bright);
    text-shadow:
        0 0 10px rgba(139, 0, 0, 0.8),
        0 0 20px rgba(139, 0, 0, 0.5),
        2px 2px 0 var(--color-blood-dark),
        0 0 30px rgba(220, 20, 60, 0.3);
    animation: titleGlitch 4s infinite;
    position: relative;
}

@keyframes titleGlitch {
    0%, 90%, 100% {
        transform: translate(0);
        text-shadow:
            0 0 10px rgba(139, 0, 0, 0.5),
            0 0 20px rgba(139, 0, 0, 0.3),
            2px 2px 0 var(--color-blood-dark);
    }
    91% {
        transform: translate(-2px, 1px);
        text-shadow:
            -2px 0 red,
            2px 0 cyan;
    }
    92% {
        transform: translate(2px, -1px);
        text-shadow:
            2px 0 red,
            -2px 0 cyan;
    }
    93% {
        transform: translate(0);
        text-shadow:
            0 0 10px rgba(139, 0, 0, 0.5),
            0 0 20px rgba(139, 0, 0, 0.3),
            2px 2px 0 var(--color-blood-dark);
    }
}

.subtitle {
    font-size: 1.3rem;
    color: var(--color-text);
    font-family: var(--font-mono);
    letter-spacing: 3px;
    text-transform: uppercase;
    position: relative;
    padding-top: var(--space-sm);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.subtitle::before,
.subtitle::after {
    content: '◆';
    color: var(--color-blood);
    margin: 0 var(--space-sm);
    font-size: 0.8em;
}

/* ===================================
   主要内容区域
   =================================== */

main {
    padding: var(--space-xl) 0;
    flex: 1;
    position: relative;
}

/* ===================================
   图片画廊 - 扭曲网格布局
   =================================== */

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-lg);
    position: relative;
}

/* 装饰性螺旋线条 */
.gallery::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 100px;
    border: 2px solid var(--color-blood);
    border-radius: 0 0 100px 100px;
    border-top: none;
    opacity: 0.3;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-slow);
    aspect-ratio: 3 / 2;
    transform-style: preserve-3d;
    animation: fadeInUp 0.8s ease-out backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) rotateX(-10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

/* 为每个项目添加延迟，创造错落感 */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--color-charcoal);
    z-index: 2;
    pointer-events: none;
    transition: var(--transition-medium);
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid var(--color-blood);
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
    transition: var(--transition-medium);
}

.gallery-item:hover {
    transform: translateY(-12px) scale(1.02) rotate(1deg);
    z-index: 10;
}

.gallery-item:hover::before {
    border-color: var(--color-blood);
    box-shadow:
        0 0 20px rgba(139, 0, 0, 0.5),
        inset 0 0 20px rgba(139, 0, 0, 0.2);
}

.gallery-item:hover::after {
    opacity: 0.8;
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.8;
    }
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition-slow);
    filter: grayscale(0.3) contrast(1.1);
}

.gallery-item:hover img {
    transform: scale(1.15) rotate(-1deg);
    filter: grayscale(0) contrast(1.2) brightness(1.1);
}

/* 遮罩层 - 从底部浮现 */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top,
        rgba(10, 10, 10, 0.98) 0%,
        rgba(10, 10, 10, 0.9) 30%,
        rgba(10, 10, 10, 0.7) 60%,
        transparent 100%);
    color: var(--color-paper);
    padding: var(--space-lg) var(--space-md) var(--space-md);
    transform: translateY(100%);
    transition: transform var(--transition-slow);
    z-index: 5;
    border-top: 2px solid var(--color-blood);
}

.gallery-item:hover .overlay {
    transform: translateY(0);
}

.overlay h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin-bottom: var(--space-xs);
    color: var(--color-text-bright);
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.9),
        0 0 10px rgba(139, 0, 0, 0.5);
    letter-spacing: 2px;
}

.overlay p {
    font-size: 0.95rem;
    color: var(--color-text);
    font-style: italic;
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* ===================================
   页脚区域
   =================================== */

footer {
    background-color: var(--color-void-light);
    color: var(--color-text);
    text-align: center;
    padding: var(--space-lg) 0;
    border-top: 1px solid rgba(139, 0, 0, 0.4);
    position: relative;
    margin-top: var(--space-2xl);
}

footer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--color-blood-dark) 20%,
        var(--color-blood) 50%,
        var(--color-blood-dark) 80%,
        transparent 100%);
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
}

footer p {
    opacity: 0.9;
    margin: var(--space-xs) 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* 备案号样式 */
.beian {
    font-size: 0.85rem;
    margin-top: var(--space-sm);
    opacity: 0.6;
    font-family: var(--font-mono);
}

.beian a {
    color: var(--color-text);
    text-decoration: none;
    transition: var(--transition-medium);
    border-bottom: 1px solid transparent;
}

.beian a:hover {
    color: var(--color-blood-bright);
    border-bottom-color: var(--color-blood);
    opacity: 1;
}

/* ===================================
   状态提示
   =================================== */

.loading,
.no-images,
.error {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    color: var(--color-text);
    font-size: 1.2rem;
    font-family: var(--font-mono);
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(220, 20, 60, 0.3);
}

.loading {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.no-images {
    color: var(--color-charcoal);
}

.error {
    color: var(--color-blood-bright);
}

/* ===================================
   响应式设计
   =================================== */

@media (max-width: 1024px) {
    header h1 {
        font-size: 3rem;
        letter-spacing: 5px;
    }

    .gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-md);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
        letter-spacing: 3px;
    }

    .subtitle {
        font-size: 1rem;
        letter-spacing: 2px;
    }

    .subtitle::before,
    .subtitle::after {
        display: none;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    main {
        padding: var(--space-lg) 0;
    }

    .overlay h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: var(--space-lg) 0;
    }

    header h1 {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .gallery {
        gap: var(--space-sm);
    }

    .overlay h3 {
        font-size: 1.1rem;
    }

    .overlay p {
        font-size: 0.85rem;
    }

    .beian {
        font-size: 0.75rem;
        word-break: break-all;
    }
}

/* ===================================
   自定义滚动条
   =================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-void);
}

::-webkit-scrollbar-thumb {
    background: var(--color-charcoal);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-blood);
}

/* ===================================
   选择文本样式
   =================================== */

::selection {
    background: var(--color-blood);
    color: var(--color-paper);
}

::-moz-selection {
    background: var(--color-blood);
    color: var(--color-paper);
}
