/* =========================================================
   测试项目详情页 · 共用样式表 test-common.css
   设计语言：深青色主导 + 金色点缀 + 衬线标题
   引用方式：<link rel="stylesheet" href="../test-common.css">
   ========================================================= */


:root {
    /* 主色系 - 深青色 */
    --primary: #1f4e5f;
    --primary-dark: #0d2a35;
    --primary-mid: #163a47;
    --primary-light: #2f7a8f;
    --primary-50: #edf4f6;
    --primary-100: #d3e4e9;
    --primary-200: #a7c9d2;

    /* 金色点缀 */
    --gold: #c48a3a;
    --gold-light: #e5c48c;
    --gold-50: #fbf5ea;
    --gold-dark: #9a6a2c;

    /* 语义色 */
    --success: #2e7d32;
    --success-light: #e8f5e9;
    --warning: #b8860b;
    --warning-light: #fff8e1;
    --danger: #c62828;
    --danger-light: #fdecea;
    --info: #1565c0;
    --info-light: #e3f2fd;

    /* 分类主题色 */
    --c-safety: #c62828;
    --c-safety-light: #fdecea;
    --c-emc: #e67e22;
    --c-emc-light: #fef5e7;
    --c-reliability: #1f4e5f;
    --c-reliability-light: #edf4f6;
    --c-performance: #7b2d8e;
    --c-performance-light: #f4ecf7;
    --c-function: #1565c0;
    --c-function-light: #e3f2fd;
    --c-electronics: #c48a3a;
    --c-electronics-light: #fbf5ea;
    --c-environmental: #2e7d32;
    --c-environmental-light: #e8f5e9;

    /* 中性色 */
    --bg: #f0f2f5;
    --bg-alt: #e8ecf0;
    --card-bg: #ffffff;
    --text: #1a2332;
    --text-2: #4a5568;
    --text-3: #8896a6;
    --border: #c8d1dc;
    --border-light: #e4e9ef;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(13,42,53,.05);
    --shadow-md: 0 4px 24px rgba(13,42,53,.07);
    --shadow-lg: 0 12px 40px rgba(13,42,53,.10);
    --shadow-xl: 0 24px 60px rgba(13,42,53,.14);

    /* 字体 */
    --serif: "Songti SC", "Source Han Serif SC", "SimSun", serif;
    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
    --mono: ui-monospace, "SF Mono", "Consolas", "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: all .25s cubic-bezier(.4,0,.2,1); }

/* ============ 顶部导航栏 ============ */
.topbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(200,209,220,.5);
    box-shadow: 0 1px 12px rgba(13,42,53,.04);
}
.topbar-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 28px;
    height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); flex-wrap: wrap; }
.topbar-breadcrumb a { color: var(--primary); font-weight: 600; }
.topbar-breadcrumb a:hover { color: var(--gold); }
.topbar-breadcrumb .sep { opacity: .5; }
.topbar-breadcrumb .current { color: var(--text-2); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-badge {
    font-family: var(--mono); font-size: 11px; font-weight: 700;
    padding: 4px 10px; background: var(--gold-50); color: var(--gold-dark);
    border-radius: 6px; letter-spacing: .3px;
}
.topbar-home {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px; background: var(--primary); color: #fff;
    border-radius: 8px; font-size: 12.5px; font-weight: 600;
}
.topbar-home:hover { background: var(--primary-dark); transform: translateX(-2px); }

/* ============ 英雄区 ============ */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-mid) 45%, var(--primary) 100%);
    overflow: hidden;
    padding: 48px 32px 44px;
    color: #fff;
}
.hero::before {
    content: ""; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
}
.hero::after {
    content: ""; position: absolute;
    top: -100px; right: -60px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(196,138,58,.14) 0%, transparent 65%);
    border-radius: 50%; pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; }
