:root {
    --bg-color: #0c111d;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(23, 32, 51, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(17, 24, 39, 0.7);
    --input-bg: rgba(15, 23, 42, 0.6);
    --line-green: #06c755;
    --line-green-hover: #05b34c;
    --line-green-glow: rgba(6, 199, 85, 0.35);
    --primary: #3b82f6;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 16px 24px;
    position: relative;
    overflow-x: hidden;
}

/* ── 背景光暈 ── */
.background-elements {
    position: fixed;
    width: 100vw; height: 100vh;
    top: 0; left: 0;
    z-index: 0; overflow: hidden;
    pointer-events: none;
}
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    animation: float 12s infinite ease-in-out alternate;
}
.orb-1 { width: 500px; height: 500px; background: var(--line-green); top: -150px; left: -100px; }
.orb-2 { width: 420px; height: 420px; background: #0284c7; bottom: -80px; right: -80px; animation-delay: -4s; }
.orb-3 { width: 300px; height: 300px; background: #6366f1; top: 40%; left: 45%; animation-delay: -8s; }
@keyframes float {
    0%   { transform: translateY(0) scale(1); }
    100% { transform: translateY(-30px) scale(1.1); }
}

/* ── 頂部導航 ── */
.main-header {
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 8px 12px;
    margin-bottom: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    min-height: 54px;
    height: auto;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 1;
    min-width: 0;
}
.brand-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 0 10px var(--line-green-glow));
    flex-shrink: 0;
}
.brand-titles {
    min-width: 0;
    overflow: hidden;
}
.brand-titles h1 {
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #ffffff 30%, var(--line-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
}
.brand-titles p {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}
.header-action-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.header-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 2px;
}
.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    padding: 0 12px;
    height: 36px;
    box-sizing: border-box;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.25s ease;
}
.login-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--error);
    box-shadow: 0 0 8px var(--error);
    display: inline-block;
}
.status-dot.online {
    background: var(--line-green);
    box-shadow: 0 0 10px var(--line-green);
}
.status-dot.waiting {
    background: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
}

/* ── 雙欄工作區佈局 ── */
.dashboard-layout {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 20px;
    height: calc(100vh - 120px);
}
.panel {
    display: flex;
    flex-direction: column;
}
.left-panel {
    flex: 1.1;
    min-width: 480px;
    overflow: hidden;
}
.right-panel {
    flex: 1;
    min-width: 420px;
    position: relative;
    z-index: 15;
}

/* ── 卡片與面板樣式 ── */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.3);
}
.card.h-full {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}
.compact-card {
    padding: 10px 16px;
    margin-bottom: 10px;
}
.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.badge-hint {
    font-size: 0.8rem;
    color: var(--line-green);
    background: rgba(6, 199, 85, 0.12);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(6, 199, 85, 0.25);
}

/* ── 子導航 ── */
.sub-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: nowrap;
}
.sub-nav-multi {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 14px;
}
.sub-nav-row {
    display: flex;
    gap: 6px;
    width: 100%;
}
/* Row 1 & Row 2 都用 grid 5欄，確保每格等寬 */
.sub-nav-row-1 {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.sub-nav-row-2 {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    width: 100%;
}
.nav-tab-cleaner {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(99, 102, 241, 0.12));
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 8px 10px;
    font-weight: 700;
    /* grid 子元素不需要 flex 設定 */
}
.nav-tab-cleaner:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(99, 102, 241, 0.22));
    color: #fff;
    border-color: rgba(56, 189, 248, 0.7);
}
.nav-tab-cleaner.active {
    background: linear-gradient(135deg, #0284c7, #4f46e5) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 4px 18px rgba(14, 165, 233, 0.45) !important;
    color: #fff !important;
}
.nav-tab {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap !important;
    /* flex width controlled by grid parent */
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.nav-tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}
.nav-tab.active {
    color: #fff;
    background: var(--line-green);
    border-color: var(--line-green);
    box-shadow: 0 4px 18px var(--line-green-glow);
}
.tab-pane {
    display: none;
    overflow-y: auto;
    padding-right: 4px;
}
.tab-pane.active {
    display: block;
}

/* ── 表單元件 ── */
.textarea-input {
    width: 100%;
    height: 200px;
    min-height: 130px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    padding: 12px 14px;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
}
.textarea-input:focus {
    border-color: var(--line-green);
    box-shadow: 0 0 0 2px var(--line-green-glow);
}

.template-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.template-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 220px;
}
.bar-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
    white-space: nowrap;
}
.select-input {
    flex: 1;
    min-width: 140px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    font-size: 0.9rem;
}
.select-input option {
    background: #1e293b;
    color: #fff;
}
.template-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.btn-update-tpl {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #34d399;
    font-weight: 700;
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-update-tpl:hover {
    background: #10b981;
    color: #0b141a;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}
.btn-save-new-tpl {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-save-new-tpl:hover {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

/* ── 圖片/影片上傳區 (緊湊版與標準版) ── */
.upload-container {
    margin-top: 12px;
}
.upload-trigger {
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    background: rgba(255,255,255,0.02);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.upload-trigger:hover {
    border-color: var(--line-green);
    background: rgba(6, 199, 85, 0.05);
}
.upload-icon { font-size: 1.3rem; }
.upload-text { font-size: 0.88rem; color: var(--text-muted); }

/* ── 批量發訊區控制項樣式 (放下面) ── */
.send-controls-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
    margin-bottom: 0;
    padding: 16px;
}

.upload-trigger-compact {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
    text-align: left;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    margin-top: 10px;
}

.upload-trigger-compact:hover {
    border-color: var(--line-green);
    background: rgba(6, 199, 85, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(6, 199, 85, 0.15);
}

.upload-icon-compact {
    font-size: 1.45rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.upload-text-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upload-title-compact {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.2px;
}

.upload-hint-compact {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.preview-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.compact-preview-box {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 8px;
    margin-top: 8px;
    max-height: 160px;
    overflow-y: auto;
}

.img-thumb-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.compact-preview-box .img-thumb-wrap {
    width: 100%;
    height: 68px;
    border-radius: 8px;
}

.img-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-delete-btn {
    position: absolute;
    top: 2px; right: 2px;
    background: rgba(0,0,0,0.7);
    color: #ef4444;
    border: none;
    border-radius: 50%;
    width: 18px; height: 18px;
    line-height: 16px;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    z-index: 2;
}

/* ── 發送控制卡片元件微調 ── */
.send-controls-card .send-mode-card {
    margin-bottom: 0;
    padding: 12px 14px;
}

.send-controls-card .mode-btn-group {
    margin: 8px 0;
}

.send-controls-card .delay-settings-grid {
    margin-bottom: 0;
    gap: 12px;
}

.send-controls-card .delay-slider-box {
    margin-bottom: 0;
    padding: 10px 14px;
}

.send-controls-card .send-target-status-bar {
    margin-bottom: 0;
    padding: 10px 14px;
}

.send-controls-card .primary-btn {
    padding: 13px 20px;
    font-size: 1.05rem;
    margin-top: 4px;
}

/* ── 延遲設定滑桿與按鈕 ── */
.delay-slider-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    background: rgba(255,255,255,0.03);
    padding: 10px 14px;
    border-radius: 10px;
}
.slider-label {
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.35;
    white-space: nowrap;
    flex-shrink: 0;
}
.slider-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.num-input {
    width: 80px !important;
    min-width: 76px !important;
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    padding: 4px 6px !important;
    border-radius: 8px !important;
    text-align: center !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}
.num-input:focus {
    border-color: var(--line-green) !important;
    box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.2) !important;
}

/* ── 主要動作按鈕 ── */
.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--line-green) 0%, #05a045 100%);
    color: #fff;
    border: none;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--line-green-glow);
    transition: all 0.25s ease;
}
.primary-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(6, 199, 85, 0.5);
}
.btn-sm {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-sm:hover { background: rgba(255,255,255,0.15); }
.secondary-btn {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #60a5fa;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.secondary-btn:hover {
    background: rgba(59, 130, 246, 0.28);
    color: #fff;
}
.stop-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.stop-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fff;
}

/* ── 進度條與日誌卡片 ── */
.progress-box {
    margin-top: 14px;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}
.progress-track {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, var(--line-green));
    border-radius: 20px;
    transition: width 0.3s ease;
}
.log-box {
    margin-top: 10px;
    min-height: 120px;
    height: 180px;
    max-height: 800px;
    resize: vertical;
    overflow-y: auto !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.35);
    font-size: 0.84rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.log-item {
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.02);
}
.log-item.success { color: #34d399; }
.log-item.fail { color: #f87171; }

/* ── 右欄名單視圖 ── */
.list-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.list-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
}
.list-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.list-title h3 {
    margin: 0;
    font-size: 1.05rem;
    white-space: nowrap;
}
.counter-badge {
    background: rgba(255,255,255,0.08);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.btn-exclude-trigger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.28);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.btn-exclude-trigger:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: #ef4444;
    color: #fff;
}
.self-account-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.84rem;
    color: #e2e8f0;
}
.self-banner-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.self-tag {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.78rem;
    white-space: nowrap;
}
.self-name {
    font-weight: 700;
    color: #38bdf8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.self-hint {
    color: #94a3b8;
    font-size: 0.78rem;
    white-space: nowrap;
    margin-left: 8px;
}
.contact-tag.excluded {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}
.contact-item.is-excluded {
    opacity: 0.65;
    background: rgba(239, 68, 68, 0.04);
}
.detect-progress-box {
    background: rgba(6, 199, 85, 0.1);
    border: 1px solid rgba(6, 199, 85, 0.25);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 10px;
}
.progress-info-sm {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--line-green);
    margin-bottom: 6px;
    font-weight: 600;
}
.stop-btn-sm {
    background: transparent;
    border: none;
    color: #f87171;
    font-size: 0.78rem;
    cursor: pointer;
}
.progress-track-sm {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
}
.progress-fill-sm {
    height: 100%;
    background: var(--line-green);
    border-radius: 10px;
    transition: width 0.2s ease;
}

