/*
 * TG CallBot 管理后台样式
 * 蓝灰色调，简洁专业的管理后台 UI
 */

/* ============================================================
   基础重置和变量
   ============================================================ */

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

:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --topbar-height: 56px;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --success-hover: #16a34a;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --info: #06b6d4;
    --default: #6b7280;
    --default-hover: #4b5563;
    --bg: #f1f5f9;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-page: #f1f5f9;
    --muted: #94a3b8;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a {
    text-decoration: none;
    color: var(--primary);
}

code {
    font-family: "SF Mono", Monaco, "Cascadia Code", Consolas, "Microsoft YaHei Mono", monospace;
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--text);
    word-break: break-all;
}

/* ============================================================
   侧边栏导航
   ============================================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: block;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

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

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #cbd5e1;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.nav-icon {
    margin-right: 10px;
    font-size: 10px;
    opacity: 0.6;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ============================================================
   主内容区
   ============================================================ */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.btn-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text);
    padding: 4px 8px;
    margin-right: 12px;
}

.topbar-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

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

.topbar-user {
    color: var(--text-light);
    font-size: 13px;
}

.btn-logout-top {
    width: auto;
    padding: 6px 14px;
    background: var(--bg);
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
}

.btn-logout-top:hover {
    background: var(--border);
}

.page-content {
    flex: 1;
    padding: 20px;
}

/* ============================================================
   统计卡片
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-card-green { border-left-color: var(--success); }
.stat-card-orange { border-left-color: var(--warning); }
.stat-card-red { border-left-color: var(--danger); }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ============================================================
   详细信息卡片
   ============================================================ */

.detail-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.detail-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
}

.detail-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-light);
}

/* ============================================================
   快捷操作
   ============================================================ */

.quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* ============================================================
   面板 / 表格容器
   ============================================================ */

.panel {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.panel-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.panel-body {
    padding: 0;
}

.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    background: #f8fafc;
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.table tr:hover td {
    background: #f8fafc;
}

.table tr:last-child td {
    border-bottom: none;
}

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

.actions-cell .btn-sm {
    margin: 0 2px;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ============================================================
   操作栏
   ============================================================ */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

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

.toolbar-right {
    display: flex;
}

/* ============================================================
   按钮
   ============================================================ */

.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    line-height: 1.4;
}

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

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

.btn-block {
    display: block;
    width: 100%;
}

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

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover { background: var(--success-hover); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-hover); }

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}
.btn-warning:hover { background: var(--warning-hover); }

.btn-info {
    background: var(--info);
    color: #fff;
    border-color: var(--info);
}

.btn-default {
    background: var(--bg-white);
    color: var(--text);
    border-color: var(--border);
}
.btn-default:hover { background: var(--bg); }

/* ============================================================
   表单
   ============================================================ */

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.required {
    color: var(--danger);
}

.form-input {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text);
    transition: border-color 0.15s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input:disabled {
    background: #f1f5f9;
    color: var(--text-muted);
}

.form-error {
    background: #fef2f2;
    color: var(--danger);
    padding: 8px 12px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 13px;
}

.form-inline {
    display: flex;
    align-items: center;
}

.form-inline .form-input {
    width: auto;
    flex: 1;
}

/* ============================================================
   标签
   ============================================================ */

.tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 10px;
    line-height: 1.5;
    white-space: nowrap;
}

.tag-green {
    background: #dcfce7;
    color: #166534;
}

.tag-red {
    background: #fee2e2;
    color: #991b1b;
}

.tag-orange {
    background: #fef3c7;
    color: #92400e;
}

.tag-blue {
    background: #dbeafe;
    color: #1e40af;
}

.tag-default {
    background: #f1f5f9;
    color: #475569;
}

/* ============================================================
   模态框
   ============================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-white);
    border-radius: 8px;
    width: 480px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.25s ease;
}

.modal-lg {
    width: 680px;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

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

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

/* ============================================================
   Toast 消息
   ============================================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 13px;
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.3s ease;
    max-width: 400px;
    word-break: break-word;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--primary); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   确认对话框
   ============================================================ */

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    animation: fadeIn 0.15s ease;
}

.confirm-box {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 24px;
    width: 360px;
    max-width: 90vw;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.confirm-box p {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 20px;
}

.confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* ============================================================
   登录页面
   ============================================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--bg-white);
    border-radius: 10px;
    padding: 36px 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.login-form .form-group label {
    font-size: 13px;
}

