/* ===================================
   CSS 变量定义 - 设计系统基础
   =================================== */
:root {
    /* 主色调 */
    --primary-color: #1a237e;
    --primary-light: #3949ab;
    --primary-dark: #0d1642;

    /* 强调色 */
    --accent-color: #ff6b6b;
    --accent-hover: #ff5252;
    --accent-glow: rgba(255, 107, 107, 0.4);

    /* 辅助色 */
    --secondary-color: #4ecdc4;
    --secondary-light: #7ee8e1;

    /* 中性色 */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;

    /* 玻璃态效果 */
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: rgba(31, 38, 135, 0.15);

    /* 字体系统 */
    --font-display: 'Playfair Display', serif;
    --font-body: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;

    /* 间距系统 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.24);

    /* 过渡动画 */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* 容器宽度 */
    --container-max-width: 1200px;
}

/* ===================================
   全局重置与基础样式
   =================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ===================================
   背景装饰层
   =================================== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.4) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.35) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.25) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    33% {
        transform: translateY(-30px) scale(1.05);
    }
    66% {
        transform: translateY(20px) scale(0.95);
    }
}

/* ===================================
   主容器
   =================================== */
.main-container {
    position: relative;
    z-index: 1;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--spacing-md);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===================================
   头部区域
   =================================== */
.site-header {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    animation: fadeInDown 0.8s ease-out;
}

.brand-section {
    margin-bottom: var(--spacing-lg);
}

.site-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    margin-bottom: var(--spacing-xs);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.title-gradient {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 50%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 20px rgba(255, 255, 255, 0.3);
    letter-spacing: 0.05em;
}

.title-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.15em;
    -webkit-text-fill-color: initial;
}

.tagline {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
    letter-spacing: 0.2em;
    margin-top: var(--spacing-sm);
}

.entry-links {
    margin-top: var(--spacing-md);
}

.entry-label {
    display: inline-block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    letter-spacing: 0.15em;
    margin-bottom: var(--spacing-sm);
    padding: 0.3em 1em;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
}

.entry-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.entry-btn {
    padding: 0.65em 1.8em;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.entry-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.entry-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.entry-btn:hover::before {
    width: 300px;
    height: 300px;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   导航内容区
   =================================== */
.navigation-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

/* ===================================
   分类区块
   =================================== */
.nav-category {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(40px);
    animation: slideUpFadeIn 0.8s ease-out forwards;
}

.nav-category:nth-child(1) { animation-delay: 0.2s; }
.nav-category:nth-child(2) { animation-delay: 0.35s; }
.nav-category:nth-child(3) { animation-delay: 0.5s; }
.nav-category:nth-child(4) { animation-delay: 0.65s; }

@keyframes slideUpFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-header {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.category-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
}

.category-title .icon {
    font-size: 1.3em;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.title-decoration {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    margin: var(--spacing-sm) auto 0;
    border-radius: 2px;
}

/* ===================================
   卡片网格布局
   =================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-md);
}

.cards-grid.grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

/* ===================================
   导航卡片
   =================================== */
.nav-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    animation: cardAppear 0.6s ease-out forwards;
    box-shadow: var(--shadow-sm);
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 0;
}

.nav-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.nav-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl), 0 0 30px var(--accent-glow);
    border-color: var(--accent-color);
}

.nav-card:hover::before {
    opacity: 1;
}

.nav-card:hover::after {
    opacity: 1;
    animation: shine 0.6s ease;
}

.nav-card:hover .card-icon img,
.nav-card:hover .card-icon svg {
    transform: scale(1.15) rotate(5deg);
}

.nav-card:hover .card-label {
    color: #ffffff;
    font-weight: 600;
    transform: translateY(-2px);
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shine {
    from {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    to {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    transition: transform var(--transition-base);
}

.card-icon .fallback-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    transition: all var(--transition-base);
}

.card-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    position: relative;
    z-index: 2;
    transition: all var(--transition-base);
    line-height: 1.3;
}

/* ===================================
   页脚
   =================================== */
.site-footer {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: center;
    animation: fadeIn 1s ease-out 0.8s both;
}

.footer-content {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
}

.copyright {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.footer-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===================================
   响应式设计
   =================================== */

/* 平板设备 (768px - 1024px) */
@media screen and (max-width: 1024px) {
    :root {
        --container-max-width: 96%;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: var(--spacing-sm);
    }

    .cards-grid.grid-wide {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .nav-card {
        padding: var(--spacing-sm);
    }

    .card-icon {
        width: 48px;
        height: 48px;
    }

    .card-label {
        font-size: 0.85rem;
    }
}

/* 移动设备 (< 768px) */
@media screen and (max-width: 768px) {
    :root {
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
    }

    .site-header {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .site-title {
        gap: 0.3rem;
    }

    .entry-buttons {
        gap: 0.5rem;
    }

    .entry-btn {
        padding: 0.55em 1.3em;
        font-size: 0.85rem;
    }

    .nav-category {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .category-title {
        font-size: 1.4rem;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: var(--spacing-sm);
    }

    .cards-grid.grid-wide {
        grid-template-columns: repeat(3, 1fr);
    }

    .nav-card {
        padding: var(--spacing-sm) 0.7rem;
        border-radius: var(--radius-sm);
    }

    .card-icon {
        width: 44px;
        height: 44px;
    }

    .card-label {
        font-size: 0.8rem;
    }

    .footer-content {
        padding: var(--spacing-md);
    }
}

/* 小屏手机 (< 480px) */
@media screen and (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .main-container {
        padding: var(--spacing-sm);
    }

    .entry-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .entry-btn {
        width: 100%;
        text-align: center;
    }

    .cards-grid.grid-wide {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-card {
        padding: 0.8rem 0.5rem;
    }

    .card-icon {
        width: 40px;
        height: 40px;
    }

    .card-label {
        font-size: 0.75rem;
    }
}

/* ===================================
   可访问性增强
   =================================== */
.nav-card:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

.nav-card:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

.entry-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 3px;
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .gradient-orb {
        animation: none;
    }
}

/* ===================================
   打印样式
   =================================== */
@media print {
    .bg-decoration {
        display: none;
    }

    body {
        background: white;
    }

    .nav-category {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
    }

    .nav-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
