/* 使用多个选择器确保主题样式能被正确应用 */
[data-bs-theme="dark"],
:root[data-bs-theme="dark"],
body[data-bs-theme="dark"],
.dark-theme {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --text-primary: #e0e0e0;
    --text-secondary: #bbb;
    --border-color: #333;
    --hover-color: #1e88e5;
    --meta-color: #888;
}

/* 全局深色主题样式 */
body.dark-theme {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

body.dark-theme main {
    background-color: #1a1a1a !important;
}

body.dark-theme .container {
    background-color: transparent !important;
}

body.dark-theme .main-content {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

body.dark-theme .main-content h1,
body.dark-theme .main-content h2,
body.dark-theme .main-content h3,
body.dark-theme .main-content h4,
body.dark-theme .main-content h5,
body.dark-theme .main-content h6 {
    color: #e0e0e0 !important;
}

body.dark-theme .main-content p {
    color: #bbb !important;
}

body.dark-theme .main-content a {
    color: #1e88e5 !important;
}

body.dark-theme .main-content a:hover {
    color: #42a5f5 !important;
}

/* 导航栏深色样式 */
body.dark-theme .navbar {
    background: #242424;
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

body.dark-theme .nav-link {
    color: #e0e0e0 !important;
}

body.dark-theme .nav-link:hover {
    color: #1e88e5 !important;
}

body.dark-theme .nav-link.current {
    color: #1e88e5 !important;
}

/* TopSearchBar 和 Footer 不参与主题切换，移除其深色样式 */

/* 首页和内容区域背景 */
body.dark-theme .featured-section,
body.dark-theme .book-library-section,
body.dark-theme .content-grid {
    background-color: transparent !important;
}

/* 内容卡片深色样式 */
body.dark-theme .content-section,
body.dark-theme .side-section,
body.dark-theme .main-feature,
body.dark-theme .news-list {
    background: #242424 !important;
    border: 1px solid #333;
}

/* 标题和链接深色样式 */
body.dark-theme .section-header h3,
body.dark-theme .feature-title a,
body.dark-theme .list-item a,
body.dark-theme .news-item a,
body.dark-theme .book-info a,
body.dark-theme .first-title {
    color: #e0e0e0 !important;
}

body.dark-theme .list-item a:hover,
body.dark-theme .news-item a:hover,
body.dark-theme .book-info a:hover,
body.dark-theme .first-title:hover {
    color: #1e88e5 !important;
}

body.dark-theme .more-link {
    color: #1e88e5 !important;
}

body.dark-theme .more-link:hover {
    color: #42a5f5 !important;
}

/* 分隔线深色样式 */
body.dark-theme .section-header {
    border-bottom-color: #333;
}

body.dark-theme .list-item,
body.dark-theme .news-item {
    border-bottom-color: #333;
}

/* 文本内容深色样式 */
body.dark-theme .feature-desc,
body.dark-theme .first-excerpt,
body.dark-theme .content-excerpt {
    color: #bbb !important;
}

body.dark-theme .item-meta,
body.dark-theme .item-info,
body.dark-theme .meta,
body.dark-theme .author {
    color: #888 !important;
}

body.dark-theme .feature-details,
body.dark-theme .feature-detail-item {
    color: #bbb !important;
}

body.dark-theme .detail-label {
    color: #888 !important;
}

body.dark-theme .detail-value {
    color: #e0e0e0 !important;
}

body.dark-theme .feature-category {
    color: #1e88e5 !important;
}

/* 问答板块深色样式 */
body.dark-theme .qa-content {
    background: #2a2a2a;
}

body.dark-theme .qa-content:hover {
    background: #333;
}

body.dark-theme .qa-title {
    color: #e0e0e0;
}

body.dark-theme .answer-content {
    color: #bbb;
}

/* 返回顶部按钮保持原样，不参与主题切换 */

/* 页脚保持原样，不参与主题切换 */

/* TopSearchBar 内的所有元素保持原样，不参与主题切换 */

/* 书库轮播深色样式 */
body.dark-theme .book-carousel,
body.dark-theme .carousel-item {
    background-color: transparent !important;
}

body.dark-theme .book-card {
    background: #242424 !important;
    border: 1px solid #333 !important;
}

body.dark-theme .book-title {
    color: #e0e0e0 !important;
}

body.dark-theme .book-author {
    color: #888 !important;
}

/* 添加 Logo 容器的深色主题样式 */
body.dark-theme .logo-container {
    background: #242424 !important; /* 深色背景 */
}

/* Logo 相关样式 */
body.dark-theme .logo-light {
    display: none !important;
}

body.dark-theme .logo-dark {
    display: inline-block !important;
}

body.dark-theme .navbar-logo img {
    content: url('/assets/images/logo_white.png');
}

/* BookList 深色主题样式 */
body.dark-theme .book-list-card {
    background-color: #242424 !important;
    border-color: #333 !important;
}

body.dark-theme .book-list-card:hover {
    border-color: #444 !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
}

body.dark-theme .book-list-title-link {
    color: #e0e0e0 !important;
}

body.dark-theme .book-list-title-link:hover {
    color: #1e88e5 !important;
}

body.dark-theme .book-list-author {
    color: #888 !important;
}

body.dark-theme .book-list-empty,
body.dark-theme .book-list-loading {
    color: #888 !important;
}

body.dark-theme .book-card {
    background-color: #242424 !important;
    border-color: #333 !important;
}

body.dark-theme .book-card h6 a {
    color: #e0e0e0 !important;
}

body.dark-theme .book-card h6 a:hover {
    color: #1e88e5 !important;
}

body.dark-theme .text-muted {
    color: #888 !important;
}

/* ArticleList 深色主题样式 */
body.dark-theme .article-list-item {
    background-color: #242424 !important;
    border-color: #333 !important;
}

body.dark-theme .article-list-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important;
}

body.dark-theme .article-list-title-link {
    color: #e0e0e0 !important;
}

body.dark-theme .article-list-title-link:hover {
    color: #1e88e5 !important;
}

body.dark-theme .article-list-title a {
    color: #e0e0e0 !important;
}

body.dark-theme .article-list-title a:hover {
    color: #1e88e5 !important;
}

body.dark-theme .article-list-summary {
    color: #bbb !important;
}

body.dark-theme .article-list-meta {
    color: #888 !important;
}

body.dark-theme .article-list-meta i {
    color: #888 !important;
}

body.dark-theme .article-list-empty,
body.dark-theme .article-list-loading {
    color: #888 !important;
}

/* CommentSection 深色主题样式 */
body.dark-theme .ant-card {
    background: #242424 !important;
    border-color: #333 !important;
}

body.dark-theme .ant-card-body {
    background: #242424 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .ant-typography {
    color: #e0e0e0 !important;
}

body.dark-theme .ant-typography-title {
    color: #e0e0e0 !important;
}

body.dark-theme .ant-typography-text {
    color: #e0e0e0 !important;
}

body.dark-theme .ant-typography-text[type="secondary"] {
    color: #888 !important;
}

body.dark-theme .ant-input {
    background-color: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .ant-input:focus,
body.dark-theme .ant-input-focused {
    background-color: #2a2a2a !important;
    border-color: #1e88e5 !important;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.1) !important;
}

body.dark-theme .ant-input::placeholder {
    color: #666 !important;
}

body.dark-theme .ant-input-textarea {
    background-color: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .ant-input-textarea:focus,
body.dark-theme .ant-input-textarea-focused {
    background-color: #2a2a2a !important;
    border-color: #1e88e5 !important;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.1) !important;
}

body.dark-theme .ant-btn-primary {
    background-color: #1e88e5 !important;
    border-color: #1e88e5 !important;
}

body.dark-theme .ant-btn-primary:hover {
    background-color: #42a5f5 !important;
    border-color: #42a5f5 !important;
}

body.dark-theme .ant-btn-link {
    color: #1e88e5 !important;
}

body.dark-theme .ant-btn-link:hover {
    color: #42a5f5 !important;
}

body.dark-theme .ant-empty {
    color: #888 !important;
}

body.dark-theme .ant-empty-description {
    color: #888 !important;
}

body.dark-theme .ant-alert {
    background-color: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .ant-alert-info {
    background-color: #1a3a5a !important;
    border-color: #1e88e5 !important;
}

body.dark-theme .ant-divider {
    border-color: #333 !important;
}

body.dark-theme .ant-spin {
    color: #1e88e5 !important;
}

body.dark-theme .ant-spin-dot-item {
    background-color: #1e88e5 !important;
}

/* QAPage 深色主题样式 */
body.dark-theme .qa-page-container {
    background-color: #1a1a1a !important;
}

body.dark-theme .qa-question-card {
    background-color: #242424 !important;
    border-color: #333 !important;
}

body.dark-theme .qa-answer-section {
    background-color: #2a2a2a !important;
    border-color: #444 !important;
}

body.dark-theme .qa-form-card {
    background-color: #242424 !important;
}

body.dark-theme .qa-textarea {
    background-color: #2a2a2a !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .qa-textarea::placeholder {
    color: #666 !important;
}

/* HadithDetailPage 深色主题样式补充 */
body.dark-theme .hadith-sidebar {
    background-color: #242424 !important;
}

body.dark-theme .hadith-content {
    background-color: #1a1a1a !important;
}

body.dark-theme .hadith-card {
    background-color: #242424 !important;
    border-color: #333 !important;
}

body.dark-theme .hadith-search-input {
    background-color: #242424 !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .hadith-search-input::placeholder {
    color: #666 !important;
} 