/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 亮色主题变量 */
:root {
    --primary: #5b6abf;
    --secondary: #7c3aed;
    --accent: #0ea5e9;
    --bg-main: #f0f2f8;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-primary: #1a1a2e;
    --text-secondary: rgba(26, 26, 46, 0.65);
    --text-muted: rgba(26, 26, 46, 0.45);
    --border: rgba(102, 126, 234, 0.15);
    --shadow: rgba(102, 126, 234, 0.08);
    --card-icon-bg: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    --card-icon-hover-bg: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    --tag-bg: rgba(102, 126, 234, 0.08);
    --tag-border: rgba(102, 126, 234, 0.2);
    --tag-text: #5b6abf;
    --arrow-bg: rgba(102, 126, 234, 0.08);
    --float-opacity: 0.2;
    --particle-opacity: 0.4;
    --grid-opacity: 0.06;
    --logo-shadow: drop-shadow(0 4px 12px rgba(91, 106, 191, 0.35));
    --logo-shadow-hover: drop-shadow(0 6px 20px rgba(91, 106, 191, 0.5));
}

/* 暗色主题变量 */
body.dark-theme {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #00d4ff;
    --bg-main: #0a0a0f;
    --bg-card: rgba(20, 20, 35, 0.8);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.3);
    --card-icon-bg: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    --card-icon-hover-bg: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    --tag-bg: rgba(102, 126, 234, 0.15);
    --tag-border: rgba(102, 126, 234, 0.3);
    --tag-text: rgba(255, 255, 255, 0.7);
    --arrow-bg: rgba(255, 255, 255, 0.05);
    --float-opacity: 0.3;
    --particle-opacity: 0.6;
    --grid-opacity: 0.03;
    --logo-shadow: drop-shadow(0 0 15px rgba(102, 126, 234, 0.5));
    --logo-shadow-hover: drop-shadow(0 0 25px rgba(102, 126, 234, 0.8));
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background 0.4s ease, color 0.4s ease;
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px var(--shadow);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.theme-toggle:hover svg {
    color: var(--primary);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

body.dark-theme .theme-toggle .sun-icon {
    display: block;
}

body.dark-theme .theme-toggle .moon-icon {
    display: none;
}

/* 网格背景 */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(102, 126, 234, var(--grid-opacity)) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, var(--grid-opacity)) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.4s ease;
}

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

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle 15s infinite;
}

@keyframes float-particle {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: var(--particle-opacity);
    }
    90% {
        opacity: var(--particle-opacity);
    }
    100% {
        opacity: 0;
        transform: translateY(-10vh) scale(1);
    }
}

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

/* 头部 */
.header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease-out;
}

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    position: relative;
}

.logo-svg {
    width: 100%;
    height: 100%;
    filter: var(--logo-shadow);
    animation: pulse 3s ease-in-out infinite;
    transition: filter 0.4s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: var(--logo-shadow);
    }
    50% {
        transform: scale(1.05);
        filter: var(--logo-shadow-hover);
    }
}

.logo-text {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 5s ease infinite;
    letter-spacing: -1px;
}

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

.tagline {
    font-size: 18px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    transition: color 0.4s ease;
}

/* 导航网格 */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    max-width: 900px;
    width: 100%;
    margin-bottom: 60px;
}

/* 导航卡片 */
.nav-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 35px;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px var(--shadow);
    animation: fadeInUp 0.8s ease-out backwards;
}

.nav-card:nth-child(1) {
    animation-delay: 0.2s;
}

.nav-card:nth-child(2) {
    animation-delay: 0.4s;
}

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

/* 卡片发光效果 */
.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(102, 126, 234, 0.1),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    border-radius: 20px;
}

.nav-card:hover .card-glow {
    opacity: 1;
}

.nav-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow:
        0 20px 40px -8px rgba(102, 126, 234, 0.18),
        0 0 0 1px rgba(102, 126, 234, 0.15);
}

/* 卡片背景图案 */
.card-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.06) 0%, transparent 50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-card:hover .card-bg-pattern {
    opacity: 1;
}

.card-content {
    position: relative;
    z-index: 1;
}

/* 卡片图标 */
.card-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--card-icon-bg);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.card-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.1));
}

.card-icon svg {
    width: 100%;
    height: 100%;
    color: var(--primary);
}

.nav-card:hover .card-icon {
    background: var(--card-icon-hover-bg);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.claude-icon {
    background: linear-gradient(135deg, rgba(212, 162, 127, 0.1), rgba(102, 126, 234, 0.1));
}

.nav-card:hover .claude-icon {
    background: linear-gradient(135deg, rgba(212, 162, 127, 0.2), rgba(102, 126, 234, 0.2));
}

/* 卡片标题 */
.card-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-primary), rgba(26, 26, 46, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.4s ease;
}

body.dark-theme .card-title {
    background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    background-clip: text;
}

/* 卡片描述 */
.card-desc {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 20px;
    transition: color 0.4s ease;
}

/* 标签 */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    padding: 6px 14px;
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--tag-text);
    transition: all 0.3s ease;
}

.nav-card:hover .tag {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.35);
    color: var(--secondary);
}

body.dark-theme .nav-card:hover .tag {
    color: var(--text-primary);
}

/* 箭头 */
.card-arrow {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 35px;
    right: 35px;
    background: var(--arrow-bg);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.card-arrow svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.nav-card:hover .card-arrow {
    background: var(--primary);
    transform: scale(1.1);
}

.nav-card:hover .card-arrow svg {
    color: white;
    transform: translateX(2px);
}

/* 浮动元素 */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.float-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: var(--float-opacity);
    transition: opacity 0.4s ease;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation: float1 20s ease-in-out infinite;
}

.circle-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -50px;
    left: -50px;
    animation: float2 25s ease-in-out infinite;
}

.circle-3 {
    width: 250px;
    height: 250px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float3 30s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(-50px, 50px);
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(50px, -50px);
    }
}

@keyframes float3 {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* 底部 */
.footer {
    margin-top: auto;
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.4s ease;
}

.footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .logo-text {
        font-size: 36px;
    }

    .tagline {
        font-size: 14px;
    }

    .nav-grid {
        grid-template-columns: 1fr;
    }

    .nav-card {
        padding: 25px;
    }

    .card-title {
        font-size: 24px;
    }

    .card-desc {
        font-size: 14px;
    }

    .card-icon {
        width: 60px;
        height: 60px;
    }

    .card-arrow {
        bottom: 25px;
        right: 25px;
    }

    .theme-toggle {
        width: 44px;
        height: 44px;
        top: 15px;
        right: 15px;
    }

    .theme-toggle svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 30px 15px;
    }

    .logo-text {
        font-size: 28px;
    }

    .tagline {
        font-size: 12px;
        letter-spacing: 1px;
    }

    .header {
        margin-bottom: 40px;
    }

    .nav-card {
        padding: 20px;
    }

    .card-title {
        font-size: 20px;
    }

    .tag {
        font-size: 11px;
        padding: 5px 10px;
    }

    .card-arrow {
        width: 35px;
        height: 35px;
        bottom: 20px;
        right: 20px;
    }
}