/* ── 🔍 好友與群組獨立搜尋列 ── */
.contact-search-card {
    margin-bottom: 8px;
}
.contact-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    padding: 3px 10px 3px 12px;
    transition: all 0.2s ease;
}
.contact-search-wrapper:focus-within {
    border-color: var(--line-green);
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 12px var(--line-green-glow);
}
.search-icon-badge {
    font-size: 0.95rem;
    margin-right: 8px;
    opacity: 0.85;
    user-select: none;
    flex-shrink: 0;
}
.search-input-box {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.88rem;
    padding: 7px 0;
    width: 100%;
}
.search-input-box::placeholder {
    color: #94a3b8;
    font-size: 0.84rem;
}
.btn-clear-search {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #94a3b8;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 6px;
    transition: all 0.15s ease;
}
.btn-clear-search:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.filter-tabs {
    display: flex;
    flex-shrink: 0;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 3px;
    border: 1px solid var(--glass-border);
}
.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.filter-btn.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.filter-count {
    font-size: 0.78rem;
    font-weight: 500;
    opacity: 0.85;
    color: inherit;
}
.filter-btn.active .filter-count {
    color: #4ade80;
    font-weight: 700;
    opacity: 1;
}
.search-input {
    flex: 1;
    min-width: 140px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    outline: none;
    font-size: 0.85rem;
}
.search-input:focus {
    border-color: var(--line-green);
}

.selection-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap !important;
    gap: 10px 14px !important;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.selected-badge {
    color: var(--line-green);
    font-size: 0.85rem;
}

.contacts-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 9px 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none !important;
    -webkit-user-select: none !important;
}
.contact-item:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.18);
}
.contact-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #06c755);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}
.contact-info {
    flex: 1;
    overflow: hidden;
}
.contact-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.contact-name {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.contact-tag {
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}
.contact-tag.group {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}
.contact-tag.openchat {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
}
.contact-tag.official {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}
.contact-msg {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.contact-time {
    font-size: 0.75rem;
    color: #64748b;
    flex-shrink: 0;
}

.empty-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    gap: 12px;
}
.empty-placeholder span { font-size: 3rem; }

/* ── LINE 操作即時畫面 (Live Monitor) ── */
.btn-header-live {
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: #38bdf8;
}
.btn-header-live:hover {
    background: rgba(14, 165, 233, 0.28);
    border-color: rgba(56, 189, 248, 0.6);
    color: #fff;
}
.live-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #06c755;
    box-shadow: 0 0 10px #06c755;
    display: inline-block;
    animation: livePulse 1.8s infinite;
}
.live-pulse-dot.pulse-blue {
    background: #38bdf8;
    box-shadow: 0 0 10px #38bdf8;
}
.live-pulse-dot.pulse-yellow {
    background: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
}
.live-pulse-dot.pulse-red {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}
.live-pulse-dot.pulse-gray {
    background: #64748b;
    box-shadow: 0 0 6px #64748b;
    animation: none;
}
.badge-green {
    background: rgba(6, 199, 85, 0.15) !important;
    border-color: rgba(6, 199, 85, 0.4) !important;
    color: #4ade80 !important;
}
.badge-yellow {
    background: rgba(245, 158, 11, 0.18) !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
    color: #fbbf24 !important;
}
.badge-gray {
    background: rgba(148, 163, 184, 0.15) !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
    color: #94a3b8 !important;
}
@keyframes livePulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.live-card {
    border-color: rgba(6, 199, 85, 0.25);
    background: linear-gradient(180deg, rgba(20, 27, 45, 0.85) 0%, rgba(13, 19, 33, 0.95) 100%);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
}
.live-title-box {
    display: flex;
    align-items: center;
    gap: 8px;
}
.live-btn-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-xs {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: #e2e8f0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-xs:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.live-body {
    transition: all 0.3s ease;
}
.live-body.collapsed {
    display: none;
}

.live-screen-viewport {
    position: relative;
    width: 100%;
    min-height: 200px;
    max-height: 380px;
    background: #0b0f19;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.live-screen-viewport img {
    width: 100%;
    height: 100%;
    max-height: 380px;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease;
}
.live-screen-viewport:hover img {
    transform: scale(1.01);
}
.live-screen-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #fff;
    font-weight: 600;
    pointer-events: none;
}
.live-screen-zoom-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.live-screen-viewport:hover .live-screen-zoom-hint {
    opacity: 1;
}

.live-screen-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
    gap: 8px;
}
.live-screen-empty .empty-icon {
    font-size: 2.5rem;
}

.live-screen-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.live-timestamp {
    color: #64748b;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ── Lightbox Zoom Modal ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active {
    display: flex;
}
.modal-card {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    width: 640px;
    max-width: 96vw !important;  /* ★ 全站彈窗徹底解除寬度鎖定，拉寬無上限（最高可拉至 96vw） */
    max-height: 94vh !important; /* ★ 高度最高可拉至 94vh */
    min-width: 360px !important;
    min-height: 240px !important;
    overflow: hidden;
    resize: both !important;     /* 原生 CSS 縮放支援 */
    position: relative;
    box-sizing: border-box;
    animation: modalPop 0.25s ease-out;
}

