/* ========================================
   作品集网站 - 缤纷鲜艳风格
   ======================================== */

/* ---------- 基础重置 & 字体 ---------- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;700;900&family=Poppins:wght@400;600;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --c1: #FF6B6B;
    --c2: #FF9F43;
    --c3: #FECA57;
    --c4: #54A0FF;
    --c5: #A55EEA;
    --bg-dark: #1a1a2e;
    --bg-mid: #16213e;
    --text: #fff;
    --glow-strength: 0.6;
}

body {
    font-family: 'Poppins', 'Noto Sans SC', sans-serif;
    /* 背景由 JS 动态设置本地随机图片 */
    background-color: #0f0c29; /* 图片加载前的后备色 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ---------- 半透明遮罩（保证文字可读性）---------- */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(8, 6, 24, 0.68);
    pointer-events: none;
    z-index: 0;
}

/* ---------- 全局文字阴影（强化反差）---------- */
h1, h2, h3, h4, p, span, a, .file-name, .file-meta, .mini-logo-label, .mini-logo-sub {
    text-shadow: 0 1px 6px rgba(0,0,0,0.65);
}

/* ---------- 浮动粒子 ---------- */
.particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    animation: floatUp linear infinite;
    opacity: 0.6;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) scale(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-10vh) scale(1) rotate(720deg);
        opacity: 0;
    }
}

/* ---------- 主容器 ---------- */
.main-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

/* ---------- 标题区 ---------- */
.header {
    text-align: center;
    margin-bottom: 10px;
    z-index: 2;
}

.header h1 {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3), var(--c4), var(--c5));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
    letter-spacing: 4px;
}

.header p {
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-top: 4px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========================================
   核心：Logo 环绕布局
   ======================================== */
.logo-stage {
    position: relative;
    width: 500px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- 主 Logo（大）---------- */
.main-logo-wrapper {
    position: absolute;
    z-index: 10;
    width: 180px;
    height: 180px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.main-logo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(
        var(--c1) 0deg, var(--c2) 72deg,
        var(--c3) 144deg, var(--c4) 216deg,
        var(--c5) 288deg, var(--c1) 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoSpin 12s linear infinite, logoGlow 2s ease-in-out infinite alternate;
    box-shadow: 
        0 0 60px rgba(255,255,255,0.15),
        0 0 120px rgba(255,107,107,0.2),
        inset 0 0 40px rgba(255,255,255,0.05);
    cursor: default;
    position: relative;
}

.main-logo::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--bg-dark);
}

.main-logo-inner {
    position: relative;
    z-index: 2;
    font-size: 3.5rem;
    text-align: center;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
}

.main-logo-label {
    position: relative;
    z-index: 2;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    margin-top: 2px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}

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

@keyframes logoGlow {
    0% {
        box-shadow: 
            0 0 60px rgba(255,255,255,0.15),
            0 0 120px rgba(255,107,107,0.2);
    }
    50% {
        box-shadow: 
            0 0 80px rgba(255,255,255,0.25),
            0 0 160px rgba(165,94,234,0.35);
    }
    100% {
        box-shadow: 
            0 0 60px rgba(255,255,255,0.15),
            0 0 120px rgba(84,160,255,0.25);
    }
}

/* ---------- 主Logo脉冲波纹 ---------- */
.main-logo-ripple {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    animation: ripple 3s ease-out infinite;
}

.main-logo-ripple:nth-child(2) { animation-delay: 1s; }
.main-logo-ripple:nth-child(3) { animation-delay: 2s; }

@keyframes ripple {
    0% {
        width: 180px; height: 180px;
        opacity: 0.8;
    }
    100% {
        width: 320px; height: 320px;
        opacity: 0;
    }
}

/* ---------- 小 Logo（5个，弧形排列在上方）---------- */
.mini-logos {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mini-logo-item {
    position: absolute;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5;
}

.mini-logo-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    position: relative;
    box-shadow: 0 6px 30px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}

.mini-logo-circle::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(255,255,255,0.4);
    animation: miniSpin 3s linear infinite;
}

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

.mini-logo-item:hover .mini-logo-circle {
    transform: scale(1.2);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.6);
}

.mini-logo-item:hover {
    transform: translateY(-8px);
    z-index: 20;
}

.mini-logo-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 8px;
    color: rgba(255,255,255,0.9);
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    transition: color 0.3s;
}

