/* ==========================================================================
   CPA Auto Refresher & Inspector Pro - Ultra Modern Cyber Glassmorphism UI
   Design Inspired by Linear, Vercel, Raycast & Supabase Dark Modern Systems
   ========================================================================== */

:root {
    /* 核心背景与层级色彩 */
    --bg-main: #070a12;
    --bg-grid: rgba(255, 255, 255, 0.025);
    --bg-card: rgba(13, 19, 32, 0.75);
    --bg-card-hover: rgba(20, 29, 48, 0.88);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-card-border-hover: rgba(99, 102, 241, 0.4);
    --bg-card-inner: rgba(8, 12, 21, 0.65);
    
    --bg-input: rgba(10, 15, 26, 0.85);
    --bg-input-border: rgba(255, 255, 255, 0.1);
    --bg-input-focus: rgba(15, 23, 42, 0.95);
    
    /* 核心主题色彩体系 */
    --primary: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --primary-light: rgba(99, 102, 241, 0.14);
    
    --success: #10b981;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --success-glow: rgba(16, 185, 129, 0.3);
    --success-light: rgba(16, 185, 129, 0.14);
    
    --danger: #f43f5e;
    --danger-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    --danger-hover: #e11d48;
    --danger-glow: rgba(244, 63, 94, 0.3);
    --danger-light: rgba(244, 63, 94, 0.14);
    
    --warning: #f59e0b;
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --warning-light: rgba(245, 158, 11, 0.14);
    
    --cyan: #06b6d4;
    --blue: #38bdf8;
    --purple: #a855f7;
    
    /* 文字色彩 */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;
    
    /* 圆角与阴影体系 */
    --radius-2xl: 22px;
    --radius-xl: 16px;
    --radius-lg: 12px;
    --radius-md: 9px;
    --radius-sm: 6px;
    
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, 'Fira Code', monospace;
    
    --shadow-card: 0 16px 40px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--bg-card-border);
    --shadow-card-hover: 0 24px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--bg-card-border-hover);
    --shadow-glow-primary: 0 0 24px var(--primary-glow);
}

/* ==================== 全局重置与背景 ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 0%, rgba(99, 102, 241, 0.16) 0%, transparent 42%),
        radial-gradient(circle at 90% 15%, rgba(6, 182, 212, 0.12) 0%, transparent 38%),
        radial-gradient(circle at 50% 100%, rgba(16, 185, 129, 0.09) 0%, transparent 45%),
        linear-gradient(var(--bg-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 32px 32px, 32px 32px;
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 自定义极简透明滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.app-layout {
    max-width: 1420px;
    margin: 0 auto;
    padding: 24px 32px 56px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    transition: filter 0.3s ease;
}

/* ==================== 顶部浮动毛玻璃导航栏 ==================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(20px) saturate(180%);
    position: relative;
    z-index: 50;
    transition: all 0.3s ease;
}

.navbar:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 50%, #10b981 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 18px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.brand-logo::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, transparent 60%);
}

.brand-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-title-wrap h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg, #ffffff 30%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tag {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(56, 189, 248, 0.2) 100%);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.4);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.brand-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cpa-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 15, 26, 0.85);
    border: 1px solid var(--bg-card-border);
    padding: 7px 15px;
    border-radius: 30px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.cpa-status-pill.connected {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.09);
    color: #34d399;
}

.cpa-status-pill.connected .status-dot {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.cpa-status-pill.error {
    border-color: rgba(244, 63, 94, 0.4);
    background: rgba(244, 63, 94, 0.09);
    color: #fb7185;
}

.cpa-status-pill.error .status-dot {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    display: inline-block;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.user-menu-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==================== 现代胶囊分段导航 (Segmented Tabs) ==================== */
.main-tabs {
    display: flex;
    gap: 6px;
    background: rgba(10, 16, 28, 0.75);
    padding: 5px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: blur(16px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06);
}