.modal-large {
    width: 880px;
}

.modal-card-accounts {
    width: 620px;
}

/* 確保全站彈窗內部容器與表格能隨視窗拉大拉高無縫填滿 */
.modal-card .modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-card .table-responsive {
    flex: 1;
    min-height: 220px;
    max-height: none !important;
}

/* ★ 右下角專屬縮放手柄 (Corner Resizer Grip) */
.modal-resizer-grip {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    cursor: nwse-resize !important;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 5px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.modal-resizer-grip::after {
    content: "⋰";
    font-size: 17px;
    color: rgba(56, 189, 248, 0.75);
    line-height: 1;
    font-family: monospace;
    font-weight: bold;
    pointer-events: none;
    transition: color 0.15s, transform 0.15s;
}
.modal-resizer-grip:hover::after,
.modal-card.is-resizing .modal-resizer-grip::after {
    color: #38bdf8;
    transform: scale(1.25);
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

.modal-card.is-dragging,
.modal-card.is-resizing {
    user-select: none !important;
    -webkit-user-select: none !important;
    transition: none !important;
}
@keyframes modalPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-title-row h3 {
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
}
.modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close-btn:hover {
    color: #fff;
}
.modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.modal-body-zoom {
    flex: 1;
    overflow: auto;
    background: #030712;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-body-zoom img {
    max-width: 100%;
    max-height: calc(90vh - 120px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}
.modal-time-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── 右側即時畫面專用面板 (比照銷冠全平台發文王) ── */
.preview-panel-side {
    flex: 1.1;
    min-width: 480px;
    height: 100%;
}
.preview-card-wrap {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(20, 27, 45, 0.85) 0%, rgba(13, 19, 33, 0.95) 100%);
    border: 1px solid rgba(6, 199, 85, 0.3);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
}
.preview-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.45);
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: nowrap !important;
    gap: 8px;
    min-height: 44px;
    overflow-x: auto;
    scrollbar-width: none;
}
.preview-header-bar::-webkit-scrollbar {
    display: none;
}
.preview-title-box {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.preview-title-box h3 {
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    white-space: nowrap;
}
.live-screen-badge-inline {
    background: rgba(6, 199, 85, 0.15);
    border: 1px solid rgba(6, 199, 85, 0.35);
    color: #4ade80;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.preview-btn-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap !important;
    flex-shrink: 0;
}
.preview-btn-group .btn-xs {
    height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    white-space: nowrap;
}
.account-switch-compact {
    height: 28px !important;
    padding: 0 7px !important;
    border-radius: 6px !important;
    font-size: 0.76rem !important;
}
.account-switch-compact .account-name-main {
    max-width: 80px !important;
    font-size: 0.76rem !important;
}
.btn-header-login {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}
.btn-header-cred {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    white-space: nowrap;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-header-cred:hover {
    background: rgba(245, 158, 11, 0.3);
    color: #fff;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}
.preview-body-scroll {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #060913;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px;
}
.preview-body-scroll img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.25s ease;
}
.preview-body-scroll:hover img {
    transform: scale(1.015);
}
.preview-zoom-tag {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.preview-body-scroll:hover .preview-zoom-tag {
    opacity: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.9);
}
.preview-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--glass-border);
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── 發送方式選擇卡片與影片秒數設定 ── */
.send-mode-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.mode-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 8px;
}
.mode-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.25;
    min-height: 36px;
}
.mode-subtext {
    font-size: 0.78rem;
    opacity: 0.85;
    font-weight: normal;
    display: inline-block;
    margin-top: 2px;
}
.mode-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.mode-pill.active {
    background: linear-gradient(135deg, rgba(6, 199, 85, 0.25), rgba(59, 130, 246, 0.25));
    border-color: #06c755;
    color: #fff;
    box-shadow: 0 0 12px rgba(6, 199, 85, 0.2);
}
.mode-pill input[type="radio"] {
    display: none;
}
.mode-desc-box {
    font-size: 0.82rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.25);
    padding: 7px 12px;
    border-radius: 6px;
    line-height: 1.4;
    border-left: 3px solid #06c755;
}
.delay-settings-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.delay-settings-grid .delay-slider-box {
    margin-bottom: 0;
}
.upload-subtext {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 3px;
    display: block;
}
.media-video-tag {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(239, 68, 68, 0.88);
    color: #fff;
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
    pointer-events: none;
}

/* ══ 帳號切換與分身管理 (Multi-Account Switcher) ══ */
.account-selector-wrapper {
    position: relative;
    display: inline-block;
}

/* 頂部右上角 多LINE帳號管理 按鈕 (附圖 1 款式) */
.btn-multi-account-header {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.38);
    color: #38bdf8;
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
}

.btn-multi-account-header:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.28);
    color: #e0f2fe;
}

.btn-multi-account-header .account-gear-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.btn-multi-account-header .account-arrow-icon {
    font-size: 0.72rem;
    color: rgba(56, 189, 248, 0.75);
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.btn-multi-account-header:hover .account-arrow-icon {
    color: #e0f2fe;
}

.account-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0 10px;
    height: 36px;
    box-sizing: border-box;
    color: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
}

.account-switch-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(6, 199, 85, 0.4);
    box-shadow: 0 0 12px rgba(6, 199, 85, 0.18);
}

.account-badge-avatar {
    font-size: 0.92rem;
    background: rgba(6, 199, 85, 0.2);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.account-btn-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.15;
}

.account-label-sub {
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-name-main {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f8fafc;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-arrow-icon {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: 2px;
}

/* 帳號下拉選單 (右靠齊定位，絕不截斷) */
.account-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 280px;
    max-width: 340px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 14px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75), 0 0 25px rgba(56, 189, 248, 0.12);
    z-index: 9999;
    overflow: hidden;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.account-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    font-weight: 600;
    color: #94a3b8;
}

.btn-text-sm {
    background: transparent;
    border: none;
    color: #38bdf8;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.btn-text-sm:hover {
    background: rgba(56, 189, 248, 0.12);
}

.account-dropdown-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 6px 0;
}

.account-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.account-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.account-dropdown-item.is-active {
    background: rgba(6, 199, 85, 0.12);
    border-left: 3px solid #06c755;
}

.account-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1e293b;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #06c755;
}

.account-item-info {
    display: flex;
    flex-direction: column;
}

.account-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f1f5f9;
}

.account-item-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}

.account-item-badge {
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(6, 199, 85, 0.15);
    color: #06c755;
    font-weight: 600;
}

.account-dropdown-footer {
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.account-add-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(6, 199, 85, 0.18) 0%, rgba(56, 189, 248, 0.18) 100%);
    border: 1px solid rgba(6, 199, 85, 0.35);
    border-radius: 8px;
    padding: 8px 14px;
    color: #4ade80;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-add-action-btn:hover {
    background: linear-gradient(135deg, rgba(6, 199, 85, 0.3) 0%, rgba(56, 189, 248, 0.3) 100%);
    border-color: #06c755;
    color: #fff;
    transform: translateY(-1px);
}

.btn-xs-manage {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: #38bdf8;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-xs-manage:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #fff;
}

/* 帳號管理彈窗 */
.modal-card-accounts {
    width: 580px;
}

.accounts-modal-actions-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.accounts-tip {
    font-size: 0.8rem;
    color: #94a3b8;
}

