/* DCMA-14 进度计划质量评估工具 — 纯静态样式（无外部依赖） */
:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --green: #16a34a;
    --green-bg: #f0fdf4;
    --red: #dc2626;
    --red-bg: #fef2f2;
    --amber: #d97706;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ---------- 头部 ---------- */
.site-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    padding: 28px 0;
    box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-header h1 { margin: 0; font-size: 26px; font-weight: 700; }
.subtitle { margin: 6px 0 0; opacity: .85; font-size: 14px; }
.privacy-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: default;
}

/* ---------- 卡片 ---------- */
main { padding: 24px 0 48px; }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card-title {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 16px;
    font-size: 17px; font-weight: 700;
}
.card-title .icon { width: 20px; height: 20px; color: var(--primary); flex: none; }
.title-hint { font-size: 12px; font-weight: 400; color: var(--muted); }

/* ---------- 上传 ---------- */
.upload-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 28px; }
@media (max-width: 860px) { .upload-grid { grid-template-columns: 1fr; } }
.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 2px dashed #c7d2fe;
    border-radius: var(--radius);
    background: #f8faff;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--primary); background: #eef2ff; outline: none; }
.dropzone.dragover { border-color: var(--primary); background: #e0e7ff; }
.dropzone-icon { width: 44px; height: 44px; color: #a5b4fc; margin-bottom: 8px; }
.dropzone-title { margin: 0; font-size: 16px; font-weight: 600; color: #475569; }
.dropzone-hint { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.file-status { margin: 12px 0 0; font-size: 13px; color: var(--muted); min-height: 1.2em; }
.file-status.ok { color: var(--green); font-weight: 600; }
.file-status.err { color: var(--red); font-weight: 600; }

/* ---------- 摘要 ---------- */
.summary-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.summary-box.empty {
    display: flex; align-items: center; justify-content: center;
    min-height: 180px; color: #94a3b8; font-size: 14px;
    border: 1px dashed var(--border); border-radius: var(--radius);
}
.summary-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}
.summary-item .k { font-size: 12px; color: var(--muted); }
.summary-item .v { font-size: 17px; font-weight: 700; color: var(--text); }

/* ---------- 指标卡片 ---------- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.metric-card {
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    background: #fff;
    transition: transform .15s, box-shadow .15s;
    cursor: pointer;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric-card.pass { border-left: 4px solid var(--green); }
.metric-card.fail { border-left: 4px solid var(--red); }
.metric-card.na { border-left: 4px solid var(--amber); }
.metric-name { font-size: 12.5px; font-weight: 600; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-value { font-size: 21px; font-weight: 800; margin: 4px 0 6px; }
.metric-card.pass .metric-value { color: var(--green); }
.metric-card.fail .metric-value { color: var(--red); }
.metric-card.na .metric-value { color: var(--amber); }
.metric-unit { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.metric-badge {
    display: inline-block; font-size: 11px; font-weight: 700;
    border-radius: 999px; padding: 2px 10px;
}
.metric-card.pass .metric-badge { background: var(--green-bg); color: var(--green); }
.metric-card.fail .metric-badge { background: var(--red-bg); color: var(--red); }
.metric-card.na .metric-badge { background: #fffbeb; color: var(--amber); }
.metric-note { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ---------- 图表 ---------- */
.chart-box { width: 100%; overflow-x: auto; }
.chart-box svg { display: block; min-width: 760px; width: 100%; height: auto; }
.bar-pass { fill: #22c55e; }
.bar-fail { fill: #ef4444; }
.bar-na { fill: #f59e0b; }
.bar-pass:hover, .bar-fail:hover, .bar-na:hover { opacity: .8; cursor: pointer; }

/* ---------- 明细 ---------- */
.details-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.details-toolbar .card-title { margin: 0; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
select {
    border: 1px solid var(--border); border-radius: 8px;
    padding: 8px 12px; font-size: 14px; background: #fff; color: var(--text);
}
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: none; border-radius: 8px; cursor: pointer;
    padding: 9px 16px; font-size: 14px; font-weight: 600;
    transition: background .15s;
}
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.detail-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.detail-meta .warn { color: var(--amber); font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; max-height: 480px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
    position: sticky; top: 0; z-index: 1;
    background: #f8fafc; text-align: left;
    padding: 10px 14px; font-weight: 600; color: var(--muted);
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 9px 14px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }
td.all-ok { color: var(--green); font-weight: 600; text-align: center; padding: 28px !important; white-space: normal !important; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); background: #fff; padding: 20px 0; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer p { margin: 0; font-size: 13px; color: var(--muted); }
.btn-link { background: none; border: none; color: var(--primary); font-size: 13px; cursor: pointer; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* ---------- 模态框 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
.modal-body {
    position: relative; background: #fff; border-radius: var(--radius);
    width: 100%; max-width: 720px; max-height: 82vh; overflow-y: auto;
    padding: 24px; box-shadow: 0 20px 60px rgba(15, 23, 42, .25);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.btn-icon { background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.btn-icon:hover { color: var(--text); }
.ref-item { border-left: 3px solid var(--primary); padding: 2px 0 2px 14px; margin-bottom: 14px; }
.ref-item .name { font-weight: 700; font-size: 14px; }
.ref-item .std { font-weight: 700; font-size: 13px; color: var(--primary); margin-left: 8px; }
.ref-item .desc { font-size: 13px; color: var(--muted); margin: 2px 0 0; }

/* ---------- 轻提示 ---------- */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: #1e293b; color: #fff; border-radius: 8px;
    padding: 12px 20px; font-size: 14px; box-shadow: var(--shadow);
    z-index: 60; max-width: 90vw;
}
.toast.err { background: var(--red); }
