/* ====== 基础 ====== */
*{margin:0;padding:0;box-sizing:border-box}
:root{
  --primary:#2563eb;--primary-d:#1d4ed8;--primary-l:#dbeafe;
  --bg:#f1f5f9;--card:#fff;--border:#e2e8f0;
  --text:#1e293b;--text-2:#64748b;--green:#16a34a;--red:#dc2626;--amber:#d97706;
  --radius:8px;--shadow:0 1px 3px rgba(0,0,0,.08);
}
body{font-family:'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;background:var(--bg);color:var(--text);font-size:14px}

/* ====== 顶栏 ====== */
.topbar{background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 24px;height:56px;box-shadow:var(--shadow)}
.brand{display:flex;align-items:center;gap:10px}
.brand .logo{font-size:22px;color:var(--primary)}
.brand .title{font-size:17px;font-weight:600}
.brand .badge{background:var(--primary-l);color:var(--primary-d);font-size:11px;padding:2px 8px;border-radius:10px;font-weight:600}
.status-bar{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--text-2)}
.status-bar .dot{width:8px;height:8px;border-radius:50%;background:var(--amber)}
.status-bar.ok .dot{background:var(--green)}

/* ====== 布局 ====== */
.layout{display:flex;height:calc(100vh - 56px);min-width:0}
.sidebar{width:260px;background:#fff;border-right:1px solid var(--border);display:flex;flex-direction:column;flex-shrink:0}
.sidebar-head{padding:16px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.sidebar-head h3{font-size:14px}
.ds-list{flex:1;overflow-y:auto;padding:8px}
.main{flex:1;overflow-y:auto;padding:24px;min-width:0;overflow-x:hidden}

/* ====== 按钮 ====== */
button{cursor:pointer;border:none;border-radius:var(--radius);font-size:13px;transition:.15s}
.btn-sm{padding:5px 12px;font-size:12px}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-d)}
.btn-outline{background:#fff;border:1px solid var(--border);color:var(--text)}
.btn-outline:hover{border-color:var(--primary);color:var(--primary)}
.btn-danger{background:#fff;border:1px solid var(--border);color:var(--red)}
.btn-danger:hover{background:#fef2f2}
button:disabled{opacity:.5;cursor:not-allowed}

/* ====== 数据源列表项 ====== */
.ds-item{padding:10px 14px;border-radius:var(--radius);margin-bottom:4px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;transition:.1s}
.ds-item:hover{background:var(--bg)}
.ds-item.active{background:var(--primary-l)}
.ds-item .ds-name{font-weight:500;font-size:13px}
.ds-item .ds-type{font-size:11px;color:var(--text-2)}
.ds-item .ds-status{width:8px;height:8px;border-radius:50%;background:#cbd5e1}
.ds-item .ds-status.ok{background:var(--green)}
.ds-item .ds-status.err{background:var(--red)}

/* ====== 表单 ====== */
.form-card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:24px;max-width:640px;box-shadow:var(--shadow)}
.form-card h3{margin-bottom:16px;font-size:16px;border-bottom:2px solid var(--primary);padding-bottom:8px}
.form-row{margin-bottom:16px}
.form-row label{display:block;font-size:13px;font-weight:500;margin-bottom:5px;color:var(--text-2)}
.form-row input,.form-row select{width:100%;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius);font-size:13px;transition:.15s}
.form-row input:focus,.form-row select:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-l)}
.form-row-2{display:flex;gap:12px}
.form-row-2 .form-row{flex:1}
.form-actions{display:flex;gap:10px;margin-top:20px}