.accounts-management-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.account-manage-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.account-manage-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

.account-manage-card.is-active-card {
    border-color: rgba(6, 199, 85, 0.45);
    background: rgba(6, 199, 85, 0.08);
}

.account-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0f172a;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #06c755;
}

.account-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
}

.btn-rename-icon {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 4px;
    border-radius: 4px;
}
.btn-rename-icon:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
}

.account-card-meta {
    font-size: 0.78rem;
    color: #94a3b8;
}

.account-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-switch-active {
    background: #06c755 !important;
    color: #fff !important;
    border-color: #06c755 !important;
    cursor: default;
}

/* ── Multi-user & Admin Header Badges ── */
.user-badge-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    min-height: 36px;
    height: auto;
    box-sizing: border-box;
    border-radius: 10px;
    white-space: nowrap;
}
.user-pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #e2e8f0;
}
.user-name-text {
    font-weight: 600;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-role-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}
.user-role-badge.badge-admin {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.4);
}
.user-role-badge.badge-user {
    background: rgba(56, 189, 248, 0.2);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.35);
}
.btn-admin-header {
    background: rgba(234, 179, 8, 0.15);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.4);
    padding: 0 8px;
    height: 26px;
    line-height: 24px;
    box-sizing: border-box;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.btn-admin-header:hover {
    background: rgba(234, 179, 8, 0.3);
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}
.btn-logout-header {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 0 8px;
    height: 26px;
    line-height: 24px;
    box-sizing: border-box;
    border-radius: 6px;
    font-size: 0.78rem;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.btn-logout-header:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fee2e2;
}

/* ── Admin Users Table ── */
.admin-users-table th {
    font-weight: 600;
    background: rgba(2, 6, 23, 0.4);
}
.admin-users-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.admin-users-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}
.status-pill-active {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.status-pill-disabled {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.form-control-sm {
    padding: 7px 10px;
    background: rgba(2, 6, 23, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #f8fafc;
    font-size: 0.84rem;
    box-sizing: border-box;
}
.form-control-sm:focus {
    outline: none;
    border-color: #10b981;
}

/* ══════════════════════════════════════════════════════════════
   📱 響應式佈局 (Responsive Web Design - RWD)
   支援平板、筆電與手機無縫自適應
   ══════════════════════════════════════════════════════════════ */

/* ── 中大螢幕與筆電適配 (<= 1200px) ── */
@media (max-width: 1200px) {
    .main-header {
        padding: 8px 14px;
    }
    .header-actions {
        gap: 8px;
    }
    .account-name-main {
        max-width: 100px;
    }
    .user-name-text {
        max-width: 75px;
    }
}

/* ── 平板與中型螢幕適配 (<= 1024px) ── */
@media (max-width: 1024px) {
    .dashboard-layout {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 120px);
    }
    .left-panel {
        min-width: 0 !important;
        width: 100%;
        flex: none;
    }
    .right-panel {
        min-width: 0 !important;
        width: 100%;
        flex: none;
        margin-top: 10px;
    }
    .preview-card-wrap {
        min-height: 480px;
    }
}

/* ── 小型平板與大手機適配 (<= 860px) ── */
@media (max-width: 860px) {
    .main-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 14px;
        border-radius: 12px;
    }
    .header-brand {
        justify-content: space-between;
        width: 100%;
    }
    .header-actions {
        justify-content: flex-start;
        width: 100%;
        gap: 8px;
    }
    .header-divider {
        display: none;
    }
    .header-action-group {
        flex-wrap: wrap;
    }
}

/* ── 手機直向模式 (<= 640px) ── */
@media (max-width: 640px) {
    body {
        padding: 8px;
    }
    .main-header {
        padding: 10px 12px;
        margin-bottom: 10px;
    }
    .brand-icon {
        font-size: 1.5rem;
    }
    .brand-titles h1 {
        font-size: 1.05rem;
    }
    .brand-titles p {
        display: none; /* 手機端隱藏長描述以省空間 */
    }
    .header-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .header-action-group.line-ops-group {
        display: flex;
        width: 100%;
        justify-content: space-between;
    }
    .header-action-group.line-ops-group > * {
        flex: 1;
        justify-content: center;
    }
    .header-action-group.user-ops-group {
        display: flex;
        width: 100%;
        justify-content: space-between;
    }
    .user-badge-wrapper {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        height: auto;
        gap: 6px;
    }
    .login-btn, .account-switch-btn {
        padding: 0 8px;
        font-size: 0.78rem;
        height: 34px;
    }
    .account-name-main {
        max-width: 80px;
        font-size: 0.76rem;
    }
    .card {
        padding: 12px 10px;
        border-radius: 12px;
    }
    .modal-card {
        width: 95% !important;
        max-width: 95% !important;
        padding: 14px 10px !important;
        margin: 10px auto;
    }
}

/* ══ 名單分類與加標籤擴充樣式 ══ */
.category-filter-wrap {
    display: flex;
    align-items: center;
}

.select-category-filter {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 32px;
}

.select-category-filter:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.select-category-filter option {
    background: #0f172a;
    color: #f8fafc;
}

.selection-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}
.selection-bar-left .checkbox-container {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.selection-bar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap !important;
}

.btn-batch-tool {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-batch-tool:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    color: #fff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.btn-batch-tool.btn-tool-rename {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.35);
    color: #c084fc;
}

.btn-batch-tool.btn-tool-rename:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: #c084fc;
    color: #fff;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
}

/* 好友列分類標籤 */
.contact-cat-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.contact-cat-badge:hover {
    background: rgba(56, 189, 248, 0.28);
    border-color: #38bdf8;
}

.contact-cat-badge.uncat {
    background: rgba(148, 163, 184, 0.08);
    color: #94a3b8;
    border: 1px dashed rgba(148, 163, 184, 0.3);
}

.contact-cat-badge.uncat:hover {
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}

/* 快速推薦分類標籤按鈕 */
.quick-cat-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: #cbd5e1;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-cat-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}

.quick-cat-btn.quick-cat-clear:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

/* 快速標籤小藥丸 */
.quick-tag-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-tag-pill:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #38bdf8;
}

/* 預覽表格與手動編輯框 */
.tag-preview-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tag-preview-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.manual-edit-row-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #f59e0b;
    color: #fde047;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.manual-edit-row-input.is-valid {
    border-color: #22c55e;
    color: #86efac;
}

.manual-edit-row-input:focus {
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.tag-status-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 600;
}

.tag-status-badge.badge-valid {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.tag-status-badge.badge-over {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

/* ══ 👥 好友名單獨立頁籤佈局 ══ */
#tab-contacts.tab-pane.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

#tab-contacts #cardContacts {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    overflow: visible;
}

#tab-contacts .contacts-scroll-area {
    min-height: 160px;
    max-height: 360px;
    overflow-y: auto;
}

