/**
 * Anime Landing Page System - 主样式文件
 *
 * @author ALPS System
 * @version 1.0.0
 */

/* ==================== 变量定义 ==================== */
:root {
    /* 默认配色（浅色模式） */
    --primary-color: #ff6b9d;
    --primary-light: #ffc2d4;
    --primary-dark: #e84a7f;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #ff6b9d 100%);
    --bg-glass: rgba(255, 255, 255, 0.15);
    --border-glass: rgba(255, 255, 255, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --glass-blur: 20px;

    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;

    /* 间距 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* 圆角 */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
}

/* 深色模式 */
[data-theme-mode="dark"],
@media (prefers-color-scheme: dark) {
    :root:not([data-theme-mode="light"]) {
        --text-primary: #f5f6fa;
        --text-secondary: #a4b0be;
        --bg-glass: rgba(0, 0, 0, 0.3);
        --border-glass: rgba(255, 255, 255, 0.1);
        --shadow-color: rgba(0, 0, 0, 0.3);
    }
}

[data-theme-mode="light"] {
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --bg-glass: rgba(255, 255, 255, 0.15);
    --border-glass: rgba(255, 255, 255, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* ==================== 基础重置 ==================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ==================== 背景样式 ==================== */
body {
    background: var(--bg-primary);
    background-attachment: fixed;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    z-index: -1;
}

/* 背景图片模式 */
body.bg-image::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--bg-image-url);
    background-size: cover;
    background-position: center;
    z-index: -2;
    opacity: 0.8;
}

/* 粒子效果层 */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ==================== 预加载动画 ==================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    color: #fff;
}

/* 骨架屏 */
.skeleton-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 auto 1.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-title {
    width: 200px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    margin: 0 auto 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-subtitle {
    width: 150px;
    height: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    margin: 0 auto 2rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.skeleton-button {
    width: 120px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-button:nth-child(2) {
    animation-delay: 0.2s;
}

.skeleton-button:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
}

/* 加载进度条 */
.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    margin: 0 auto 0.5rem;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.3s ease;
}

.loading-text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ==================== 密码验证弹窗 ==================== */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.password-modal {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.password-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.password-modal h2 {
    color: #fff;
    margin-bottom: var(--spacing-lg);
    font-size: 1.25rem;
}

.password-modal input {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    text-align: center;
    transition: var(--transition-fast);
}

.password-modal input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.2);
}

.password-modal input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.password-error {
    color: #ff6b6b;
    font-size: 0.875rem;
    margin: var(--spacing-sm) 0;
}

.password-modal button {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-xl);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    margin-top: var(--spacing-md);
    transition: var(--transition-fast);
}

.password-modal button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

/* ==================== 公告弹窗 ==================== */
.announcement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9990;
    animation: fadeIn 0.3s ease;
}

.announcement-content {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

.announcement-close {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    transition: var(--transition-fast);
}

.announcement-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.announcement-content h3 {
    color: #fff;
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
}

.announcement-body {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 0.95rem;
}

/* ==================== 樱花动画层 ==================== */
#sakura-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ==================== 主内容区 ==================== */
.main-content {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

/* ==================== 头部区域 ==================== */
.hero {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    animation: fadeInUp 0.8s ease;
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-lg);
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: var(--transition-normal);
}

.avatar:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.avatar-container::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), transparent, var(--primary-light));
    z-index: -1;
    animation: rotate 3s linear infinite;
}

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

.site-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.05em;
}

.site-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* ==================== 按钮区域 ==================== */
.buttons-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    max-width: 800px;
    width: 100%;
    margin-bottom: var(--spacing-2xl);
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

/* 玻璃按钮 */
.glass-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-normal);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.glass-button:hover {
    transform: scale(1.05) translateY(-2px);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.glass-button:active {
    transform: scale(0.98);
}

.glass-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.4);
}

/* 按钮涟漪效果 */
.button-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.button-icon {
    font-size: 1.25rem;
}

.button-text {
    position: relative;
    z-index: 1;
}

/* 无按钮提示 */
.no-buttons {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    grid-column: 1 / -1;
    padding: var(--spacing-xl);
}

/* ==================== 底部区域 ==================== */
.footer {
    text-align: center;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.footer-info {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.footer-info span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.footer-slogan {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 手机 (< 576px) */
@media (max-width: 575.98px) {
    .main-content {
        padding: var(--spacing-lg);
        justify-content: flex-start;
        padding-top: 10vh;
    }

    .hero {
        margin-bottom: var(--spacing-xl);
    }

    .avatar-container {
        width: 100px;
        height: 100px;
    }

    .buttons-section {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .glass-button {
        padding: var(--spacing-md);
    }

    .footer {
        margin-top: var(--spacing-xl);
    }

    .footer-info {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
}

/* 平板 (576px - 1024px) */
@media (min-width: 576px) and (max-width: 1024px) {
    .buttons-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 桌面 (> 1024px) */
@media (min-width: 1025px) {
    .buttons-section {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==================== 辅助类 ==================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 淡入效果 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

/* 视差容器 */
.parallax-container {
    perspective: 1000px;
    transform-style: preserve-3d;
}
