/* =====================================================================
   極簡表格風 (Minimal) — 載入於 style.css 之後。
   還原舊風格：從 index.html 移除 <link rel="stylesheet" href="/minimal.css"> 即可。
   夜間 = 亮色重點的深色 (dark-bright)；日間 = 白底。
   ===================================================================== */

:root {
    --font-ui: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    --bg-dark: #14161a;
    --nav-bg: #14161a;
    --panel-bg: transparent;
    --card-sub-bg: rgba(255, 255, 255, 0.03);
    --card-hover-bg: rgba(255, 255, 255, 0.05);
    --input-bg: #14161a;
    --readonly-bg: #1b1f25;
    --border-subtle: #232830;
    --border-mid: #343944;
    --gold-primary: #5fb0ff;
    --gold-light: #ffffff;
    --gold-dark: #343944;
    --accent-cyan: #5fb0ff;
    --k1-blue: #5fb0ff;
    --k2-red: #ff6b6b;
    --text-main: #ffffff;
    --text-muted: #b8bcc6;
    --text-soft: #d6d9e0;
    --tab-header-bg: transparent;
    --tab-row-odd: transparent;
    --tab-row-even: transparent;
    --drawer-bg: #1b1f25;
    --onaccent: #0b1220;
    --warn: #ffc247;
    --red: #ff6b6b;
}
body.light-mode {
    --bg-dark: #ffffff;
    --nav-bg: #ffffff;
    --panel-bg: transparent;
    --card-sub-bg: #f4f5f7;
    --card-hover-bg: #f4f5f7;
    --input-bg: #ffffff;
    --readonly-bg: #f4f5f7;
    --border-subtle: #eceef2;
    --border-mid: #dfe2e8;
    --gold-primary: #2563eb;
    --gold-light: #14161a;
    --gold-dark: #dfe2e8;
    --accent-cyan: #2563eb;
    --k1-blue: #2563eb;
    --k2-red: #d32f2f;
    --text-main: #14161a;
    --text-muted: #5d6470;
    --text-soft: #3c424d;
    --tab-header-bg: transparent;
    --tab-row-odd: transparent;
    --tab-row-even: transparent;
    --drawer-bg: #f4f5f7;
    --onaccent: #ffffff;
    --warn: #b45309;
    --red: #d32f2f;
    background-image: none !important;
}

/* ---------- 基礎：平面、無光暈、無漸層、系統字體 ---------- */
body { font-family: var(--font-ui); background-image: none !important; background-color: var(--bg-dark); }
*, *::before, *::after { box-shadow: none !important; text-shadow: none !important; }
h1, h2, h3, h4, .brand-text h2, .mp-hero-section h1, .header-banner h1, .panel-title, .btn-battle,
.vs-badge, .k1-panel h2, .k2-panel h2, [style*="Cinzel"], [style*="Rajdhani"] { font-family: var(--font-ui) !important; letter-spacing: 0 !important; }
.view-section { font-variant-numeric: tabular-nums; }
.tabulator, .mp-board-row, .mp-kpi-card, .data-table, .pcard, .hx-card, .drawer-card, .profile-stat-box { font-variant-numeric: tabular-nums; }

/* ---------- 導覽列：純文字，目前頁面以底線標示 ---------- */
.top-navbar { backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px solid var(--border-mid); height: auto; min-height: 56px; }
.brand-icon-wrap { display: none; }
.brand-text h2 { font-size: 15px; font-weight: 700; letter-spacing: 0; }
.brand-text span { display: none; }
.top-nav-links li a { border-radius: 0; border: 0; border-bottom: 2px solid transparent; padding: 18px 4px; margin: 0 8px; font-weight: 500; font-size: 14px; background: none; }
.top-nav-links li a:hover { color: var(--text-main); background: none; }
.top-nav-links li a.active { color: var(--text-main); background: none; border-bottom-color: var(--gold-primary); font-weight: 700; }
.top-nav-links li a i { display: none; }
.btn-nav-tool, .nav-auth-pill { background: none; border: 0; color: var(--text-muted); border-radius: 4px; font-weight: 500; }
.btn-nav-tool:hover { color: var(--text-main); background: var(--card-sub-bg); }