/* 好友名單頁籤內的發送控制卡片 */
.send-controls-card-contacts {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.send-controls-card-contacts .send-mode-card {
    margin-bottom: 0;
}

.send-controls-card-contacts .delay-settings-grid {
    margin-bottom: 0;
}

.send-controls-card-contacts .send-target-status-bar {
    margin-bottom: 0;
}

/* 批量發訊頁面中：發送目標狀態列 */
.send-target-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(6, 199, 85, 0.08);
    border: 1px solid rgba(6, 199, 85, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    color: #e2e8f0;
}

.target-status-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.target-count-highlight {
    color: var(--line-green);
    font-size: 1.1rem;
    font-weight: 700;
}

.btn-pick-contacts {
    background: rgba(6, 199, 85, 0.18);
    border: 1px solid var(--line-green);
    color: #4ade80;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-pick-contacts:hover {
    background: var(--line-green);
    color: #0b141a;
    box-shadow: 0 0 12px var(--line-green-glow);
}

/* 好友名單分頁底部快速導向發訊 */
.contacts-footer-actions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-contacts-to-send {
    background: linear-gradient(135deg, rgba(6, 199, 85, 0.2), rgba(59, 130, 246, 0.2));
    border: 1px solid rgba(6, 199, 85, 0.4);
    color: #e2e8f0;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-contacts-to-send:hover {
    background: linear-gradient(135deg, var(--line-green), #3b82f6);
    color: #fff;
    box-shadow: 0 4px 15px rgba(6, 199, 85, 0.3);
}

/* ══ 範本管理頁卡片樣式 ══ */
.template-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    transition: all 0.2s ease;
}

.template-item-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.18);
}

.template-item-main {
    flex: 1;
    min-width: 0;
}

.template-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.template-item-title {
    font-size: 1.05rem;
    color: #f1f5f9;
}

.badge-media-count {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-media-count.text-only {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
}

.template-item-content {
    margin: 6px 0 0 0;
    font-size: 0.86rem;
    color: #cbd5e1;
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.template-item-empty-text {
    margin-top: 6px;
    font-size: 0.82rem;
    color: #94a3b8;
    font-style: italic;
}

.template-item-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.btn-apply-tpl {
    background: rgba(6, 199, 85, 0.15);
    border: 1px solid var(--line-green);
    color: #4ade80;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-apply-tpl:hover {
    background: var(--line-green);
    color: #0b141a;
    box-shadow: 0 0 10px var(--line-green-glow);
}

.btn-rename-tpl {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-rename-tpl:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ── 輔助登入：多組常用帳號標籤 ── */
.saved-accounts-pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 90px;
    overflow-y: auto;
    padding: 2px 0 6px 0;
}

.saved-account-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.saved-account-pill:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #fff;
    transform: translateY(-1px);
}

.saved-account-pill.active {
    background: rgba(6, 199, 85, 0.18);
    border-color: var(--line-green);
    color: #4ade80;
    font-weight: 600;
}

.saved-account-pill-del {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 3px;
    border-radius: 50%;
    transition: color 0.15s ease;
}

.saved-account-pill-del:hover {
    color: #ef4444;
}

@media (max-width: 768px) {
    .tab1-action-grid {
        grid-template-columns: 1fr !important;
    }
}






/* ── 頁籤 2 發送名單：可整體往下拉、無內部卷軸、每20筆自動分頁 ── */
body {
    overflow-y: auto;
}

.dashboard-layout {
    height: auto;
    min-height: calc(100vh - 120px);
}

.left-panel {
    overflow: visible;
}

#tab-contacts.active {
    display: block;
    height: auto;
    overflow: visible;
}

#tab-contacts #cardContacts {
    height: auto;
    overflow: visible;
    padding: 14px 18px;
    gap: 8px;
    margin-bottom: 20px;
}

.send-controls-card-contacts.top-controls {
    margin-top: 0;
    margin-bottom: 8px;
    padding-top: 0;
    border-top: none;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

/* ── 左功能、右說明 左右兩欄格局 ── */
.send-settings-2col {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    align-items: stretch !important;
    margin-bottom: 6px !important;
}

.col-functions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px 12px;
}

.func-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.func-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
    min-width: 78px;
}

.func-group .mode-btn-group {
    display: flex;
    gap: 6px;
}

.func-checkboxes {
    padding-top: 4px;
    margin-top: 2px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    gap: 14px;
}

.top-chk-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.86rem;
    color: #e2e8f0;
    user-select: none;
    white-space: nowrap;
}

.top-chk-label.highlight-blue {
    color: #38bdf8;
    font-weight: 600;
}

.top-chk-label input {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--line-green);
}

.top-chk-label.highlight-blue input {
    accent-color: #38bdf8;
}

/* 右邊說明面板 */
.col-explanation {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(6, 199, 85, 0.25);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start !important;
    gap: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.col-explanation::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--line-green);
}

.exp-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.exp-icon {
    font-size: 1.1rem;
}

.exp-title {
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    color: var(--line-green) !important;
}

.exp-content {
    font-size: 0.88rem !important;
    color: #e2e8f0 !important;
    line-height: 1.55 !important;
    flex: none !important;
    margin-top: 2px !important;
    margin-bottom: 4px !important;
}

.exp-subhints {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-top: 6px !important;
    padding-top: 8px !important;
    border-top: 1px dashed rgba(255, 255, 255, 0.12) !important;
    font-size: 0.82rem !important;
    color: #cbd5e1 !important;
}

.exp-subhints span {
    font-size: 0.85rem !important;
    background: rgba(255, 255, 255, 0.07) !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
}

.send-target-status-bar.compact {
    margin-bottom: 0;
    padding: 8px 14px;
    font-size: 0.88rem;
    background: rgba(6, 199, 85, 0.08);
    border: 1px solid rgba(6, 199, 85, 0.25);
    border-radius: 10px;
}

.send-action-buttons-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 10px;
    align-items: stretch;
}

.btn-send-huge {
    margin: 0 !important;
    height: 42px;
    font-size: 1.05rem;
    font-weight: 700;
}

.send-controls-card-contacts .btn-sent-history {
    margin-top: 0 !important;
    height: 42px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    font-weight: 600;
    padding: 0 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.send-controls-card-contacts .btn-sent-history:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: #10b981;
}

/* 好友群組名單區（置於下方，無內部卷軸，每20個自動分頁） */
.contacts-list-section {
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.contacts-list-section .contact-search-card {
    margin-bottom: 6px;
}

.contacts-list-section .filter-bar {
    margin-bottom: 6px;
}

.contacts-list-section .selection-bar {
    margin-bottom: 6px;
}

#tab-contacts .contacts-scroll-area {
    overflow: visible;
    min-height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 0;
}

/* ── 20 筆自動分頁控制列 ── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: #f8fafc;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--line-green);
    color: #0b141a;
    border-color: var(--line-green);
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.88rem;
    color: #94a3b8;
    margin: 0 4px;
}

.page-info b {
    color: var(--line-green);
    font-size: 1.02rem;
}

/* 左右兩欄互動與工具列樣式 (v4.9) */
.func-clickable {
    cursor: pointer;
    border-radius: 8px;
    padding: 3px 6px;
    transition: background 0.15s ease;
}
.func-clickable:hover {
    background: rgba(255, 255, 255, 0.06);
}

.btn-tool-outline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e2e8f0;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}
.btn-tool-outline:hover {
    background: rgba(6, 199, 85, 0.15);
    border-color: var(--line-green);
    color: #4ade80;
}
.btn-tool-outline.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #f87171;
}

.page-size-select {
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.82rem;
    cursor: pointer;
    outline: none;
}
.page-size-select:focus {
    border-color: var(--line-green);
}

.send-action-buttons-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 12px !important;
    align-items: stretch !important;
    margin-bottom: 6px !important;
}

.btn-send-main-action {
    height: 48px !important;
    border-radius: 10px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    outline: none !important;
}

.btn-send-main-action.btn-start {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
}
.btn-resume {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}
.btn-send-main-action.btn-start:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-1px) !important;
}

.btn-send-main-action.btn-stop {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.32) !important;
}
.btn-send-main-action.btn-stop:hover {
    filter: brightness(1.12) !important;
    transform: translateY(-1px) !important;
}

