/* ============================================================
   ai.css — X智算 · 模型采样与 RL 模块样式
   与 industry/science 同范式，复用 common.css 的 CSS 变量
   ============================================================ */
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-family); background: var(--color-bg-deep); color: var(--color-text-main); }

/* ===== 顶部栏（与品牌一致） ===== */
.topbar { display: flex; align-items: center; justify-content: space-between;
    max-width: 1200px; margin: 0 auto; padding: 16px 24px 0; }
.topbar .brand { font-size: 16px; font-weight: 700; color: var(--color-text-main);
    text-decoration: none; display: flex; align-items: center; gap: 8px; }
.topbar .brand i { font-size: 20px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.auth .btn-login { background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff; padding: 7px 16px; border-radius: 20px; text-decoration: none; font-weight: 600; }
.auth .btn-login:hover { filter: brightness(1.08); }
.auth .user { display: flex; align-items: center; gap: 10px; }
.auth .avatar { width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.auth .bal { color: var(--color-text-sub); } .auth .bal b { color: #5fe3a1; }
.auth .btn-logout { background: transparent; border: 1px solid rgba(255,255,255,0.1);
    color: var(--color-text-sub); padding: 6px 12px; border-radius: 20px; cursor: pointer; font-size: 13px; }
.auth .btn-logout:hover { border-color: var(--color-primary); color: #fff; }

/* ===== 容器 / 头部 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; }
.header { text-align: center; margin-bottom: 44px; }
.header h1 { font-size: 40px; font-weight: 800; margin-bottom: 12px; }
.header h1 .highlight {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.header p { color: var(--color-text-sub); font-size: 16px; }

/* ===== 子应用网格（与 industry 一致） ===== */
.sim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.sim-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04);
    border-radius: 20px; padding: 32px 28px; text-decoration: none; color: var(--color-text-main);
    transition: all .3s ease; position: relative; }
.sim-card:hover { transform: translateY(-6px); border-color: rgba(102,126,234,0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.sim-card .icon { font-size: 42px; margin-bottom: 16px; display: block; }
.sim-card .name { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.sim-card .desc { font-size: 14px; color: var(--color-text-sub); line-height: 1.7; margin-bottom: 20px; }
.sim-card .meta { display: flex; justify-content: space-between; align-items: center;
    padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.04); }
.sim-card .tag { padding: 3px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.sim-card .tag-live { background: rgba(72,187,120,0.12); color: #48bb78; }
.sim-card .tag-coming { background: rgba(237,137,54,0.12); color: #ed8936; }
.sim-card .arrow { color: var(--color-text-muted); transition: all .3s ease; }
.sim-card:hover .arrow { color: var(--color-primary); transform: translateX(4px); }

/* ===== 任务概览（落地页） ===== */
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 36px; }
.ov { background: rgba(102,126,234,0.06); border: 1px solid rgba(102,126,234,0.12);
    border-radius: 14px; padding: 20px; text-align: center; }
.ov .v { font-size: 32px; font-weight: 700; color: var(--color-primary); }
.ov .l { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }

/* ===== 成本预览（提交页） ===== */
.cost-preview { background: rgba(79,172,254,0.06); border: 1px solid rgba(79,172,254,0.1);
    border-radius: 10px; padding: 14px 18px; display: flex; justify-content: space-between;
    align-items: center; margin-top: 8px; }
.cost-preview .label { font-size: 13px; color: var(--color-text-sub); }
.cost-preview .amount { font-size: 24px; font-weight: 700; color: #4facfe; }
.cost-preview .amount small { font-size: 14px; color: var(--color-text-muted); }

/* ===== 提交页：模式选择 ===== */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-btn { padding: 16px 12px; background: rgba(255,255,255,0.02);
    border: 2px solid rgba(255,255,255,0.06); border-radius: 14px; cursor: pointer;
    text-align: center; transition: all .2s ease; }
.mode-btn:hover { border-color: rgba(102,126,234,0.4); transform: translateY(-2px); }
.mode-btn.active { border-color: var(--color-primary); background: rgba(102,126,234,0.08);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }
.mode-btn .mi { font-size: 26px; margin-bottom: 6px; display: block; }
.mode-btn .mn { font-size: 14px; font-weight: 600; }
.mode-btn .me { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; display: block; }

/* ===== 结果页：验证结论卡 ===== */
.verdict { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: 14px;
    border-left: 5px solid; margin-bottom: 18px; }
.verdict.pass { background: rgba(72,187,120,0.08); border-color: #48bb78; }
.verdict.warn { background: rgba(237,137,54,0.08); border-color: #ed8936; }
.verdict.fail { background: rgba(252,129,129,0.08); border-color: #fc8181; }
.verdict.unknown { background: rgba(160,174,192,0.08); border-color: #a0aec0; }
.verdict .mark { font-size: 28px; line-height: 1; }
.verdict .vt { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.verdict ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--color-text-sub); }

/* ===== 结果页：检查徽章 ===== */
.chk { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px;
    font-weight: 600; margin: 1px 3px 1px 0; }
.chk.ok { background: rgba(72,187,120,0.14); color: #48bb78; }
.chk.bad { background: rgba(252,129,129,0.14); color: #fc8181; }

/* ===== 表格（结果 / 任务列表） ===== */
.tbl-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
table.data th { color: var(--color-text-muted); font-weight: 500; }
table.data tr:hover td { background: rgba(255,255,255,0.02); }
.st { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; }
.st.pending { background: rgba(237,137,54,0.12); border: 1px solid rgba(237,137,54,0.2); color: #ed8936; }
.st.running { background: rgba(79,172,254,0.12); border: 1px solid rgba(79,172,254,0.2); color: #4facfe; }
.st.completed { background: rgba(72,187,120,0.12); border: 1px solid rgba(72,187,120,0.2); color: #48bb78; }
.st.failed { background: rgba(252,129,129,0.12); border: 1px solid rgba(252,129,129,0.2); color: #fc8181; }

/* ===== 进度条 ===== */
.pbar { height: 6px; background: #2a3050; border-radius: 4px; overflow: hidden; margin-top: 5px; min-width: 64px; }
.pbar > i { display: block; height: 100%; background: linear-gradient(90deg,#4f7cff,#5fe3a1); transition: width .4s; }

.btn-view { display: inline-block; background: #222744; border: 1px solid #34406b; color: #8fb0ff;
    padding: 5px 11px; border-radius: 8px; font-size: 12px; text-decoration: none; white-space: nowrap; }
.btn-view:hover { background: #2d3760; color: #fff; }
.btn-del { display: inline-block; background: rgba(252,129,129,0.08); border: 1px solid rgba(252,129,129,0.3);
    color: #fc8181; padding: 5px 11px; border-radius: 8px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.btn-del:hover { background: rgba(252,129,129,0.18); color: #fff; }
.btn-del:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 任务详情弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(5,8,20,0.72); display: flex;
    align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-box { background: #161b33; border: 1px solid #2a3050; border-radius: 14px; width: 640px;
    max-width: 100%; max-height: 82vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid #2a3050; }
.modal-head h3 { margin: 0; font-size: 15px; color: #e6eaf6; }
.modal-close { background: none; border: none; color: #8b93b8; font-size: 20px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 16px 18px; overflow: auto; font-size: 13px; color: #c3cae6; }
.modal-body table { width: 100%; border-collapse: collapse; }
.modal-body td { padding: 6px 4px; border-bottom: 1px solid #222744; vertical-align: top; }
.modal-body td.k { color: #8b93b8; white-space: nowrap; width: 130px; }
.modal-body pre { background: #0d1124; border: 1px solid #222744; border-radius: 8px;
    padding: 10px; font-size: 12px; overflow: auto; max-height: 220px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .header h1 { font-size: 28px; }
    .sim-grid { grid-template-columns: 1fr; }
    .mode-grid { grid-template-columns: 1fr; }
}