/* ---------- 區塊：不用卡片，只用細線 ---------- */
.panel-card { background: transparent; border: 0; border-top: 1px solid var(--border-mid); border-radius: 0; padding: 24px 0; margin-bottom: 8px; }
.panel-title { font-size: 16px; font-weight: 600; color: var(--text-main); border-bottom: 0; padding-bottom: 8px; }
.panel-title i { display: none; }
.header-banner { background: none; border: 0; padding: 8px 0 16px; }
.header-banner h1 { font-size: 24px; font-weight: 600; color: var(--text-main); }
.header-banner h1 i { display: none; }
.header-banner p { color: var(--text-muted); }
.hint-badge, .toolbar-label { color: var(--text-muted); font-weight: 500; }

/* ---------- 首頁 Hero / 搜尋 ---------- */
.mp-hero-section { background: none; border: 0; border-radius: 0; text-align: left; padding: 24px 0 8px; margin-bottom: 8px; }
.mp-hero-section h1 { font-size: 28px; font-weight: 600; color: var(--text-main); }
.mp-hero-section p { color: var(--text-muted); font-size: 14px; text-align: left; margin-left: 0; margin-right: 0; max-width: none; }
.mp-pulse-badge { display: none; }
.mp-search-omnibox { margin: 16px 0 0; width: 100%; max-width: none; min-height: 56px; border: 1px solid var(--border-mid); border-radius: 4px; background: transparent; padding: 6px 6px 6px 14px; }
.mp-search-omnibox:focus-within { border-color: var(--gold-primary); }
.mp-search-omnibox input { color: var(--text-main); min-width: 0; flex: 1; font-size: 18px; }
.mp-search-omnibox { padding-left: 10px; }
.mp-search-omnibox .btn-battle { padding: 12px 28px; flex: none; font-size: 15px; }
@media (max-width: 1080px) { .mp-search-omnibox { min-height: 48px; } .mp-search-omnibox input { font-size: 16px; } .mp-search-omnibox .btn-battle { padding: 10px 14px; font-size: 14px; } }
.mp-search-omnibox i.search-icon { color: var(--text-muted); }

/* ---------- KPI：以細線分欄 ---------- */
.mp-kpi-strip { gap: 0; border-top: 1px solid var(--border-mid); border-bottom: 1px solid var(--border-mid); margin-bottom: 28px; }
.mp-kpi-card, .mp-kpi-card.cyan-top { background: transparent; border: 0; border-left: 1px solid var(--border-mid); border-radius: 0; padding: 16px 24px; }
.mp-kpi-card:first-child { border-left: 0; padding-left: 0; }
.mp-kpi-label { color: var(--text-muted); }
.mp-kpi-value { color: var(--text-main); }

/* ---------- 分頁籤 (榜單分類) ---------- */
.board-pills-bar { gap: 20px; border-bottom: 1px solid var(--border-mid); padding-bottom: 0; margin-bottom: 8px; }
.board-pill { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 0; margin-bottom: -1px; font-weight: 500; color: var(--text-muted); }
.board-pill:hover { color: var(--text-main); background: none; }
.board-pill.active { color: var(--text-main); font-weight: 700; background: none; border-color: var(--gold-primary); }

