/* 全局样式 */
:root {
    --primary-color: #4a6fa5;
    --primary-dark: #385d8a;
    --secondary-color: #6c757d;
    --accent-color: #17a2b8;
    --success-color: #28a745;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #333;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --gradient: linear-gradient(135deg, #4a6fa5 0%, #17a2b8 100%);
    --radius: 10px;
    --transition: all 0.3s ease;
}

.dark-theme {
    --primary-color: #5d8cc8;
    --primary-dark: #4a6fa5;
    --light-color: #1a1d23;
    --dark-color: #f8f9fa;
    --text-color: #e9ecef;
    --text-light: #adb5bd;
    --border-color: #2d3748;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-color);
    background-color: var(--light-color);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background-color: var(--light-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.logo i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
    background-color: rgba(74, 111, 165, 0.1);
}

.nav-links a.active {
    color: var(--primary-color);
    background-color: rgba(74, 111, 165, 0.15);
}

.theme-toggle {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    background-color: rgba(74, 111, 165, 0.1);
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: rgba(74, 111, 165, 0.2);
}

.theme-toggle i {
    font-size: 1.2rem;
    color: var(--text-color);
}

/* 英雄区域 */
.hero {
    padding: 4rem 0;
    background: var(--gradient);
    color: white;
    margin-bottom: 3rem;
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}

.hero-content {
    flex: 1;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    opacity: 0.85;
}

.search-container {
    max-width: 600px;
}

.search-box {
    display: flex;
    background: white;
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
}

.search-box i {
    color: var(--text-light);
    padding: 0.75rem 1rem;
    font-size: 1.2rem;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.75rem 0;
    background: transparent;
}

.search-box button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--primary-dark);
}

.search-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tag:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hero-image {
    flex: 0 0 300px;
    position: relative;
}

.floating-icons {
    position: relative;
    height: 200px;
}

.floating-icons i {
    position: absolute;
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.8);
    animation: float 6s ease-in-out infinite;
}

.floating-icons i:nth-child(1) {
    top: 20px;
    left: 50px;
    animation-delay: 0s;
}

.floating-icons i:nth-child(2) {
    top: 80px;
    left: 150px;
    animation-delay: 2s;
}

