/*!
Theme Name: CastaliaNav
Theme URI: https://example.com/castalianav
Description: 简洁高效的Typecho导航主题
Author: DeepSeek
Version: 2.0
*/

:root {
    /* 浅色模式变量 */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --accent-color: #4361ee;
    --light-accent: #e0e7ff;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --sidebar-width: 260px;
}

.dark-mode {
    /* 深色模式变量 */
    --bg-color: #121826;
    --card-bg: #1a1f2d;
    --text-color: #e2e8f0;
    --accent-color: #5a7dff;
    --light-accent: #2d3748;
    --border-color: #2d3748;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: var(--transition);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 1fr auto;
    grid-template-areas: 
        "sidebar main"
        "footer footer";
}

/* 侧边栏样式 */
.sidebar {
    grid-area: sidebar;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 25px 0;
    height: 100vh;
    position: sticky;
    top: 0;
}

.logo {
    padding: 0 25px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    overflow: hidden;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.sidebar-title {
    padding: 0 25px 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
    display: flex;
    align-items: center;
}

.sidebar-title i {
    margin-right: 10px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 3px;
}

.sidebar-menu a {
    display: block;
    padding: 12px 25px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.sidebar-menu a:hover {
    background-color: var(--light-accent);
}

.sidebar-menu a.active {
    background-color: var(--light-accent);
    color: var(--accent-color);
    border-left: 3px solid var(--accent-color);
}

.sidebar-menu a.active::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

.sidebar-menu i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 25px;
}

.sidebar-subtitle {
    padding: 15px 25px 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    font-weight: 600;
}

/* 主内容区域 */
.main-content {
    grid-area: main;
    padding: 40px 5% 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.category-section {
    margin-bottom: 50px;
    scroll-margin-top: 20px;
}

.section-title {
    margin-bottom: 1.5rem;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.section-title h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
}

.section-title .category-icon {
    width: 40px;
    height: 40px;
    background-color: var(--light-accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.2rem;
    color: var(--accent-color);
}

/* 链接列表 */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.link-item {
    padding: 15px;
    border-radius: 8px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
}

.link-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
    border-color: var(--accent-color);
}

.link-icon {
    width: 60px;
    height: 60px;
    background-color: var(--light-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1rem;
    color: var(--accent-color);
    overflow: hidden;
}

.link-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-content {
    flex: 1;
}

.link-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.link-url {
    font-size: 0.85rem;
    color: #94a3b8;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.external-link {
    color: var(--accent-color);
    margin-left: 10px;
    font-size: 0.9rem;
}

/* 页脚样式 */
.site-footer {
    grid-area: footer;
    background-color: #33363B;
   // padding: 30px 5%;
   // border-top: 1px solid var(--border-color);
}


.copyright {
    text-align: center;
    opacity: 0.7;
    font-size: 1.0rem;
    //padding-top: 20px;
    //border-top: 1px solid var(--border-color);
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
    //margin: 20px;
    color:#fff;

}

/* 响应式设计 */
@media (max-width: 1200px) {
    body {
        grid-template-columns: 240px 1fr;
        --sidebar-width: 240px;
    }
}

@media (max-width: 992px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "main"
            "footer";
    }
    
    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        box-shadow: 0 0 20px rgba(0,0,0,0.2);
    }
    
    .sidebar.mobile-open {
        display: block;
    }
    
    .main-content {
        padding: 20px 3% 20px;
    }
    
    .mobile-menu-toggle {
        position: fixed;
        top: 20px;
        left: 20px;
        background: var(--accent-color);
        color: white;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        z-index: 1100;
        box-shadow: var(--shadow);
        border: none;
        cursor: pointer;
    }
}

@media (max-width: 768px) {
    .link-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }
    
    .section-title h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 15px 3% 15px;
    }
    
    .section-title h2 {
        font-size: 1.4rem;
    }
    
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}

/* 侧边栏遮罩 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

.theme-toggle {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: var(--accent-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1100;
    box-shadow: var(--shadow);
    border: none;
    cursor: pointer;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1100;
    box-shadow: var(--shadow);
    border: none;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}