* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #0f3d5c;
    --accent-color: #1cbfff;
    --text-color: #ffffff;
    --accent-color-rgb: 28, 191, 255;
    --secondary-bg-rgb: 15, 61, 92;
    --primary-bg-rgb: 10, 10, 10;
    --card-bg: rgba(15, 61, 92, 0.3);
}

.light-mode {
    --primary-bg: #f0f4f8;
    --secondary-bg: #d1e8ff;
    --accent-color: #007bff;
    --text-color: #1a1a1a;
    --accent-color-rgb: 0, 123, 255;
    --secondary-bg-rgb: 209, 232, 255;
    --primary-bg-rgb: 240, 244, 248;
    --card-bg: rgba(209, 232, 255, 0.3);
}

body {
    background-color: var(--primary-bg);
    color: var(--text-color);
    overflow-x: hidden;
    padding-top: 80px;
    transition: all 0.5s ease;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(28, 191, 255, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(28, 191, 255, 0.05) 0%, transparent 20%);
}

a {
  text-decoration: none;  /* 取消下划线 */
  color: inherit;        /* 继承父元素颜色（取消默认蓝色） */
}

/* 导航栏 */
.navbar {
    background: linear-gradient(45deg, var(--secondary-bg), var(--primary-bg));
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.3);
    transition: all 0.5s ease;
    backdrop-filter: blur(10px);
}

.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    position: relative;
    transition: 0.3s;
    white-space: nowrap;
    font-weight: 500;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    bottom: -5px;
    left: 0;
    transition: 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    object-fit: cover;
    margin-left: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.nav-links .avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.5);
}

/* 搜索框 */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: rgba(var(--text-color-rgb), 0.1);
    border: 1px solid var(--accent-color);
    padding: 8px 35px 8px 15px;
    border-radius: 20px;
    color: var(--text-color);
    width: 200px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    width: 250px;
    box-shadow: 0 0 15px rgba(var(--accent-color-rgb), 0.3);
}

.search-icon {
    position: absolute;
    right: 10px;
    color: var(--accent-color);
    cursor: pointer;
    transition: 0.3s;
}

.search-icon:hover {
    transform: scale(1.2);
}

