/**
 * 黑暗模式样式
 * 为 zibll-zt-sam 插件提供黑暗模式支持
 * 
 * 加载测试：如果这个文件正确加载，body.dark-theme 应该应用所有样式
 */

/* ========== 应用下载样式黑暗模式 ========== */
body.dark-theme .zibll-zt-sam-app-download .content {
    background: #2d2e30;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

body.dark-theme .zibll-zt-sam-app-download .article-extend-app h1 {
    color: #f0f0f0;
}

body.dark-theme .zibll-zt-sam-app-download .article-extend-app p {
    color: #b0b0b0;
}

body.dark-theme .zibll-zt-sam-app-download .appattr span,
body.dark-theme .zibll-zt-sam-app-download .appattr a {
    background: #37383a;
    color: #52c41a;
    border-color: #52c41a;
}

body.dark-theme .zibll-zt-sam-app-download .appattr a:hover {
    background: #454648;
}

body.dark-theme .zibll-zt-sam-app-download .app-info {
    border-color: #4a4b4d;
}

body.dark-theme .zibll-zt-sam-app-download .app-info > div {
    color: #b0b0b0;
}

body.dark-theme .zibll-zt-sam-app-download .app-info > div span {
    color: #d0d0d0;
}

body.dark-theme .zibll-zt-sam-app-download .app-info > div a {
    color: #409eff;
}

body.dark-theme .zibll-zt-sam-app-download .app-info > div a:hover {
    color: #66b1ff;
}

body.dark-theme .zibll-zt-sam-app-download .breadcrumb a {
    color: #b0b0b0;
}

body.dark-theme .zibll-zt-sam-app-download .breadcrumb a:hover {
    color: #d0d0d0;
}

body.dark-theme .zibll-zt-sam-app-download .breadcrumb span {
    color: #666;
}

/* 面包屑导航容器黑暗模式 */
body.dark-theme .zibll-zt-sam-app-download .zibll-zt-sam-breadcrumb {
    border-bottom-color: #4a4b4d;
}

/* 下载地址标题黑暗模式 */
body.dark-theme .zibll-zt-sam-app-download .zibll-zt-sam-download-title {
    color: #d0d0d0;
}

body.dark-theme .zibll-zt-sam-app-download .zibll-zt-sam-download-title span[style*="background-color: #e4e7ed"] {
    background-color: #4a4b4d;
}

/* 点赞分享收藏按钮黑暗模式 */
body.dark-theme .zibll-zt-sam-app-download .zibll-zt-sam-action-buttons .action-button-wrapper {
    background-color: #37383a;
}

body.dark-theme .zibll-zt-sam-app-download .zibll-zt-sam-action-buttons .action {
    color: #d0d0d0;
}

body.dark-theme .zibll-zt-sam-app-download .zibll-zt-sam-action-buttons .action:hover {
    color: #fff;
}

/* ========== 应用下载小工具黑暗模式 ========== */
/* 小工具最外层容器 - 使用透明背景让主题控制 */
body.dark-theme .zib-widget .app-download-menu,
body.dark-theme .widget-box .app-download-menu,
body.dark-theme .app-download-menu {
    background: transparent !important;
    box-shadow: none !important;
}

/* 网格容器 */
body.dark-theme .app-download-menu .app-grid,
body.dark-theme .app-grid {
    background: transparent !important;
}

/* 应用卡片 */
body.dark-theme .app-grid .app-item,
body.dark-theme .app-item {
    background: var(--main-bg-color) !important;
    box-shadow: none !important;
}

body.dark-theme .app-grid .app-item:hover,
body.dark-theme .app-item:hover {
    background: var(--muted-bg-color) !important;
}

/* 应用卡片内的所有白色背景元素 */
body.dark-theme .app-item [style*="background: #fff"],
body.dark-theme .app-item [style*="background:#fff"],
body.dark-theme .app-item [style*="background: #ffffff"],
body.dark-theme .app-item [style*="background-color: #fff"],
body.dark-theme .app-item [style*="background-color: #ffffff"] {
    background: var(--main-bg-color) !important;
}

body.dark-theme .app-icon img {
    border-radius: 8px;
}

body.dark-theme .app-icon-placeholder {
    background: var(--muted-bg-color) !important;
}

body.dark-theme .app-icon-placeholder-text {
    color: var(--muted-2-color) !important;
}

/* 应用名称、描述、标签 - 使用更强的选择器 */
body.dark-theme .app-item .app-name,
body.dark-theme .app-name {
    color: var(--main-color) !important;
}

body.dark-theme .app-item .app-desc,
body.dark-theme .app-desc {
    color: var(--muted-color) !important;
}

body.dark-theme .app-item .app-tag,
body.dark-theme .app-tag {
    background: var(--muted-bg-color) !important;
    color: var(--muted-color) !important;
}

body.dark-theme .app-item .app-tag:hover,
body.dark-theme .app-tag:hover {
    background: var(--muted-2-color) !important;
    color: var(--main-color) !important;
}

body.dark-theme .app-item .app-download-btn,
body.dark-theme .app-download-btn {
    background: var(--theme-color) !important;
    color: #fff !important;
}

body.dark-theme .app-item .app-download-btn:hover,
body.dark-theme .app-download-btn:hover {
    opacity: 0.9;
}

body.dark-theme .app-item .app-date,
body.dark-theme .app-date {
    color: var(--muted-2-color) !important;
}

body.dark-theme .app-date[style*="color: #ff0000"] {
    color: var(--theme-color) !important;
}

body.dark-theme .zib-widget.c-gray {
    color: var(--muted-color) !important;
}

/* ========== Tab 标签菜单黑暗模式 ========== */
body.dark-theme .zibll-zt-sam-tab-menu {
    background: #2d2e30;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-theme .zibll-zt-sam-tab-menu .tab-menu-header {
    border-bottom-color: #4a4b4d;
}

body.dark-theme .zibll-zt-sam-tab-menu .tab-menu-item {
    color: #b0b0b0;
}

body.dark-theme .zibll-zt-sam-tab-menu .tab-menu-item:hover {
    background-color: #37383a;
    color: #d0d0d0;
}

body.dark-theme .zibll-zt-sam-tab-menu .tab-menu-item.active {
    background-color: #37383a;
    color: #409eff;
}

body.dark-theme .zibll-zt-sam-tab-menu .tab-menu-content {
    color: #d0d0d0;
}

body.dark-theme .zibll-zt-sam-tab-menu .history-versions-table thead {
    background-color: #37383a;
}

body.dark-theme .zibll-zt-sam-tab-menu .history-versions-table th {
    color: #d0d0d0;
    border-bottom-color: #4a4b4d;
}

body.dark-theme .zibll-zt-sam-tab-menu .history-versions-table td {
    color: #b0b0b0;
    border-bottom-color: #4a4b4d;
}

body.dark-theme .zibll-zt-sam-tab-menu .history-versions-table tbody tr:hover {
    background-color: #37383a;
}

body.dark-theme .zibll-zt-sam-tab-menu .history-versions-table .version-number {
    background-color: #37383a;
    color: #d0d0d0;
}

body.dark-theme .zibll-zt-sam-tab-menu .history-versions-table .version-text {
    color: #ff6b6b;
}

body.dark-theme .zibll-zt-sam-tab-menu .history-versions-table .remark-text {
    color: #909399;
}

body.dark-theme .zibll-zt-sam-tab-menu .update-log-item {
    border-color: #4a4b4d;
}

body.dark-theme .zibll-zt-sam-tab-menu .update-log-header {
    background: #37383a;
}

body.dark-theme .zibll-zt-sam-tab-menu .update-log-header h4 {
    color: #d0d0d0;
}

body.dark-theme .zibll-zt-sam-tab-menu .update-log-content {
    border-top-color: #4a4b4d;
}

body.dark-theme .zibll-zt-sam-tab-menu .update-log-content * {
    color: #b0b0b0;
}

body.dark-theme .zibll-zt-sam-tab-menu .muted-2-color {
    color: #909399 !important;
}

body.dark-theme .zibll-zt-sam-tab-menu .article-content {
    color: #d0d0d0;
}

body.dark-theme .zibll-zt-sam-tab-menu .article-content * {
    color: inherit;
}

/* ========== 多功能菜单黑暗模式 ========== */
body.dark-theme .info-cat-item {
    background: linear-gradient(180deg, rgba(55, 56, 58, 0.3) -20%, transparent 100%);
}

body.dark-theme .cat-arrow {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-theme .cat-item a {
    color: #999;
}

body.dark-theme .cat-item a:hover {
    color: #409eff;
}

body.dark-theme .stats-label {
    color: #999;
}

body.dark-theme .stats-value {
    color: #d0d0d0;
}

body.dark-theme .stats-value .red-number {
    color: #ff6b6b !important;
}

body.dark-theme .activity-item a {
    color: #999;
}

body.dark-theme .user-label {
    color: #999;
}

body.dark-theme .user-name {
    color: #52c41a;
}

body.dark-theme .action-title {
    color: #ff6b6b;
}

body.dark-theme .activity-time {
    background: transparent;
    color: #666;
}

body.dark-theme .info-activities::before {
    background: #4a4b4d;
}

/* ========== 浏览记录黑暗模式 ========== */
body.dark-theme .zibll-zt-sam-viewers-toggle {
    color: #b0b0b0;
}

body.dark-theme .zibll-zt-sam-viewers-avatars span a {
    color: #b0b0b0;
}

body.dark-theme .zibll-zt-sam-viewers-avatars span a:hover {
    color: #d0d0d0;
}

body.dark-theme .zibll-zt-sam-viewers-avatars div[style*="border: 2px solid #fff"] {
    border-color: #37383a !important;
}

body.dark-theme .zibll-zt-sam-viewers-avatars div[style*="background-color: #f5f5f5"] {
    background-color: #37383a !important;
}

body.dark-theme .zibll-zt-sam-viewers-avatars .activity-avatar-wrapper {
    border-color: #37383a !important;
}

/* ========== 通用元素黑暗模式 ========== */
body.dark-theme .zibll-zt-sam-component .but {
    color: #d0d0d0;
}

body.dark-theme .zibll-zt-sam-component .but:hover {
    color: #fff;
}

body.dark-theme .zibll-zt-sam-component .muted-color {
    color: #999 !important;
}

body.dark-theme .zibll-zt-sam-component .muted-2-color {
    color: #666 !important;
}

body.dark-theme .zibll-zt-sam-component .muted-3-color {
    color: #444 !important;
}

body.dark-theme .zibll-zt-sam-component .separator {
    border-top-color: #4a4b4d;
}

/* ========== 下载按钮黑暗模式 ========== */
body.dark-theme .but-download .but {
    background: #37383a;
    color: #d0d0d0;
}

body.dark-theme .but-download .but:hover {
    background: #454648;
    color: #fff;
}

body.dark-theme .but-download .but.jb-blue {
    background: #1890ff;
    color: #fff;
}

body.dark-theme .but-download .but.jb-blue:hover {
    background: #40a9ff;
}

body.dark-theme .but-download .but.jb-red {
    background: #f5222d;
    color: #fff;
}

body.dark-theme .but-download .but.jb-red:hover {
    background: #ff4d4f;
}

body.dark-theme .but-download .but.weiyun {
    background: #00c853;
    color: #fff;
}

body.dark-theme .but-download .but.baidu {
    background: #2932e0;
    color: #fff;
}

body.dark-theme .but-download .but.lanzou {
    background: #0078d4;
    color: #fff;
}

body.dark-theme .but-download .but.onedrive {
    background: #0078d4;
    color: #fff;
}

body.dark-theme .but-download .but.ctfile {
    background: #00a6fd;
    color: #fff;
}

body.dark-theme .but-download .but.alipan {
    background: #00c853;
    color: #fff;
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
    body.dark-theme .content {
        background: #2d2e30 !important;
    }
    
    body.dark-theme .article-extend-app h1 {
        color: #f0f0f0 !important;
    }
    
    body.dark-theme .article-extend-app p {
        color: #b0b0b0 !important;
    }
}

/* 
 * ========================================
 * 测试规则 - 验证 CSS 文件是否正确加载
 * ========================================
 */
/* 如果黑暗模式下小工具仍然显示白色背景，请检查：
   1. 浏览器开发者工具中是否看到这个注释
   2. Network 标签中 dark-mode.css 是否成功加载 (状态码 200)
   3. 清除浏览器缓存 (Ctrl+F5)
   4. 检查 WordPress 是否有缓存插件
*/
