:root {
    --bg: #f4f6f9;
    --bg-white: #ffffff;
    --card: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text: #1e293b;
    --muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: #eff6ff;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
}

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

body {
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    background: var(--bg-white);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* —— 登录页 —— */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, #f0f4ff 0%, #f8fafc 50%, #ffffff 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
    box-shadow: var(--shadow-md);
}

.login-card h1 { font-size: 1.5rem; margin-bottom: 8px; color: var(--text); }
.subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }

form label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin: 12px 0 6px;
    font-weight: 500;
}

form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text);
    font-size: 1rem;
}

form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

#error, .error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 12px;
}

#login-btn {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

#login-btn:hover { background: var(--accent-hover); }
#login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* —— 布局 —— */
.layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    width: 232px;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    box-shadow: var(--shadow-sm);
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
    padding: 0 20px 28px;
    color: var(--accent);
    letter-spacing: 0.02em;
}

.nav-item {
    display: block;
    padding: 10px 20px;
    margin: 2px 12px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
}

.nav-item:hover:not(.disabled) {
    background: var(--border-light);
    color: var(--text);
}

.nav-item.active {
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 500;
}

.nav-item.disabled { opacity: 0.45; pointer-events: none; }

.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--muted);
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    margin-left: 6px;
    padding: 0;
    font-size: 0.85rem;
}

.link-btn:hover { text-decoration: underline; }

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    min-width: 0;
}

