/* CSS变量定义 */
:root {
    /* 亮色主题 */
    --bg-primary: #f5f7fa;
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-heavy: rgba(0, 0, 0, 0.25);
}

/* 暗色主题 */
[data-theme="dark"] {
    --bg-primary: #2d2d2d;
    --bg-secondary: #1a1a1a;
    --bg-card: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-light: #999999;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
    --shadow-heavy: rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 左侧导航栏 */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #8B5CF6 0%, #7C3AED 100%);
    box-shadow: 2px 0 10px var(--shadow-light);
    padding: 0;
    transition: all 0.3s ease;
}

/* 导航标题 */
.nav-title {
    padding: 25px 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 10px;
    color: white;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

/* 暗色主题下的按钮样式 */
[data-theme="dark"] .theme-toggle {
    background: rgba(45, 45, 45, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(45, 45, 45, 0.95);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.theme-icon {
    width: 24px;
    height: 24px;
    color: #333333;
    transition: all 0.3s ease;
    position: absolute;
}

/* 暗色主题下的图标颜色 */
[data-theme="dark"] .theme-icon {
    color: #ffffff;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.moon-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0.8);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0.8);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 30px;
    margin: 2px 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    border-radius: 8px;
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: #FFF;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.25);
    border-left-color: #FFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateX(2px);
}

.nav-item .icon {
    font-size: 20px;
    margin-right: 15px;
    width: 28px;
    text-align: center;
}

.nav-item .text {
    font-size: 15px;
    font-weight: 500;
}

/* 右侧内容区域 */
.content {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
}

/* 搜索框容器 */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    width: 400px;
    max-width: 100%;
}

.search-input {
    width: 100%;
    height: 50px;
    padding: 0 20px 0 55px;
    border: none;
    border-radius: 25px;
    background: var(--bg-card);
    box-shadow: 
        0 8px 32px rgba(139, 69, 255, 0.15),
        0 4px 16px rgba(139, 69, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

.search-input:focus {
    box-shadow: 
        0 12px 40px rgba(139, 69, 255, 0.25),
        0 6px 20px rgba(139, 69, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #8b45ff;
    pointer-events: none;
    transition: all 0.3s ease;
}

.search-input:focus ~ .search-icon,
.search-box:hover .search-icon {
    color: #7c3aed;
    transform: translateY(-50%) scale(1.1);
}

/* 网站卡片网格 */
.website-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
    width: 100%;
}

/* 网站卡片 */
.website-card {
    height: 60px;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-light);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.website-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.website-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #8B5CF6;
}

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

.website-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    margin-right: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}

.website-icon img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.website-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 32px;
    overflow: hidden;
}

.website-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 2px;
}

.website-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .website-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1000px) {
    .website-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 800px) {
    .website-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .sidebar {
        width: 240px;
    }
}

@media (max-width: 600px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }
    
    .nav-item {
        white-space: nowrap;
        min-width: 120px;
    }
    
    .website-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content {
        padding: 20px;
    }
}

/* 加载动画 */
.website-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

.website-card:nth-child(1) { animation-delay: 0.1s; }
.website-card:nth-child(2) { animation-delay: 0.2s; }
.website-card:nth-child(3) { animation-delay: 0.3s; }
.website-card:nth-child(4) { animation-delay: 0.4s; }
.website-card:nth-child(5) { animation-delay: 0.5s; }
.website-card:nth-child(6) { animation-delay: 0.6s; }
.website-card:nth-child(7) { animation-delay: 0.7s; }
.website-card:nth-child(8) { animation-delay: 0.8s; }
.website-card:nth-child(9) { animation-delay: 0.9s; }
.website-card:nth-child(10) { animation-delay: 1.0s; }
.website-card:nth-child(11) { animation-delay: 1.1s; }
.website-card:nth-child(12) { animation-delay: 1.2s; }