.floating-icons i:nth-child(3) {
    top: 40px;
    left: 250px;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* 主要内容区域 */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* 分类卡片网格 */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.category-card {
    background: var(--light-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.category-icon i {
    font-size: 1.8rem;
    color: white;
}

.category-info {
    flex: 1;
}

.category-info h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.category-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.category-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.category-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.category-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.category-tags .tag {
    background: rgba(74, 111, 165, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    border: none;
}

.category-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(74, 111, 165, 0.1);
    border-color: var(--primary-color);
}

/* 统计区域 */
.stats-section {
    margin-bottom: 4rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: var(--light-color);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.stat-card p {
    color: var(--text-light);
    font-size: 1rem;
}

/* 关于区域 */
.about-section {
    margin-bottom: 4rem;
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.about-text ul {
    list-style: none;
    margin-top: 1.5rem;
}

.about-text li {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.about-text li i {
    color: var(--success-color);
    margin-top: 0.2rem;
}

.about-cta {
    background: var(--gradient);
    color: white;
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
}

.about-cta h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.about-cta p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.about-cta .btn-primary {
    background: white;
    color: var(--primary-color);
    width: 100%;
}

.about-cta .btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* 页脚 */
.footer {
    background: var(--dark-color);
    color: var(--light-color);
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-logo i {
    font-size: 1.8rem;
}

.footer-description {
    margin-bottom: 2rem;
    opacity: 0.8;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--light-color);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    opacity: 1;
}

.copyright {
    opacity: 0.6;
    font-size: 0.9rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--light-color);
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

/* 详情页布局 */
.details-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    margin-top: 0;
}

/* 左侧导航 */
.sidebar {
    width: 380px;
    background: var(--light-color);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    position: fixed;
    top: 80px;
    left: 0;
    height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow);
}

.sidebar h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
}

.sidebar h4 {
    font-size: 1rem;
    margin: 1.5rem 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.sidebar-stats,
.sidebar-help {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.sidebar-help p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* 树形导航样式 */
.category-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--light-color);
    transition: all 0.2s;
}

.category-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(74, 111, 165, 0.1);
}

.category-item + .category-item {
    margin-top: 0;
}

/* 移除列表项之间的所有间距 */
.category-nav li {
    margin: 0;
    padding: 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.category-header:hover {
    background: rgba(74, 111, 165, 0.05);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.expand-icon {
    color: var(--primary-color);
    font-size: 0.8rem;
    transition: transform 0.2s;
    width: 16px;
    text-align: center;
}

.nav-text {
    font-size: 0.95rem;
}

.site-count {
    font-size: 0.8rem;
    color: var(--text-light);
    background: rgba(74, 111, 165, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.site-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(255, 255, 255, 0.5);
    display: none;
}

.site-list.expanded {
    display: block;
}

.site-list.expanded {
    max-height: 500px;
    transition: max-height 0.5s ease-in;
}

.site-list li {
    border-top: 1px solid var(--border-color);
    margin: 0;
    padding: 0;
}

.site-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem 0.4rem 2rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
    font-size: 0.85rem;
    margin: 0;
}

.site-link:hover {
    background: rgba(74, 111, 165, 0.08);
    color: var(--primary-color);
}

.site-link i {
    font-size: 0.8rem;
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.site-link.visited {
    color: var(--success-color);
}

.site-link.visited i {
    color: var(--success-color);
}

/* 深色主题适配 */
.dark-theme .category-item {
    background: var(--dark-light);
    border-color: var(--dark-border);
}

.dark-theme .category-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(74, 111, 165, 0.2);
}

.dark-theme .category-header:hover {
    background: rgba(74, 111, 165, 0.1);
}

.dark-theme .site-list {
    background: rgba(40, 44, 52, 0.5);
}

.dark-theme .site-count {
    background: rgba(74, 111, 165, 0.2);
}

.dark-theme .site-link:hover {
    background: rgba(74, 111, 165, 0.15);
}



/* 旧的 .category-nav 样式已删除 - 使用新的树形导航样式 */

/* 右侧内容区域 */
.details-content {
    flex: 1;
    margin-left: 380px;
    padding: 3rem;
    max-width: calc(100% - 380px);
}

.category-section {
    margin-bottom: 4rem;
    scroll-margin-top: 100px;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.category-header h2 {
    font-size: 2rem;
    color: var(--text-color);
}

.category-header .category-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
}

/* 网站列表 - 网格布局 */
.sites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.site-card {
    background: var(--light-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.site-card:hover {
    box-shadow: var(--shadow-hover);
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.site-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
    background: white;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.site-title-info {
    flex: 1;
    min-width: 0;
}

.site-title-info h3 {
    margin: 0 0 0.25rem 0;
}

.site-header h3 {
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.site-url {
    color: var(--primary-color);
    font-size: 0.9rem;
    word-break: break-all;
}

.site-description {
    color: var(--text-light);
    line-height: 1.6;
    flex: 1;
}

.site-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.site-tags .tag {
    background: rgba(74, 111, 165, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.site-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.site-actions .btn-primary,
.site-actions .btn-secondary {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    flex: 1;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.3rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .details-content {
        margin-left: 0;
    }
    
    .details-layout {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .search-box {
        flex-direction: column;
        border-radius: var(--radius);
    }
    
    .search-box button {
        width: 100%;
        border-radius: var(--radius);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .category-actions {
        flex-direction: column;
    }
    
    .site-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .site-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .category-info h3 {
        font-size: 1.2rem;
    }
    
    .category-header h2 {
        font-size: 1.5rem;
    }
}