/* ---------- 資料時間徽章 ---------- */
.asof-chip { background: none; border: 0; border-radius: 0; padding: 0; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.asof-chip i { display: none; }
.asof-row { justify-content: flex-start; margin: 0 0 8px; }

/* ---------- 首頁榜單列 ---------- */
.mp-leaderboard-head, .mp-alliance-head { padding-left: 0; padding-right: 0; color: var(--text-muted); border-bottom: 1px solid var(--border-mid); letter-spacing: 0; text-transform: none; font-weight: 500; }
.mp-board-list { gap: 0; }
.mp-board-row, .mp-board-row.top-1-row, .mp-board-row.top-2-row, .mp-board-row.top-3-row, .mp-ally-row {
    background: transparent; border: 0; border-bottom: 1px solid var(--border-subtle); border-radius: 0; padding: 12px 0; transform: none;
}
.mp-board-row:hover, .mp-ally-row:hover { background: transparent; transform: none; border-color: var(--border-subtle); }
.mp-board-row:hover .mp-gov-name { color: var(--gold-primary); text-decoration: underline; }
.mp-rank-box, .mp-rank-box.r-1, .mp-rank-box.r-2, .mp-rank-box.r-3 { background: none; border: 0; width: auto; height: auto; justify-content: flex-start; color: var(--text-muted); font-size: 14px; font-weight: 400; }
.mp-rank-box.r-1, .mp-rank-box.r-2, .mp-rank-box.r-3 { font-weight: 800; }
.mp-gov-avatar { background: var(--card-sub-bg); border: 1px solid var(--border-mid); color: var(--text-muted); border-radius: 50%; width: 36px; height: 36px; }
.mp-gov-avatar img { border-radius: 50% !important; }
.mp-gov-name { font-size: 15px; font-weight: 600; }
.mp-ally-pill { background: none; border: 0; padding: 0; color: var(--text-soft); font-weight: 400; font-size: 14px; }
.mp-ally-pill img { display: none; }
.mp-tc-pill, .mp-tc-pill.tg-badge, .mp-tc-pill.tg-max { background: none; border: 0; padding: 0; color: var(--text-soft); font-weight: 400; font-size: 14px; }
.mp-tc-pill i { display: none; }
.mp-power-main { font-size: 15px; font-weight: 700; }
.mp-ally-bar-track { background: var(--border-subtle); height: 5px; }
.mp-ally-bar-fill { background: var(--gold-primary); }
.btn-mp-more { background: none; border: 0; color: var(--gold-primary); font-weight: 600; }
.btn-mp-more:hover { background: none; color: var(--gold-primary); text-decoration: underline; }

/* ---------- 搜尋結果卡 ---------- */
.gov-basic-card { background: transparent; border: 0; border-bottom: 1px solid var(--border-subtle); border-radius: 0; }
.gov-basic-card:hover { background: var(--card-sub-bg); border-color: var(--border-subtle); }
.gov-avatar-circle { border: 1px solid var(--border-mid); background: var(--card-sub-bg); color: var(--text-muted); }

/* ---------- 按鈕 ---------- */
.btn-battle { background: var(--gold-primary); color: var(--onaccent); border: 0; border-radius: 4px; font-weight: 600; font-size: 14px; padding: 9px 18px; }
.btn-battle:hover { filter: brightness(1.08); }
.btn-battle:disabled { background: var(--border-mid); color: var(--text-muted); filter: none; }
.btn-chart-toggle, .btn-copy-link, .btn-preset, .btn-visual, .btn-layout, .pdetail-btn, .phero-retry {
    background: transparent; color: var(--text-soft); border: 1px solid var(--border-mid); border-radius: 4px; font-weight: 500;
}
.btn-chart-toggle:hover, .btn-copy-link:hover, .btn-preset:hover, .btn-visual:hover, .btn-layout:hover { background: var(--card-sub-bg); color: var(--text-main); }
.btn-chart-toggle.active, .btn-preset.active, .btn-layout.active, .btn-visual.active { background: transparent; color: var(--gold-primary); border-color: var(--gold-primary); font-weight: 700; }
.cb-label { background: none; border: 0; border-radius: 0; color: var(--text-muted); font-weight: 500; }
.cb-label:has(input:checked) { background: none; border: 0; color: var(--text-main); }

/* ---------- 輸入框 ---------- */
.kingdom-input-box, .form-field input, .form-field select, .input-group input, input[type="number"], input[type="text"] { border-radius: 4px; }
.kingdom-input-box, .input-group .kingdom-input-box { background: transparent; border: 1px solid var(--border-mid); }
.dhm-unit input { background: transparent; border: 1px solid var(--border-mid); border-radius: 4px; }
.score-preview-bar { background: transparent; border: 0; border-top: 1px solid var(--border-mid); border-bottom: 1px solid var(--border-mid); border-radius: 0; }

/* ---------- 表格 (Tabulator / data-table) ---------- */
.tabulator { background: transparent !important; border: 0 !important; font-size: 14px; }
.tabulator .tabulator-header { background: transparent !important; border-bottom: 1px solid var(--border-mid) !important; color: var(--text-muted) !important; }
.tabulator .tabulator-header .tabulator-col { background: transparent !important; border-right: 0 !important; color: var(--text-muted) !important; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: 8px 10px; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-title { font-weight: 500; font-size: 12px; }
/* Tabulator midnight 主題的深灰底色 (tableholder / table / 奇偶列 / 儲存格)：用高優先權全部蓋成跟頁面一致，避免淺色模式出現深灰列 */
.tabulator .tabulator-tableholder, .tabulator .tabulator-tableholder .tabulator-table,
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row,
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-row-odd,
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-row-even,
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell,
.tabulator .tabulator-footer { background: transparent !important; background-color: transparent !important; color: var(--text-main) !important; }
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row:hover,
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.row-expanded { background: var(--card-sub-bg) !important; }
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row { border-bottom: 1px solid var(--border-subtle) !important; }
.tabulator-row, .tabulator-row.tabulator-row-even { background: transparent !important; border-bottom: 1px solid var(--border-subtle) !important; color: var(--text-main) !important; }
.tabulator-row:hover { background: var(--card-sub-bg) !important; }
.tabulator .tabulator-cell { border-right: 0 !important; }
.tabulator-row.row-expanded { background: var(--card-sub-bg) !important; }
.data-table th { background: transparent; color: var(--text-muted); border-bottom: 1px solid var(--border-mid); font-weight: 500; text-transform: none; }
.data-table td { border-bottom: 1px solid var(--border-subtle); }

/* ---------- 展開區 / 抽屜 ---------- */
.player-detail-drawer { background: var(--drawer-bg); border: 0; border-top: 1px solid var(--border-mid); border-bottom: 1px solid var(--border-mid); }
.drawer-card { background: transparent; border: 0; border-left: 0; border-top: 1px solid var(--border-mid); border-radius: 0; }
.drawer-card .d-label { text-transform: none; }

/* ---------- 個人頁 ---------- */
.profile-hero-banner { background: none; border: 0; border-bottom: 1px solid var(--border-mid); border-radius: 0; padding: 8px 0 20px; }
.profile-avatar-lg { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--border-mid); background: var(--card-sub-bg); color: var(--text-muted); font-size: 26px; }
.profile-avatar-lg img { border-radius: 50% !important; }
.p-badge, .p-badge.gold, .p-badge.cyan { background: none; border: 0; padding: 0; color: var(--text-soft); font-weight: 500; }
.profile-metrics-grid { gap: 0; }
.profile-stat-box { background: transparent; border: 0; border-top: 1px solid var(--border-subtle); border-left: 0; border-radius: 0; padding: 14px 0; }
.profile-stat-box .ps-val { color: var(--text-main); }

/* ---------- 英雄卡 (個人頁 / 展開區 / 手機卡片) ---------- */
.hx-card { background: transparent; border: 1px solid var(--border-mid); border-top: 1px solid var(--border-mid); border-radius: 4px; }
.hx-chips span { background: none; border: 0; padding: 0; color: var(--text-muted); font-weight: 500; }
.hx-gears { border-top: 1px solid var(--border-subtle); }
.hc-genh.red, .hc-gt.red, .mp-gear-item.red-gear { color: var(--red) !important; }

/* ---------- 手機卡片 ---------- */
.pcard { background: transparent; border: 0; border-bottom: 1px solid var(--border-subtle); border-radius: 0; }
.pstat { background: transparent; border: 0; border-radius: 0; padding: 4px 0; }
.ppill { background: none; border: 0; color: var(--text-soft); font-weight: 500; padding: 0; }
.pally { color: var(--text-muted); font-weight: 400; }
.prank, .prank.r1, .prank.r2, .prank.r3 { background: var(--bg-dark); color: var(--text-main); border: 1px solid var(--border-mid); }
.pdetail-btn { color: var(--gold-primary); border-color: var(--gold-primary); }

/* ---------- 提示 / 橫幅 ---------- */
.notice-bar { background: transparent; border: 0; border-top: 1px solid var(--border-mid); border-bottom: 1px solid var(--border-mid); border-radius: 0; color: var(--text-soft); }
.notice-bar.warn { color: var(--warn); }
.not-home-banner { background: transparent; border: 0; border-top: 1px solid var(--warn); border-bottom: 1px solid var(--warn); border-radius: 0; color: var(--warn); }
.super-admin-banner { background: transparent; border: 0; border-bottom: 1px solid var(--border-mid); border-radius: 0; }
.chart-box, .k1-panel, .k2-panel, .tactical-toolbar, .toolbar-section { background: transparent; border-radius: 0; }
.tactical-toolbar { border: 0; border-top: 1px solid var(--border-mid); border-bottom: 1px solid var(--border-mid); }
.chart-box { border: 0; border-top: 1px solid var(--border-subtle); }
.vs-badge { color: var(--text-muted); font-weight: 600; font-size: 16px; }
.k1-panel h2, .k2-panel h2 { font-size: 16px; font-weight: 600; }
.fd-progress { background: var(--border-subtle); }

/* ---------- 全站搜尋 (導覽列) ---------- */
.nav-search { display: flex; align-items: center; flex: 1 1 220px; max-width: 300px; margin: 0 8px; border: 1px solid var(--border-mid); border-radius: 4px; background: transparent; height: 36px; }
.nav-search:focus-within { border-color: var(--gold-primary); }
.nav-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text-main); padding: 0 10px; font-size: 14px; outline: none; font-family: inherit; }
.nav-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.nav-search button { border: 0; background: transparent; color: var(--text-muted); width: 36px; height: 100%; cursor: pointer; font-size: 14px; }
.nav-search button:hover { color: var(--gold-primary); }
body[data-view="dashboard"] .nav-search { display: none; }
@media (max-width: 1080px) {
    .nav-search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; height: 40px; }
    .nav-search input { font-size: 16px; }   /* 16px 避免 iOS 聚焦時自動放大頁面 */
}