.mini-logo-item:hover .mini-logo-label {
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.9);
}

.mini-logo-sub {
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.6);
    margin-top: 2px;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

/* 5个小Logo位置（弧形排列在上方半圆） */
.mini-logo-item:nth-child(1) { top: 8%;  left: 10%; }
.mini-logo-item:nth-child(2) { top: 2%;  left: 28%; }
.mini-logo-item:nth-child(3) { top: 0%;  left: 50%; transform: translateX(-50%); }
.mini-logo-item:nth-child(3):hover { transform: translateX(-50%) translateY(-8px); }
.mini-logo-item:nth-child(4) { top: 2%;  right: 28%; }
.mini-logo-item:nth-child(5) { top: 8%;  right: 10%; }

/* ---------- 底部标识 ---------- */
.footer-note {
    margin-top: 20px;
    z-index: 2;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* ========================================
   画廊子页面样式
   ======================================== */

.gallery-page {
    padding: 40px 20px;
    min-height: 100vh;
}

.gallery-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 30px;
    transition: color 0.3s;
    text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}

.gallery-back:hover {
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 10px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.gallery-header h2 {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 3px;
    margin-bottom: 6px;
}

.gallery-header .gallery-sub {
    font-size: 0.85rem;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.65);
    text-transform: uppercase;
}

/* ---------- 作品网格 ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-card {
    background: rgba(0,0,0,0.35);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gallery-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--card-accent);
    opacity: 0.7;
}

.gallery-card:hover {
    transform: translateY(-6px);
    background: rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.gallery-card .file-icon {
    font-size: 3rem;
    display: block;
    text-align: center;
    margin-bottom: 12px;
}

.gallery-card .file-name {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    word-break: break-all;
    margin-bottom: 6px;
    color: rgba(255,255,255,0.95);
}

.gallery-card .file-meta {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.65);
    text-align: center;
}

.gallery-card .file-preview {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 12px;
    background: rgba(0,0,0,0.2);
}

.gallery-card .file-download {
    display: block;
    text-align: center;
    margin-top: 12px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(0,0,0,0.35);
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.15);
}

.gallery-card .file-download:hover {
    background: rgba(0,0,0,0.55);
    color: #fff;
    border-color: rgba(255,255,255,0.35);
}

/* 空状态 */
.gallery-empty {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255,255,255,0.55);
}

.gallery-empty .empty-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 16px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.gallery-empty p {
    font-size: 1rem;
    letter-spacing: 1px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

/* ---------- 备案信息 ---------- */
.icp-beian {
    margin-top: 16px;
    text-align: center;
}
.icp-beian a {
    color: rgba(255,255,255,0.35);
    text-decoration: none;
    font-size: 0.7rem;
    letter-spacing: 1px;
    transition: color 0.3s;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.icp-beian a:hover {
    color: rgba(255,255,255,0.65);
}

/* ---------- 背景刷新按钮 ---------- */
.bg-refresh-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.4);
    color: rgba(255,255,255,0.6);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: all 0.3s;
}
.bg-refresh-btn:hover {
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-color: rgba(255,255,255,0.5);
    transform: rotate(180deg);
    box-shadow: 0 0 24px rgba(255,255,255,0.15);
}
.bg-refresh-btn:active {
    transform: rotate(360deg) scale(0.9);
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
    .logo-stage {
        width: 340px;
        height: 340px;
    }
    .main-logo-wrapper {
        width: 120px;
        height: 120px;
    }
    .main-logo {
        width: 120px;
        height: 120px;
    }
    .main-logo-inner {
        font-size: 2.5rem;
    }
    .main-logo-ripple {
        width: 120px;
        height: 120px;
    }
    @keyframes ripple {
        0% { width: 120px; height: 120px; opacity: 0.8; }
        100% { width: 220px; height: 220px; opacity: 0; }
    }
    .mini-logo-circle {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    .mini-logo-label {
        font-size: 0.6rem;
    }
    .mini-logo-sub {
        font-size: 0.5rem;
    }
    .mini-logo-item:nth-child(1) { top: 12%; left: 5%; }
    .mini-logo-item:nth-child(2) { top: 4%;  left: 24%; }
    .mini-logo-item:nth-child(3) { top: 0%;  left: 50%; }
    .mini-logo-item:nth-child(4) { top: 4%;  right: 24%; }
    .mini-logo-item:nth-child(5) { top: 12%; right: 5%; }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
