@charset "UTF-8";

/* 深色模式基础样式 */
html.dark-mode body,
body.dark-mode {
    background-color: var(--color-background) !important;
}

html.dark-mode .content,
html.dark-mode #main-content,
body.dark-mode .content,
body.dark-mode #main-content {
    background-color: #00000000 !important;
    box-shadow: var(--shadow-md) !important;
}
/* 文本颜色 */
body {
    color: var(--color-text-primary) !important;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-primary) !important;
}

/* 链接样式 */
a {
    color: var(--color-text-primary) !important;
    text-decoration: none !important;
}

a:hover {
    text-decoration: underline !important;
}

/* 按钮基础样式 */
button {
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    font-family: inherit !important;
}

.view-toggle-container button svg {
    color: #999999 !important;
    width: 16px !important;
    height: 16px !important;
}

/* 标签样式 - 添加背景颜色 */
.tag-item {
    border-color: #f7f7f7 !important;
    background-color: #f5f7fa !important;
}

body:not(.dark-mode) .tag-item a,
body:not(.dark-mode) .tag-item span,
body:not(.dark-mode) .tag-item a:hover,
body:not(.dark-mode) .tag-item a:active {
    color: rgba(0, 0, 0, 0.7) !important;
}

body:not(.dark-mode) .tag-item svg {
    fill: rgba(0, 0, 0, 0.5) !important;
    color: rgba(0, 0, 0, 0.5) !important;
}

/* 深色模式标签样式 - 修复黑色背景问题 */
body.dark-mode .tag-item {
    border-color: #666 !important;
}

body.dark-mode .tag-item a,
body.dark-mode .tag-item span,
body.dark-mode .tag-item a:hover,
body.dark-mode .tag-item a:active {
    color: rgba(255, 255, 255, 0.8) !important;
}

body.dark-mode .tag-item svg {
    fill: rgba(255, 255, 255, 0.5) !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

/* 修复深色模式下标签背景为黑色的问题 - 提高优先级 */
html.dark-mode .primary-background-light {
    background-color: rgb(171 166 157 / 20%) !important;
}

html.dark-mode .tag-item.primary-background-light {
    background-color: rgb(171 166 157 / 20%) !important;
}

/* 确保最高优先级 */
:root html.dark-mode .primary-background-light {
    background-color: rgb(171 166 157 / 20%) !important;
}

:root html.dark-mode .tag-item.primary-background-light {
    background-color: rgb(171 166 157 / 20%) !important;
}

/* 左侧栏通用样式 */
.tri-layout-left-contents a,
.tri-layout-left-contents a:hover,
.tri-layout-left-contents a:focus,
.tri-layout-left-contents a:active {
    text-decoration: none !important;
    transition: background-color 0.3s ease !important;
}

/* 左侧栏a标签hover效果 */
body:not(.dark-mode) .tri-layout-left-contents a:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

body.dark-mode .tri-layout-left-contents a:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

/* 实体列表项样式 */
.entity-list-item {
    transition: background-color 0.3s ease !important;
}

/* 深浅色模式下的实体列表项hover和active样式 */
body:not(.dark-mode) .entity-list-item:hover,
body:not(.dark-mode) .entity-list-item.active {
    background-color: #e5e7eb !important;
}

body.dark-mode .entity-list-item:hover,
body.dark-mode .entity-list-item.active {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

/* 书架项样式 */
.shelf-item {
    padding: 8px 12px !important;
    margin-bottom: 5px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

/* 深浅色模式下的书架项样式 */
body:not(.dark-mode) .shelf-item {
    background-color: #f5f7fa !important;
    border: 1px solid #e5e7eb !important;
}

body:not(.dark-mode) .shelf-item:hover,
body:not(.dark-mode) .shelf-item.active {
    background-color: #e5e7eb !important;
}

body.dark-mode .shelf-item {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode .shelf-item:hover,
body.dark-mode .shelf-item.active {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

/* 左侧栏标题样式 */
#recents h5,
#popular h5,
#new h5,
#shelves-list h5 {
    margin-bottom: 16px !important;
    margin-top: 0 !important;
    padding-right: 15px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    color: var(--color-text-primary) !important;
    cursor: pointer !important;
    transition: color 0.3s ease !important;
}

/* 左侧栏标题hover效果 */
#recents h5:hover,
#popular h5:hover,
#new h5:hover,
#shelves-list h5:hover {
    color: #c17007 !important;
}

/* 三栏布局通用样式 */
.tri-layout-container {
    display: grid !important;
    grid-template-columns: 180px 1fr !important;
    grid-column-gap: 0 !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    width: 100% !important;
    position: relative !important;
}

/* 侧边栏内容布局 */
.tri-layout-sides-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
}

/* 左侧边栏样式 */
.tri-layout-left {
    min-width: 180px !important;
    width: 180px !important;
}

/* 左侧边栏内容 */
.tri-layout-left-contents {
    padding: 15px !important;
}

/* 隐藏右侧边栏 */
.tri-layout-right {
    display: none !important;
}

/* 适配不同屏幕尺寸 */
@media screen and (max-width: 1200px) {
    .tri-layout-container {
        max-width: 95% !important;
        grid-template-columns: 180px 1fr !important;
    }
    
    .tri-layout-left {
        width: 180px !important;
    }
}

@media screen and (max-width: 1024px) {
    .tri-layout-container {
        grid-template-columns: 1fr !important;
    }
    
    .tri-layout-left {
        display: none !important;
    }
}