/* 主题切换按钮 */
.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(var(--accent-color-rgb), 0.1);
    border: 2px solid var(--accent-color);
    cursor: pointer;
    margin-left: 1rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(180deg);
    background: rgba(var(--accent-color-rgb), 0.2);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath d='M512 0a58.514286 58.514286 0 0 1 58.514286 58.514286v73.142857a58.514286 58.514286 0 1 1-117.028572 0V58.514286a58.514286 58.514286 0 0 1 58.514286-58.514286zm0 833.828571a58.514286 58.514286 0 0 1 58.514286 58.514286v73.142857a58.514286 58.514286 0 1 1-117.028572 0v-73.142857a58.514286 58.514286 0 0 1 58.514286-58.514286zm512-321.828571a58.514286 58.514286 0 0 1-58.514286 58.514286h-73.142857a58.514286 58.514286 0 1 1 0-117.028572h73.142857a58.514286 58.514286 0 0 1 58.514286 58.514286zm-833.828571 0a58.514286 58.514286 0 0 1-58.514286 58.514286H58.514286a58.514286 58.514286 0 1 1 0-117.028572h73.142857a58.514286 58.514286 0 0 1 58.514286 58.514286zm683.871085-362.042514a58.514286 58.514286 0 0 1 0 82.753828l-51.726628 51.726629a58.514286 58.514286 0 1 1-82.753829-82.753829l51.726629-51.726628a58.514286 58.514286 0 0 1 82.753828 0zM284.437943 739.562057a58.514286 58.514286 0 0 1 0 82.753829l-51.726629 51.726628a58.514286 58.514286 0 1 1-82.753828-82.753828l51.726628-51.726629a58.514286 58.514286 0 0 1 82.753829 0zm589.604571 134.480457a58.514286 58.514286 0 0 1-82.753828 0l-51.726629-51.726628a58.514286 58.514286 0 0 1 82.753829-82.753829l51.726628 51.726629a58.514286 58.514286 0 0 1 0 82.753828zM284.437943 284.437943a58.514286 58.514286 0 0 1-82.753829 0l-51.726628-51.726629a58.514286 58.514286 0 1 1 82.753828-82.753828l51.726629 51.726628a58.514286 58.514286 0 0 1 0 82.753829zM512 731.428571c-121.183086 0-219.428571-98.245486-219.428571-219.428571 0-121.183086 98.245486-219.428571 219.428571-219.428571 121.183086 0 219.428571 98.245486 219.428571 219.428571 0 121.183086-98.245486 219.428571-219.428571 219.428571z' fill='%23ffffff'/%3E%3C/svg%3E");
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath d='M512 0a58.514286 58.514286 0 0 1 58.514286 58.514286v73.142857a58.514286 58.514286 0 1 1-117.028572 0V58.514286a58.514286 58.514286 0 0 1 58.514286-58.514286zm0 833.828571a58.514286 58.514286 0 0 1 58.514286 58.514286v73.142857a58.514286 58.514286 0 1 1-117.028572 0v-73.142857a58.514286 58.514286 0 0 1 58.514286-58.514286zm512-321.828571a58.514286 58.514286 0 0 1-58.514286 58.514286h-73.142857a58.514286 58.514286 0 1 1 0-117.028572h73.142857a58.514286 58.514286 0 0 1 58.514286 58.514286zm-833.828571 0a58.514286 58.514286 0 0 1-58.514286 58.514286H58.514286a58.514286 58.514286 0 1 1 0-117.028572h73.142857a58.514286 58.514286 0 0 1 58.514286 58.514286zm683.871085-362.042514a58.514286 58.514286 0 0 1 0 82.753828l-51.726628 51.726629a58.514286 58.514286 0 1 1-82.753829-82.753829l51.726629-51.726628a58.514286 58.514286 0 0 1 82.753828 0zM284.437943 739.562057a58.514286 58.514286 0 0 1 0 82.753829l-51.726629 51.726628a58.514286 58.514286 0 1 1-82.753828-82.753828l51.726628-51.726629a58.514286 58.514286 0 0 1 82.753829 0zm589.604571 134.480457a58.514286 58.514286 0 0 1-82.753828 0l-51.726629-51.726628a58.514286 58.514286 0 0 1 82.753829-82.753829l51.726628 51.726629a58.514286 58.514286 0 0 1 0 82.753828zM284.437943 284.437943a58.514286 58.514286 0 0 1-82.753829 0l-51.726628-51.726629a58.514286 58.514286 0 1 1 82.753828-82.753828l51.726629 51.726628a58.514286 58.514286 0 0 1 0 82.753829zM512 731.428571c-121.183086 0-219.428571-98.245486-219.428571-219.428571 0-121.183086 98.245486-219.428571 219.428571-219.428571 121.183086 0 219.428571 98.245486 219.428571 219.428571 0 121.183086-98.245486 219.428571-219.428571 219.428571z' fill='%23ffffff'/%3E%3C/svg%3E");
    transition: all 0.3s ease;
}

