/* ==========================================================
   UU直播 全站深色模式
   开关：html[data-uu-theme="dark"]（由 /assets/js/uu-theme.js 控制）
   ========================================================== */
html[data-uu-theme="dark"] {
    color-scheme: dark;
    --uu-bg: #0f1419;
    --uu-surface: #171c24;
    --uu-surface-2: #1e2530;
    --uu-surface-3: #232b37;
    --uu-border: #262e3a;
    --uu-text: #e3e7ec;
    --uu-text-2: #a9b2c0;
    --uu-text-3: #74808f;
    --uu-accent: #ef4444;
}

html[data-uu-theme="dark"],
html[data-uu-theme="dark"] body {
    background: var(--uu-bg) !important;
    color: var(--uu-text) !important;
}

html[data-uu-theme="dark"] h1,
html[data-uu-theme="dark"] h2,
html[data-uu-theme="dark"] h3,
html[data-uu-theme="dark"] h4,
html[data-uu-theme="dark"] h5,
html[data-uu-theme="dark"] h6,
html[data-uu-theme="dark"] strong,
html[data-uu-theme="dark"] b {
    color: var(--uu-text) !important;
}

html[data-uu-theme="dark"] a { color: #7fb2ff; }
html[data-uu-theme="dark"] a:hover { color: #a8c8ff; }
html[data-uu-theme="dark"] hr { border-color: var(--uu-border); }

/* ---------- 顶栏 / 底栏 ---------- */
html[data-uu-theme="dark"] .top-header,
html[data-uu-theme="dark"] header.top-header,
html[data-uu-theme="dark"] .navbar,
html[data-uu-theme="dark"] .header {
    background: #121821 !important;
    border-bottom-color: var(--uu-border) !important;
}

html[data-uu-theme="dark"] .footer {
    background: #121821 !important;
    border-top-color: var(--uu-border) !important;
    color: var(--uu-text-3) !important;
}

html[data-uu-theme="dark"] .footer a { color: var(--uu-text-2); }

/* ---------- 卡片 / 面板 ---------- */
html[data-uu-theme="dark"] .card,
html[data-uu-theme="dark"] .panel,
html[data-uu-theme="dark"] .box,
html[data-uu-theme="dark"] .section,
html[data-uu-theme="dark"] .widget,
html[data-uu-theme="dark"] .sidebar-block,
html[data-uu-theme="dark"] .live-card,
html[data-uu-theme="dark"] .news-card,
html[data-uu-theme="dark"] .match-card,
html[data-uu-theme="dark"] .user-card,
html[data-uu-theme="dark"] .profile-card,
html[data-uu-theme="dark"] .list-item,
html[data-uu-theme="dark"] .row-item,
html[data-uu-theme="dark"] .chat-container,
html[data-uu-theme="dark"] .chat-panel,
html[data-uu-theme="dark"] .chat-main,
html[data-uu-theme="dark"] .chat-sidebar,
html[data-uu-theme="dark"] .msg-list,
html[data-uu-theme="dark"] .message-list {
    background: var(--uu-surface) !important;
    border-color: var(--uu-border) !important;
    color: var(--uu-text) !important;
}

/* ---------- 内联背景兜底 ---------- */
html[data-uu-theme="dark"] [style*="background:#fff"],
html[data-uu-theme="dark"] [style*="background: #fff"],
html[data-uu-theme="dark"] [style*="background:#ffffff"],
html[data-uu-theme="dark"] [style*="background: #ffffff"],
html[data-uu-theme="dark"] [style*="background-color:#fff"],
html[data-uu-theme="dark"] [style*="background-color: #fff"],
html[data-uu-theme="dark"] [style*="background:white"],
html[data-uu-theme="dark"] [style*="background: white"],
html[data-uu-theme="dark"] [style*="background-color:white"],
html[data-uu-theme="dark"] [style*="background-color: white"] {
    background: var(--uu-surface) !important;
}

html[data-uu-theme="dark"] [style*="background:#f8"],
html[data-uu-theme="dark"] [style*="background: #f8"],
html[data-uu-theme="dark"] [style*="background:#f5"],
html[data-uu-theme="dark"] [style*="background: #f5"],
html[data-uu-theme="dark"] [style*="background:#faf"],
html[data-uu-theme="dark"] [style*="background: #faf"],
html[data-uu-theme="dark"] [style*="background:#f0"],
html[data-uu-theme="dark"] [style*="background: #f0"],
html[data-uu-theme="dark"] [style*="background:#eee"],
html[data-uu-theme="dark"] [style*="background: #eee"],
html[data-uu-theme="dark"] [style*="background:#eef"],
html[data-uu-theme="dark"] [style*="background: #eef"] {
    background: var(--uu-surface-2) !important;
}

html[data-uu-theme="dark"] [style*="color:#333"],
html[data-uu-theme="dark"] [style*="color: #333"],
html[data-uu-theme="dark"] [style*="color:#222"],
html[data-uu-theme="dark"] [style*="color: #222"],
html[data-uu-theme="dark"] [style*="color:#000"],
html[data-uu-theme="dark"] [style*="color: #000"],
html[data-uu-theme="dark"] [style*="color:#2c3e50"],
html[data-uu-theme="dark"] [style*="color: #2c3e50"],
html[data-uu-theme="dark"] [style*="color:#1a1a2e"],
html[data-uu-theme="dark"] [style*="color: #1a1a2e"],
html[data-uu-theme="dark"] [style*="color:#111"],
html[data-uu-theme="dark"] [style*="color: #111"] {
    color: var(--uu-text) !important;
}

html[data-uu-theme="dark"] [style*="border:1px solid #eee"],
html[data-uu-theme="dark"] [style*="border:1px solid #e8"],
html[data-uu-theme="dark"] [style*="border: 1px solid #eee"],
html[data-uu-theme="dark"] [style*="border:1px solid #f0"],
html[data-uu-theme="dark"] [style*="border-bottom:1px solid #eee"],
html[data-uu-theme="dark"] [style*="border-bottom:1px solid #f0"] {
    border-color: var(--uu-border) !important;
}

/* ---------- 表单控件 ---------- */
html[data-uu-theme="dark"] input,
html[data-uu-theme="dark"] textarea,
html[data-uu-theme="dark"] select {
    background: var(--uu-surface-2) !important;
    border-color: var(--uu-border) !important;
    color: var(--uu-text) !important;
}

html[data-uu-theme="dark"] input::placeholder,
html[data-uu-theme="dark"] textarea::placeholder { color: #6b7686 !important; }

html[data-uu-theme="dark"] input:focus,
html[data-uu-theme="dark"] textarea:focus,
html[data-uu-theme="dark"] select:focus { border-color: var(--uu-accent) !important; }

html[data-uu-theme="dark"] button,
html[data-uu-theme="dark"] .btn {
    background: var(--uu-surface-2);
    border-color: var(--uu-border);
    color: var(--uu-text);
}

html[data-uu-theme="dark"] .btn-primary,
html[data-uu-theme="dark"] .btn.btn-primary,
html[data-uu-theme="dark"] button[type="submit"] {
    background: var(--uu-accent) !important;
    border-color: var(--uu-accent) !important;
    color: #fff !important;
}

/* ---------- 表格 ---------- */
html[data-uu-theme="dark"] table { background: transparent; }
html[data-uu-theme="dark"] th,
html[data-uu-theme="dark"] thead th {
    background: var(--uu-surface-2) !important;
    color: var(--uu-text-2) !important;
    border-color: var(--uu-border) !important;
}
html[data-uu-theme="dark"] td { border-color: var(--uu-border) !important; color: var(--uu-text-2); }
html[data-uu-theme="dark"] tbody tr:hover,
html[data-uu-theme="dark"] tbody tr:hover td { background: var(--uu-surface-2) !important; }

/* ---------- 标签页 ---------- */
html[data-uu-theme="dark"] .tabs { border-color: var(--uu-border); }
html[data-uu-theme="dark"] .tabs .tab { color: var(--uu-text-3); }
html[data-uu-theme="dark"] .tabs .tab.active { color: var(--uu-accent) !important; }

/* ---------- 聊天室 ---------- */
html[data-uu-theme="dark"] .msg,
html[data-uu-theme="dark"] .message,
html[data-uu-theme="dark"] .msg-item { border-color: var(--uu-border) !important; }
html[data-uu-theme="dark"] .msg-content,
html[data-uu-theme="dark"] .bubble,
html[data-uu-theme="dark"] .msg-bubble {
    background: var(--uu-surface-2) !important;
    color: var(--uu-text) !important;
}
html[data-uu-theme="dark"] .msg-name { color: #8fc7ff !important; }
html[data-uu-theme="dark"] .msg-time { color: var(--uu-text-3) !important; }

/* ---------- 弹层 ---------- */
html[data-uu-theme="dark"] .modal,
html[data-uu-theme="dark"] .modal-box,
html[data-uu-theme="dark"] .dialog,
html[data-uu-theme="dark"] .popup,
html[data-uu-theme="dark"] .dropdown-menu {
    background: var(--uu-surface) !important;
    border-color: var(--uu-border) !important;
    color: var(--uu-text) !important;
}

html[data-uu-theme="dark"] .modal-mask,
html[data-uu-theme="dark"] .overlay { background: rgba(0, 0, 0, .6) !important; }

/* ---------- 滚动条 ---------- */
html[data-uu-theme="dark"] ::-webkit-scrollbar { width: 8px; height: 8px; }
html[data-uu-theme="dark"] ::-webkit-scrollbar-thumb { background: #333c4a; border-radius: 4px; }
html[data-uu-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }

/* ---------- 切换按钮 ---------- */
#uuThemeBtn {
    position: fixed;
    right: 18px;
    bottom: 84px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
    color: #2c3e50;
    box-shadow: 0 4px 14px rgba(15, 20, 25, .16);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    padding: 0;
    transition: transform .15s ease, background .15s ease;
}

#uuThemeBtn:hover { transform: scale(1.06); }
#uuThemeBtn svg { width: 20px; height: 20px; display: block; }

html[data-uu-theme="dark"] #uuThemeBtn {
    background: #1e2530;
    border-color: #2f3948;
    color: #f6c34a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .5);
}

html[data-uu-theme="dark"] img.lazy,
html[data-uu-theme="dark"] .dark-dim img { filter: brightness(.92); }
