/* ================================================================
   夜間／深色主題（預設） — body[data-theme="dark"] 全域覆寫
   覆蓋頂欄、內容區、卡片、表格、表單與 UserInfo 組件。
   切到 light 時移除本組規則，回歸 style.css/light-theme.css 淺色。
   ================================================================ */

/* ----- 全站色彩變數 ----- */
body[data-theme="dark"] {
    --bg-color: #0a1c2d;
    --card-bg: #10283d;
    --text-main: #e8f7ff;
    --text-muted: #9db4c8;
    --border-color: #1e3a52;
    --primary-color: #6ea8dc;
    --accent-color: #e94560;
    --success-color: #2ecc9a;
    --warning-color: #f5c33b;
    background-color: var(--bg-color);
    color: var(--text-main);
    position: relative;
    overflow-x: hidden;
}

/* 全站娛樂風背景光暈 */
body[data-theme="dark"]::before,
body[data-theme="dark"]::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}
body[data-theme="dark"]::before {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(139,92,246,0.12) 0%, transparent 70%);
    top: -15%; left: -10%;
    animation: globalGlowA 15s ease-in-out infinite alternate;
}
body[data-theme="dark"]::after {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(13,138,188,0.10) 0%, transparent 70%);
    bottom: -10%; right: -8%;
    animation: globalGlowB 18s ease-in-out infinite alternate;
}
@@keyframes globalGlowA { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(30px,20px) scale(1.1); } }
@@keyframes globalGlowB { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(-25px,-18px) scale(1.08); } }

/* wrapper 確保內容在光暈之上 */
body[data-theme="dark"] .wrapper { position: relative; z-index: 1; }

/* ----- 標題與文字 ----- */
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] h5,
body[data-theme="dark"] h6 {
    color: #e8f7ff;
}

