:root {
    --text-color: #2d3436;
    --text-secondary: #636e72;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-bg-solid: #fff;
    --border-color: rgba(255, 255, 255, 0.6);
    --link-color: #6c5ce7;
    --link-gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    --hover-color: #5b4cdb;
    --search-bg: rgba(255, 255, 255, 0.9);
    --icon-color: #2d3436;
    --shadow-color: rgba(108, 92, 231, 0.2);
    --shadow-light: rgba(0, 0, 0, 0.06);
}

body.dark-mode {
    --text-color: #f5f6fa;
    --text-secondary: #b2bec3;
    --card-bg: rgba(45, 52, 54, 0.8);
    --card-bg-solid: #2d3436;
    --border-color: rgba(255, 255, 255, 0.1);
    --link-color: #a29bfe;
    --link-gradient: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    --hover-color: #b8b5ff;
    --search-bg: rgba(45, 52, 54, 0.9);
    --icon-color: #f5f6fa;
    --shadow-color: rgba(162, 155, 254, 0.25);
    --shadow-light: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

#background-video {
    position: fixed;
    top: 0;
    left: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0;
    object-fit: cover;
    pointer-events: none;
}

/* 模糊遮罩层 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, 0.25);
    z-index: 1;
    pointer-events: none;
    transition: background-color 0.4s ease;
}

body.dark-mode::before {
    background: rgba(0, 0, 0, 0.4);
}

.main-content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 24px 100px;
    position: relative;
    z-index: 10;
}

/* 头部样式 */
.header {
    margin-bottom: 50px;
    animation: fadeInDown 0.6s ease;
}

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

.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.header-title h1 {
    font-size: 2.8em;
    font-weight: 700;
    background: var(--link-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header > p {
    color: var(--text-secondary);
    font-size: 1.1em;
    font-weight: 400;
    letter-spacing: 2px;
}

/* 搜索框样式 */
.search-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

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

.search-box {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 640px;
}

.search-box input {
    flex-grow: 1;
    padding: 18px 100px 18px 56px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-size: 16px;
    background: var(--search-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: 0 4px 24px var(--shadow-light);
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 4px 24px var(--shadow-color), 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.search-logo {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    padding: 4px;
    background: var(--card-bg-solid);
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 2;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-logo:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background: var(--link-gradient);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
    z-index: 2;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 16px var(--shadow-color);
}

/* 分类标签 */
.tags-container {
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.tags-container button,
.tag-button {
    padding: 10px 24px;
    border: none;
    border-radius: 25px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px var(--shadow-light);
}

.tags-container button:hover,
.tag-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.tags-container button.active,
.tag-button.active {
    background: var(--link-gradient);
    color: #fff;
    box-shadow: 0 4px 16px var(--shadow-color);
}

/* 链接网格 */
.links-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.links-grid.active {
    display: grid;
}

/* 链接卡片 */
.link-item {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 12px;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.link-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--link-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.link-item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 32px var(--shadow-color);
    border-color: var(--link-color);
}

.link-item:hover::before {
    opacity: 0.05;
}

.link-item img {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    border-radius: 10px;
    transition: transform 0.3s ease;
    object-fit: contain;
}

.link-item:hover img {
    transform: scale(1.1);
}

.link-item span {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 底部版权 */
.footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    padding: 20px 24px;
    z-index: 10;
    letter-spacing: 0.5px;
}

.footer a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--hover-color);
}

/* 深色模式切换按钮 */
.dark-mode-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px var(--shadow-light);
}

.dark-mode-toggle svg {
    width: 22px;
    height: 22px;
    fill: var(--icon-color);
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.dark-mode-toggle:focus {
    outline: none;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .main-content {
        padding: 24px 16px 100px;
    }

    .header {
        margin-bottom: 32px;
    }

    .header-title h1 {
        font-size: 2.2em;
    }

    .header > p {
        font-size: 1em;
    }

    .search-container {
        margin-bottom: 28px;
    }

    .search-box input {
        padding: 14px 80px 14px 48px;
        font-size: 15px;
    }

    .tags-container {
        gap: 8px;
        margin-bottom: 24px;
    }

    .tags-container button,
    .tag-button {
        padding: 8px 18px;
        font-size: 13px;
    }

    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }

    .link-item {
        padding: 16px 10px;
        border-radius: 14px;
    }

    .link-item img {
        width: 36px;
        height: 36px;
        margin-bottom: 8px;
    }

    .link-item span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .header-title h1 {
        font-size: 1.8em;
    }

    .search-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

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

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--link-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hover-color);
}

/* 选中文字样式 */
::selection {
    background: var(--link-color);
    color: #fff;
}
