* {
    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 100 100'%3E%3Cmask id='a'%3E%3Crect width='100%25' height='100%25' fill='white'/%3E%3Ccircle cx='60' cy='50' r='40' fill='black'/%3E%3C/mask%3E%3Ccircle cx='50' cy='50' r='40' fill='white' mask='url(%23a)'/%3E%3C/svg%3E");
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cmask id='a'%3E%3Crect width='100%25' height='100%25' fill='white'/%3E%3Ccircle cx='60' cy='50' r='40' fill='black'/%3E%3C/mask%3E%3Ccircle cx='50' cy='50' r='40' fill='white' mask='url(%23a)'/%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 100 100'%3E%3Cmask id='a'%3E%3Ccircle cx='50' cy='50' r='25' fill='white'/%3E%3Crect x='48' y='15' width='4' height='20' fill='white'/%3E%3Crect x='48' y='65' width='4' height='20' fill='white'/%3E%3Crect x='15' y='48' width='20' height='4' fill='white'/%3E%3Crect x='65' y='48' width='20' height='4' fill='white'/%3E%3Crect x='68' y='68' width='4' height='20' transform='rotate(135 70 70)' fill='white'/%3E%3Crect x='68' y='22' width='4' height='20' transform='rotate(-135 70 30)' fill='white'/%3E%3Crect x='22' y='68' width='4' height='20' transform='rotate(-135 30 70)' fill='white'/%3E%3Crect x='22' y='22' width='4' height='20' transform='rotate(135 30 30)' fill='white'/%3E%3C/mask%3E%3Crect width='100%25' height='100%25' mask='url(%23a)' fill='white'/%3E%3C/svg%3E");
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cmask id='a'%3E%3Ccircle cx='50' cy='50' r='25' fill='white'/%3E%3Crect x='48' y='15' width='4' height='20' fill='white'/%3E%3Crect x='48' y='65' width='4' height='20' fill='white'/%3E%3Crect x='15' y='48' width='20' height='4' fill='white'/%3E%3Crect x='65' y='48' width='20' height='4' fill='white'/%3E%3Crect x='68' y='68' width='4' height='20' transform='rotate(135 70 70)' fill='white'/%3E%3Crect x='68' y='22' width='4' height='20' transform='rotate(-135 70 30)' fill='white'/%3E%3Crect x='22' y='68' width='4' height='20' transform='rotate(-135 30 70)' fill='white'/%3E%3Crect x='22' y='22' width='4' height='20' transform='rotate(135 30 30)' fill='white'/%3E%3C/mask%3E%3Crect width='100%25' height='100%25' mask='url(%23a)' fill='white'/%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;
    }
}