/* 夜间模式样式 */
:root {
    /* 浅色模式变量（默认） */
    --bg-primary: #F5F7FA;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F8FAFC;
    --text-primary: #303133;
    --text-secondary: #606266;
    --text-tertiary: #909399;
    --border-color: #E4E7ED;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --hover-bg: #F5F7FA;
    --card-bg: #FFFFFF;
}

/* 夜间模式 */
[data-theme="dark"] {
    --bg-primary: #141414;
    --bg-secondary: #1E1E20;
    --bg-tertiary: #2A2A2C;
    --text-primary: #E4E7ED;
    --text-secondary: #C0C4CC;
    --text-tertiary: #909399;
    --border-color: #3A3A3C;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --hover-bg: #2A2A2C;
    --card-bg: #1E1E20;
}

/* 应用夜间模式到各个元素 */
[data-theme="dark"] body {
    background-color: var(--bg-primary) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-neutral-100 {
    background-color: var(--card-bg) !important;
}

[data-theme="dark"] .bg-neutral-50 {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .bg-neutral-200,
[data-theme="dark"] .bg-gray-200 {
    background-color: #3A3A3C !important;
}

[data-theme="dark"] .bg-neutral-300,
[data-theme="dark"] .bg-gray-300 {
    background-color: #4B5563 !important;
}

[data-theme="dark"] .text-neutral-700,
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-neutral-800 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-neutral-600,
[data-theme="dark"] .text-gray-700 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-neutral-500,
[data-theme="dark"] .text-gray-600 {
    color: var(--text-tertiary) !important;
}

[data-theme="dark"] .text-neutral-400,
[data-theme="dark"] .text-gray-500 {
    color: var(--text-tertiary) !important;
}

[data-theme="dark"] .text-neutral-300,
[data-theme="dark"] .text-gray-400 {
    color: #6B7280 !important;
}

[data-theme="dark"] .border-neutral-200,
[data-theme="dark"] .border-gray-200 {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .border-neutral-300,
[data-theme="dark"] .border-gray-300 {
    border-color: #4B5563 !important;
}

[data-theme="dark"] .shadow-card,
[data-theme="dark"] .shadow-md,
[data-theme="dark"] .shadow-sm {
    box-shadow: 0 4px 20px var(--shadow-color) !important;
}

[data-theme="dark"] .hover\:bg-neutral-100:hover,
[data-theme="dark"] .hover\:bg-gray-50:hover,
[data-theme="dark"] .hover\:bg-gray-100:hover {
    background-color: var(--hover-bg) !important;
}

[data-theme="dark"] .bg-primary\/10 {
    background-color: rgba(22, 93, 255, 0.15) !important;
}

[data-theme="dark"] .bg-primary\/5 {
    background-color: rgba(22, 93, 255, 0.1) !important;
}

[data-theme="dark"] .bg-blue-100 {
    background-color: rgba(59, 130, 246, 0.2) !important;
}

[data-theme="dark"] .bg-blue-200 {
    background-color: rgba(59, 130, 246, 0.3) !important;
}

[data-theme="dark"] .bg-gray-100 {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .bg-gray-50 {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-tertiary) !important;
}

[data-theme="dark"] .article-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .chart-container,
[data-theme="dark"] .activity-list {
    background-color: var(--card-bg) !important;
}

/* 主题切换按钮样式 */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #165DFF 0%, #0040C9 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 9999;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(22, 93, 255, 0.4);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* 后台管理系统的夜间模式 */
[data-theme="dark"] .sidebar {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .main-content {
    background-color: var(--bg-primary) !important;
}

[data-theme="dark"] .data-table {
    background-color: var(--card-bg) !important;
}

[data-theme="dark"] .data-table th {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .data-table td {
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .btn-primary {
    background-color: #165DFF !important;
}

[data-theme="dark"] .btn-danger {
    background-color: #dc2626 !important;
}

/* 图片在夜间模式下的处理 */
[data-theme="dark"] img {
    opacity: 0.9;
}

[data-theme="dark"] img:hover {
    opacity: 1;
}

/* 分类网站卡片夜间模式 */
[data-theme="dark"] .border-neutral-200 {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .hover\:border-primary:hover {
    border-color: #165DFF !important;
}

[data-theme="dark"] .hover\:bg-primary\/5:hover {
    background-color: rgba(22, 93, 255, 0.1) !important;
}

/* 快审网站夜间模式 */
[data-theme="dark"] .from-blue-100 {
    --tw-gradient-from: rgba(59, 130, 246, 0.2) !important;
}

[data-theme="dark"] .to-blue-200 {
    --tw-gradient-to: rgba(59, 130, 246, 0.3) !important;
}

[data-theme="dark"] .border-white {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* 文字颜色细化 */
[data-theme="dark"] .text-blue-600,
[data-theme="dark"] .text-blue-500 {
    color: #60A5FA !important;
}

[data-theme="dark"] .text-red-600,
[data-theme="dark"] .text-red-500 {
    color: #ff0000 !important;
}

[data-theme="dark"] .text-green-600,
[data-theme="dark"] .text-green-500 {
    color: #34D399 !important;
}

[data-theme="dark"] .text-purple-600,
[data-theme="dark"] .text-purple-500 {
    color: #A78BFA !important;
}

[data-theme="dark"] .text-yellow-600,
[data-theme="dark"] .text-yellow-500 {
    color: #FBBF24 !important;
}

/* 背景颜色细化 */
[data-theme="dark"] .bg-red-500 {
    background-color: #DC2626 !important;
}

[data-theme="dark"] .bg-blue-500 {
    background-color: #2563EB !important;
}

[data-theme="dark"] .bg-gray-300 {
    background-color: #4B5563 !important;
}

/* 链接颜色 */
[data-theme="dark"] a {
    color: #e4e7ed;
}

[data-theme="dark"] a:hover {
    color: #60A5FA;
}

/* 卡片悬停效果 */
[data-theme="dark"] .hover\:shadow-md:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

/* 表单元素 */
[data-theme="dark"] option {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* ===== 论坛页面夜间模式 ===== */
[data-theme="dark"] header {
    background-color: #1e293b !important;
}
[data-theme="dark"] #mobile-menu,
[data-theme="dark"] #user-dropdown {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}
[data-theme="dark"] #login-modal .bg-white,
[data-theme="dark"] #register-modal .bg-white {
    background-color: #1e293b !important;
}
[data-theme="dark"] footer {
    background: linear-gradient(135deg, #0f172a, #1e293b) !important;
}
[data-theme="dark"] .bg-gray-50 {
    background-color: #0f172a !important;
}
[data-theme="dark"] .bg-white {
    background-color: #1e293b !important;
}
[data-theme="dark"] .bg-neutral-50 {
    background-color: #334155 !important;
}
[data-theme="dark"] .bg-neutral-100 {
    background-color: #334155 !important;
}
[data-theme="dark"] .border-neutral-100 {
    border-color: #334155 !important;
}
[data-theme="dark"] .border-neutral-200 {
    border-color: #334155 !important;
}
[data-theme="dark"] .text-neutral-800 {
    color: #e2e8f0 !important;
}
[data-theme="dark"] .text-neutral-700 {
    color: #cbd5e1 !important;
}
[data-theme="dark"] .text-neutral-600 {
    color: #94a3b8 !important;
}
[data-theme="dark"] .text-neutral-500 {
    color: #64748b !important;
}
[data-theme="dark"] .text-neutral-400 {
    color: #64748b !important;
}
[data-theme="dark"] .hover\:bg-neutral-100:hover {
    background-color: #334155 !important;
}
[data-theme="dark"] .shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}