/* ====== 测试结果 ====== */
/* ====== 自动发现数据库 ====== */
.opt-tag{font-size:11px;color:#8a94a6;font-weight:normal;background:#f0f3f8;padding:1px 6px;border-radius:8px;margin-left:6px}
.db-pick{margin-top:10px;padding:10px 12px;background:#f0f7ff;border:1px dashed #7ab8ff;border-radius:8px}
.db-pick label{font-size:13px;color:#1a66cc;font-weight:600;display:block;margin-bottom:6px}
.db-pick select{width:100%;padding:8px 10px;border:1px solid #c9d4e3;border-radius:6px;font-size:14px;background:#fff}
.db-hint{font-size:12px;color:#6b7a90;margin-top:6px}

.test-result{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:16px;margin:16px 0;max-width:640px}
.test-result.ok{border-color:var(--green);background:#f0fdf4}
.test-result.err{border-color:var(--red);background:#fef2f2}
.test-result h4{font-size:14px;margin-bottom:8px}
.test-meta{display:flex;gap:24px;font-size:13px;color:var(--text-2)}
.test-meta b{color:var(--text)}

/* ====== 表清单 ====== */
.tables-section{margin-top:20px}
.tables-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.tables-head h3{font-size:16px}
.tables-head input{padding:7px 12px;border:1px solid var(--border);border-radius:var(--radius);width:240px;font-size:13px}
.tables-head input:focus{outline:none;border-color:var(--primary)}
.tables-summary{display:flex;gap:16px;margin-bottom:12px}
.summary-card{background:#fff;border:1px solid var(--border);border-radius:var(--radius);padding:10px 18px;text-align:center}
.summary-card .num{font-size:22px;font-weight:700;color:var(--primary)}
.summary-card .label{font-size:11px;color:var(--text-2)}

/* ====== 表格 ====== */
.tbl-wrap{background:#fff;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
table{width:100%;border-collapse:collapse;font-size:13px}
th{background:#f8fafc;padding:10px 14px;text-align:left;font-weight:600;color:var(--text-2);border-bottom:1px solid var(--border);font-size:12px;white-space:nowrap}
td{padding:8px 14px;border-bottom:1px solid var(--border)}
tr:last-child td{border-bottom:none}
tr:hover td{background:#f8fafc}
.clickable{cursor:pointer;color:var(--primary)}
.clickable:hover{text-decoration:underline}
.badge-type{font-size:10px;padding:1px 6px;border-radius:4px;font-weight:600}
.badge-type.TABLE{background:var(--primary-l);color:var(--primary-d)}
.badge-type.VIEW{background:#fef3c7;color:#92400e}
.rows-num{font-variant-numeric:tabular-nums;color:var(--text-2)}

/* ====== 字段详情弹层 ====== */
.schema-detail{background:#fff;border:1px solid var(--border);border-radius:var(--radius);margin:12px 0;box-shadow:var(--shadow)}
.schema-detail .schema-head{padding:12px 16px;background:#f8fafc;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.schema-detail .schema-head b{font-size:14px}
.data-type{font-family:'Consolas','Monaco',monospace;font-size:12px;color:var(--primary-d);background:var(--primary-l);padding:1px 6px;border-radius:4px}
.nullable{color:var(--amber);font-size:11px}
.notnull{color:var(--text-2);font-size:11px}

/* ====== 欢迎页 ====== */
.welcome{max-width:720px}
.welcome h2{font-size:20px;margin-bottom:12px}
.welcome>p{color:var(--text-2);line-height:1.7;margin-bottom:24px}
.steps{display:flex;gap:16px}
.step{display:flex;gap:12px;align-items:flex-start;background:#fff;border:1px solid var(--border);border-radius:var(--radius);padding:16px;flex:1}
.step-num{background:var(--primary);color:#fff;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;flex-shrink:0}
.step b{font-size:13px}
.step{font-size:12px;color:var(--text-2);line-height:1.5}

/* ====== 杂项 ====== */
.empty-hint{text-align:center;color:var(--text-2);font-size:13px;padding:40px 0}
.loading{text-align:center;padding:30px;color:var(--text-2)}
.spin{display:inline-block;width:18px;height:18px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .6s linear infinite;margin-right:6px;vertical-align:middle}
@keyframes spin{to{transform:rotate(360deg)}}
.err-msg{color:var(--red);font-size:13px;padding:12px 0}

/* ====== 阶段二：分析报告样式 ====== */
.tabnav{display:flex;gap:0;background:var(--bg-2);border-bottom:2px solid var(--border);padding:0 20px;overflow-x:auto;flex-wrap:nowrap}
.tab{padding:10px 20px;border:none;background:none;cursor:pointer;font-size:14px;color:var(--text-2);border-bottom:3px solid transparent;transition:.2s}
.tab:hover{color:var(--primary)}
.tab.active{color:var(--primary);border-bottom-color:var(--primary);font-weight:600}
.tab-stage{padding:0 6px 0 10px;font-size:11px;color:#aaa;font-weight:700;align-self:center;border-left:1px solid var(--border);white-space:nowrap;letter-spacing:1px}
.tab-stage:first-child{border-left:none;padding-left:0}
.gate-banner{background:linear-gradient(90deg,#fff9e6,#fff3cc);border:1px solid #ffe08a;border-radius:8px;padding:12px 16px;margin:0 0 16px;display:flex;align-items:center;gap:12px;font-size:13px;color:#7a5a10}
.gate-icon{font-size:20px}
.gate-meter{flex:1;height:8px;background:#f0e0b0;border-radius:4px;overflow:hidden}
.gate-meter-fill{height:100%;background:linear-gradient(90deg,#f0a020,#e8751a);border-radius:4px;transition:width .5s}
.gate-item{display:inline-flex;align-items:center;gap:4px;margin-right:16px}
.gate-item b{color:#c08010}
.gate-ok{background:linear-gradient(90deg,#eef8ee,#d8efd8)!important;border-color:#8fd88f!important}
.gate-ok .gate-meter-fill{background:linear-gradient(90deg,#4caf50,#2e7d32)}
.analysis-layout{padding:0 20px 20px}

/* 进度 */
.analysis-progress{padding:30px}
.progress-bar-wrap{background:var(--bg-2);border-radius:8px;height:24px;margin:16px 0;overflow:hidden}
.progress-bar{background:linear-gradient(90deg,var(--primary),var(--primary-dark));height:100%;border-radius:8px;transition:width .5s}
.progress-text{color:var(--text-2);font-size:14px}
.log-area{background:#1a1a2e;color:#a8b2d1;border-radius:8px;padding:12px;margin-top:16px;max-height:200px;overflow-y:auto;font-family:monospace;font-size:12px}
.log-line{padding:2px 0;border-bottom:1px solid rgba(255,255,255,.05)}

/* 报告概览 */
.report-overview{padding:20px 0}
.report-header{margin-bottom:20px}
.report-header h2{margin:0 0 4px}
.report-meta{font-size:12px;color:var(--text-2)}

.summary-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;margin-bottom:24px}
.summary-tile{background:var(--bg-2);border-radius:10px;padding:16px;text-align:center;border:1px solid var(--border)}
.summary-tile.highlight{border-color:var(--primary);background:linear-gradient(135deg,rgba(34,84,234,.08),rgba(34,84,234,.02))}
.tile-num{font-size:24px;font-weight:700;color:var(--primary);line-height:1.2}
.tile-label{font-size:12px;color:var(--text-2);margin-top:4px}

.section-block{margin-bottom:28px}
.section-block h3{font-size:16px;margin:0 0 12px;padding-bottom:8px;border-bottom:1px solid var(--border)}

/* 业务域 */
.domain-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px}
.domain-card{background:var(--bg-2);border:1px solid var(--border);border-radius:10px;padding:14px;cursor:pointer;transition:.2s}
.domain-card:hover{border-color:var(--primary);box-shadow:0 2px 12px rgba(34,84,234,.12);transform:translateY(-2px)}
.domain-name{font-weight:600;font-size:14px;margin-bottom:6px}
.domain-stats{display:flex;gap:12px;font-size:12px;color:var(--text-2)}
.domain-count{background:var(--primary);color:#fff;padding:1px 8px;border-radius:10px;font-size:11px}

/* 敏感字段 */
.sensitive-list{display:flex;flex-wrap:wrap;gap:6px}
.sensitive-tag{background:#fff3cd;border:1px solid #ffc107;color:#856404;padding:3px 10px;border-radius:14px;font-size:12px;font-family:monospace}
.sensitive-badge{background:#dc3545;color:#fff;padding:1px 7px;border-radius:10px;font-size:11px;font-weight:600}

/* 表列表 */
.table-filter-bar{display:flex;gap:10px;margin-bottom:12px}
.filter-input,.filter-select{padding:8px 12px;border:1px solid var(--border);border-radius:8px;font-size:13px;outline:none}
.filter-input{flex:1;max-width:300px}
.filter-input:focus,.filter-select:focus{border-color:var(--primary)}
.analysis-table{font-size:13px}
.analysis-table td{padding:8px 10px}
.mono{font-family:'Courier New',monospace;font-size:12px}
.muted{color:var(--text-2);font-size:12px}
.num{text-align:right;font-variant-numeric:tabular-nums}
.btn-link{background:none;border:none;color:var(--primary);cursor:pointer;font-size:13px;text-decoration:underline}
.btn-link:hover{color:var(--primary-dark)}
.domain-tag{background:var(--bg-2);border:1px solid var(--border);padding:2px 8px;border-radius:10px;font-size:11px;white-space:nowrap}

/* 侧边栏导航 */
.domain-nav-item{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;cursor:pointer;border-radius:8px;font-size:13px;color:var(--text-1);transition:.15s}
.domain-nav-item:hover{background:var(--bg-2)}
.domain-nav-item.active{background:var(--primary);color:#fff;font-weight:600}
.nav-count{background:rgba(255,255,255,.25);padding:0 8px;border-radius:10px;font-size:11px}
.domain-nav-item:not(.active) .nav-count{background:var(--border);color:var(--text-2)}

/* 表详情 */
.table-detail-view{padding:20px 0}
.detail-header{margin-bottom:16px}
.btn-back{background:none;border:none;color:var(--primary);cursor:pointer;font-size:14px;margin-bottom:8px}
.detail-header h2{margin:0 0 6px}
.detail-meta{display:flex;gap:16px;font-size:13px;color:var(--text-2);flex-wrap:wrap;align-items:center}
.detail-desc{background:var(--bg-2);border-left:3px solid var(--primary);padding:12px 16px;border-radius:0 8px 8px 0;margin-bottom:8px;font-size:14px}
.detail-chars{font-size:13px;color:var(--text-2);margin-bottom:20px}
.detail-section{margin-bottom:24px}
.col-sensitive{background:#fff3cd}
.col-pk{background:#d4edda}
.pk-badge{background:#28a745;color:#fff;padding:0 5px;border-radius:8px;font-size:10px;margin-left:4px}
.sens-badge{font-size:12px}
.conf-高{color:#28a745;font-weight:600}
.conf-中{color:#ffc107}
.conf-低{color:var(--text-2)}
.sample-scroll{overflow-x:auto;max-width:100%}
.sample-table{font-size:11px}
.sample-table th{white-space:nowrap}
.small{font-size:11px}
.null-val{color:var(--text-2);font-style:italic}

/* ====== API 管理 ====== */
.api-actions{display:flex;gap:6px;padding:0 12px 8px}
.api-item .ds-type{font-size:10px}
.api-status-badge{font-size:14px}
.status-active{color:var(--green)}
.status-inactive,.status-draft{color:var(--text-2)}
.domain-group{margin-bottom:8px}
.domain-head{padding:6px 12px 4px;font-size:11px;font-weight:700;color:var(--text-2);text-transform:uppercase;letter-spacing:.5px;border-bottom:1px solid var(--border)}
.domain-count{background:var(--primary-l);color:var(--primary);padding:1px 6px;border-radius:8px;font-size:10px;font-weight:600}
.domain-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px}
.domain-card{background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);padding:14px;text-align:center;transition:.2s}
.domain-card:hover{border-color:var(--primary);background:var(--primary-l)}
.domain-card-name{font-weight:600;font-size:14px;margin-bottom:4px}
.domain-card-count{font-size:12px;color:var(--text-2)}
.api-method-badge{background:var(--green);color:#fff;padding:2px 8px;border-radius:4px;font-size:11px;font-weight:700}
.api-path-box{display:flex;align-items:center;gap:12px;margin:8px 0}
.api-path-box code{flex:1;background:var(--bg);padding:8px 12px;border-radius:6px;font-size:13px;color:var(--primary)}
.api-info-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}
.api-info-grid>div{background:var(--bg);padding:8px 12px;border-radius:6px}
.info-label{display:block;font-size:10px;color:var(--text-2);margin-bottom:2px;text-transform:uppercase;letter-spacing:.5px}
.info-label+code,.info-label+span{font-size:13px}
.test-controls{background:var(--bg);border-radius:var(--radius);padding:16px;margin-top:12px}
.test-param-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:10px}
.test-controls label{display:block;font-size:11px;color:var(--text-2);margin-bottom:3px}
.test-controls input{width:100%;padding:6px 8px;border:1px solid var(--border);border-radius:4px;font-size:13px}
.filter-input{width:100%;padding:6px 8px;border:1px solid var(--border);border-radius:4px;font-size:12px;font-family:monospace}
.exec-result{margin-top:12px}
.exec-meta{display:flex;gap:16px;font-size:13px;color:var(--text-2);margin-bottom:8px;flex-wrap:wrap}
.exec-meta b{color:var(--text);font-weight:600}
.json-viewer{background:#1e293b;color:#93c5fd;padding:12px;border-radius:6px;font-size:11px;overflow-x:auto;max-height:400px;overflow-y:auto;line-height:1.5}
.tag{display:inline-block;font-size:10px;padding:1px 6px;border-radius:8px;background:var(--primary-l);color:var(--primary);margin-right:3px}
.tag-warn{background:#fef3c7;color:#d97706}
.tag-muted{background:#f1f5f9;color:var(--text-2)}
.consistency-result{background:var(--bg);border-radius:var(--radius);padding:16px;margin-top:12px}
.consistency-result.pass{border:2px solid var(--green)}
.consistency-result.warn{border:2px solid var(--amber)}
.consistency-rate{font-size:36px;font-weight:800;color:var(--green);text-align:center;padding:12px 0}
.consistency-rate.warn{color:var(--amber)}
.consistency-stats{display:flex;gap:20px;justify-content:center;font-size:14px;color:var(--text-2)}
.consistency-stats b{color:var(--text)}
.mismatch-list{margin-top:8px}
.mismatch-item{background:#fff;border:1px solid #fde68a;border-radius:6px;padding:8px 12px;margin-bottom:6px}
.diff-field{font-size:12px;color:var(--text-2);padding:4px 0}
.diff-field code{background:var(--bg);padding:1px 4px;border-radius:3px;font-size:11px}

/* ==================== 阶段四：AI 测试引擎 ==================== */
.loading-box{padding:40px;text-align:center;color:var(--text-2);font-size:15px;background:var(--bg-card);border-radius:8px;border:1px solid var(--border)}
.error-box{padding:20px;color:#ef4444;background:#fef2f2;border:1px solid #fecaca;border-radius:8px;font-size:14px}

.stat-mini-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:4px 0}
.stat-mini{text-align:center;padding:10px 4px;background:var(--bg);border-radius:6px}
.stat-mini .stat-num{font-size:20px;font-weight:700;color:var(--text)}
.stat-mini .stat-label{font-size:11px;color:var(--text-2);margin-top:2px}
.stat-mini.stat-pass .stat-num{color:var(--green)}
.stat-mini.stat-fail .stat-num{color:var(--red,#ef4444)}
.stat-mini.stat-warn .stat-num{color:var(--amber)}

.report-section{background:var(--bg-card);border:1px solid var(--border);border-radius:8px;padding:20px;margin-bottom:16px}
.report-section h3{margin:0 0 16px;font-size:18px;color:var(--text)}
.report-subsection{margin-top:20px}
.report-subsection h4{margin:0 0 10px;font-size:15px;color:var(--text)}

.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px}
.metric-card{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:14px 10px;text-align:center}
.metric-val{font-size:24px;font-weight:800;color:var(--text)}
.metric-label{font-size:12px;color:var(--text-2);margin-top:4px}
.metric-sub{font-size:11px;color:var(--text-3);margin-top:2px}

.data-table{width:100%;border-collapse:collapse;font-size:13px}
.data-table th{background:var(--bg);padding:8px 10px;text-align:left;font-weight:600;color:var(--text-2);border-bottom:2px solid var(--border);font-size:12px;white-space:nowrap}
.data-table td{padding:6px 10px;border-bottom:1px solid var(--border);color:var(--text)}
.data-table tr:hover td{background:var(--bg)}

.diff-list{display:flex;flex-direction:column;gap:6px}
.diff-item{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:8px 12px;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.diff-sev{color:#fff;font-size:10px;padding:2px 6px;border-radius:3px;font-weight:600;text-transform:uppercase}
.diff-type{font-size:12px;font-weight:600;color:var(--text)}
.diff-api{font-family:monospace;font-size:12px;color:var(--text-2)}
.diff-case{font-size:12px;color:var(--text-2)}
.diff-detail{width:100%;font-size:12px;color:var(--text-3);padding-top:4px}

.test-api-group{margin-bottom:12px;border:1px solid var(--border);border-radius:6px;overflow:hidden}
.test-api-group summary{padding:10px 14px;cursor:pointer;font-weight:600;font-size:14px;background:var(--bg)}
.test-api-group summary:hover{background:var(--bg-hover)}
.test-api-group[open] summary{border-bottom:1px solid var(--border)}
.diff-inline{padding:6px 10px;background:#fffbeb;border-radius:4px}
.diff-inline-item{font-size:12px;color:var(--text-2);padding:2px 0}
.tag{display:inline-block;padding:1px 8px;border-radius:10px;font-size:11px;background:var(--bg);color:var(--text-2);border:1px solid var(--border)}

/* ====== 阶段五：人工确认工作台 ====== */
.btn-success { background: #4CAF50; color: white; border: none; }
.btn-success:hover { background: #43A047; }
.btn-danger { background: #F44336; color: white; border: none; }
.btn-danger:hover { background: #E53935; }
.btn-warn { background: #FF9800; color: white; border: none; }
.btn-warn:hover { background: #F57C00; }

.review-overview { padding: 0; }
.review-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.review-card {
  background: white; border-radius: 8px; padding: 16px 20px;
  min-width: 130px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-align: center; border: 1px solid #e0e0e0;
}
.review-card-value { font-size: 28px; font-weight: 700; }
.review-card-label { font-size: 13px; color: #666; margin-top: 4px; }

.review-suite-info {
  background: #f0f4ff; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px;
}
.review-suite-info h3 { margin: 0 0 8px; font-size: 15px; color: #333; }
.suite-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #555; }
.suite-time { color: #999 !important; font-size: 12px; }

.review-detail { padding: 0; }
.review-detail-header { margin-bottom: 16px; }
.review-detail-header h2 { margin: 0 0 8px; font-size: 20px; }
.review-detail-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #666; align-items: center; }

.status-badge { padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }

.review-test-summary {
  background: #fafafa; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px;
  border: 1px solid #e0e0e0;
}
.review-test-summary h3 { margin: 0 0 8px; font-size: 15px; }
.test-summary-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.cat-breakdown { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.cat-badge {
  background: #e3f2fd; color: #1565C0; padding: 2px 10px;
  border-radius: 10px; font-size: 12px;
}

.review-actions-bar {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
  padding: 12px 16px; background: #f5f5f5; border-radius: 8px; align-items: center;
}
.badge-active {
  background: #4CAF50; color: white; padding: 6px 16px;
  border-radius: 4px; font-size: 14px; font-weight: 600;
}

.review-section { margin-bottom: 12px; }
.review-section summary, .review-section-open h3 {
  cursor: pointer; font-size: 14px; font-weight: 600; color: #333;
  padding: 8px 12px; background: #f0f0f0; border-radius: 4px;
  list-style: none;
}
.review-section summary::before { content: '▶ '; font-size: 10px; }
.review-section[open] summary::before { content: '▼ '; }
.review-section table { margin-top: 8px; }

.review-group-header {
  font-size: 12px; font-weight: 700; color: #555;
  padding: 6px 8px; background: #f0f0f0; border-radius: 4px; margin-top: 4px;
}
.ds-item-active { border-left: 3px solid #4CAF50; }
.ds-item-rejected { border-left: 3px solid #F44336; }

/* Timeline */
.timeline { padding-left: 8px; }
.timeline-item {
  position: relative; padding-left: 24px; padding-bottom: 16px;
  border-left: 2px solid #e0e0e0; margin-left: 8px;
}
.timeline-item:last-child { border-left: 2px solid transparent; }
.timeline-dot {
  position: absolute; left: -7px; top: 0;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid white; box-shadow: 0 0 0 1px #ccc;
}
.timeline-content { }
.timeline-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.timeline-feedback { font-size: 13px; color: #555; padding: 4px 0; }
.timeline-meta { font-size: 12px; color: #999; }
.timeline-decision { font-size: 13px; }

.loading { padding: 20px; text-align: center; color: #999; }


/* ====== 流程进度向导 ====== */
.flow-progress{display:flex;align-items:center;background:var(--bg-2);padding:6px 20px;border-bottom:1px solid var(--border);gap:0}
.flow-stage{display:flex;align-items:center;flex:1;min-width:0;cursor:pointer;padding:2px 4px;transition:.2s}
.flow-stage:hover{background:rgba(0,0,0,.04);border-radius:6px}
.flow-stage-dot{width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;flex-shrink:0;margin-right:4px;transition:.3s}
.flow-stage-dot.done{background:#43a047;color:#fff}
.flow-stage-dot.active{background:var(--primary);color:#fff}
.flow-stage-dot.pending{background:#e8e8e8;color:#aaa;border:2px solid #d0d0d0}
.flow-stage-dot.blocked{background:#fff3e0;color:#e65100;border:2px solid #ff9800;animation:flowPulse 2s infinite}
@keyframes flowPulse{0%,100%{opacity:1}50%{opacity:.55}}
.flow-stage-label{font-size:11px;font-weight:600;color:#666;white-space:nowrap;flex-shrink:0}
.flow-stage-bar{flex:1;height:3px;background:#e0e0e0;margin:0 6px;border-radius:2px;overflow:hidden;min-width:20px}
.flow-stage-bar-fill{height:100%;background:linear-gradient(90deg,#43a047,#66bb6a);border-radius:2px;transition:width .5s ease}
.flow-stage-warn .flow-stage-label{color:#e65100}

/* access_control.js CSS（追加到 style.css） */

.acc-stat-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin-bottom:8px}
.acc-stat{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:10px;text-align:center}
.acc-stat-num{font-size:22px;font-weight:700;color:#374151;line-height:1.2}
.acc-stat-lbl{font-size:11px;color:#9ca3af;margin-top:2px}
.acc-stat-green .acc-stat-num{color:#10b981}
.acc-stat-red .acc-stat-num{color:#ef4444}
.acc-stat-blue .acc-stat-num{color:#3b82f6}

.acc-scope{display:inline-block;padding:2px 6px;border-radius:3px;font-size:11px;background:#e0e7ff;color:#3730a3}
.acc-scope-api{background:#fef3c7;color:#92400e}
.acc-scope-view{background:#ede9fe;color:#5b21b6}
.acc-scope-datasource{background:#dcfce7;color:#166534}


/* ===== View引擎升级样式 ===== */
.btn-analyze {
  background: #7c4dff !important;
  color: #fff !important;
  border: none !important;
}
.btn-analyze:hover { background: #651fff !important; }

.btn-xs {
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #f5f5f5;
  cursor: pointer;
  white-space: nowrap;
}
.btn-xs:hover { background: #e0e0e0; border-color: #bbb; }

/* 报告弹窗 */
.report-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.report-modal {
  background: #fff;
  border-radius: 8px;
  width: 90%; max-width: 900px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.report-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.report-modal-title {
  font-size: 16px; font-weight: 600; color: #333;
}
.report-modal-close {
  background: none; border: none; font-size: 20px;
  cursor: pointer; color: #999; padding: 4px 8px;
}
.report-modal-close:hover { color: #333; }
.report-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  line-height: 1.7;
}
.report-modal-body h2 { font-size: 18px; margin: 16px 0 8px; color: #1a237e; }
.report-modal-body h3 { font-size: 15px; margin: 14px 0 6px; color: #283593; }
.report-modal-body h4 { font-size: 14px; margin: 10px 0 4px; color: #333; }
.report-modal-body p { margin: 6px 0; color: #444; }
.report-modal-body blockquote {
  border-left: 3px solid #7c4dff;
  margin: 8px 0; padding: 4px 12px;
  color: #666; background: #f5f0ff;
  border-radius: 0 4px 4px 0;
}
.report-modal-body hr { border: none; border-top: 1px solid #eee; margin: 16px 0; }
.report-modal-body ul { margin: 6px 0; padding-left: 20px; }
.report-modal-body li { margin: 3px 0; color: #444; }
.report-modal-body .report-table { width: 100%; margin: 8px 0; }
.report-modal-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}
.report-meta { font-size: 12px; color: #999; }

/* ── 统计卡片（字段语义 / 关系图谱） ── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 10px;
  margin: 12px 0 8px;
}
.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  min-width: 0;
}
.stat-card.highlight { border-left: 4px solid #f44336; }
.stat-num {
  font-size: 24px;
  font-weight: 700;
  color: #1a237e;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-label {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* P2 #7: API 管理页内子 tab */
.api-subtabs { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: #f8f9fb; }
.api-subtabs .subtab { padding: 6px 16px; border: 1px solid #d5d9e2; border-radius: 8px; background: #fff; cursor: pointer; font-size: 13px; color: #555; transition: all .15s; }
.api-subtabs .subtab:hover { border-color: #667eea; color: #667eea; }
.api-subtabs .subtab.active { background: #667eea; color: #fff; border-color: #667eea; box-shadow: 0 2px 6px rgba(102,126,234,.35); }

/* P3-2: 敏感字段钻取抽屉 */
.sens-drill-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 999; }
.sens-drill { position: fixed; top: 10%; left: 50%; transform: translateX(-50%); width: 640px; max-width: 92vw; max-height: 76vh; overflow: auto; background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); z-index: 1000; display: flex; flex-direction: column; }
.sens-drill-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #eee; background: #fafbfc; border-radius: 12px 12px 0 0; }

/* ===== 智能问数（Q-1..Q-5）===== */
.qa-wrap{display:flex;height:calc(100vh - 150px);min-height:460px;margin:14px 16px;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;background:#f8fafc}
.qa-side{width:300px;min-width:260px;background:#fff;border-right:1px solid #e5e7eb;display:flex;flex-direction:column;padding:12px}
.qa-side-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:6px}
.qa-side-head h3{font-size:15px;margin:0}
.qa-side-head select{padding:5px 8px;border:1px solid #d1d5db;border-radius:6px;font-size:12px;max-width:150px}
.qa-mode-switch{display:flex;gap:6px;margin-bottom:10px}
.qa-mode-btn{flex:1;padding:7px 0;border:1px solid #d1d5db;border-radius:8px;background:#f9fafb;font-size:12px;cursor:pointer}
.qa-mode-btn.active{background:#0d9488;color:#fff;border-color:#0d9488}
.qa-chat-log{flex:1;overflow-y:auto;min-height:60px;max-height:180px;background:#f9fafb;border-radius:8px;padding:8px;margin-bottom:8px;font-size:12px}
.qa-msg{margin-bottom:8px;line-height:1.6}
.qa-msg-user{color:#0f766e}
.qa-msg-assistant{color:#374151}
.qa-input-row{display:flex;gap:8px}
.qa-input-row textarea{flex:1;padding:8px;border:1px solid #d1d5db;border-radius:8px;font-size:13px;resize:none;font-family:inherit}
.qa-send-btn{padding:8px 16px;border-radius:8px;border:none;background:linear-gradient(135deg,#0d9488,#0f766e);color:#fff;cursor:pointer;font-weight:600}
.qa-history{margin-top:10px;max-height:220px;overflow-y:auto}
.qa-history-item{padding:7px 8px;border:1px solid #eee;border-radius:8px;margin-bottom:6px;cursor:pointer;background:#fafafa}
.qa-history-item:hover{background:#f0fdfa;border-color:#99f6e4}
.qa-mode-tag{background:#e0f2fe;color:#0369a1;border-radius:4px;padding:1px 6px;font-size:10px}
.qa-main{flex:1;padding:14px;overflow-y:auto;min-width:0}
.qa-result{background:#fff;border-radius:12px;border:1px solid #e5e7eb;min-height:300px;padding:14px}
.qa-empty{color:#9ca3af;text-align:center;padding:70px 20px;font-size:13px}
.qa-loading{color:#0d9488;text-align:center;padding:60px 20px;font-size:13px}
.qa-error{color:#dc2626;background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:14px;font-size:13px}
.qa-report-head{border-bottom:1px solid #f0f0f0;padding-bottom:8px}
.qa-tip{background:#fffbeb;color:#92400e;border:1px solid #fde68a;border-radius:6px;padding:3px 8px;font-size:11px}
.qa-findings{background:#fffbeb;border:1px solid #fde68a;border-radius:10px;padding:10px 14px;margin:10px 0}
.qa-findings-title{font-weight:700;color:#92400e;margin-bottom:6px}
.qa-findings ul{margin:0;padding-left:18px;font-size:13px;line-height:1.9;color:#78350f}
.qa-table-title{font-weight:700;margin:12px 0 6px;font-size:13px}
.qa-chart-switch{padding:4px 10px;font-size:11px;border:1px solid #d1d5db;border-radius:6px;background:#f9fafb;color:#555;cursor:pointer}
.qa-chart-switch.active{background:#0d9488;color:#fff;border-color:#0d9488}
.qa-sql{margin-top:10px}
.qa-sql pre{background:#111827;color:#d1fae5;padding:10px;border-radius:8px;font-size:11px;overflow-x:auto}
.qa-chat-answer{line-height:1.9;font-size:13px}
@media (max-width:860px){
  .qa-wrap{flex-direction:column;height:auto}
  .qa-side{width:100%;border-right:none;border-bottom:1px solid #e5e7eb}
  .qa-main{padding:10px}
}

/* ==================== AI 测试引擎进度条 ==================== */
.testing-progress-container {
  max-width: 800px;
  margin: 24px auto;
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.testing-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.testing-progress-header h3 { margin: 0; font-size: 18px; }
.testing-status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.testing-status-running {
  background: #fef3c7;
  color: #d97706;
  animation: pulse-badge 2s infinite;
}
.testing-status-completed { background: #d1fae5; color: #059669; }
.testing-status-failed { background: #fee2e2; color: #dc2626; }
@keyframes pulse-badge {
  0%,100% { opacity: 1; }
  50% { opacity: .6; }
}

.testing-progress-bar-wrap {
  width: 100%;
  height: 24px;
  background: #f3f4f6;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
}
.testing-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  border-radius: 12px;
  transition: width .5s ease;
  position: relative;
  overflow: hidden;
}
.testing-progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.testing-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 20px;
}
#testingProgressPct { font-weight: 700; color: #3b82f6; font-size: 15px; }

.testing-progress-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.tps-item {
  text-align: center;
  padding: 12px 8px;
  background: #f9fafb;
  border-radius: 8px;
}
.tps-num {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: #374151;
}
.tps-label {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}
.tps-pass .tps-num { color: #10b981; }
.tps-fail .tps-num { color: #ef4444; }

.testing-progress-current {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #eff6ff;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #1e40af;
}
.tps-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #bfdbfe;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.testing-progress-log {
  max-height: 180px;
  overflow-y: auto;
  background: #1e293b;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.6;
}
.testing-log-line { color: #94a3b8; padding: 1px 0; }
.testing-log-success { color: #4ade80; }
.testing-log-error { color: #f87171; }
.testing-log-info { color: #60a5fa; }

.testing-progress-hint {
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 13px;
  color: #92400e;
}

@media (max-width: 768px) {
  .testing-progress-stats { grid-template-columns: repeat(2, 1fr); }
}


/* ═══ 智能问数：核心功能突出样式 ═══ */

/* 菜单按钮高亮 */
.tab.tab-featured{
  background:linear-gradient(135deg,#0d9488,#0f766e)!important;
  color:#fff!important;
  border-radius:8px;
  font-weight:700;
  margin:4px 6px 4px 4px;
  padding:8px 18px;
  border:none!important;
  border-bottom:none!important;
  box-shadow:0 2px 10px rgba(13,148,136,.35);
  animation:tabGlow 2.8s ease-in-out infinite;
  position:relative;
}
.tab.tab-featured:hover{
  background:linear-gradient(135deg,#0f766e,#115e59)!important;
  color:#fff!important;
  box-shadow:0 4px 16px rgba(13,148,136,.5);
  transform:translateY(-1px);
}
.tab.tab-featured.active{
  background:linear-gradient(135deg,#0d9488,#0f766e)!important;
  color:#fff!important;
  border:none!important;
  border-bottom:none!important;
  box-shadow:0 2px 14px rgba(13,148,136,.55);
}
@keyframes tabGlow{
  0%,100%{box-shadow:0 2px 10px rgba(13,148,136,.3)}
  50%{box-shadow:0 2px 18px rgba(13,148,136,.55)}
}

/* 左侧交互面板强化 */
.qa-side{
  width:360px;
  min-width:320px;
  box-shadow:2px 0 16px rgba(0,0,0,.06);
  background:linear-gradient(180deg,#ffffff,#fafbfc);
}
.qa-side-head{
  padding:4px 4px 12px;
  border-bottom:2px solid #f0fdfa;
  margin-bottom:12px;
}
.qa-side-head h3{
  font-size:18px;
  font-weight:800;
  background:linear-gradient(135deg,#0d9488,#0f766e);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  letter-spacing:.5px;
}
.qa-mode-btn{
  padding:10px 0;
  font-size:13px;
  font-weight:600;
  transition:.2s;
}
.qa-mode-btn.active{
  box-shadow:0 2px 10px rgba(13,148,136,.35);
  transform:translateY(-1px);
}
.qa-input-row textarea{
  padding:10px 14px;
  font-size:14px;
  border-width:2px;
  box-shadow:inset 0 1px 3px rgba(0,0,0,.04);
  line-height:1.6;
}
.qa-input-row textarea:focus{
  border-color:#0d9488;
  box-shadow:0 0 0 3px rgba(13,148,136,.12);
  outline:none;
}
.qa-send-btn{
  padding:10px 28px;
  font-size:14px;
  font-weight:700;
  border-radius:8px;
  box-shadow:0 2px 8px rgba(13,148,136,.3);
  transition:.2s;
  letter-spacing:1px;
}
.qa-send-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 4px 14px rgba(13,148,136,.45);
}
.qa-send-btn:active{
  transform:translateY(0);
}
.qa-history{
  border-top:1px solid #f0fdfa;
  padding-top:8px;
}
.qa-empty{
  font-size:15px;
  color:#94a3b8;
  padding:80px 24px;
}
.qa-empty::before{
  content:"🤖";
  display:block;
  font-size:48px;
  margin-bottom:12px;
  opacity:.3;
}