body[data-theme="dark"] .text-primary { color: #6ea8dc !important; }
body[data-theme="dark"] .text-muted { color: #9db4c8 !important; }
body[data-theme="dark"] .text-dark { color: #e8f7ff !important; }
body[data-theme="dark"] .text-secondary { color: #a9c3d6 !important; }
body[data-theme="dark"] .text-success { color: #2ecc9a !important; }
body[data-theme="dark"] .text-warning { color: #f5c33b !important; }
body[data-theme="dark"] .text-danger { color: #ff7b72 !important; }
body[data-theme="dark"] .text-body,
body[data-theme="dark"] .text-body-secondary { color: #c9d9e6 !important; }

/* ----- 頂欄 ----- */
body[data-theme="dark"] .top-navbar {
    background: #0f2940;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .brand-name-en {
    color: #e8f7ff;
}

body[data-theme="dark"] .brand-name-zh {
    color: #d4a836;
}

body[data-theme="dark"] .top-user-name {
    color: #a9c3d6 !important;
}

body[data-theme="dark"] .top-user-rank {
    color: #70e5d0 !important;
}

body[data-theme="dark"] .user-profile img {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .language-switcher .form-select,
body[data-theme="dark"] .language-switcher select {
    background-color: #10283d;
    color: #e8f7ff;
    border-color: #1e3a52;
}

body[data-theme="dark"] .sidebar-toggler {
    color: #e8f7ff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* ----- 登入／註冊等訪客按鈕 ----- */
body[data-theme="dark"] .navbar-right-controls .btn-outline-primary {
    color: #6ea8dc;
    border-color: rgba(110, 168, 220, 0.6);
}

body[data-theme="dark"] .navbar-right-controls .btn-outline-primary:hover {
    color: #fff;
    background-color: #6ea8dc;
    border-color: #6ea8dc;
}

body[data-theme="dark"] .admin-gear-btn {
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #e8f7ff;
}

/* ----- 下拉選單 ----- */
body[data-theme="dark"] .dropdown-menu {
    background-color: #10283d;
    color: #e8f7ff;
    border: 1px solid #1e3a52;
}

body[data-theme="dark"] .dropdown-menu .dropdown-item {
    color: #e8f7ff;
}

body[data-theme="dark"] .dropdown-menu .dropdown-item:hover,
body[data-theme="dark"] .dropdown-menu .dropdown-item:focus {
    background-color: #1a3a55;
    color: #ffffff;
}

body[data-theme="dark"] .dropdown-menu .dropdown-divider {
    border-color: #1e3a52;
}

body[data-theme="dark"] .dropdown-menu .text-dark {
    color: #e8f7ff !important;
}

body[data-theme="dark"] .dropdown-menu .text-secondary {
    color: #a9c3d6 !important;
}

/* ----- 卡片 ----- */
body[data-theme="dark"] .fin-card {
    background: var(--card-bg);
    border-color: rgba(132, 228, 255, 0.15);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

body[data-theme="dark"] .fin-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .card {
    background-color: var(--card-bg);
    color: var(--text-main);
    border-color: rgba(132, 228, 255, 0.15);
}

body[data-theme="dark"] .card-header,
body[data-theme="dark"] .card-footer {
    background-color: rgba(10, 28, 45, 0.55);
    border-color: #1e3a52;
    color: var(--text-main);
}

body[data-theme="dark"] .light-card {
    background: var(--card-bg);
    border-color: #1e3a52;
    color: var(--text-main);
}

/* ----- UserInfo 組件 ----- */
body[data-theme="dark"] .user-info-light-section {
    background: linear-gradient(135deg, #0d2236 0%, #0f2f4a 100%);
}

body[data-theme="dark"] .user-header-card {
    background: #10283d;
    border-color: #1e3a52;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .username-text {
    color: #70e5d0;
}

body[data-theme="dark"] .rank-status {
    color: #a78bfa;
}

body[data-theme="dark"] .wallet-card {
    background: #10283d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .wallet-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .wallet-label {
    color: #9db4c8;
}

body[data-theme="dark"] .wallet-amount {
    color: #e8f7ff;
}

body[data-theme="dark"] .wallet-card.profit .wallet-amount { color: #6ea8dc; }
body[data-theme="dark"] .wallet-card.performance .wallet-amount { color: #f5c33b; }
body[data-theme="dark"] .wallet-card.cash .wallet-amount { color: #2ecc9a; }
body[data-theme="dark"] .wallet-card.rwa .wallet-amount { color: #a78bfa; }

body[data-theme="dark"] .info-row {
    background: #10283d;
    border-color: #1e3a52;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .info-row label {
    color: #9db4c8;
}

body[data-theme="dark"] .info-value {
    color: #70e5d0;
}

body[data-theme="dark"] .stock-section {
    background: #10283d;
    border-color: #1e3a52;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .stock-title {
    color: #70e5d0;
}

body[data-theme="dark"] .stock-list li {
    color: #c9d9e6;
}

body[data-theme="dark"] .stock-list li:before {
    color: #6ea8dc;
}

body[data-theme="dark"] .stock-serial {
    color: #e8f7ff;
}

body[data-theme="dark"] .stock-pledgor {
    color: #9db4c8;
}

/* ----- 表格 ----- */
body[data-theme="dark"] .table-custom th {
    color: var(--text-muted);
    border-color: var(--border-color);
}

body[data-theme="dark"] .table-custom td {
    color: var(--text-main);
    border-color: var(--border-color);
}

body[data-theme="dark"] .table,
body[data-theme="dark"] .table-hover,
body[data-theme="dark"] .table-striped {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

body[data-theme="dark"] .table thead th {
    color: var(--text-muted);
    border-color: var(--border-color);
}

body[data-theme="dark"] .table th,
body[data-theme="dark"] .table td {
    border-color: var(--border-color);
    color: var(--text-main);
}

body[data-theme="dark"] .light-table {
    background: var(--card-bg);
    color: var(--text-main);
}

body[data-theme="dark"] .light-table thead th {
    color: #9db4c8;
    background-color: rgba(10, 28, 45, 0.55);
    border-color: #1e3a52;
}

body[data-theme="dark"] .light-table tbody tr {
    border-color: #1e3a52;
}

body[data-theme="dark"] .light-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .light-table tbody td {
    color: var(--text-main);
    border-color: #1e3a52;
}

/* ----- 表單 ----- */
body[data-theme="dark"] .form-control,
body[data-theme="dark"] .form-select {
    background-color: #10283d;
    color: #e8f7ff;
    border-color: #1e3a52;
}

body[data-theme="dark"] .form-control:focus,
body[data-theme="dark"] .form-select:focus {
    background-color: #10283d;
    color: #e8f7ff;
    border-color: #6ea8dc;
    box-shadow: 0 0 0 0.25rem rgba(110, 168, 220, 0.2);
}

body[data-theme="dark"] .form-control::placeholder {
    color: #6b8194;
}

body[data-theme="dark"] .form-control:disabled,
body[data-theme="dark"] .form-control[readonly] {
    background-color: #0d1f30;
    color: #9db4c8;
}

body[data-theme="dark"] .form-label {
    color: #c9d9e6;
}

body[data-theme="dark"] .light-form-group label {
    color: #9db4c8;
}

body[data-theme="dark"] .light-form-input,
body[data-theme="dark"] .light-form-select,
body[data-theme="dark"] .light-form-textarea {
    background-color: #10283d;
    color: #e8f7ff;
    border-color: #1e3a52;
}

body[data-theme="dark"] .light-form-input:focus,
body[data-theme="dark"] .light-form-select:focus,
body[data-theme="dark"] .light-form-textarea:focus {
    background-color: #10283d;
    color: #e8f7ff;
    border-color: #6ea8dc;
}

/* ----- 列表／導覽 ----- */
body[data-theme="dark"] .list-group {
    background: transparent;
}

body[data-theme="dark"] .list-group-item {
    background-color: #10283d;
    color: #e8f7ff;
    border-color: #1e3a52;
}

body[data-theme="dark"] .nav-pills .nav-link {
    color: #c9d9e6;
}

body[data-theme="dark"] .nav-pills .nav-link.active {
    background-color: #6ea8dc;
    color: #fff;
}

body[data-theme="dark"] .accordion-button {
    background-color: #10283d;
    color: #e8f7ff;
    border-color: #1e3a52;
}

body[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: #17314a;
    color: #e8f7ff;
}

body[data-theme="dark"] .accordion-body {
    background-color: #10283d;
    color: #e8f7ff;
}

/* ----- 彈窗與警報 ----- */
body[data-theme="dark"] .modal-content {
    background-color: #10283d;
    color: #e8f7ff;
    border-color: #1e3a52;
}

body[data-theme="dark"] .modal-header,
body[data-theme="dark"] .modal-footer {
    border-color: #1e3a52;
}

body[data-theme="dark"] .modal-title {
    color: #e8f7ff;
}

body[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body[data-theme="dark"] .alert {
    color: #e8f7ff;
}

body[data-theme="dark"] .alert-info,
body[data-theme="dark"] .alert-primary {
    background-color: #17314a;
    border-color: #2a4a66;
    color: #c9e5ff;
}

body[data-theme="dark"] .alert-success {
    background-color: #0f2f26;
    border-color: #1e4a3a;
    color: #a7f3d0;
}

body[data-theme="dark"] .alert-warning {
    background-color: #2f2a0f;
    border-color: #4a4220;
    color: #ffe9a7;
}

body[data-theme="dark"] .alert-danger {
    background-color: #33201f;
    border-color: #5a302d;
    color: #ffb4ad;
}

/* ----- 分頁 ----- */
body[data-theme="dark"] .pagination .page-link {
    background-color: #10283d;
    color: #6ea8dc;
    border-color: #1e3a52;
}

body[data-theme="dark"] .pagination .page-link:hover {
    background-color: #1a3a55;
    color: #ffffff;
}

body[data-theme="dark"] .pagination .page-item.active .page-link {
    background-color: #6ea8dc;
    border-color: #6ea8dc;
    color: #fff;
}

/* ----- 註冊表單分區卡片 ----- */
body[data-theme="dark"] .reg-form-intro {
    background: var(--card-bg);
}

body[data-theme="dark"] .reg-card {
    background: var(--card-bg);
}

body[data-theme="dark"] .reg-card-header {
    background: #17314a;
    border-bottom-color: #1e3a52;
}

body[data-theme="dark"] .reg-step {
    background: #6ea8dc;
    color: #0a1c2d;
}

body[data-theme="dark"] .reg-balance-list {
    background: #0d1f30;
}

body[data-theme="dark"] .reg-total-row {
    background: #17314a;
}

/* ----- 頁首首頁（訪客）內容區 ----- */
body[data-theme="dark"] .home-section,
body[data-theme="dark"] .intro-video-area,
body[data-theme="dark"] .faq section {
    background: linear-gradient(135deg, #0d2236 0%, #0f2f4a 100%);
    color: var(--text-main);
}

/* ----- DataTables / 其他常用容器 ----- */
body[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background-color: #10283d;
    color: #e8f7ff;
    border-color: #1e3a52;
}

body[data-theme="dark"] .page-header-banner {
    background: linear-gradient(135deg, #0b1b2e, #12314f);
}

body[data-theme="dark"] hr {
    border-color: #1e3a52;
}

body[data-theme="dark"] code {
    color: #ffb86b;
}

/* ================================================================
   全新 Table 風格 — 卡片化、無邊框、漸層表頭、行懸浮發光
   ================================================================ */

/* ─── 表格容器 ─── */
body[data-theme="dark"] .dataTables_wrapper,
body[data-theme="dark"] .table-responsive {
    background: transparent !important;
}

/* ─── 表格本身 ─── */
body[data-theme="dark"] table.dataTable,
body[data-theme="dark"] table.dataTable tbody tr,
body[data-theme="dark"] .table,
body[data-theme="dark"] .table-custom,
body[data-theme="dark"] .light-table {
    background: transparent !important;
    border-collapse: separate !important;
    border-spacing: 0 6px !important;
}

/* ─── 表頭 ─── */
body[data-theme="dark"] table.dataTable thead th,
body[data-theme="dark"] .table thead th,
body[data-theme="dark"] .table-custom thead th,
body[data-theme="dark"] .light-table thead th {
    background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(13,138,188,0.15)) !important;
    color: #c4b5fd !important;
    border: none !important;
    padding: 14px 16px !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border-radius: 12px 12px 0 0 !important;
    white-space: nowrap !important;
    position: relative;
}
body[data-theme="dark"] table.dataTable thead th::after {
    content: '';
    position: absolute;
    bottom: 0; left: 20%; right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(139,92,246,0.4), transparent);
}

/* ─── 資料列 ─── */
body[data-theme="dark"] table.dataTable tbody td,
body[data-theme="dark"] .table tbody td,
body[data-theme="dark"] .table-custom tbody td,
body[data-theme="dark"] .light-table tbody td {
    background: rgba(15,20,40,0.5) !important;
    color: #e2e8f0 !important;
    border: none !important;
    padding: 14px 16px !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
    vertical-align: middle !important;
}
body[data-theme="dark"] table.dataTable tbody tr:first-child td:first-child { border-radius: 0 !important; }
body[data-theme="dark"] table.dataTable tbody tr:first-child td:last-child { border-radius: 0 !important; }

/* ─── 每列左右圓角 ─── */
body[data-theme="dark"] table.dataTable tbody tr td:first-child { border-radius: 10px 0 0 10px !important; }
body[data-theme="dark"] table.dataTable tbody tr td:last-child { border-radius: 0 10px 10px 0 !important; }

/* ─── 奇偶行色差 ─── */
body[data-theme="dark"] table.dataTable tbody tr:nth-child(even) td {
    background: rgba(15,25,50,0.4) !important;
}

/* ─── 懸浮行效果 ─── */
body[data-theme="dark"] table.dataTable tbody tr:hover td,
body[data-theme="dark"] .table tbody tr:hover td,
body[data-theme="dark"] .table-custom tbody tr:hover td {
    background: rgba(139,92,246,0.12) !important;
    box-shadow: inset 3px 0 0 #8B5CF6 !important;
}

/* ─── 選中列 ─── */
body[data-theme="dark"] table.dataTable tbody tr.selected td {
    background: rgba(139,92,246,0.2) !important;
    box-shadow: inset 3px 0 0 #8B5CF6 !important;
}

/* ─── Bootstrap table 懸浮 ─── */
body[data-theme="dark"] .table-hover tbody tr:hover td {
    background: rgba(139,92,246,0.12) !important;
}

/* ─── 斑馬紋（蓋掉預設）─── */
body[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > td {
    background: rgba(15,20,40,0.5) !important;
}
body[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(even) > td {
    background: rgba(15,25,50,0.35) !important;
}

/* ─── 無邊框 ─── */
body[data-theme="dark"] table.dataTable,
body[data-theme="dark"] .table,
body[data-theme="dark"] .table-custom {
    border: none !important;
}

/* ================================================================
   DataTables 分頁 — 藥丸式按鈕 + 漸層
   ================================================================ */

body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate {
    padding-top: 20px !important;
    text-align: center !important;
}
body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 14px !important;
    margin: 0 3px !important;
    border: 1px solid rgba(139,92,246,0.25) !important;
    border-radius: 20px !important;
    background: rgba(15,20,40,0.6) !important;
    color: #c4b5fd !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    line-height: 1 !important;
}
body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(13,138,188,0.2)) !important;
    border-color: rgba(139,92,246,0.5) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(139,92,246,0.2) !important;
    transform: translateY(-2px) !important;
}
body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #8B5CF6, #0D8ABC) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 4px 20px rgba(139,92,246,0.35) !important;
    font-weight: 800 !important;
}
body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    border-color: transparent !important;
    background: transparent !important;
}
body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, #8B5CF6, #0D8ABC) !important;
    transform: none !important;
}
body[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .ellipsis {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 40px !important;
    height: 40px !important;
    color: rgba(196,181,253,0.4) !important;
    font-weight: 600 !important;
}

/* ─── DataTables 搜尋/資訊列 ─── */
body[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background: rgba(15,20,40,0.6) !important;
    border: 1px solid rgba(139,92,246,0.25) !important;
    border-radius: 12px !important;
    color: #e2e8f0 !important;
    padding: 8px 16px !important;
    transition: all 0.3s ease !important;
}
body[data-theme="dark"] .dataTables_wrapper .dataTables_filter input:focus {
    border-color: #8B5CF6 !important;
    box-shadow: 0 0 0 3px rgba(139,92,246,0.15) !important;
    outline: none !important;
}
body[data-theme="dark"] .dataTables_wrapper .dataTables_filter label,
body[data-theme="dark"] .dataTables_wrapper .dataTables_length label {
    color: #9db4c8 !important;
    font-weight: 600 !important;
}
body[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background: rgba(15,20,40,0.6) !important;
    border: 1px solid rgba(139,92,246,0.25) !important;
    border-radius: 10px !important;
    color: #e2e8f0 !important;
    padding: 6px 12px !important;
}
body[data-theme="dark"] .dataTables_wrapper .dataTables_info {
    color: #9db4c8 !important;
    font-size: 0.85rem !important;
    padding-top: 16px !important;
}

/* ─── DataTables 排序圖示 ─── */
body[data-theme="dark"] table.dataTable thead .sorting:after,
body[data-theme="dark"] table.dataTable thead .sorting_asc:after,
body[data-theme="dark"] table.dataTable thead .sorting_desc:after {
    opacity: 0.5 !important;
}
body[data-theme="dark"] table.dataTable thead .sorting_asc:after,
body[data-theme="dark"] table.dataTable thead .sorting_desc:after {
    opacity: 1 !important;
    color: #8B5CF6 !important;
}

/* ─── 表格無資料提示 ─── */
body[data-theme="dark"] .dataTables_empty {
    color: #9db4c8 !important;
    font-style: italic !important;
    padding: 40px 20px !important;
}

/* ─── Checkbox / action 欄 ─── */
body[data-theme="dark"] .form-check-input {
    background-color: rgba(15,20,40,0.6) !important;
    border-color: rgba(139,92,246,0.35) !important;
}
body[data-theme="dark"] .form-check-input:checked {
    background-color: #8B5CF6 !important;
    border-color: #8B5CF6 !important;
}

/* ─── 連結按鈕（表格內）─── */
body[data-theme="dark"] table a,
body[data-theme="dark"] .table-custom a {
    color: #8B5CF6 !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}
body[data-theme="dark"] table a:hover,
body[data-theme="dark"] .table-custom a:hover {
    color: #a78bfa !important;
    text-decoration: underline !important;
}
body[data-theme="dark"] table .btn,
body[data-theme="dark"] .table-custom .btn {
    border-radius: 10px !important;
}

/* ─── 狀態 Badge ─── */
body[data-theme="dark"] .badge {
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    border-radius: 8px !important;
    padding: 5px 12px !important;
}

/* ================================================================
   全站 — 深色模式覆寫：修正各頁面 inline style / embedded style
   造成「字或背景顏色不對，肉眼看不見」的問題。
   ================================================================ */

/* ─── Home/Index.cshtml 內嵌淺色樣式覆寫 ─── */
body[data-theme="dark"] .home-section {
    background: linear-gradient(135deg, #0d2236 0%, #0f2f4a 100%) !important;
}
body[data-theme="dark"] .home-section h1 { color: #e8f7ff !important; }
body[data-theme="dark"] .home-section h2 { color: #e8f7ff !important; border-left-color: #6ea8dc !important; }
body[data-theme="dark"] .home-list li { color: #c9d9e6 !important; }
body[data-theme="dark"] .home-list li:before { color: #6ea8dc !important; }
body[data-theme="dark"] .home-table { background: #10283d !important; border-color: #1e3a52 !important; box-shadow: none !important; }
body[data-theme="dark"] .home-table th { background: #17314a !important; color: #e8f7ff !important; border-bottom-color: #1e3a52 !important; }
body[data-theme="dark"] .home-table td { color: #c9d9e6 !important; border-top-color: #1e3a52 !important; }
body[data-theme="dark"] .home-table tbody tr:hover { background: rgba(255,255,255,0.05) !important; }
body[data-theme="dark"] .home-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.03) !important; }
body[data-theme="dark"] .highlight { color: #6ea8dc !important; }
body[data-theme="dark"] .bulletin-section { background: #10283d !important; border-color: #1e3a52 !important; box-shadow: none !important; }
body[data-theme="dark"] .bulletin-header { background: linear-gradient(135deg, #17314a 0%, #1a3550 100%) !important; border-color: #1e3a52 !important; }
body[data-theme="dark"] .bulletin-header:hover { background: linear-gradient(135deg, #1a3550 0%, #1e3a55 100%) !important; }
body[data-theme="dark"] .bulletin-title { color: #e8f7ff !important; }
body[data-theme="dark"] .bulletin-date { color: #9db4c8 !important; }
body[data-theme="dark"] .bulletin-content { background: #0d1f30 !important; border-color: #1e3a52 !important; }
body[data-theme="dark"] .bulletin-text { color: #c9d9e6 !important; }
body[data-theme="dark"] .stock-info-section { color: #e8f7ff !important; }

/* ─── inline style: color: #00ffcc 亮青色標題 → 深色主題用可讀的 teal ─── */
body[data-theme="dark"] [style*="color: #00ffcc"] { color: #5eead4 !important; }
body[data-theme="dark"] [style*="color:#00ffcc"] { color: #5eead4 !important; }
body[data-theme="dark"] [style*="color: #888"] { color: #9db4c8 !important; }
body[data-theme="dark"] [style*="color:#888"] { color: #9db4c8 !important; }

/* ─── Cart/Summary.cshtml：內嵌淺色 fin-card 覆寫 ─── */
body[data-theme="dark"] .cart-summary .fin-card { background: #10283d !important; border-color: #1e3a52 !important; }
body[data-theme="dark"] .cart-summary .section-title { color: #e8f7ff !important; border-bottom-color: #1e3a52 !important; }
body[data-theme="dark"] .cart-summary .product-card { background: #0d1f30 !important; border-color: #1e3a52 !important; }
body[data-theme="dark"] .cart-summary .product-card h5 { color: #e8f7ff !important; }
body[data-theme="dark"] .cart-summary .product-card p { color: #9db4c8 !important; }
body[data-theme="dark"] .cart-summary .payment-container,
body[data-theme="dark"] .cart-summary .contract-section,
body[data-theme="dark"] .cart-summary .customer-info-section,
body[data-theme="dark"] .cart-summary .summary-section { background: #0d1f30 !important; border-color: #1e3a52 !important; }
body[data-theme="dark"] .cart-summary .form-control-custom { background-color: #10283d !important; color: #e8f7ff !important; border-color: #1e3a52 !important; }
body[data-theme="dark"] .cart-summary .form-control-custom:focus { border-color: #6ea8dc !important; box-shadow: 0 0 0 0.2rem rgba(110,168,220,0.2) !important; }
body[data-theme="dark"] .cart-summary .form-control-custom[readonly] { background-color: #0d1f30 !important; color: #9db4c8 !important; }
body[data-theme="dark"] .cart-summary .form-label { color: #c9d9e6 !important; }
body[data-theme="dark"] .cart-summary .amount-display { background: #0d1f30 !important; border-color: #1e3a52 !important; }
body[data-theme="dark"] .cart-summary .amount-label { color: #9db4c8 !important; }
body[data-theme="dark"] .cart-summary .btn-outline-light { border-color: #6ea8dc !important; color: #6ea8dc !important; }
body[data-theme="dark"] .cart-summary .btn-outline-light:hover { background: #6ea8dc !important; color: #fff !important; }
body[data-theme="dark"] .cart-summary .text-info { color: #6ea8dc !important; }
body[data-theme="dark"] .cart-summary .text-muted { color: #9db4c8 !important; }
body[data-theme="dark"] .cart-summary .text-success { color: #2ecc9a !important; }
body[data-theme="dark"] .cart-summary .list-group-item { background-color: #10283d !important; border-color: #1e3a52 !important; color: #e8f7ff !important; }
body[data-theme="dark"] .cart-summary .card-footer { background-color: #10283d !important; border-color: #1e3a52 !important; }

/* ─── AccountBinding/Index.cshtml：全 hardcoded dark palette → 深色統一 ─── */
body[data-theme="dark"] .container.mt-4 [style*="background-color: #1a3c2a"] { background-color: #10283d !important; }
body[data-theme="dark"] .container.mt-4 [style*="background-color: #1a2a3c"] { background-color: #10283d !important; }
body[data-theme="dark"] [style*="border: 1px solid #2d6b4a"] { border-color: #1e3a52 !important; }
body[data-theme="dark"] [style*="border: 1px solid #2d4a6b"] { border-color: #1e3a52 !important; }
body[data-theme="dark"] [style*="color: #4dccbd"] { color: #5eead4 !important; }
body[data-theme="dark"] [style*="color: #42a5f5"] { color: #6ea8dc !important; }
body[data-theme="dark"] [style*="color: #999 !important"] { color: #9db4c8 !important; }
body[data-theme="dark"] [style*="color: #e0e0e0"] { color: #e8f7ff !important; }
body[data-theme="dark"] .table-dark { --bs-table-bg: transparent; --bs-table-striped-bg: rgba(255,255,255,0.03); --bs-table-hover-bg: rgba(255,255,255,0.06); }
body[data-theme="dark"] .table-dark th { background-color: rgba(255,255,255,0.1) !important; color: #e8f7ff !important; }
body[data-theme="dark"] .table-dark td { color: #e8f7ff !important; }
body[data-theme="dark"] [style*="background-color: rgba(255,255,255,0.05)"] { background-color: rgba(255,255,255,0.05) !important; }

/* ─── PreviewConsolidation.cshtml：table 文字 ─── */
body[data-theme="dark"] [style*="border-color: rgba(255,255,255,0.1)"] { border-color: rgba(255,255,255,0.1) !important; }
body[data-theme="dark"] [style*="border-color: rgba(255,255,255,0.05)"] { border-color: rgba(255,255,255,0.05) !important; }
body[data-theme="dark"] [style*="color: #666"] { color: #9db4c8 !important; }

/* ─── TranCoin/M11ToM13.cshtml：自身 dark CSS 與 site theme 整合 ─── */
body[data-theme="dark"] [style*="color: #212529"] { color: #e8f7ff !important; }
body[data-theme="dark"] .bonus-table th { color: #c9d9e6 !important; }
body[data-theme="dark"] .bonus-table td { color: #e8f7ff !important; }

/* ─── TranM13/StockPledge.cshtml：#1e1e1e wrapper → site dark ─── */
body[data-theme="dark"] [style*="background-color: #1e1e1e"] { background-color: #10283d !important; }
body[data-theme="dark"] [style*="color: #e9ecef"] { color: #e8f7ff !important; }
body[data-theme="dark"] [style*="background-color: #2d3748"] { background-color: #17314a !important; }
body[data-theme="dark"] [style*="border-color: #4a5568"] { border-color: #1e3a52 !important; }
body[data-theme="dark"] [style*="color: #e2e8f0"] { color: #e8f7ff !important; }
body[data-theme="dark"] [style*="color: #a0aec0"] { color: #9db4c8 !important; }
body[data-theme="dark"] [style*="background-color: #6c757d"] { background-color: #4a5568 !important; border-color: #4a5568 !important; }

/* ─── TranM/Upsert, M12/Upsert, M14/Upsert 及 TranCoin/M11,M12,M14
       #0F3460 labels → 可讀色, #f0f2f5 inputs → dark bg, #dce1e8 borders → dark ─── */
body[data-theme="dark"] .fin-card .form-label { color: #c9d9e6 !important; }
body[data-theme="dark"] .fin-card .form-control { border-color: #1e3a52 !important; }
body[data-theme="dark"] .fin-card .form-control[readonly] { background-color: #0d1f30 !important; color: #9db4c8 !important; }

/* ─── PlaceList/Tree.cshtml：warm palette → dark mode ─── */
body[data-theme="dark"] #tree-container { background: transparent !important; }
body[data-theme="dark"] .back-bar { background: rgba(16,40,61,0.82) !important; border-color: #1e3a52 !important; }
body[data-theme="dark"] .back-bar .btn-back { background: #0d1f30 !important; border-color: #1e3a52 !important; color: #9db4c8 !important; }
body[data-theme="dark"] .back-bar .current-label { color: #9db4c8 !important; }
body[data-theme="dark"] .back-bar .current-label strong { color: #6ea8dc !important; }
body[data-theme="dark"] .back-bar form input.form-control { background: #0d1f30 !important; color: #e8f7ff !important; border-color: #1e3a52 !important; }

/* ─── StockList/Index.cshtml：hardcoded light alert/table → dark ─── */
body[data-theme="dark"] #tblData_wrapper .table { background-color: transparent !important; color: #e8f7ff !important; }
body[data-theme="dark"] #tblData_wrapper .table td { color: #e8f7ff !important; background-color: transparent !important; border-color: #1e3a52 !important; }
body[data-theme="dark"] #tblData_wrapper .table th { background-color: #17314a !important; color: #e8f7ff !important; border-color: #1e3a52 !important; }
body[data-theme="dark"] #tblData_wrapper .table-striped tbody tr:nth-of-type(odd) td { background-color: rgba(255,255,255,0.03) !important; }

/* ─── AddUSTD/Index：TRC2.0 code + buttons dark mode ─── */
body[data-theme="dark"] .content-wrapper { background-color: transparent !important; }
body[data-theme="dark"] .content-wrapper .card { background-color: #1a2332 !important; border-color: #2a3a4a !important; }
body[data-theme="dark"] .wallet-address { color: #e8f7ff !important; }
body[data-theme="dark"] span[id^="walletAddress"] { background-color: #0d1b2a !important; color: #5eead4 !important; border-color: #2a3a4a !important; }
body[data-theme="dark"] .btn-copy-bsc { background-color: #1a2332 !important; color: #e8f7ff !important; border-color: #3a4a5a !important; }
body[data-theme="dark"] .btn-copy-bsc:hover { background-color: #2a3a4a !important; }
body[data-theme="dark"] h4.card-title { color: #e8f7ff !important; }
body[data-theme="dark"] .wallet-section div[style*="color: #0d6efd"] { color: #818cf8 !important; }