/* ---------- 手機 / 窄螢幕導覽 (漢堡選單) ---------- */
.mobile-menu-btn { background: none; border: 1px solid var(--border-mid); border-radius: 4px; color: var(--text-main); width: 38px; height: 36px; align-items: center; justify-content: center; }
@media (max-width: 1080px) {
    .top-navbar { flex-wrap: wrap; padding: 8px 16px; gap: 8px 12px; }
    .top-nav-links { width: 100%; order: 4; margin: 0; padding: 4px 0 0; border-top: 1px solid var(--border-subtle); }
    .top-nav-links li { width: 100%; }
    .top-nav-links li a { display: flex; width: 100%; margin: 0; padding: 14px 4px; border-bottom: 1px solid var(--border-subtle); border-left: 2px solid transparent; }
    .top-nav-links li a.active { border-bottom-color: var(--border-subtle); border-left-color: var(--gold-primary); padding-left: 12px; }
}

/* ---------- 手機 ---------- */
@media (max-width: 720px) {
    .mp-board-row { grid-template-columns: 28px minmax(0, 1fr) auto 14px; column-gap: 10px; padding: 10px 0; }
    .mp-hero-section h1 { font-size: 22px; }
    .mp-kpi-card, .mp-kpi-card.cyan-top { padding: 12px 0; border-left: 0; border-top: 1px solid var(--border-subtle); }
    .mp-kpi-card:first-child { border-top: 0; }
}
.brand-text h2 { color: var(--text-main); }