/* ============================================================
   响应式设计 (768px 断点)
   ============================================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .btn-menu-toggle {
        display: block;
    }

    .btn-logout-top {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-cards {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-right {
        width: 100%;
    }

    .toolbar-right .form-input {
        width: 100%;
    }

    .page-content {
        padding: 12px;
    }

    .modal {
        width: 95vw;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 24px;
    }

    .quick-actions {
        flex-direction: column;
    }
}
﻿/* ??????????????????????????????????????????????????????????????????? */
/* Dashboard v2: 6-card grid, charts, gaps, filters, pagination     */
/* ??????????????????????????????????????????????????????????????????? */

/* ?? 6-card KPI grid ???????????????????????????????????????????? */
.stats-grid-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

/* 4-card classification KPI grid - v3.7.5 */
.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card-blue { border-left: 4px solid var(--primary, #3b82f6); }
.stat-card-green { border-left: 4px solid var(--success, #22c55e); }
.stat-card-purple { border-left: 4px solid #8b5cf6; }
.stat-card-teal { border-left: 4px solid #14b8a6; }
.stat-card-orange { border-left: 4px solid var(--warning, #f59e0b); }
.stat-card-red { border-left: 4px solid var(--danger, #ef4444); }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    line-height: 1.2;
}

/* ?? Chart panels ??????????????????????????????????????????????? */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.chart-panel {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-panel h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #374151;
}

.chart-panel canvas {
    width: 100% !important;
    max-height: 280px;
}

/* ?? Gap detection panel ???????????????????????????????????????? */
.gap-panel .panel-header {
    border-bottom: 1px solid #e5e7eb;
}

.gap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.gap-empty {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 13px;
}

.gap-table td {
    font-size: 13px;
    vertical-align: middle;
}

/* ?? Filter bar ????????????????????????????????????????????????? */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    align-items: flex-end;
}

.form-input-sm {
    padding: 5px 8px !important;
    font-size: 13px !important;
    height: auto !important;
    border-radius: 6px !important;
}

/* ?? Pagination ????????????????????????????????????????????????? */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 5px 12px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    color: #374151;
    transition: all 0.15s;
}

.pagination button:hover:not(:disabled):not(.active) {
    background: #f3f4f6;
}

.pagination button:disabled {
    opacity: 0.35;
    cursor: default;
}

.pagination button.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    font-weight: 600;
}

.page-info {
    font-size: 12px;
    color: #6b7280;
    margin-left: 8px;
    white-space: nowrap;
}

/* ?? Smaller table variant ?????????????????????????????????????? */
.table-sm th,
.table-sm td {
    padding: 6px 10px;
    font-size: 13px;
}

/* ?? Responsive ????????????????????????????????????????????????? */
@media (max-width: 768px) {
    .stats-grid-6 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-value {
        font-size: 24px;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .chart-panel canvas {
        max-height: 220px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-input-sm {
        width: 100% !important;
    }

    .gap-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .pagination {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid-6 {
        grid-template-columns: 1fr;
    }
}
﻿/* Fix: chart panel height constraint */
.chart-panel {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    height: 260px;
    display: flex;
    flex-direction: column;
}
.chart-panel h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #374151;
    flex-shrink: 0;
}
.chart-panel .chart-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    width: 100%;
}
.chart-panel .chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {
    .chart-panel {
        height: 240px;
    }
}

/* ═══════════════════════════════════════════════════════════
   v4.2 通用工具类（从内联样式提取）
   ═══════════════════════════════════════════════════════════ */

/* ── 卡片 ── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 16px; overflow: hidden; }
.card h2, .card h3 { margin: 0; font-size: 16px; }

/* ── 模态框 ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--bg-card); border-radius: 8px; min-width: 360px; max-width: 600px; max-height: 80vh; overflow-y: auto; box-shadow: 0 4px 24px rgba(0,0,0,0.15); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg-page); }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: #999; line-height: 1; }
.modal-close:hover { color: var(--danger); }

/* ── 表单 ── */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: #374151; }
.form-input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; box-sizing: border-box; }
.form-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px rgba(74,144,217,0.2); }
.form-input-sm { width: auto; padding: 4px 8px; font-size: 12px; }
.required { color: var(--danger); }

/* ── 按钮 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; cursor: pointer; background: #fff; color: #374151; gap: 4px; }
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-default { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-info { background: #0ea5e9; color: #fff; border-color: #0ea5e9; }

/* ── 状态标签 ── */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.tag-green { background: #dcfce7; color: #166534; }
.tag-red { background: #fee2e2; color: #991b1b; }
.tag-orange { background: #fef3c7; color: #92400e; }
.tag-default { background: #f3f4f6; color: #6b7280; }

/* ── 徽章 ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-default { background: #f3f4f6; color: #6b7280; }
.badge-normal { background: #dcfce7; color: #166534; }
.badge-cooling { background: #fef3c7; color: #92400e; }
.badge-dead { background: #fee2e2; color: #991b1b; }

/* ── 时间线 ── */
.tl-chip { background: #f1f5f9; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-family: monospace; }

/* ── 信息表 ── */
.info-table { width: 100%; border-collapse: collapse; }
.info-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-label { color: #999; width: 140px; white-space: nowrap; }

/* ── 数据表（紧凑型） ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { font-size: 11px; padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--border); background: var(--bg-page); }
.data-table td { font-size: 12px; padding: 6px; border-bottom: 1px solid var(--border); }
.data-table code { font-size: 11px; background: #f1f5f9; padding: 1px 4px; border-radius: 3px; }

/* ── 加载/空/错误态 ── */
.loading { color: #999; text-align: center; padding: 40px; font-size: 14px; }
.error-msg { color: var(--danger); text-align: center; padding: 40px; font-size: 14px; }
.empty-state { color: var(--muted); text-align: center; padding: 32px; font-size: 14px; }

/* ── Toast 补充 ── */
.toast-info { background: var(--primary); color: #fff; }
.toast-warning { background: var(--warning); color: #333; }

/* ── 标签页按钮 ── */
.tab-btn { padding: 10px 20px; border: none; background: #f5f5f5; color: #666; border-radius: 4px 4px 0 0; cursor: pointer; font-size: 14px; margin-right: 2px; }
.tab-btn.active { background: var(--primary); color: #fff; }
.tab-btn:hover:not(.active) { background: #e8e8e8; }

/* ── 分页 ── */
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination button { padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; }
.pagination button:hover:not(:disabled) { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: default; }
.pagination .page-info { font-size: 12px; color: var(--muted); margin-left: 8px; }

/* ── 筛选栏 ── */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filter-bar .form-input { width: auto; min-width: 120px; }
.filter-bar .form-group { margin-bottom: 0; }

/* ── 统计行 ── */
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stat-card { flex: 1; min-width: 120px; padding: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; text-align: center; }
.stat-card .stat-label { font-size: 12px; color: #999; }
.stat-card .stat-value { margin-top: 4px; }
.stat-big { font-size: 20px; font-weight: bold; }

/* ── 页面头部 ── */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-header h2 { font-size: 18px; color: #1e293b; margin: 0; }

/* ── 详情折叠 ── */
details.card { cursor: pointer; }
details.card summary { padding: 12px 16px; user-select: none; }
details.card summary h3 { display: inline; margin: 0; font-size: 16px; }
details.card[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }

/* ── 代码块 ── */
code { font-family: 'SF Mono', 'Consolas', monospace; font-size: 12px; background: #f1f5f9; padding: 1px 5px; border-radius: 3px; color: #1e293b; }

/* ── 可搜索下拉 ── */
.search-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    max-height: 240px; overflow-y: auto;
    background: #fff; border: 1px solid var(--border);
    border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
}
.search-dropdown-item {
    display: flex; gap: 8px; padding: 6px 10px;
    cursor: pointer; font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
}
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover { background: #eff6ff; }
.search-dropdown-item .tg-id { font-weight: 600; color: #1e40af; min-width: 80px; }
.search-dropdown-item .tg-name { color: #6b7280; }

/* ── 可搜索下拉选择器 ── */
.search-select-wrap { position: relative; display: inline-block; }
.search-select-input { padding-right: 28px !important; cursor: pointer; }
.search-select-arrow {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    font-size: 10px; color: #9ca3af; pointer-events: none;
    cursor: pointer; pointer-events: auto;
}

/* ── Toast 定位修正 ── */
.toast {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;
}
