/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS变量定义 */
:root, [data-theme="dark"] {
    --primary-bg: #1a1a2e;
    --secondary-bg: rgba(26, 26, 46, 0.95);
    --text-color: #e0e0e0;
    --text-color-rgb: 224, 224, 224;
    --accent-color: #d4af37;
    --accent-color-rgb: 212, 175, 55;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --shadow: rgba(0, 0, 0, 0.4);
    --particle-color: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] {
    --primary-bg: #f0f0f5;
    --secondary-bg: rgba(240, 240, 245, 0.95);
    --text-color: #333;
    --text-color-rgb: 51, 51, 51;
    --accent-color: #d4af37;
    --accent-color-rgb: 212, 175, 55;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
    --shadow: rgba(0, 0, 0, 0.1);
    --particle-color: rgba(0, 0, 0, 0.3);
}

html {
    background: var(--primary-bg);
    transition: background 0.3s ease;
}

body {
    font-family: 'Arial', sans-serif;
    background: transparent;
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 暗黑模式降低壁纸亮度 */
[data-theme="dark"] #random-background {
    filter: brightness(0.6);
}

[data-theme="light"] #random-background {
    filter: brightness(1);
}

/* 标题高光效果 */
h1, h2, h3, .resources-title, .profile-title, .blog-header h1 {
    background: linear-gradient(135deg, var(--accent-color) 0%, #fff 50%, var(--accent-color) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* 随机背景 */
#random-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    transition: opacity 1s ease;
    opacity: 0;
}

/* 粒子背景 */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

/* 欢迎界面 */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg);
    z-index: 1000;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.welcome-content {
    text-align: center;
    animation: fadeInUp 1s ease;
}

.welcome-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px var(--shadow);
    animation: float 3s ease-in-out infinite;
}

.welcome-title {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px var(--shadow);
}

.enter-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    background: linear-gradient(45deg, var(--accent-color), #f0c674);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px var(--shadow);
    position: relative;
    overflow: hidden;
}

.enter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
}

.enter-btn:active {
    transform: translateY(0);
}

/* 液态玻璃导航栏 */
.glass-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    padding: 15px 30px;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 12px 40px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 16px;
    border-radius: 12px;
}

.nav-menu a:hover {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 80%;
}

.nav-menu a.active {
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.1);
}

.nav-menu a.active::after {
    width: 80%;
}

/* 返回按钮 */
.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.back-btn svg {
    width: 16px;
    height: 16px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

/* 主题切换按钮 */
.theme-toggle {
    width: 60px;
    height: 30px;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 15px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-ball {
    width: 22px;
    height: 22px;
    background: var(--accent-color);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-ball svg {
    width: 12px;
    height: 12px;
    color: white;
    transition: all 0.3s ease;
}

.sun-icon {
    opacity: 1;
}

.moon-icon {
    opacity: 0;
    position: absolute;
}

[data-theme="dark"] .toggle-ball {
    transform: translateX(28px);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
}

/* 主网站内容 */
.main-site {
    min-height: 100vh;
    padding-top: 120px;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    min-height: 80vh;
    padding: 4rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.section h1, .section h2 {
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.section h1 {
    font-size: 3rem;
}

.section h2 {
    font-size: 2.5rem;
}

.section p {
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 600px;
}

/* 返回顶部按钮 - Android 16风格 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: var(--accent-color);
    border: none;
    border-radius: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 50;
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    color: white;
}

.back-to-top:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow);
}

.back-to-top:active {
    transform: scale(0.95);
}

/* 工具类 */
.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .glass-nav {
        width: 95%;
        padding: 12px 25px;
    }
    
    .nav-container {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-menu a {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .section h1 {
        font-size: 2rem;
    }
    
    .section h2 {
        font-size: 1.8rem;
    }
    
    .glass-nav {
        width: 95%;
        padding: 10px 20px;
    }
    
    .theme-toggle {
        width: 50px;
        height: 25px;
    }
    
    .toggle-ball {
        width: 19px;
        height: 19px;
    }
    
    [data-theme="dark"] .toggle-ball {
        transform: translateX(23px);
    }
}

@media (max-width: 480px) {
    .welcome-icon {
        width: 80px;
        height: 80px;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .enter-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .section h1 {
        font-size: 1.5rem;
    }
    
    .section h2 {
        font-size: 1.3rem;
    }
    
    .section p {
        font-size: 1rem;
    }
    
    .back-to-top {
        width: 48px;
        height: 48px;
        bottom: 20px;
        right: 20px;
    }
    
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* 搜索容器样式 */
.search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 150px auto 50px; /* 增加顶部边距，向下移动搜索框 */
    max-width: 600px;
    padding: 0 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 5px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.search-select {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    margin-right: 10px;
    min-width: 100px;
}

.search-select option {
    background: var(--bg-color);
    color: var(--text-color);
}

#searchInput {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 15px;
    color: var(--text-color);
    font-size: 16px;
    outline: none;
}

#searchInput::placeholder {
    color: var(--text-color);
    opacity: 0.5;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.academic-search-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 1;
}

.academic-search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
}

.academic-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.content-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .search-select {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    #searchInput {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .search-btn {
        width: 100%;
        padding: 12px;
    }
}

/* 快速链接区域样式 - 作为footer */
.quick-links-container {
    max-width: 800px;
    margin: 40px auto 30px;
    padding: 20px 16px;
    text-align: center;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow);
}

.quick-links-title {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.quick-link-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.quick-link-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-link-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.quick-link-icon .icon-text {
    font-size: 12px;
    font-weight: bold;
}

.quick-link-icon svg {
    width: 16px;
    height: 16px;
}

/* 各个网站的渐变色 */
.quick-link-icon.deepseek { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.quick-link-icon.bilibili { background: linear-gradient(135deg, #00a1d6, #0084c7); }
.quick-link-icon.douyin { background: linear-gradient(135deg, #ff0050, #ff4081); }
.quick-link-icon.kimi { background: linear-gradient(135deg, #10b981, #059669); }
.quick-link-icon.github { background: linear-gradient(135deg, #333, #666); }
.quick-link-icon.chatgpt { background: linear-gradient(135deg, #10a37f, #1a7f64); }
.quick-link-icon.youtube { background: linear-gradient(135deg, #ff0000, #cc0000); }

.quick-link-info {
    text-align: left;
    flex: 1;
    min-width: 0;
}

.quick-link-info h3 {
    font-size: 0.85rem;
    color: var(--text-color);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-link-info p {
    font-size: 0.7rem;
    color: var(--text-color);
    opacity: 0.6;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .quick-links-container {
        max-height: 300px;
    }
    
    .quick-links-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.8rem;
    }
    
    .quick-link-card {
        padding: 0.8rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        min-height: auto;
    }
    
    .quick-links-title {
        font-size: 1.4rem;
    }
    
    .quick-link-info {
        text-align: center;
    }

    .quick-link-info h3,
    .quick-link-info p {
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
    }
}

@media (max-width: 480px) {
    .quick-links-container {
        margin: 30px 15px 20px;
        padding: 15px 12px;
    }

    .quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .quick-link-card {
        padding: 0.6rem;
        flex-direction: column;
        text-align: center;
        gap: 0.4rem;
    }

    .quick-link-info {
        text-align: center;
    }
}