.hero-cat {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 30px;
    color: rgba(255,255,255,.85);
    font-size: 12px; font-weight: 600; letter-spacing: .5px;
    margin-bottom: 18px;
}
.hero-cat .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-light); }
.hero h1 {
    font-family: var(--serif);
    font-size: 38px; font-weight: 900;
    line-height: 1.2; letter-spacing: 1.5px;
    margin-bottom: 12px;
    text-shadow: 0 4px 24px rgba(0,0,0,.2);
}
.hero h1 .accent { color: var(--gold-light); }
.hero-sub {
    font-size: 15px; color: rgba(255,255,255,.78);
    letter-spacing: .5px; line-height: 1.8;
    max-width: 820px; margin-bottom: 22px;
}
.hero-sub strong { color: var(--gold-light); font-weight: 600; }
.hero-meta {
    display: flex; flex-wrap: wrap; gap: 10px;
    padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12);
}
.hero-meta-item {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: rgba(255,255,255,.7);
}
.hero-meta-item strong { color: #fff; font-weight: 600; }
.hero-meta-item .lab { color: var(--gold-light); }

/* ============ 主体布局 ============ */
.layout {
    max-width: 1280px; margin: 0 auto; padding: 28px 28px 60px;
    display: grid; grid-template-columns: 220px 1fr; gap: 28px;
    align-items: start;
}
/* 侧边目录 */
.sidebar {
    position: sticky; top: 76px;
    background: var(--card-bg);
    border-radius: 14px;
    padding: 20px 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}
.sidebar-title {
    font-family: var(--serif); font-size: 14px; font-weight: 700;
    color: var(--text); margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
    display: flex; align-items: center; gap: 6px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 8px;
    font-size: 13px; color: var(--text-2);
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: var(--primary-50); color: var(--primary); border-left-color: var(--primary-light); }
.sidebar-nav a.active { background: var(--primary-50); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.sidebar-nav a .num {
    font-family: var(--mono); font-size: 11px;
    width: 22px; height: 22px; border-radius: 6px;
    background: var(--bg-alt); color: var(--text-3);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar-nav a.active .num { background: var(--primary); color: #fff; }
.sidebar-related {
    margin-top: 20px; padding-top: 16px;
    border-top: 1px dashed var(--border);
}
.sidebar-related-title { font-size: 12px; color: var(--text-3); margin-bottom: 8px; letter-spacing: .5px; }
.sidebar-related a {
    display: block; padding: 6px 10px; font-size: 12.5px;
    color: var(--text-2); border-radius: 6px;
}
.sidebar-related a:hover { background: var(--gold-50); color: var(--gold-dark); }

/* ============ 内容区 ============ */
.content { min-width: 0; }

/* 信息概览卡片 */
.overview {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
    margin-bottom: 24px;
}
.ov-card {
    background: var(--card-bg); padding: 16px 18px;
    border-radius: 12px; border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--primary);
}
.ov-card.gold { border-top-color: var(--gold); }
.ov-card.danger { border-top-color: var(--danger); }
.ov-card.success { border-top-color: var(--success); }
.ov-label { font-size: 11.5px; color: var(--text-3); letter-spacing: .5px; margin-bottom: 4px; }
.ov-value { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--text); }
.ov-value.small { font-family: var(--sans); font-size: 14px; }
.ov-card .ov-value strong { color: var(--primary); }
.ov-card.gold .ov-value strong { color: var(--gold-dark); }

/* 章节 */
.section {
    background: var(--card-bg); border-radius: 14px;
    padding: 26px 28px; margin-bottom: 20px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
    scroll-margin-top: 76px;
}
.section-head {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 18px; padding-bottom: 14px;
    border-bottom: 2px solid var(--border-light);
}
.section-head .sh-num {
    font-family: var(--mono); font-size: 13px; font-weight: 700;
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.section-head .sh-num.gold { background: linear-gradient(135deg, var(--gold), var(--gold-light)); }
.section-head .sh-num.danger { background: linear-gradient(135deg, var(--danger), #e57373); }
.section-head .sh-num.success { background: linear-gradient(135deg, var(--success), #66bb6a); }
.section-head .sh-num.info { background: linear-gradient(135deg, var(--info), #64b5f6); }
.section-head .sh-num.purple { background: linear-gradient(135deg, var(--c-performance), var(--c-performance-light)); }
.section-title {
    font-family: var(--serif); font-size: 20px; font-weight: 700;
    color: var(--text); flex: 1;
}
.section-head .sh-meta {
    font-size: 12px; color: var(--text-3);
    font-family: var(--mono);
}

/* 正文段落 */
.p { font-size: 14.5px; color: var(--text-2); line-height: 1.9; margin-bottom: 12px; }
.p strong { color: var(--primary); font-weight: 600; }
.p code { font-family: var(--mono); background: var(--primary-50); color: var(--primary); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.lead { font-size: 15.5px; color: var(--text); line-height: 1.9; padding: 14px 18px; background: var(--primary-50); border-left: 4px solid var(--primary); border-radius: 0 8px 8px 0; margin-bottom: 16px; }
.lead strong { color: var(--primary-dark); }

/* 子标题 */
h3.sub {
    font-family: var(--serif); font-size: 16px; font-weight: 700;
    color: var(--primary); margin: 18px 0 10px;
    padding-left: 12px; border-left: 4px solid var(--gold);
}
h4.sub2 {
    font-size: 14.5px; font-weight: 700; color: var(--text);
    margin: 14px 0 8px; display: flex; align-items: center; gap: 6px;
}
h4.sub2::before { content: "▸"; color: var(--gold); }

/* 列表 */
.ul { list-style: none; padding-left: 4px; margin-bottom: 14px; }
.ul li {
    position: relative; padding-left: 22px; margin-bottom: 8px;
    font-size: 14.5px; color: var(--text-2); line-height: 1.85;
}
.ul li::before {
    content: ""; position: absolute; left: 6px; top: 11px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--gold);
}
.ul li strong { color: var(--text); font-weight: 600; }
.ul li code { font-family: var(--mono); background: var(--primary-50); color: var(--primary); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

.ol { list-style: none; counter-reset: ol; padding-left: 4px; margin-bottom: 14px; }
.ol li {
    position: relative; padding-left: 36px; margin-bottom: 10px;
    font-size: 14.5px; color: var(--text-2); line-height: 1.85;
    counter-increment: ol;
}
.ol li::before {
    content: counter(ol); position: absolute; left: 0; top: 3px;
    width: 24px; height: 24px; border-radius: 6px;
    background: var(--primary-50); color: var(--primary);
    font-family: var(--mono); font-size: 12px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.ol li strong { color: var(--text); font-weight: 600; }

/* 表格 */
.tbl-wrap { overflow-x: auto; margin: 12px 0 18px; border-radius: 10px; border: 1px solid var(--border-light); }
table.tbl {
    width: 100%; border-collapse: collapse; font-size: 13.5px;
    background: var(--card-bg);
}
table.tbl th {
    background: linear-gradient(135deg, var(--primary), var(--primary-mid));
    color: #fff; padding: 11px 14px; text-align: left;
    font-weight: 600; font-size: 13px; letter-spacing: .3px;
    white-space: nowrap;
}
table.tbl td {
    padding: 10px 14px; border-bottom: 1px solid var(--border-light);
    color: var(--text-2); vertical-align: top;
}
table.tbl tr:nth-child(even) td { background: #fafbfc; }
table.tbl tr:hover td { background: var(--primary-50); }
table.tbl td strong { color: var(--text); font-weight: 600; }
table.tbl td code { font-family: var(--mono); background: var(--primary-50); color: var(--primary); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
table.tbl .num { font-family: var(--mono); color: var(--primary); font-weight: 600; }
table.tbl .pass { color: var(--success); font-weight: 600; }
table.tbl .fail { color: var(--danger); font-weight: 600; }

/* 金色主题表 */
table.tbl.gold th { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); }
table.tbl.danger th { background: linear-gradient(135deg, var(--danger), #8e2424); }
table.tbl.success th { background: linear-gradient(135deg, var(--success), #1b5e20); }

/* 信息提示框 */
.note {
    padding: 14px 18px; border-radius: 10px; margin: 14px 0;
    font-size: 13.5px; line-height: 1.8;
    display: flex; gap: 12px;
}
.note .ico { font-size: 18px; flex-shrink: 0; }
.note .body { flex: 1; }
.note .body strong { font-weight: 700; }
.note.info { background: var(--info-light); border-left: 4px solid var(--info); color: #0d47a1; }
.note.warn { background: var(--warning-light); border-left: 4px solid var(--warning); color: #6b4f00; }
.note.danger { background: var(--danger-light); border-left: 4px solid var(--danger); color: #8e1c1c; }
.note.success { background: var(--success-light); border-left: 4px solid var(--success); color: #1b5e20; }
.note.tip { background: var(--gold-50); border-left: 4px solid var(--gold); color: var(--gold-dark); }

/* 标准条款引用块 */
.clause-ref {
    background: linear-gradient(135deg, var(--primary-50), #f7fafb);
    border: 1px solid var(--primary-100);
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    padding: 14px 18px; margin: 12px 0;
    font-size: 13.5px; color: var(--text-2); line-height: 1.85;
}
.clause-ref .cr-tag {
    display: inline-block; padding: 2px 8px;
    background: var(--primary); color: #fff;
    font-family: var(--mono); font-size: 11px; font-weight: 700;
    border-radius: 4px; margin-right: 8px; letter-spacing: .3px;
}
.clause-ref strong { color: var(--primary-dark); }

/* 设备卡片网格 */
.equip-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0; }
.equip-card {
    background: #fafbfc; border: 1px solid var(--border-light);
    border-radius: 10px; padding: 14px 16px;
    border-left: 3px solid var(--gold);
}
.equip-card .ec-name {
    font-size: 14px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.equip-card .ec-name .icon { font-size: 16px; }
.equip-card .ec-spec { font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.equip-card .ec-spec strong { color: var(--text-2); font-weight: 600; }

/* 步骤流程 */
.steps { display: flex; flex-direction: column; gap: 0; margin: 14px 0; }
.step {
    position: relative; padding: 14px 18px 14px 56px;
    background: #fafbfc; border: 1px solid var(--border-light);
    border-radius: 10px; margin-bottom: 8px;
}
.step::before {
    content: attr(data-n); position: absolute; left: 14px; top: 14px;
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; font-family: var(--mono); font-size: 13px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.step::after {
    content: ""; position: absolute; left: 28px; bottom: -8px;
    width: 2px; height: 8px; background: var(--border);
}
.step:last-child::after { display: none; }
.step .st-title { font-size: 14.5px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.step .st-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.8; }
.step .st-desc strong { color: var(--primary); font-weight: 600; }
.step .st-desc code { font-family: var(--mono); background: var(--primary-50); color: var(--primary); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* 判定结果卡 */
.verdict {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    margin: 14px 0;
}
.verdict-card {
    padding: 14px 16px; border-radius: 10px;
    border: 1px solid var(--border-light);
    background: var(--card-bg);
}
.verdict-card.pass { background: var(--success-light); border-color: #c8e6c9; }
.verdict-card.fail { background: var(--danger-light); border-color: #ffcdd2; }
.verdict-card.cond { background: var(--warning-light); border-color: #ffe082; }
.vc-label { font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; letter-spacing: .3px; }
.vc-value { font-size: 14px; font-weight: 700; color: var(--text); }
.verdict-card.pass .vc-value { color: var(--success); }
.verdict-card.fail .vc-value { color: var(--danger); }
.verdict-card.cond .vc-value { color: var(--warning); }

/* 报告模板表 */
.report-tpl {
    background: #fff; border: 2px solid var(--border);
    border-radius: 12px; padding: 22px 26px; margin: 14px 0;
    box-shadow: var(--shadow-md);
}
.report-tpl .rt-head {
    text-align: center; padding-bottom: 14px; margin-bottom: 16px;
    border-bottom: 2px solid var(--primary);
}
.report-tpl .rt-title {
    font-family: var(--serif); font-size: 18px; font-weight: 700;
    color: var(--primary-dark); margin-bottom: 4px;
}
.report-tpl .rt-sub { font-size: 12px; color: var(--text-3); letter-spacing: .5px; }
.report-tpl .rt-meta {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-bottom: 16px; font-size: 12.5px;
}
.report-tpl .rt-meta-item {
    padding: 6px 10px; background: #fafbfc; border-radius: 6px;
    border: 1px solid var(--border-light);
}
.report-tpl .rt-meta-item .lab { color: var(--text-3); }
.report-tpl .rt-meta-item .val { color: var(--text); font-weight: 600; }

/* 标签徽章 */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 30px;
    font-size: 11.5px; font-weight: 600; letter-spacing: .3px;
}
.badge.primary { background: var(--primary-50); color: var(--primary); }
.badge.gold { background: var(--gold-50); color: var(--gold-dark); }
.badge.danger { background: var(--danger-light); color: var(--danger); }
.badge.success { background: var(--success-light); color: var(--success); }
.badge.warning { background: var(--warning-light); color: var(--warning); }
.badge.info { background: var(--info-light); color: var(--info); }

/* 浮动目录按钮(移动端) */
.toc-toggle { display: none; }

/* 页脚 */
.page-footer {
    text-align: center; padding: 24px;
    color: var(--text-3); font-size: 12.5px;
    border-top: 1px solid var(--border-light);
    background: var(--card-bg);
}
.page-footer strong { color: var(--primary); }

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .overview { grid-template-columns: repeat(2, 1fr); }
    .equip-grid { grid-template-columns: 1fr; }
    .verdict { grid-template-columns: 1fr; }
    .report-tpl .rt-meta { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .topbar-inner { padding: 0 16px; height: auto; min-height: 52px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
    .hero { padding: 36px 18px 32px; }
    .hero h1 { font-size: 28px; }
    .layout { padding: 20px 16px 40px; }
    .section { padding: 20px 18px; }
    .overview { grid-template-columns: 1fr; }
    .report-tpl .rt-meta { grid-template-columns: 1fr; }
}

/* ============ 打印样式(测试报告) ============ */
@media print {
    .topbar, .sidebar, .page-footer { display: none; }
    .layout { display: block; padding: 0; }
    .section { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
    body { background: #fff; }
}

/* ============ 宽屏自适应宽度 ============ */
/* 原 .topbar-inner / .hero-inner / .layout 都是固定 px 上限，宽屏上内容挤成窄条。
   改为随视口分档提升的上限 + 百分比回退，仅在 ≥1200px 生效（移动端维持原样）。 */
:root { --w-page: 1280px; }
@media (min-width: 1600px) { :root { --w-page: 1560px; } }
@media (min-width: 1920px) { :root { --w-page: 1720px; } }
@media (min-width: 2200px) { :root { --w-page: 1960px; } }
@media (min-width: 2560px) { :root { --w-page: 2200px; } }

@media (min-width: 1200px) {
    .topbar-inner { max-width: min(var(--w-page), calc(100% - 56px)); }
    .layout { max-width: min(var(--w-page), calc(100% - 56px)); }
    .hero-inner { max-width: min(calc(var(--w-page) - 100px), calc(100% - 56px)); }
}
@media (min-width: 1600px) {
    /* 内容变宽后侧栏同步加宽，避免目录区显得过窄 */
    .layout { grid-template-columns: 260px 1fr; }
}