.topbar {
    padding: 18px 28px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.badge {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 999px;
    background: #ecfdf5;
    color: var(--success);
    border: 1px solid #bbf7d0;
    font-weight: 500;
}

.badge.offline {
    background: #fef2f2;
    color: var(--danger);
    border-color: #fecaca;
}

.panel {
    padding: 24px 28px 32px;
    flex: 1;
    background: var(--bg);
}

/* —— 卡片与统计 —— */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.card h4 { font-size: 0.9rem; margin-bottom: 8px; color: var(--text); }
.card .status { font-size: 0.8rem; color: var(--muted); }
.card .status.pending::before { content: "○ "; color: var(--warning); }
.card .status.ready { color: var(--success); }
.card .status.ready::before { content: "● "; }

.info-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.info-box h3 { margin-bottom: 12px; font-size: 1rem; }
.info-box pre {
    font-size: 0.85rem;
    color: var(--muted);
    white-space: pre-wrap;
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 22px;
    min-width: 110px;
    box-shadow: var(--shadow-sm);
}

.stat-num {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

/* —— 数据分析（手动查询） —— */
.analytics-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    margin-bottom: 16px;
}

.analytics-title {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.analytics-hint {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
    max-width: 520px;
}

.analytics-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.analytics-date-label {
    font-size: 0.88rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.analytics-date-input {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
}

.analytics-section {
    padding: 18px 20px;
    margin-bottom: 16px;
}

.analytics-section-title {
    margin: 0 0 14px;
    font-size: 1rem;
    color: var(--text);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.analytics-cell {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

.analytics-cell.accent .analytics-num {
    color: #0d6efd;
}

.analytics-cell.muted .analytics-num {
    color: var(--muted);
    font-size: 1.2rem;
}

.analytics-num {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.analytics-label {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--muted);
}

.analytics-foot {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 24px;
}

/* —— 表单区 —— */
.form-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.form-box h4 {
    margin-bottom: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.form-grid input,
.form-grid select,
.form-box textarea,
.full-width {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text);
    font-size: 0.9rem;
}

.form-grid input:focus,
.form-grid select:focus,
.form-box textarea:focus,
.full-width:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-box textarea {
    margin-bottom: 10px;
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
}

.full-width { margin-bottom: 10px; }

.hint {
    margin-top: 10px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}

.hint code {
    font-size: 0.78rem;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #475569;
    border: 1px solid var(--border-light);
}

.highlight-box { border-color: #93c5fd; background: #f8fafc; }

.mode-switch label {
    display: block;
    margin: 10px 0;
    cursor: pointer;
    color: var(--text);
}

.prov-list {
    list-style: none;
    margin-top: 12px;
    font-size: 13px;
    color: var(--muted);
}

.prov-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

/* —— 按钮 —— */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-primary,
.btn-secondary {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
}

.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-secondary {
    background: var(--bg-white);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-danger.btn-secondary {
    color: var(--danger);
    border-color: #fecaca;
}

.btn-danger.btn-secondary:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.btn-primary:disabled,
.btn-primary.is-busy,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.proxy-forms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 900px) {
    .proxy-forms { grid-template-columns: 1fr; }
}

/* —— 消息 —— */
.msg {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.msg.ok {
    background: #ecfdf5;
    color: #166534;
    border-color: #bbf7d0;
}

.msg.warn {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.msg.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* —— 表格 —— */
.table-wrap {
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th,
.data-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: #f8fafc;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: none;
    white-space: nowrap;
}

.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* —— 账号管理 —— */
.alert-banner {
    background: var(--accent-soft);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #1e40af;
}

.alert-banner strong { color: #1e3a8a; }

.info-strip {
    margin-top: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

.info-strip strong { color: var(--text); }

.tag-demo {
    float: right;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 6px;
    background: #fffbeb;
    color: var(--warning);
    border: 1px solid #fde68a;
    font-weight: 500;
}

.acc-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1100px) {
    .acc-layout { grid-template-columns: 1fr; }
}

.acc-import-panel .format-tree {
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--muted);
    overflow-x: auto;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 10px;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: #eff6ff;
}

.drop-zone p { margin: 0; font-size: 0.9rem; color: var(--muted); }

.file-picked {
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 10px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin: 12px 0;
    color: var(--muted);
}

.acc-import-panel .btn-primary,
.acc-import-panel .btn-secondary {
    width: 100%;
    margin-top: 6px;
}

.acc-actions { white-space: nowrap; }

.agent-select-toolbar,
.agent-select-row {
    max-width: 140px;
    font-size: 0.85rem;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.agent-col { min-width: 120px; }

.acc-stats-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 12px;
}

.acc-stats-wrap .stats-row {
    flex: 1 1 480px;
    margin-bottom: 0;
}

.tier-summary-row {
    display: flex;
    gap: 10px;
    flex: 1 1 280px;
    align-items: stretch;
}

.tier-card {
    flex: 1;
    min-width: 88px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: var(--bg-white);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.tier-card.active {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.tier-card.tier-vip {
    border-color: #fbbf24;
    background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
}

.tier-card.tier-vip.active {
    border-color: #d97706;
}

.tier-card.tier-regular.active {
    border-color: #64748b;
}

.tier-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.tier-label {
    font-size: 0.8rem;
    color: var(--muted);
}

.tier-drop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 10px 0;
}

.drop-zone-vip {
    border-color: #fcd34d;
    background: #fffbeb;
}

.drop-zone-regular {
    border-color: #cbd5e1;
}

.drop-zone.has-file {
    border-style: solid;
    border-width: 2px;
}

.tier-drop-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.drop-zone-vip .tier-drop-title {
    color: #b45309;
}

.format-tree-sm {
    font-size: 0.75rem;
    margin: 0 0 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    margin-top: 8px;
    width: 100%;
}

.tier-select-row {
    max-width: 100px;
    font-size: 0.85rem;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.tier-btn-vip {
    color: #b45309;
    border-color: #fcd34d;
}

#acc-filter-tier {
    min-width: 100px;
}

/* —— 数据管理 —— */
.card-elevated {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.btn-block {
    width: 100%;
    margin-top: 10px;
}

.btn-ghost {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--muted);
    transition: all 0.15s;
}

.btn-ghost:hover {
    background: #f8fafc;
    color: var(--text);
    border-color: #cbd5e1;
}

.btn-pill {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text);
    transition: all 0.15s;
}

.btn-pill:hover {
    background: #f1f5f9;
}

.btn-pill.success {
    color: #15803d;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.btn-pill.success:hover {
    background: #dcfce7;
}

.btn-pill.danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.btn-pill.danger:hover {
    background: #fee2e2;
}

.btn-pill.export {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.btn-pill.export:hover {
    background: #dbeafe;
}

.lead-panel {
    max-width: 1400px;
}

.lead-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 55%, #ffffff 100%);
    border: 1px solid #dbeafe;
    border-radius: 16px;
}

.lead-hero-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.lead-hero-desc {
    font-size: 0.88rem;
    color: var(--muted);
    max-width: 520px;
    line-height: 1.5;
}

.lead-hero-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lead-stat-chip {
    min-width: 88px;
    padding: 12px 18px;
    text-align: center;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.lead-stat-chip.unused {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.lead-stat-chip.used {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.lead-stat-val {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

.lead-stat-chip.unused .lead-stat-val {
    color: #15803d;
}

.lead-stat-lbl {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 4px;
    display: block;
}

.lead-pool-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 960px) {
    .lead-pool-layout {
        grid-template-columns: 1fr;
    }
}

.lead-sidebar {
    padding: 18px;
    position: sticky;
    top: 12px;
}

.lead-sidebar-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.lead-sidebar-head h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.lead-sidebar-icon {
    font-size: 1.1rem;
}

.lead-group-create .lead-input {
    margin-bottom: 0;
}

.lead-input,
.lead-select,
.lead-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--bg-white);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lead-input:focus,
.lead-select:focus,
.lead-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.lead-input.search {
    min-width: 200px;
    width: auto;
    flex: 1;
}

.lead-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 10px 0 12px;
}

.lead-group-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    max-height: calc(100vh - 320px);
    min-height: 120px;
    overflow-y: auto;
}

.lead-group-list::-webkit-scrollbar {
    width: 6px;
}

.lead-group-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.lead-group-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.6;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px dashed var(--border);
}

.lead-group-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 8px;
    padding: 12px 12px 10px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 6px;
    transition: all 0.15s;
}

.lead-group-item:hover {
    background: #f8fafc;
    border-color: var(--border);
}

.lead-group-item.active {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.lead-gname {
    grid-column: 1;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
}

.lead-gstats {
    grid-column: 1;
    font-size: 0.75rem;
    color: var(--muted);
}

.lead-gbar {
    grid-column: 1 / -1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}

.lead-gbar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    border-radius: 2px;
    transition: width 0.3s;
}

.lead-group-del {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    padding: 4px 8px;
    font-size: 0.75rem;
    color: #94a3b8;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
}

.lead-group-del:hover {
    color: var(--danger);
    background: #fef2f2;
}

.lead-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.lead-context-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
}

.lead-context-left {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

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

.lead-context-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
}

.lead-context-name.empty {
    color: var(--muted);
    font-weight: 500;
}

.lead-context-filters {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    min-width: 240px;
}

.lead-import-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 800px) {
    .lead-import-cards {
        grid-template-columns: 1fr;
    }
}

.lead-import-card {
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lead-import-card.paste {
    text-align: left;
}

.lead-import-card.drop-zone {
    border-style: dashed;
    border-width: 2px;
    border-color: #cbd5e1;
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
    cursor: pointer;
}

.lead-import-card.drop-zone:hover,
.lead-import-card.drop-zone.dragover {
    border-color: var(--accent);
    background: #f8fbff;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
}

.lead-import-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    line-height: 1;
}

.lead-import-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--text);
}

.lead-import-hint {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.55;
}

.lead-import-hint code {
    font-size: 0.78rem;
    padding: 1px 5px;
    background: #f1f5f9;
    border-radius: 4px;
}

.lead-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 2px;
}

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

.lead-action-label {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
    margin-right: 4px;
}

.lead-table-card {
    overflow: hidden;
}

.lead-table-head {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-light);
    background: #fafbfc;
}