.tab-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.tab-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-item.active {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tab-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: tabFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ==================== 数据统计卡片 (Metric Cards) ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-xl);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow-card-hover);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-card-alert {
    border-color: rgba(244, 63, 94, 0.35);
    background: linear-gradient(180deg, rgba(244, 63, 94, 0.08) 0%, rgba(13, 19, 32, 0.72) 100%);
}
.stat-card-alert:hover {
    border-color: rgba(244, 63, 94, 0.6);
    box-shadow: 0 20px 40px -10px rgba(244, 63, 94, 0.25);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.stat-icon-primary { background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(56, 189, 248, 0.15) 100%); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.stat-icon-success { background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.15) 100%); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.stat-icon-danger { background: linear-gradient(135deg, rgba(244, 63, 94, 0.25) 0%, rgba(225, 29, 72, 0.15) 100%); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.stat-icon-muted { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid rgba(255, 255, 255, 0.08); }

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-number-wrap {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-mono);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.stat-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.text-success { color: #34d399 !important; }
.text-danger { color: #fb7185 !important; }
.text-muted { color: var(--text-muted) !important; }

/* ==================== 通用卡片容器 ==================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(20px) saturate(180%);
    overflow: hidden;
    position: relative;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 26px;
    border-bottom: 1px solid var(--bg-card-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-icon-tag {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.card-title-group h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.card-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.card-actions-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 26px;
}

/* ==================== 表格与列表样式 ==================== */
.search-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.search-input-wrap .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 3;
}

.search-input-wrap input[type="text"],
.search-input-wrap input {
    background: var(--bg-input);
    border: 1px solid var(--bg-input-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 8px 14px 8px 36px !important;
    font-size: 0.84rem;
    width: 220px;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-wrap input[type="text"]:focus,
.search-input-wrap input:focus {
    border-color: var(--primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
    width: 280px;
}

.table-container {
    max-height: 520px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    text-align: left;
}

.data-table th {
    background: rgba(10, 15, 26, 0.95);
    padding: 14px 24px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--bg-card-border);
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(10px);
}

.data-table td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    transition: background 0.15s ease;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover td {
    background: var(--bg-card-hover);
}

.account-email {
    font-family: var(--font-mono);
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: -0.01em;
}

.account-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.type-outlook {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.35);
}

.type-proton {
    background: rgba(139, 92, 246, 0.18);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.type-domain {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.type-gmail {
    background: rgba(148, 163, 184, 0.12) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
}

.empty-state {
    text-align: center;
    padding: 56px 24px !important;
    color: var(--text-muted);
}

.empty-icon-wrap {
    margin-bottom: 12px;
    color: #334155;
}

/* ==================== macOS 风格代码控制台终端 ==================== */
.terminal-card {
    background: #05080f;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dots {
    display: flex;
    gap: 7px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
}
.dot-red { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
.dot-yellow { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.dot-green { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }

.terminal-live-badge {
    font-size: 0.76rem;
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: radarPulse 2s infinite;
}

@keyframes radarPulse {
    0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.terminal-body {
    background: #03050a;
    padding: 18px 22px;
    height: 260px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.65;
    color: #cbd5e1;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.log-line {
    word-break: break-all;
    white-space: pre-wrap;
    margin-bottom: 3px;
    transition: color 0.15s ease;
}

.log-system { color: #60a5fa; }
.log-success { color: #34d399; }
.log-error { color: #f87171; }
.log-warn { color: #fbbf24; }

/* ==================== 表单系统与输入控件 ==================== */
.settings-grid-layout, .data-grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="time"],
input[type="date"],
select.form-select,
textarea,
textarea.form-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--bg-input-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 11px 15px;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    resize: vertical;
    color-scheme: dark;
}

input[type="time"] {
    background: var(--bg-input) !important;
    border: 1px solid var(--bg-input-border) !important;
    color: #818cf8 !important;
    font-family: var(--font-mono) !important;
    font-weight: 600 !important;
}

input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8) sepia(1) hue-rotate(200deg);
    cursor: pointer;
    opacity: 0.85;
}

textarea#proxyListInput {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    min-height: 110px;
}

input:focus, select.form-select:focus, textarea:focus, textarea.form-textarea:focus {
    border-color: var(--primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea::placeholder, input::placeholder {
    color: #475569;
}

.input-with-action {
    display: flex;
    position: relative;
    align-items: center;
}

.input-with-action input {
    padding-right: 42px;
}

.input-with-action button {
    position: absolute;
    right: 6px;
    padding: 6px;
    color: var(--text-muted);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.checkbox-group {
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* ==================== 现代按钮系统 (Modern Buttons) ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
    position: relative;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.08);
}
.btn-ghost:hover:not(:disabled) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

.btn-danger {
    background: var(--danger-gradient);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--danger-glow);
}
.btn-danger:hover:not(:disabled) {
    box-shadow: 0 6px 20px var(--danger-glow);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-gradient);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--success-glow);
}
.btn-success:hover:not(:disabled) {
    box-shadow: 0 6px 20px var(--success-glow);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 13px 26px;
    font-size: 0.95rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

.btn-icon-only {
    padding: 8px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}
.btn-icon-only:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 登录页与全屏遮罩 ==================== */
.auth-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(4, 7, 13, 0.88);
    backdrop-filter: blur(28px) saturate(180%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: rgba(13, 19, 32, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 440px;
    padding: 38px 34px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(99, 102, 241, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 20%; right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #6366f1, #38bdf8, transparent);
}

.login-logo {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 50%, #10b981 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 8px 24px var(--primary-glow);
    margin-bottom: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 26px;
}

.login-header h2 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.login-form {
    width: 100%;
}

.login-error {
    color: #fb7185;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 0.82rem;
    margin-bottom: 16px;
    display: none;
    text-align: center;
}

/* ==================== 弹窗 Modal 系统 ==================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(3, 6, 12, 0.82);
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: rgba(13, 19, 32, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: modalSlideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(16px) scale(0.97); }
    to { transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--bg-card-border);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.modal-subtitle {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--bg-card-border);
    background: rgba(255, 255, 255, 0.015);
}

/* 截图画廊弹窗专属 */
.modal-gallery {
    max-width: 1180px;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.gallery-body {
    display: flex;
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.gallery-sidebar {
    width: 340px;
    border-right: 1px solid var(--bg-card-border);
    display: flex;
    flex-direction: column;
    background: rgba(8, 12, 21, 0.5);
}

.gallery-filter-bar {
    padding: 14px 16px;
    border-bottom: 1px solid var(--bg-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.gallery-count-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.gallery-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==================== 诊断截图画廊缩略图卡片系统 (防压缩高质感列表) ==================== */
.gallery-thumb-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 12px !important;
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: var(--radius-lg) !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    user-select: none !important;
    flex-shrink: 0 !important;
    min-height: 78px !important;
    box-sizing: border-box !important;
}

.gallery-thumb-card:hover {
    background: rgba(30, 41, 59, 0.85) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    transform: translateX(2px) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

.gallery-thumb-card.active {
    background: rgba(99, 102, 241, 0.18) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.3) !important;
}

.gallery-thumb-img-wrap {
    width: 90px !important;
    height: 60px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #090d16 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.gallery-thumb-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
    background: #1e293b !important;
}

.gallery-thumb-info {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    overflow: hidden !important;
}

.gallery-thumb-account {
    font-family: var(--font-mono) !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: #f8fafc !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.gallery-thumb-badge {
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    max-width: 100% !important;
}

.gallery-thumb-time {
    font-size: 0.72rem !important;
    color: #64748b !important;
    font-family: var(--font-mono) !important;
}

.gallery-preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #04060c;
}

.gallery-main-view {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.gallery-active-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.gallery-footer-bar {
    padding: 14px 24px;
    border-top: 1px solid var(--bg-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 15, 26, 0.8);
}

.gallery-tag {
    font-size: 0.76rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.gallery-tag-account { background: rgba(99, 102, 241, 0.15); color: #818cf8; font-family: var(--font-mono); }
.gallery-tag-stage { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.gallery-meta-time { font-size: 0.76rem; color: var(--text-muted); margin-left: 8px; }

/* ==================== 调度模式胶囊 Tab 按钮与多选胶囊 (暗黑极客主题 & 完美网格对齐) ==================== */
#scheduleModeTabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    background: rgba(15, 23, 42, 0.6);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.schedule-mode-btn {
    width: 100%;
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    padding: 8px 6px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
}

.schedule-mode-btn:hover {
    background: rgba(51, 65, 85, 0.8) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    transform: translateY(-1px);
}

.schedule-mode-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%) !important;
    border-color: rgba(99, 102, 241, 0.6) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important;
}

/* 多时段 5 列等宽对齐 */
#multiTimeSelector {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
}

/* 每周 7 天等宽对齐 */
#weekdaySelector {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 6px !important;
    margin-bottom: 12px !important;
}

.weekday-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 7px 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    text-align: center;
    width: 100%;
}

.weekday-pill:hover {
    background: rgba(51, 65, 85, 0.7);
    border-color: rgba(99, 102, 241, 0.4);
    color: #ffffff;
}

.weekday-pill:has(input:checked) {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.65);
    color: #a5b4fc;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.weekday-pill input[type="checkbox"] {
    accent-color: #6366f1;
}

.schedule-subpanel {
    background: rgba(15, 23, 42, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: var(--radius-md) !important;
    padding: 14px 16px !important;
}

/* ==================== 账号池文件卡片 (File Cards Layout) ==================== */
.file-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.file-item-card:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.file-item-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.file-item-name {
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #f8fafc;
}

.file-item-status {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.file-upload-btn {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}


/* ==================== 自动化巡检与自愈流水线表格深度美化 (宽裕呼吸感) ==================== */
.pipeline-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
}

.pipeline-table th {
    padding: 14px 20px !important;
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(8px);
}

.pipeline-table td {
    padding: 18px 20px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: transparent !important;
    transition: background 0.15s ease !important;
}

.pipeline-table tbody tr {
    transition: background 0.15s ease;
}

.pipeline-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03) !important;
}

.pipeline-time-title {
    font-family: var(--font-mono);
    font-size: 0.86rem;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

.pipeline-time-sub {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pipeline-metric-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pipeline-metric-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.pipeline-metric-bar {
    height: 5px;
    width: 110px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex;
}

.pipeline-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ==================== 响应式适配 ==================== */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .settings-grid-layout, .data-grid-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-layout {
        padding: 16px;
    }
    .navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .nav-actions {
        justify-content: space-between;
    }
    .main-tabs {
        overflow-x: auto;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}