.btn-send-main-action.btn-history {
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    color: #f1f5f9 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.25 !important;
    padding: 3px 6px !important;
    white-space: nowrap !important;
}
.btn-send-main-action.btn-history .hist-title {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    display: block !important;
    letter-spacing: 0.5px !important;
}
.btn-send-main-action.btn-history .hist-sub {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: #93c5fd !important;
    white-space: nowrap !important;
    display: block !important;
    margin-top: 1px !important;
}
.btn-send-main-action.btn-history:hover {
    background: rgba(51, 65, 85, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}
/* 分類彈窗專屬：輸入框增高與左右等大按鈕 */
.category-modal-input {
    width: 100% !important;
    height: 48px !important;
    padding: 0 16px !important;
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-size: 1rem !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}
.category-modal-input:focus {
    border-color: var(--line-green) !important;
    box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.25) !important;
}

.category-equal-footer {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
}

.btn-cat-footer-action {
    height: 46px !important;
    border-radius: 8px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    outline: none !important;
}

.btn-cat-cancel {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    color: #e2e8f0 !important;
}
.btn-cat-cancel:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
}

.btn-cat-confirm {
    background: var(--line-green) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(6, 199, 85, 0.35) !important;
}
.btn-cat-confirm:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-1px) !important;
}

/* 夾帶素材與前往名單整體設計 (上下左右充足留空，絕不貼邊) */
.action-btn-pill {
    min-height: 64px !important;
    border-radius: 12px !important;
    padding: 10px 18px !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    outline: none !important;
}

.upload-action-btn {
    background: rgba(30, 41, 59, 0.75) !important;
    border: 1px dashed rgba(56, 189, 248, 0.45) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
}
.upload-action-btn:hover {
    background: rgba(56, 189, 248, 0.12) !important;
    border-color: #38bdf8 !important;
    transform: translateY(-1px) !important;
}

.next-tab-action-btn {
    background: linear-gradient(135deg, #06c755, #05b04c) !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(6, 199, 85, 0.35) !important;
}
.next-tab-action-btn:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-1px) !important;
}

.action-btn-inner {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
}

.action-btn-emoji {
    font-size: 1.45rem !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

.action-btn-labels {
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    justify-content: center !important;
}

.action-btn-main {
    font-size: 0.96rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
}

.action-btn-sub {
    font-size: 0.76rem !important;
    color: #94a3b8 !important;
    line-height: 1.3 !important;
    margin-top: 3px !important;
    white-space: nowrap !important;
}
.next-tab-action-btn .action-btn-sub {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* 快速插入變數晶片按鈕 */
.var-insert-toolbar {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
}
.btn-var-chip {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    color: #38bdf8 !important;
    padding: 5px 11px !important;
    border-radius: 6px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    user-select: none !important;
}
.btn-var-chip:hover {
    background: rgba(56, 189, 248, 0.18) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}
.btn-var-rand {
    background: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
    color: #fbbf24 !important;
}
.btn-var-rand:hover {
    background: rgba(245, 158, 11, 0.22) !important;
    border-color: #fbbf24 !important;
    color: #ffffff !important;
}



/* ── 🔄 同步暱稱至 LINE 工具按鈕 ── */
.btn-tool-sync {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.45) !important;
    color: #10b981 !important;
}
.btn-tool-sync:hover {
    background: rgba(16, 185, 129, 0.28) !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.25) !important;
}

/* ── ⏰ 預約排程專區樣式 ── */
.schedules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.schedule-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.schedule-card:hover {
    border-color: #475569;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}
.schedule-card.status-running {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}
.schedule-card.status-completed {
    border-color: #10b981;
}
.schedule-card.status-cancelled {
    opacity: 0.65;
}

.schedule-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 10px;
}

.schedule-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.schedule-status-badge {
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
}
.badge-pending {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
}
.badge-running {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.5);
    animation: pulse 1.5s infinite;
}
.badge-completed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.badge-cancelled {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.4);
}
.badge-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.schedule-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.86rem;
    color: #cbd5e1;
    margin-bottom: 14px;
}

.sched-info-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.sched-info-label {
    color: #94a3b8;
    font-size: 0.8rem;
    min-width: 70px;
}
.sched-info-value {
    color: #f1f5f9;
    font-weight: 600;
}

.sched-tpl-preview-box {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.8rem;
    color: #94a3b8;
    max-height: 55px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.schedule-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(51, 65, 85, 0.7);
    padding-top: 12px;
    gap: 8px;
    flex-wrap: wrap;
}

.sched-btn-run {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #10b981;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.sched-btn-run:hover {
    background: #10b981;
    color: #ffffff;
}

.sched-btn-toggle {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid #475569;
    color: #cbd5e1;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}
.sched-btn-toggle:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: #94a3b8;
    color: #ffffff;
}

.sched-btn-del {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}
.sched-btn-del:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

/* 移動發送子模式選單標籤 */
.mode-subpill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
    padding: 6px 8px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1.4;
}
.mode-subpill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(6, 199, 85, 0.4);
}
.mode-subpill.active {
    background: linear-gradient(135deg, rgba(6, 199, 85, 0.28), rgba(16, 185, 129, 0.28));
    border-color: #06c755;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 8px rgba(6, 199, 85, 0.25);
}
.mode-subpill input[type="radio"] {
    display: none;
}


/* ═══════════════════════════════════════════════════════════════════
   🧹 好友清理管家樣式 (未讀檢測 / 批次隱藏 / 自動刪除)
   ═══════════════════════════════════════════════════════════════════ */
.btn-cleaner-action {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.btn-cleaner-action:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    filter: brightness(1.1);
}
.btn-cleaner-action:active:not(:disabled) {
    transform: translateY(0);
}
.copyable-name {
    transition: color 0.15s ease;
}
.copyable-name:hover {
    color: #38bdf8 !important;
}
.copyable-name:hover span:last-child {
    background: rgba(56, 189, 248, 0.3) !important;
    border-color: #38bdf8 !important;
}
#tbCleanerList tr {
    transition: background-color 0.15s ease;
}
#tbCleanerList tr:hover {
    background-color: rgba(255, 255, 255, 0.04) !important;
}
.copy-toast-pill {
    animation: toastFadeInOut 2s ease forwards;
}
@keyframes toastFadeInOut {
    0% { opacity: 0; transform: translate(-50%, 15px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    85% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* ── 📋 任務隊列樣式 ── */
.nav-tab-queue {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(99, 102, 241, 0.12));
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #c084fc;
    padding: 8px 10px;
    font-weight: 700;
}
.nav-tab-queue:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(99, 102, 241, 0.22));
    color: #fff;
    border-color: rgba(168, 85, 247, 0.7);
}
.nav-tab-queue.active {
    background: linear-gradient(135deg, #7e22ce, #6366f1) !important;
    border-color: #c084fc !important;
    box-shadow: 0 4px 18px rgba(168, 85, 247, 0.45) !important;
    color: #fff !important;
}
.queue-badge {
    background: #ec4899;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    display: inline-block;
}
.queue-task-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}
.queue-task-card.running {
    border-color: #10b981;
    background: rgba(6, 78, 59, 0.25);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}
.queue-task-card.completed {
    opacity: 0.75;
    border-color: #1e293b;
}
.queue-task-card.failed {
    border-color: #ef4444;
    background: rgba(127, 29, 29, 0.2);
}