/* 王國 ID 輸入框加寬，讓提示文字完整顯示 */
.kingdom-input-box input[type="number"] { width: 124px; padding-left: 6px; padding-right: 6px; }
.kingdom-input-box input[type="number"]#limit { width: 84px; }
.kingdom-input-box input::placeholder { font-size: 13px; white-space: nowrap; }

/* ---- 後台：Tabulator 分頁列 (極簡) ---- */
.tabulator .tabulator-footer { border-top: 1px solid var(--border-mid) !important; padding: 10px 0 !important; font-size: 13px; color: var(--text-muted) !important; }
.tabulator .tabulator-footer .tabulator-paginator { text-align: right; color: var(--text-muted) !important; }
.tabulator .tabulator-footer .tabulator-page-counter { float: left; font-variant-numeric: tabular-nums; line-height: 30px; }
.tabulator .tabulator-footer .tabulator-page-size { margin: 0 8px 0 0; border: 1px solid var(--border-mid); border-radius: 4px; background: transparent; color: var(--text-main); padding: 4px 8px; font: inherit; }
.tabulator .tabulator-footer .tabulator-pages { margin: 0; }
.tabulator .tabulator-footer .tabulator-page { border: 1px solid var(--border-mid) !important; border-radius: 4px !important; background: transparent !important; color: var(--text-main) !important; padding: 4px 10px; margin: 0 0 0 4px; font: inherit; cursor: pointer; }
.tabulator .tabulator-footer .tabulator-page.active { border-color: var(--gold-primary) !important; color: var(--gold-primary) !important; font-weight: 700; }
.tabulator .tabulator-footer .tabulator-page:disabled { opacity: .4; cursor: default; }
.adm-tabs button.on { border-bottom-color: var(--gold-primary); }