.lead-page-info {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

.lead-table-wrap {
    max-height: 420px;
    overflow: auto;
}

.lead-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 1;
    font-size: 0.8rem;
    text-transform: none;
    color: var(--muted);
    font-weight: 600;
}

.lead-table .col-check {
    width: 40px;
}

.lead-table .col-actions {
    width: 140px;
    white-space: nowrap;
}

.lead-table tbody tr:hover {
    background: #f8fafc;
}

.lead-table .mono {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.88rem;
}

.lead-time-cell {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}

.lead-kind-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
}

.lead-kind-badge.username {
    background: #eff6ff;
    color: #1d4ed8;
}

.lead-kind-badge.phone {
    background: #f0fdf4;
    color: #15803d;
}

.lead-kind-badge.link {
    background: #faf5ff;
    color: #7e22ce;
}

.lead-status-unused {
    background: #ecfdf5 !important;
    color: #15803d !important;
    border-color: #bbf7d0 !important;
}

.lead-status-processing {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #bfdbfe !important;
}

.lead-status-used {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border-color: #e2e8f0 !important;
}

.lead-status-forbidden {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border-color: #fecaca !important;
}

.lead-empty-row td {
    padding: 48px 24px !important;
    text-align: center;
    border: none !important;
}

.lead-empty-inner {
    color: var(--muted);
}