.btn-queue-clean:hover {
    background: rgba(51, 65, 85, 0.95) !important;
    border-color: #94a3b8 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}
.btn-queue-clean:active {
    transform: translateY(0);
}


/* ── 左右拖曳寬度調整條 (Splitter Resizer - 極簡流暢防卡頓) ── */
.layout-resizer {
    width: 14px;
    margin: 0 -7px;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 25;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
}

.layout-resizer::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.3);
    transition: all 0.2s ease;
}

.layout-resizer:hover::before,
.layout-resizer.is-dragging::before {
    width: 4px;
    background: linear-gradient(180deg, #38bdf8 0%, #06c755 50%, #38bdf8 100%);
    box-shadow: 0 0 10px rgba(6, 199, 85, 0.8), 0 0 16px rgba(56, 189, 248, 0.7);
}

.resizer-handle {
    width: 18px;
    height: 48px;
    border-radius: 999px;
    background: linear-gradient(180deg, #1e293b, #0f172a);
    border: 1.5px solid #38bdf8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    font-size: 0.75rem;
    font-weight: 900;
    z-index: 2;
    transition: all 0.2s ease;
    pointer-events: none;
}

.layout-resizer:hover .resizer-handle,
.layout-resizer.is-dragging .resizer-handle {
    transform: scale(1.15);
    background: linear-gradient(180deg, #06c755, #047857);
    border-color: #a7f3d0;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(6, 199, 85, 0.95);
}

@media (max-width: 1024px) {
    .layout-resizer {
        display: none !important;
    }
}



/* ── ✨ 軟體特色頁籤樣式 ── */
.nav-tab-features {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(234, 88, 12, 0.14));
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #fbbf24;
    padding: 8px 10px;
    font-weight: 700;
}
.nav-tab-features:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(234, 88, 12, 0.25));
    color: #fff;
    border-color: rgba(251, 191, 36, 0.75);
}
.nav-tab-features.active {
    background: linear-gradient(135deg, #d97706, #ea580c) !important;
    border-color: #fbbf24 !important;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.45) !important;
    color: #fff !important;
}
.nav-tab-sysmon {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(59, 130, 246, 0.14));
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #38bdf8;
    padding: 8px 10px;
    font-weight: 700;
}
.nav-tab-sysmon:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(59, 130, 246, 0.25));
    color: #fff;
    border-color: rgba(56, 189, 248, 0.75);
}
.nav-tab-sysmon.active {
    background: linear-gradient(135deg, #0284c7, #2563eb) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 4px 18px rgba(14, 165, 233, 0.45) !important;
    color: #ffffff !important;
}

/* ══ 彈窗底部按鈕排版與深色取消按鈕修正 (防止 .primary-btn width:100% 擠壓取消鈕) ══ */
.modal-footer .primary-btn {
    width: auto !important;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-cancel {
    background: rgba(51, 65, 85, 0.85);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    padding: 9px 20px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: rgba(71, 85, 105, 1);
    color: #ffffff;
    border-color: rgba(148, 163, 184, 0.65);
    transform: translateY(-1px);
}


/* ══ 雙模連續多選（Shift 區間連選 & 滑鼠按住上下拖曳連選）視覺強化 ══ */
.contact-item {
    user-select: none;
    -webkit-user-select: none;
}

.contact-item.is-selected {
    background: rgba(6, 199, 85, 0.11);
    border-color: rgba(6, 199, 85, 0.38);
}

.contact-item.is-selected:hover {
    background: rgba(6, 199, 85, 0.18);
}

#tbCleanerList tr {
    user-select: none;
    -webkit-user-select: none;
}

/* ══ 全螢幕放大檢視與醒目關閉控制 ══ */
.modal-fullscreen-overlay {
    padding: 0 !important;
    background: rgba(2, 6, 23, 0.96) !important;
}

.modal-fullscreen-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
}

.btn-header-fullscreen {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(14, 165, 233, 0.35)) !important;
    border: 1px solid #38bdf8 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.btn-header-fullscreen:hover {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border-color: #7dd3fc !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.65);
}

.preview-zoom-tag {
    background: rgba(15, 23, 42, 0.88) !important;
    border: 1px solid rgba(56, 189, 248, 0.6) !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
    padding: 6px 12px !important;
    font-size: 0.84rem !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.floating-fs-close-btn {
    position: fixed;
    bottom: 68px;
    right: 24px;
    z-index: 10005;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    border: 2px solid #fecaca;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.65), 0 0 0 4px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.floating-fs-close-btn:hover {
    transform: scale(1.06);
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 8px 28px rgba(239, 68, 68, 0.9);
}

.modal-fullscreen-card:fullscreen,
.modal-fullscreen-card:-webkit-full-screen {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
}

.modal-fullscreen-card .modal-header {
    padding: 8px 18px !important;
    flex-shrink: 0 !important;
}

.modal-fullscreen-card .modal-body-zoom {
    flex: 1 !important;
    min-height: 0 !important;
    overflow: auto !important;
    background: #020617 !important;
    padding: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: zoom-out;
}

.modal-fullscreen-card .modal-body-zoom img {
    max-width: 99vw !important;
    max-height: calc(100vh - 56px) !important;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: zoom-in;
    transition: all 0.18s ease;
}

.modal-fullscreen-card:fullscreen .modal-body-zoom img,
.modal-fullscreen-card:-webkit-full-screen .modal-body-zoom img {
    max-width: 99vw !important;
    max-height: calc(100vh - 56px) !important;
}

.modal-fullscreen-card .modal-body-zoom img.is-actual-size {
    max-width: none !important;
    max-height: none !important;
    cursor: zoom-out;
}

.btn-fullscreen-close {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #ffffff !important;
    border: 1px solid #fca5a5 !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.45) !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.btn-fullscreen-close:hover {
    background: linear-gradient(135deg, #f87171, #ef4444) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.7) !important;
}

.img-thumb-wrap {
    cursor: zoom-in;
}

.img-thumb-wrap:hover {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

/* ── 表格欄位寬度自由拖曳調整 (Table Column Resizer & 防止斷行) ── */
.resizable-table {
    border-collapse: collapse;
}
.resizable-table th {
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}
.resizable-table td {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}
.th-col-resizer {
    position: absolute;
    top: 0;
    right: -6px;
    width: 14px;
    height: 100%;
    cursor: col-resize !important;
    user-select: none;
    -webkit-user-select: none;
    z-index: 25;
}
.th-col-resizer::after {
    content: "";
    position: absolute;
    top: 15%;
    bottom: 15%;
    left: 6px;
    width: 2px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.45);
    transition: all 0.2s ease;
}
.th-col-resizer:hover,
.th-col-resizer.is-resizing {
    background: rgba(56, 189, 248, 0.15);
}
.th-col-resizer:hover::after,
.th-col-resizer.is-resizing::after {
    background: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 1);
    width: 3px;
    top: 5%;
    bottom: 5%;
}


.btn-send-main-action.btn-query-unsent {
    background: rgba(245, 158, 11, 0.12) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    color: #fbbf24 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.25 !important;
    padding: 6px 4px !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    transition: all 0.2s !important;
}
.btn-send-main-action.btn-query-unsent:hover {
    background: rgba(245, 158, 11, 0.22) !important;
    border-color: rgba(245, 158, 11, 0.75) !important;
    color: #fde047 !important;
    transform: translateY(-1px) !important;
}
.btn-send-main-action.btn-query-unsent .hist-title {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}
.btn-send-main-action.btn-query-unsent .hist-sub {
    font-size: 0.80rem !important;
    font-weight: 600 !important;
    color: #fde68a !important;
    white-space: nowrap !important;
    margin-top: 1px !important;
}


/* ── 名單統計與彈窗查看組三大按鈕樣式與絕對置中對齊 ── */
.send-query-actions-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 8px !important;
    align-items: stretch !important;
    margin-bottom: 8px !important;
}

