/* 默认浅色主题变量 */
:root {
    /* 基础颜色 */
    --bg-color: #ffffff;
    --text-color: #333333;
    --text-light: #555555;
    
    /* 侧边栏 */
    --sidebar-bg: #f8f8f8;
    --sidebar-border: #eaeaea;
    
    /* 按钮 */
    --button-bg: #ffffff;
    --button-hover: #f0f4f9;
    --button-active: #e1e8f0;
    --button-border: #d0d8e0;
    --button-text: #2c3e50;
    
    /* 强调色 */
    --accent-color: #4a6fa5;
    --accent-light: #6d8cc0;
    
    /* FAQ条目 */
    --faq-bg: #ffffff;
    --faq-border: #f0f0f0;
    
    /* 阴影 */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);

    --link-color: #2a6fc9;        /* 浅色主题链接颜色 */
    --link-hover: #1a4b8c;       /* 浅色主题悬停颜色 */
    --link-underline: rgba(42, 111, 201, 0.2);  /* 浅蓝色半透明下划线 */
}

/* 深色主题变量 */
[data-theme="dark"] {
    /* 基础颜色 */
    --bg-color: #121a24;
    --text-color: #e0e0e0;
    --text-light: #b0b0b0;
    
    /* 侧边栏 */
    --sidebar-bg: #1a2230;
    --sidebar-border: #253141;
    
    /* 按钮 */
    --button-bg: #1a2230;         /* 与侧边栏背景一致 */
    --button-hover: #253141;      /* 稍亮的蓝黑色 */
    --button-active: #2d3a4d;     /* 激活状态更深 */
    --button-border: transparent; /* 无边框 */
    --button-text: #ffffff;       /* 纯白色文字 */
    --button-highlight: #ff7b25;  /* 橙色高亮 */
    
    /* 强调色 */
    --accent-color: #ff7b25;
    --accent-light: #ff914d;
    
    /* FAQ条目 */
    --faq-bg: #1a2230;
    --faq-border: #253141;
    
    /* 阴影 */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.4);
    
    --link-color: #ff914d;       /* 深色主题链接颜色 */
    --link-hover: #ff7b25;      /* 深色主题悬停颜色 */
    --link-underline: rgba(255, 145, 77, 0.3);  /* 浅橙色半透明下划线 */
}

/* 基础样式 */
body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 侧边栏样式 */
#categories {
    float: left;
    width: 22%;
    padding: 25px 0;
    background-color: var(--sidebar-bg);
    height: 100vh;
    box-shadow: var(--shadow-sm);
    position: fixed;
    border-right: 1px solid var(--sidebar-border);
    transition: all 0.3s ease;
}

/* 主题切换按钮 */
#theme-toggle-container {
    text-align: right;
    padding: 0 25px 15px;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 15px;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: var(--text-color);
}

#theme-toggle:hover {
    background-color: var(--button-hover);
    transform: rotate(30deg);
}

#theme-toggle svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* 分类按钮样式 */
.category-btn {
    display: block;
    width: 85%;
    padding: 16px 25px;
    margin: 12px auto;
    background-color: var(--button-bg);
    color: var(--button-text);
    text-align: left;
    border: 1px solid var(--button-border);
    border-left: 4px solid var(--accent-color); /* 左侧高亮条 */
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.category-btn:hover, 
.category-btn:focus {
    background-color: var(--button-hover);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #b8c4d1;
}

.category-btn.active {
    background-color: var(--button-hover);
    border-left: 4px solid var(--accent-color);
    font-weight: 600;
    color: var(--button-text);
    box-shadow: inset 0 0 0 1px var(--accent-light);
}

.category-btn h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

/* 添加按钮的微光效果 */
.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 1%);
    z-index: 1;
}

/* 当前选中分类的标记 - 更新样式 */
.category-btn.active::after {
    content: "";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-color: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.3);
    z-index: 2;
}

/* 添加按钮按下效果 */
.category-btn:active {
    transform: translateX(5px) scale(0.98);
}
/* FAQ内容区域 */
#faqs {
    float: right;
    width: 72%;
    padding: 30px 40px;
    margin-right: 2%;
    background-color: var(--bg-color);
}

.faq-item {
    background-color: var(--faq-bg);
    padding: 25px 30px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border-left: 3px solid var(--faq-border);
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
    border-left: 3px solid var(--accent-color);
    transform: translateY(-2px);
}

.faq-item h3 {
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 500;
    font-size: 20px;
}

.faq-item p {
    color: var(--text-light);
    margin: 0;
    font-size: 15px;
}

/* 超链接样式 */
a {
    color: var(--link-color);
    text-decoration: none;
    background-image: linear-gradient(to right, var(--link-underline) 0%, var(--link-underline) 100%);
    background-repeat: repeat-x;
    background-position: 0 95%;
    background-size: 100% 1px;
    transition: all 0.2s ease;
    padding-bottom: 2px; /* 为下划线留出空间 */
}

a:hover {
    color: var(--link-hover);
    background-image: linear-gradient(to right, currentColor 0%, currentColor 100%);
    background-size: 100% 2px;
}

a:active {
    opacity: 0.8;
}

/* FAQ内的链接特别样式 */
.faq-item a {
    color: var(--accent-color);
    font-weight: 500;
    background-image: linear-gradient(to right, var(--link-underline) 0%, var(--link-underline) 100%);
}

.faq-item a:hover {
    color: var(--accent-light);
    background-image: linear-gradient(to right, currentColor 0%, currentColor 100%);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

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

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



/* 响应式设计 - 小屏幕适配 */
@media (max-width: 768px) {
    #categories {
        width: 100%;
        height: auto;
        position: relative;
        padding: 15px 0;
    }
    
    #faqs {
        width: 100%;
        padding: 20px;
        margin-right: 0;
    }
    
    .category-btn {
        width: 90%;
        padding: 12px 20px;
    }
}