/* 全屏拓宽 Filament 所有原生表格与页面容器，消除水平拖动条 */
html body .fi-main-ctn, 
html body .fi-page, 
html body .fi-main, 
html body .fi-content,
html body .fi-resource-page,
html body .fi-resource-index-page,
html body .fi-resource-list-records-page,
html body .fi-ta-content,
html body .fi-ta-ctn {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

/* 紧凑化原生 Filament 表格单元格间距，确保一屏全显示不卡死拖动 */
html body table.fi-ta-table th, 
html body table.fi-ta-table td {
    padding-left: 6px !important;
    padding-right: 6px !important;
    font-size: 12.5px !important;
    white-space: nowrap !important;
}

.batch-page-container {
    font-family: inherit;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* Stats Grid */
.batch-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 1024px) { .batch-stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .batch-stats-grid { grid-template-columns: 1fr; } }

.batch-stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box !important;
    max-width: 100% !important;
}
.dark .batch-stat-card { background: #1e293b; border-color: #334155; }

.batch-stat-title { font-size: 12px; color: #64748b; font-weight: 600; }
.dark .batch-stat-title { color: #94a3b8; }

.batch-stat-value { font-size: 22px; font-weight: 700; color: #0f172a; margin-top: 4px; }
.dark .batch-stat-value { color: #f8fafc; }

.batch-stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* Main Layout */
.batch-main-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    width: 100% !important;
    max-width: 100% !important;
}
@media (max-width: 1024px) { .batch-main-grid { grid-template-columns: 1fr; } }

/* Card */
.batch-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}
.dark .batch-card { background: #1e293b; border-color: #334155; }

.batch-card-title {
    font-size: 15px; font-weight: 700; color: #0f172a;
    margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.dark .batch-card-title { color: #f8fafc; }

/* Form */
.batch-form-group { margin-bottom: 16px; }

.batch-label {
    display: block; font-size: 13px; font-weight: 600;
    color: #334155; margin-bottom: 6px;
}
.dark .batch-label { color: #cbd5e1; }

.batch-input, .batch-textarea {
    width: 100%; box-sizing: border-box;
    padding: 10px 14px; border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff; color: #0f172a;
    font-size: 14px; outline: none;
    transition: all 0.2s;
}
.dark .batch-input, .dark .batch-textarea {
    background: #0f172a; border-color: #334155; color: #f8fafc;
}
.batch-input:focus, .batch-textarea:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

/* Sub Tabs */
.batch-subtabs {
    display: flex; gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}
.dark .batch-subtabs { border-bottom-color: #334155; }

.batch-subtab-btn {
    padding: 8px 18px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border: 1px solid transparent !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    line-height: 1.4 !important;
    display: inline-flex !important;
    align-items: center !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}
.batch-subtab-btn.active {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border-color: transparent !important;
}
.batch-subtab-btn:not(.active) {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}
.batch-subtab-btn:not(.active):hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

/* Table */
.batch-table-wrapper, .data-table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
    background: #ffffff !important;
}
.dark .batch-table-wrapper, .dark .data-table-wrapper {
    border-color: #334155 !important;
    background: #1e293b !important;
}

.batch-table, .data-table, .table-custom {
    width: 100% !important;
    min-width: 640px !important;
    border-collapse: collapse !important;
}

.batch-table th, .data-table th, .table-custom th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    padding: 12px 16px !important;
    text-align: center !important;
    white-space: nowrap !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
.dark .batch-table th, .dark .data-table th, .dark .table-custom th {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border-bottom-color: #334155 !important;
}

.batch-table td, .data-table td, .table-custom td {
    padding: 12px 16px !important;
    text-align: center !important;
    white-space: nowrap !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 13px !important;
    color: #0f172a !important;
    transition: background 0.15s ease !important;
}
.dark .batch-table td, .dark .data-table td, .dark .table-custom td {
    border-bottom-color: #334155 !important;
    color: #f8fafc !important;
}

.batch-table tbody tr:hover, .data-table tbody tr:hover, .table-custom tbody tr:hover {
    background: #f8fafc !important;
}
.dark .batch-table tbody tr:hover, .dark .data-table tbody tr:hover, .dark .table-custom tbody tr:hover {
    background: #0f172a !important;
}

.batch-sms-input {
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    text-align: center !important;
    outline: none !important;
    transition: all 0.15s ease !important;
}
.batch-sms-input:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15) !important;
}



/* Terminal */
.terminal-box {
    background: #0f172a; border-radius: 12px;
    padding: 16px; font-family: monospace; font-size: 12px;
    color: #f8fafc; height: 380px; overflow-y: auto; overflow-x: hidden;
    border: 1px solid #1e293b; word-break: break-all; overflow-wrap: anywhere;
}
.log-line   { margin-bottom: 6px; line-height: 1.4; word-break: break-all; overflow-wrap: anywhere; white-space: normal; }
.log-time   { color: #64748b; margin-right: 6px; }
.log-type-info    { color: #38bdf8; }
.log-type-success { color: #4ade80; }
.log-type-warn    { color: #facc15; }
.log-type-error   { color: #f87171; }
.log-type-debug   { color: #a78bfa; }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(15,23,42,0.6); backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex; align-items: center; justify-content: center;
}
.modal-card {
    background: #ffffff; border-radius: 14px;
    width: 90%; max-width: 480px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    overflow: hidden; border: 1px solid #e2e8f0;
}
.dark .modal-card { background: #1e293b; border-color: #334155; }
.modal-header {
    padding: 16px 20px; border-bottom: 1px solid #e2e8f0;
    display: flex; justify-content: space-between; align-items: center;
}
.dark .modal-header { border-bottom-color: #334155; }
.modal-header h4 { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0; }
.dark .modal-header h4 { color: #f8fafc; }
.modal-close-btn { background: none; border: none; font-size: 20px; color: #94a3b8; cursor: pointer; }
.modal-body { padding: 20px; }

/* Toast */
#toastContainer {
    position: fixed; top: 20px; right: 20px;
    z-index: 999999;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none; max-width: 420px;
    width: calc(100vw - 40px);
}
.filament-toast {
    pointer-events: auto; background: #ffffff;
    border-radius: 10px; padding: 14px 18px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    display: flex; align-items: flex-start; gap: 12px;
    border: 1px solid #e2e8f0;
}
.filament-toast.toast-warning { border-color: #e2e8f0; }
.filament-toast.toast-error   { border-color: #e2e8f0; }
.filament-toast.toast-success { border-color: #e2e8f0; }
.filament-toast.toast-info    { border-color: #e2e8f0; }

.toast-icon    { font-size: 1.15rem; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title   { font-weight: 600; font-size: 0.9rem; color: #0f172a; }
.toast-msg     { font-size: 0.85rem; color: #475569; margin-top: 2px; }
.toast-close   { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 1.1rem; }

/* Buttons */
.batch-btn-primary, .batch-btn-secondary, .batch-btn-danger, .batch-btn-amber {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    line-height: 1.4 !important;
    outline: none !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

.batch-btn-primary {
    padding: 10px 20px !important;
    font-size: 14px !important;
    border: none !important;
    background: #4f46e5 !important;
    color: #ffffff !important;
}
.batch-btn-primary:hover    { background: #4338ca !important; transform: translateY(-1px) !important; box-shadow: 0 4px 12px rgba(79,70,229,0.3) !important; }
.batch-btn-primary:disabled { opacity: 0.6 !important; cursor: not-allowed !important; transform: none !important; }

.batch-btn-secondary {
    padding: 10px 20px !important;
    font-size: 14px !important;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    color: #475569 !important;
}
.batch-btn-secondary:hover { background: #f1f5f9 !important; }

.batch-btn-danger {
    padding: 8px 16px !important;
    font-size: 13px !important;
    border: none !important;
    background: #fef2f2 !important;
    color: #ef4444 !important;
}
.batch-btn-danger:hover { background: #fee2e2 !important; }

.batch-btn-amber {
    padding: 10px 20px !important;
    font-size: 14px !important;
    border: none !important;
    background: #fffbeb !important;
    color: #d97706 !important;
}
.batch-btn-amber:hover { background: #fef3c7 !important; }

/* Button group */
.batch-btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* Status badges */
.batch-status-badge {
    display: inline-flex; align-items: center;
    gap: 4px; padding: 3px 10px;
    border-radius: 99px; font-size: 11px; font-weight: 600;
}
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-running { background: #dbeafe; color: #1e40af; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-error   { background: #fee2e2; color: #b91c1c; }
.badge-queried { background: #ede9fe; color: #6d28d9; }

/* WS status badge in stats grid */
.ws-badge-connected {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 3px 10px !important;
    border-radius: 99px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    background: #ecfdf5 !important;
    color: #059669 !important;
    border: 1px solid #a7f3d0 !important;
    margin-top: 6px !important;
}

.ws-badge-disconnected {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 3px 10px !important;
    border-radius: 99px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
    margin-top: 6px !important;
}

.ws-pulse-green {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
    display: inline-block;
}

.ws-pulse-red {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
    display: inline-block;
}

/* Custom Table Action Buttons & Badges */
.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    outline: none !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

.btn-primary {
    background: #4f46e5 !important;
    color: #ffffff !important;
}
.btn-primary:hover {
    background: #4338ca !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25) !important;
}

.btn-accent {
    background: #0284c7 !important;
    color: #ffffff !important;
}
.btn-accent:hover {
    background: #0369a1 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25) !important;
}

.btn-secondary {
    background: #f8fafc !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}
.btn-secondary:hover {
    background: #f1f5f9 !important;
}

.badge-status {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    height: 24px !important;
    line-height: 1 !important;
    padding: 0 7px;
    border-radius: 99px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}
.badge-status.queried {
    background: #fef9c3 !important;
    color: #854d0e !important;
    border: 1px solid #fef08a !important;
}
.badge-status.done {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important;
}

.inline-flex    { display: inline-flex; }
.items-center   { align-items: center; }
.rounded-full   { border-radius: 99px; }
.text-xs        { font-size: 12px; }
.font-medium    { font-weight: 500; }
.bg-red-100     { background: #fee2e2; }
.text-red-700   { color: #b91c1c; }
.mt-1           { margin-top: 4px; }
.text-right     { text-align: right; }
.text-sm        { font-size: 13px; }
.text-gray-400  { color: #94a3b8; }
.font-mono      { font-family: monospace; }

/* =========================================================
   全站 <a> 标签下划线全局清除 (Remove link underlines site-wide)
   ========================================================= */
a,
a *,
a:hover,
a:hover *,
a:focus,
a:focus *,
a:active,
a:visited,
.fi-link,
.fi-link *,
.fi-link:hover,
.fi-link:hover *,
.fi-ta-action,
.fi-ta-action *,
.fi-ta-action:hover,
.fi-ta-action:hover * {
    text-decoration: none !important;
    text-decoration-line: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* =========================================================
   自适应响应式媒体查询 (Mobile, Tablet & Small Screen Responsiveness)
   ========================================================= */
@media (max-width: 1024px) {
    .batch-main-grid {
        grid-template-columns: 1fr !important;
    }
    .terminal-box {
        height: 320px !important;
    }
}

@media (max-width: 768px) {
    .batch-card {
        padding: 16px !important;
        border-radius: 12px !important;
    }
    .batch-subtabs {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .batch-btn-group {
        flex-direction: column !important;
    }
    .batch-btn-primary, .batch-btn-secondary, .batch-btn-amber {
        width: 100% !important;
    }
    .modal-card {
        width: calc(100vw - 24px) !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
}

@media (max-width: 640px) {
    .batch-subtabs {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .batch-subtab-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    #phoneStepA > div:first-child {
        grid-template-columns: 1fr !important;
    }
}

/* 验证码录入框加深加粗样式 */
.batch-row-sms-input {
    border: 2px solid #4f46e5 !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    font-weight: 800 !important;
    font-size: 13.5px !important;
    box-shadow: 0 1px 3px rgba(79,70,229,0.15) !important;
    transition: all 0.2s ease-in-out !important;
}
.batch-row-sms-input:focus {
    border-color: #3730a3 !important;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.3) !important;
    background-color: #f8fafc !important;
}
.batch-row-sms-input::placeholder {
    color: #475569 !important;
    font-weight: 700 !important;
    font-size: 12.5px !important;
    opacity: 0.95 !important;
}