.light-mode .theme-toggle::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath d='M532.5 150.4c-16.5-36.8 15.1-76.2 54-69.3C794.1 117.7 951.9 299 951.9 517.2 951.9 761.7 753.6 960 509 960c-218.2 0-399.4-157.7-436.1-365.4-6.9-38.9 32.5-70.5 69.3-54s77.6 25.7 120.8 25.7c163.1 0 295.2-132.2 295.2-295.2 0-43.1-9.2-83.9-25.7-120.7zm118.3 52.7c3.9 22.1 5.9 44.8 5.9 68 0 217.4-176.2 393.6-393.6 393.6-23.2 0-45.9-2-68-5.9 54 119.5 174.3 202.7 314 202.7 190.2 0 344.4-154.2 344.4-344.4-0.1-139.6-83.2-259.9-202.7-314zM192.4 306.4l3.1 6.9c13.4 27.8 34.6 51.1 60.9 67.1l4.9 2.9a3.3 3.3 0 0 1 0 5.8l-4.9 2.9c-26.3 16.1-47.5 39.4-60.9 67.1l-3.1 6.9c-1.2 2.8-5.2 2.8-6.4 0l-3.1-6.9C169.5 431.3 148.3 408 122 392l-4.9-2.9a3.3 3.3 0 0 1 0-5.8l4.9-2.9c26.3-16.1 47.5-39.4 60.9-67.1l3.1-6.9c1.2-2.8 5.1-2.8 6.4 0zM331.7 67.3c2-4.4 8.2-4.4 10.2 0l5 10.9c21.4 44.2 55 81.3 96.9 106.9l7.8 4.6c3.6 2 3.6 7.2 0 9.3l-7.8 4.6c-41.9 25.6-75.6 62.7-96.9 106.9-1.7 3.6-3.4 7.3-5 10.9-2 4.4-8.2 4.4-10.2 0l-5-10.9c-21.4-44.2-55-81.3-96.9-106.9L222 199c-3.6-2-3.6-7.2 0-9.3l7.8-4.6c41.9-25.6 75.6-62.7 96.9-106.9l5-10.9z'/%3E%3C/svg%3E");
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath d='M532.5 150.4c-16.5-36.8 15.1-76.2 54-69.3C794.1 117.7 951.9 299 951.9 517.2 951.9 761.7 753.6 960 509 960c-218.2 0-399.4-157.7-436.1-365.4-6.9-38.9 32.5-70.5 69.3-54s77.6 25.7 120.8 25.7c163.1 0 295.2-132.2 295.2-295.2 0-43.1-9.2-83.9-25.7-120.7zm118.3 52.7c3.9 22.1 5.9 44.8 5.9 68 0 217.4-176.2 393.6-393.6 393.6-23.2 0-45.9-2-68-5.9 54 119.5 174.3 202.7 314 202.7 190.2 0 344.4-154.2 344.4-344.4-0.1-139.6-83.2-259.9-202.7-314zM192.4 306.4l3.1 6.9c13.4 27.8 34.6 51.1 60.9 67.1l4.9 2.9a3.3 3.3 0 0 1 0 5.8l-4.9 2.9c-26.3 16.1-47.5 39.4-60.9 67.1l-3.1 6.9c-1.2 2.8-5.2 2.8-6.4 0l-3.1-6.9C169.5 431.3 148.3 408 122 392l-4.9-2.9a3.3 3.3 0 0 1 0-5.8l4.9-2.9c26.3-16.1 47.5-39.4 60.9-67.1l3.1-6.9c1.2-2.8 5.1-2.8 6.4 0zM331.7 67.3c2-4.4 8.2-4.4 10.2 0l5 10.9c21.4 44.2 55 81.3 96.9 106.9l7.8 4.6c3.6 2 3.6 7.2 0 9.3l-7.8 4.6c-41.9 25.6-75.6 62.7-96.9 106.9-1.7 3.6-3.4 7.3-5 10.9-2 4.4-8.2 4.4-10.2 0l-5-10.9c-21.4-44.2-55-81.3-96.9-106.9L222 199c-3.6-2-3.6-7.2 0-9.3l7.8-4.6c41.9-25.6 75.6-62.7 96.9-106.9l5-10.9z'/%3E%3C/svg%3E");
}
/* 卡片效果 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1800px;
    margin: 3rem auto;
}

.card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 30px rgba(var(--accent-color-rgb), 0.5);
}

.card::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-color-rgb), 0.2), transparent);
    left: -100%;
    top: 0;
    transition: 0.5s;
}

.card:hover::before {
    left: 100%;
}

.card h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.card p {
    color: var(--text-color);
    opacity: 0.8;
    flex-grow: 1;
}

/* 页脚 */
footer {
    background: var(--secondary-bg);
    padding: 2rem;
    text-align: center;
    margin-top: 5rem;
}

footer p {
    color: var(--text-color);
}


/* 星空背景 */
@keyframes twinkle {
    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}


/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding-top: 120px;
    }

    .nav-links {
        gap: 0.5rem;
        padding: 0 5px;
        flex-wrap: wrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .nav-links>:not(.search-box) {
        display: flex;
        flex-shrink: 0;
        gap: 0.5rem;
        align-items: center;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        font-size: 0.9rem;
        min-width: max-content;
        padding: 0 0.3rem;
    }

    .nav-links .avatar {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px;
        margin-left: 0.3rem;
    }

    .theme-toggle {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px;
        margin-left: 0.3rem;
    }

    .theme-toggle::before {
        width: 16px !important;
        height: 16px !important;
    }

    .search-box {
        order: 1;
        flex-basis: 100%;
        margin-top: 0.5rem;
        min-width: 100%;
    }

    .search-input {
        width: 100%;
        max-width: 400px;
    }

    .search-input:focus {
        width: 100%;
        max-width: 400px;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .carousel {
        height: 300px;
        margin: 1.5rem;
    }

    .carousel-caption {
        max-width: 80%;
        bottom: 15px;
        left: 15px;
        padding: 0.5rem;
    }

    .carousel-caption h3 {
        font-size: 1.2rem;
    }

    .card-container {
        padding: 1rem;
    }

    .anime-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }

    .anime-item {
        padding: 0.5rem;
    }

    .anime-item h4 {
        font-size: 0.85rem;
    }

    .anime-item .episode {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .carousel {
        height: 250px;
    }

    .theme-toggle {
        margin-left: 0;
        margin-top: 10px;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding: 0 0.2rem;
    }

    .anime-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .section-header h2 {
        font-size: 1.4rem;
    }
}