.btn-send-main-action.btn-query-unsent,
.btn-send-main-action.btn-history,
.btn-send-main-action.btn-fail-history {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1.25 !important;
    padding: 7px 4px !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    transition: all 0.2s !important;
}

.btn-send-main-action.btn-query-unsent {
    background: rgba(245, 158, 11, 0.12) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    color: #fbbf24 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
}
.btn-send-main-action.btn-query-unsent:hover {
    background: rgba(245, 158, 11, 0.22) !important;
    border-color: rgba(245, 158, 11, 0.75) !important;
    color: #fde047 !important;
    transform: translateY(-1px) !important;
}

.btn-send-main-action.btn-history {
    background: rgba(59, 130, 246, 0.12) !important;
    border: 1px solid rgba(59, 130, 246, 0.45) !important;
    color: #60a5fa !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
}
.btn-send-main-action.btn-history:hover {
    background: rgba(59, 130, 246, 0.22) !important;
    border-color: rgba(59, 130, 246, 0.75) !important;
    color: #93c5fd !important;
    transform: translateY(-1px) !important;
}

.btn-send-main-action.btn-fail-history {
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    color: #f87171 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
}
.btn-send-main-action.btn-fail-history:hover {
    background: rgba(239, 68, 68, 0.22) !important;
    border-color: rgba(239, 68, 68, 0.75) !important;
    color: #fca5a5 !important;
    transform: translateY(-1px) !important;
}

.btn-send-main-action.btn-query-unsent .hist-title,
.btn-send-main-action.btn-history .hist-title,
.btn-send-main-action.btn-fail-history .hist-title {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    margin: 0 auto !important;
}

.btn-send-main-action.btn-query-unsent .hist-sub,
.btn-send-main-action.btn-history .hist-sub,
.btn-send-main-action.btn-fail-history .hist-sub {
    font-size: 0.80rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    margin-top: 2px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.btn-send-main-action.btn-query-unsent .hist-sub {
    color: #fde68a !important;
}
.btn-send-main-action.btn-history .hist-sub {
    color: #93c5fd !important;
}
.btn-send-main-action.btn-fail-history .hist-sub {
    color: #fca5a5 !important;
}


/* 聯絡人單獨改名鉛筆按鈕 */
.btn-contact-rename {
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    padding: 2px 5px !important;
    font-size: 0.84rem !important;
    border-radius: 4px !important;
    transition: all 0.15s !important;
    opacity: 0.65 !important;
    margin-left: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}
.btn-contact-rename:hover {
    opacity: 1 !important;
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.18) !important;
    transform: scale(1.15) !important;
}


/* ── 🪟 全域彈窗自由拖曳樣式 ── */
.modal-header {
    cursor: grab !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}
.modal-header:active,
.modal-header.is-dragging,
.modal-card.is-dragging .modal-header {
    cursor: grabbing !important;
}
.modal-card.is-dragging {
    user-select: none !important;
    -webkit-user-select: none !important;
    transition: none !important;
}
.modal-header .modal-close-btn,
.modal-header button,
.modal-header input,
.modal-header select,
.modal-header a {
    cursor: pointer !important;
    user-select: auto;
}

.contact-avatar.openchat {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #fff !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4) !important;
}


/* ══════════════════════════════════════════════════════════════
   👑 頂部右上角 雙排黃金佈局 (Dual-Row Header Actions)
   充分運用垂直空間，完美呼應左側標題與平台描述
   ══════════════════════════════════════════════════════════════ */
.header-actions-dual {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 7px;
    flex-shrink: 0;
    margin-left: auto;
}

.header-row-top,
.header-row-bottom {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: nowrap;
}

/* ── 上排：使用者身分卡片 ── */
.user-identity-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0 10px;
    height: 28px;
    box-sizing: border-box;
    border-radius: 8px;
    white-space: nowrap;
}

.user-identity-card .user-avatar-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.user-identity-card .user-name-text {
    font-weight: 700;
    font-size: 0.82rem;
    color: #f8fafc;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-identity-card .user-role-badge {
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 700;
}

.user-identity-card .user-role-badge.badge-admin {
    background: rgba(234, 179, 8, 0.22);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.45);
}

.user-identity-card .user-role-badge.badge-user {
    background: rgba(56, 189, 248, 0.2);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.expiry-inline-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 7px;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(6, 199, 85, 0.14);
    border: 1px solid rgba(6, 199, 85, 0.4);
    color: #4ade80;
    margin-left: 2px;
    white-space: nowrap;
}

/* ── 上排：授權開卡後台 ── */
.btn-admin-header-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: 1px solid rgba(251, 191, 36, 0.6);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
    white-space: nowrap;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-admin-header-pill:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.55);
    transform: translateY(-1px);
    color: #ffffff;
}

/* ── 上排：登出按鈕 ── */
.btn-logout-header-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
    white-space: nowrap;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout-header-pill:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fee2e2;
    border-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* ── 下排：多LINE帳號管理精簡按鈕 ── */
.btn-multi-account-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #38bdf8;
    height: 28px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.btn-multi-account-compact:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #e0f2fe;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.btn-multi-account-compact .account-gear-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.btn-multi-account-compact .account-arrow-icon {
    font-size: 0.7rem;
    color: rgba(56, 189, 248, 0.8);
    margin-left: 2px;
}

/* ── 下排：LINE 額度膠囊 ── */
.pill-quota-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #7dd3fc;
    white-space: nowrap;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill-quota-badge:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    color: #ffffff;
}

/* ── 下排：操作紀錄膠囊 ── */
.pill-logs-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.45);
    color: #c7d2fe;
    white-space: nowrap;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill-logs-badge:hover {
    background: rgba(99, 102, 241, 0.32);
    border-color: #a5b4fc;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}


/* ══ 帳號工作階段卡片：身分 + 登出 合為一組 ══ */
.user-session-card {
    display: inline-flex;
    align-items: center;
    gap: 0;
    height: 30px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    overflow: hidden;
    white-space: nowrap;
}
.session-identity {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 100%;
}
.session-identity .user-avatar-icon { font-size: 0.85rem; line-height: 1; }
.session-identity .user-name-text {
    font-weight: 700;
    font-size: 0.82rem;
    color: #f8fafc;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.session-identity .user-role-badge {
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 700;
}
.session-divider {
    width: 1px;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.14);
}
.session-logout-btn {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0 12px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    cursor: pointer;
    transition: all 0.2s ease;
}
.session-logout-btn:hover {
    background: rgba(239, 68, 68, 0.32);
    color: #fff;
}
.header-row-bottom .header-divider {
    height: 20px;
    margin: 0 2px;
}


/* ── 🪙 發送點數膠囊 ── */
.pill-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 800;
    background: rgba(250, 204, 21, 0.14);
    border: 1px solid rgba(250, 204, 21, 0.45);
    color: #fde047;
    white-space: nowrap;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pill-points-badge:hover { background: rgba(250, 204, 21, 0.26); color: #fff; }
.pill-points-badge.is-low { background: rgba(245, 158, 11, 0.22); border-color: rgba(245, 158, 11, 0.7); color: #fbbf24; }
.pill-points-badge.is-empty { background: rgba(239, 68, 68, 0.22); border-color: rgba(239, 68, 68, 0.7); color: #fca5a5; }