.lead-empty-inner strong {
    display: block;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 8px;
}

.lead-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.acc-actions .link-btn { margin-right: 8px; }
.link-btn.danger { color: #b91c1c; }

.ok-mark { color: #15803d; font-weight: 600; }
.twofa-hint { font-size: 0.85rem; color: var(--muted); }

.btn-login-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
    border: none;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.btn-login-sm:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.badge-pill.connecting { background: #fef3c7; color: #92400e; }
.badge-pill.ready { background: #e0e7ff; color: #3730a3; }
.badge-pill.login_error { background: #fee2e2; color: #991b1b; }
.badge-pill.offline { background: #f1f5f9; color: #64748b; }
.badge-pill.banned,
.badge-pill.deactivated,
.badge-pill.session_invalid { background: #fee2e2; color: #991b1b; }
.badge-pill.flood_wait { background: #ffedd5; color: #c2410c; }
.badge-pill.restricted { background: #fce7f3; color: #9d174d; }
.badge-pill.disconnected { background: #e2e8f0; color: #475569; }

.proxy-sub { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.session-cell { line-height: 1.35; }
.session-sub { font-size: 0.72rem; margin-top: 2px; }
.session-badge {
    display: inline-block;
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}
.session-badge.renewed { background: #dcfce7; color: #166534; }
.session-badge.initial { background: #f1f5f9; color: #64748b; }
.hb-cell { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }

.event-log-panel {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0f172a;
    overflow: hidden;
}

.event-log-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.event-log-head h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.event-log-head .hint { font-weight: normal; color: #94a3b8; font-size: 0.75rem; }

.check-row.inline { margin: 0 12px 0 0; color: #cbd5e1; }

.event-log-body {
    margin: 0;
    padding: 12px 14px;
    height: 220px;
    overflow: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.72rem;
    line-height: 1.5;
    color: #86efac;
    background: #0f172a;
    white-space: pre-wrap;
    word-break: break-all;
}

.event-log-head .link-btn { color: #93c5fd; }

.row-err {
    font-size: 0.72rem;
    color: #b91c1c;
    margin-top: 2px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acc-import-box textarea,
.acc-import-box input {
    width: 100%;
    margin-bottom: 8px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text);
}

.acc-toolbar { flex-wrap: wrap; gap: 12px; }

.acc-toolbar .filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 240px;
}

.acc-toolbar .filter-row input,
.acc-toolbar .filter-row select {
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text);
    font-size: 0.9rem;
}

.acc-toolbar .filter-row input[type="search"] {
    flex: 1;
    min-width: 140px;
}

.acc-main .table-wrap { margin-top: 0; }

/* —— 状态标签（浅色底） —— */
.badge-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-pill.online,
.badge-pill.online_verified { background: #ecfdf5; color: #15803d; border-color: #bbf7d0; }
.badge-pill.tg-premium { background: #fef3c7; color: #92400e; border-color: #fde68a; font-weight: 600; }
.premium-col { min-width: 4.5rem; white-space: nowrap; }
.premium-sub { font-size: 0.75rem; margin-top: 0.15rem; }
.badge-pill.online_stale { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.badge-pill.offline { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge-pill.pending { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-pill.no_proxy { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-pill.proxy_error { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.badge-pill.account_error { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
.badge-pill.proxy_ok { background: #ecfdf5; color: #15803d; border-color: #bbf7d0; }
.badge-pill.proxy_dead { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

.btn-login {
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-login:hover:not(:disabled) { background: var(--accent-hover); }

.btn-login:disabled {
    opacity: 1;
    cursor: not-allowed;
    background: #e2e8f0;
    color: #94a3b8;
}

.pagination-hint {
    margin-top: 12px;
}

.pager-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding: 8px 0 4px;
    font-size: 0.85rem;
    color: var(--muted);
}

.lead-pager {
    padding: 10px 16px 14px;
    border-top: 1px solid #e8edf3;
}

.pager-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pager-size-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pager-size {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    font-size: 0.85rem;
    color: #334155;
}

.pager-num {
    min-width: 88px;
    text-align: center;
    color: #64748b;
}

.pager-bar .pager-prev,
.pager-bar .pager-next {
    min-width: 72px;
}

.pager-bar .pager-prev:disabled,
.pager-bar .pager-next:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.acc-table td.mono {
    font-family: ui-monospace, "Cascadia Mono", monospace;
    font-size: 0.82rem;
    color: #334155;
}

/* —— 任务控制台 —— */
.console-panel.console-hide-advanced .console-advanced-ui {
    display: none !important;
}

.console-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.console-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    flex-wrap: wrap;
}

.console-hero-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    color: #0f172a;
}

.console-hero-desc {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
    max-width: 560px;
    line-height: 1.5;
}

.console-online-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.console-online-label {
    font-size: 0.82rem;
    color: #64748b;
}

.console-online-count {
    font-size: 1.4rem;
    font-weight: 700;
    color: #059669;
    min-width: 2ch;
}

.console-layout {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .console-layout {
        grid-template-columns: 1fr;
    }
}

.console-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
}

.console-tab {
    border: none;
    background: transparent;
    text-align: left;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.92rem;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.console-tab:hover {
    background: #f1f5f9;
}

.console-tab.active {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

.console-main {
    padding: 20px 24px;
}

.console-form-row {
    margin-bottom: 14px;
}

.console-label {
    display: block;
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 6px;
}

.console-input,
.console-textarea {
    width: 100%;
    max-width: 480px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.console-textarea {
    max-width: 560px;
    resize: vertical;
}

.console-hint {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 0 0 16px;
    line-height: 1.45;
}

.console-result {
    margin-top: 20px;
    padding: 16px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.console-result-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.console-result-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

.console-result-badge.ok {
    background: #dcfce7;
    color: #15803d;
}

.console-result-badge.fail {
    background: #fee2e2;
    color: #b91c1c;
}

.console-result-msg {
    margin: 0;
    font-size: 0.92rem;
    color: #334155;
}

.console-result-detail {
    margin: 12px 0 0;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    font-size: 0.78rem;
    overflow-x: auto;
    color: #475569;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.82rem;
}

.console-wb-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.wb-chip {
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}

.wb-chip.run {
    background: #dbeafe;
    color: #1d4ed8;
}

.wb-chip.ok {
    background: #dcfce7;
    color: #15803d;
}

.wb-chip.fail {
    background: #fee2e2;
    color: #b91c1c;
}

.wb-chip.stuck {
    background: #fef3c7;
    color: #b45309;
}

.console-wb-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.console-input.compact {
    max-width: 160px;
    padding: 6px 10px;
}

.console-wb-table-wrap {
    max-height: 420px;
    overflow: auto;
}

.console-wb-table tr.wb-stuck {
    background: #fffbeb;
}

.console-msg-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.console-msg-tab {
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

.console-msg-tab.active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.console-cycle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.console-config-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    min-width: 140px;
}

.console-config-actions .btn-sm {
    width: 100%;
}

.console-stats-hint {
    margin-top: 8px;
    margin-bottom: 0;
}

.console-stat-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.console-stat-main {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.console-stat-pair-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
}

.console-stat-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 400;
}

.cycle-group-hint-warn {
    color: #b45309;
}

.console-cycle-grid label {
    font-size: 0.82rem;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.console-cycle-grid .field-hint {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 400;
}

.console-subtitle {
    margin: 0 0 12px;
    font-size: 1rem;
}

.console-config,
.console-control,
.console-live {
    padding: 20px 24px;
}

.console-control {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.console-control-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.console-status-label {
    font-size: 0.82rem;
    color: #64748b;
}

.console-status-meta {
    font-size: 0.88rem;
    color: #475569;
}

.cycle-session-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.cycle-session-badge.idle {
    background: #f1f5f9;
    color: #64748b;
}

.cycle-session-badge.running {
    background: #dcfce7;
    color: #166534;
}

.cycle-session-badge.paused {
    background: #fef3c7;
    color: #92400e;
}

.cycle-session-badge.stopping {
    background: #fee2e2;
    color: #991b1b;
}

.console-control-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-danger-outline {
    border: 1px solid #fca5a5;
    background: #fff;
    color: #b91c1c;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-danger-outline:hover:not(:disabled) {
    background: #fef2f2;
}

.btn-danger-outline:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.cycle-stop-confirm {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #7f1d1d;
}

.console-online-count.vip {
    color: #7c3aed;
}

.console-live-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.console-live-hint {
    font-size: 0.78rem;
    color: #94a3b8;
}

/* 黑色终端式实时日志：左普通号 | 中间步骤日志 | 右 VIP */
.cycle-log-terminal {
    background: #0f1419;
    border: 1px solid #1e293b;
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    min-height: 140px;
    max-height: min(62vh, 560px);
    overflow: hidden;
}

.cycle-log-viewport,
.console-live-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: auto;
    min-height: 120px;
    max-height: min(58vh, 520px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px 12px;
    font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
    font-size: 0.78rem;
    line-height: 1.4;
}

.cycle-log-empty,
.console-live-empty {
    padding: 28px 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

.cycle-log-line {
    display: grid;
    grid-template-columns: 152px minmax(0, 1fr) 152px;
    grid-template-rows: auto 96px;
    gap: 0;
    flex-shrink: 0;
    min-height: 118px;
    border-radius: 6px;
    border: 1px solid #1e293b;
    background: #0c1220;
    overflow: hidden;
}

.log-group-banner {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: #111827;
    border-bottom: 1px solid #1e293b;
    font-size: 0.72rem;
    color: #94a3b8;
}

.log-group-index {
    font-weight: 700;
    color: #38bdf8;
    white-space: nowrap;
}

.log-group-pair {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #cbd5e1;
}

.log-group-status {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #1e293b;
    color: #e2e8f0;
}

.cycle-log-line.status-running .log-group-status {
    background: #1e3a5f;
    color: #7dd3fc;
}

.cycle-log-line.status-failed .log-group-status,
.cycle-log-line.status-aborted .log-group-status {
    background: #7f1d1d;
    color: #fecaca;
}

.cycle-log-line .log-side,
.cycle-log-line .log-center {
    grid-row: 2;
}

.cycle-log-line.status-running {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.15);
}

.cycle-log-line.status-success {
    border-color: #166534;
}

.cycle-log-line.status-failed,
.cycle-log-line.status-aborted {
    border-color: #991b1b;
}

.cycle-log-line.is-stuck {
    border-color: #d97706;
    background: #14100a;
}

.cycle-log-line.cycle-log-skeleton {
    opacity: 0.72;
}

.log-side {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 10px;
    border-right: 1px solid #1e293b;
}

.log-side-vip {
    border-right: none;
    border-left: 1px solid #1e293b;
    align-items: flex-end;
    text-align: right;
}

.log-side-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.log-side-regular .log-side-label {
    color: #7dd3fc;
}

.log-side-vip .log-side-label {
    color: #c4b5fd;
}

.log-side-phone {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f1f5f9;
    word-break: break-all;
    line-height: 1.25;
}

.log-side-act {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.35;
    flex: 1;
}

.log-side-regular .log-side-act {
    color: #bae6fd;
}

.log-side-vip .log-side-act {
    color: #ddd6fe;
}

.log-side-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    background: #1e3a5f;
    color: #7dd3fc;
    margin-top: auto;
}

.cycle-log-line.status-success .log-side-badge {
    background: #14532d;
    color: #86efac;
}

.cycle-log-line.status-failed .log-side-badge,
.cycle-log-line.status-aborted .log-side-badge {
    background: #450a0a;
    color: #fca5a5;
}

.log-center {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 12px;
    min-width: 0;
    background: rgba(15, 23, 42, 0.45);
}

.log-center-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
}

.log-center-now {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 6px 10px;
}

.log-center-step {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e0f2fe;
}

.log-center-actor {
    font-size: 0.75rem;
    color: #a5b4fc;
}

.log-center-msg {
    flex: 1;
    text-align: center;
    color: #cbd5e1;
    font-size: 0.76rem;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.log-center-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 12px;
    font-size: 0.7rem;
    color: #64748b;
    margin-top: auto;
}

.log-center-stuck {
    color: #fbbf24;
    font-weight: 600;
}

.cycle-log-terminal .live-pipe-node {
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 3px;
    background: #1e293b;
    color: #64748b;
    border: 1px solid #334155;
}

.cycle-log-terminal .live-pipe-node.done {
    background: #14532d;
    color: #86efac;
    border-color: #166534;
}

.cycle-log-terminal .live-pipe-node.active {
    background: #0369a1;
    color: #e0f2fe;
    border-color: #0284c7;
}

.cycle-debug-head {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

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

.cycle-debug-file-meta {
    font-size: 0.78rem;
    color: #64748b;
    font-family: ui-monospace, Consolas, monospace;
}

.cycle-debug-hint {
    margin: -4px 0 8px;
}

.cycle-debug-panel {
    margin-top: 12px;
    padding: 12px 14px;
}

.cycle-debug-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.2);
    color: #16a34a;
    vertical-align: middle;
}

.cycle-debug-badge.off {
    background: rgba(148, 163, 184, 0.25);
    color: #64748b;
}

.cycle-debug-viewport {
    margin: 8px 0 0;
    padding: 10px 12px;
    max-height: 220px;
    overflow: auto;
    font-size: 11px;
    line-height: 1.45;
    font-family: ui-monospace, Consolas, monospace;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-all;
}

.cycle-debug-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.cycle-log-terminal .live-pipe-node.fail {
    background: #7f1d1d;
    color: #fecaca;
    border-color: #991b1b;
}

@media (max-width: 900px) {
    .cycle-log-line {
        grid-template-columns: 120px minmax(0, 1fr) 120px;
    }
}

.console-live-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fafafa;
    font-size: 0.86rem;
}

.console-live-row.is-stuck {
    border-color: #f59e0b;
    background: #fffbeb;
    box-shadow: 0 0 0 1px #fde68a;
}

.live-row-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
}

.live-pair {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.live-sep {
    color: #94a3b8;
    font-weight: 400;
}

.live-elapsed {
    font-size: 0.75rem;
    color: #64748b;
    margin-left: auto;
}

.live-pipeline {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.live-pipe-node {
    font-size: 0.68rem;
    padding: 3px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
}

.live-pipe-node.done {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.live-pipe-node.active {
    background: #2563eb;
    color: #fff;
    border-color: #1d4ed8;
    font-weight: 600;
}

.live-pipe-node.fail {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
    font-weight: 600;
}

.live-actor {
    display: inline-block;
    min-width: 48px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
}

.live-stuck-banner {
    font-size: 0.8rem;
    color: #b45309;
    background: #fef3c7;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #fde68a;
}

.console-live-row.status-running {
    border-left: 3px solid #2563eb;
}

.console-live-row.status-success {
    border-left: 3px solid #16a34a;
    opacity: 0.85;
}

.console-live-row.status-failed,
.console-live-row.status-aborted {
    border-left: 3px solid #dc2626;
    opacity: 0.85;
}

.live-row-main {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
}

.live-status-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #e0e7ff;
    color: #3730a3;
}

.console-live-row.status-success .live-status-badge {
    background: #dcfce7;
    color: #166534;
}

.console-live-row.status-failed .live-status-badge,
.console-live-row.status-aborted .live-status-badge {
    background: #fee2e2;
    color: #991b1b;
}

.live-phone {
    font-weight: 600;
    color: #0f172a;
}

.live-vip {
    color: #6d28d9;
}

.live-target {
    color: #475569;
}

.live-row-step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-step {
    min-width: 100px;
    color: #1d4ed8;
    font-weight: 500;
}

.live-progress {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    max-width: 280px;
}

.live-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transition: width 0.3s ease;
}

.live-pct {
    font-size: 0.78rem;
    color: #64748b;
    min-width: 36px;
}

.live-row-msg {
    color: #64748b;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.console-hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 16px 0;
}

.work-available {
    background: #dcfce7;
    color: #15803d;
}

.work-cooldown {
    background: #fef3c7;
    color: #b45309;
}

.work-flood {
    background: #ffedd5;
    color: #c2410c;
}

.work-dead {
    background: #fee2e2;
    color: #b91c1c;
}

.work-col .small {
    font-size: 0.75rem;
}

.vip-dual-task {
    margin-top: 4px;
    line-height: 1.45;
}

.vip-dual-task strong {
    color: #0f172a;
    font-weight: 600;
}

/* —— PC 手动模拟向导 —— */
.pc-sim-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pc-sim-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.pc-sim-dialog {
    position: relative;
    width: min(920px, 100%);
    max-height: min(88vh, 720px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pc-sim-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.pc-sim-header h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.pc-sim-sub {
    color: var(--muted);
    font-size: 0.85rem;
}

.pc-sim-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 360px;
    overflow: hidden;
}

@media (max-width: 720px) {
    .pc-sim-body {
        grid-template-columns: 1fr;
        max-height: 70vh;
        overflow-y: auto;
    }
}

.pc-sim-steps {
    list-style: none;
    margin: 0;
    padding: 12px;
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    background: #f8fafc;
}

.pc-sim-steps li {
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.35;
}

.pc-sim-steps li.done {
    color: var(--success);
    background: #f0fdf4;
}

.pc-sim-steps li.active {
    color: var(--text);
    background: var(--accent-soft);
    font-weight: 600;
}

.pc-sim-steps li.fail {
    color: var(--danger);
    background: #fef2f2;
}

.pc-sim-panel {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.pc-sim-current h4 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.pc-sim-current p {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.pc-sim-inputs label {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin: 8px 0 4px;
    font-weight: 500;
}

.pc-sim-inputs input {
    width: 100%;
    max-width: 360px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

.pc-sim-status {
    min-height: 1.4em;
    font-size: 0.88rem;
    color: var(--text);
}

.pc-sim-status.ok {
    color: var(--success);
}

.pc-sim-status.err {
    color: var(--danger);
}

.pc-sim-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
}
