/* =========================================================
   ISTA 跌落测试方案 - 箱体跌落步骤查询
   ========================================================= */

:root {
    --ink: #22303f;
    --ink-2: #4a5a6a;
    --muted: #788694;
    --line: #e2e7ec;
    --bg: #f4f6f8;
    --card: #ffffff;
    --accent: #b08d4f;
    --accent-soft: #f7f1e4;
    --ok: #2f7d5a;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(24, 39, 54, 0.06), 0 8px 24px rgba(24, 39, 54, 0.05);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: break-word;
}

img {
    max-width: 100%;
    height: auto;
}

.wrap {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 页头 ---------- */
.site-head {
    background: var(--ink);
    color: #fff;
    padding: 18px 0;
}

.head-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: block;
    width: 42px;
    height: 42px;
    padding: 5px;
    background: #fff;
    border-radius: 10px;
    flex-shrink: 0;
}

.brand {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.brand-sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.66);
    letter-spacing: 0.3px;
}

.head-nav {
    display: flex;
    gap: 18px;
}

.head-nav a {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 14px;
}

.head-nav a:hover {
    color: #fff;
}

/* ---------- 引导区 ---------- */
.intro {
    padding: 34px 0 6px;
}

.intro h1 {
    margin: 0 0 10px;
    font-size: 30px;
    line-height: 1.35;
    letter-spacing: -0.2px;
}

.intro p {
    margin: 0;
    max-width: 760px;
    color: var(--ink-2);
}

/* ---------- 面板 ---------- */
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
    margin: 22px 0;
}

.panel h2 {
    margin: 0 0 18px;
    font-size: 19px;
    letter-spacing: 0.2px;
}

.panel h3 {
    margin: 26px 0 10px;
    font-size: 16px;
}

.panel h3:first-of-type {
    margin-top: 18px;
}

/* ---------- 表单 ---------- */
.field-row {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.field-row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-row--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: block;
}

.field > span {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-2);
}

.field em,
.field-group legend em {
    font-style: normal;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
    margin-left: 4px;
    letter-spacing: 0.3px;
}

.field input,
.field select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #ccd4dc;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 16px;
    font-family: inherit;
}

.field input:focus,
.field select:focus {
    outline: 2px solid rgba(176, 141, 79, 0.45);
    outline-offset: 1px;
    border-color: var(--accent);
}

.hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.field-group {
    margin: 8px 0 4px;
    padding: 0;
    border: 0;
}

.field-group legend {
    padding: 0;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-2);
}

.shape-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.shape-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.shape-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    padding: 16px 14px;
    border: 1px solid #ccd4dc;
    border-radius: var(--radius);
    background: #fff;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.shape-card img {
    height: 62px;
    width: auto;
    object-fit: contain;
    margin-bottom: 6px;
}

.shape-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 68px;
}

.shape-pair img {
    height: 54px;
    margin: 0;
}

.shape-card strong {
    font-size: 15px;
}

.shape-card em {
    font-style: normal;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.4px;
}

.shape-card small {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
}

.shape-option input:checked + .shape-card {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px var(--accent) inset;
}

.shape-option input:focus-visible + .shape-card {
    outline: 2px solid rgba(176, 141, 79, 0.6);
    outline-offset: 2px;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    background: var(--ink);
    color: #fff;
    border: 1px solid var(--ink);
}

.btn-primary:hover {
    background: #2d4054;
}

.btn-ghost {
    background: #fff;
    color: var(--ink-2);
    border: 1px solid #ccd4dc;
}

.btn-ghost:hover {
    border-color: var(--ink-2);
    color: var(--ink);
}

.error {
    margin: 14px 0 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fdeceb;
    color: #a03127;
    font-size: 14px;
}

/* ---------- 结果 ---------- */
.verdict {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.verdict-item {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfd;
}

.verdict-item--accent {
    background: var(--accent-soft);
    border-color: #e8dcc4;
}

.verdict-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.3px;
}

.verdict-value {
    display: block;
    margin: 2px 0 2px;
    font-size: 19px;
    line-height: 1.3;
}

.verdict-sub {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.table-head h3 {
    margin: 0;
}

.btn-print {
    min-height: 38px;
    padding: 6px 16px;
    font-size: 14px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.steps-table,
.rules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.steps-table th,
.rules-table th {
    background: #eef1f5;
    color: var(--ink);
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.steps-table td,
.rules-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.steps-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.steps-table tbody tr:last-child td,
.rules-table tbody tr:last-child td {
    border-bottom: 0;
}

.col-step {
    width: 64px;
    white-space: nowrap;
}

.step-no {
    display: inline-block;
    min-width: 26px;
    padding: 1px 7px;
    border-radius: 6px;
    background: #e8edf2;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
}

.col-img {
    width: 120px;
}

.col-img img {
    display: block;
    max-height: 78px;
    width: auto;
    border-radius: 4px;
    border: 1px solid var(--line);
}

.cell-en {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
    letter-spacing: 0.2px;
}

.table-note {
    margin: 14px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.table-note img {
    display: block;
    margin-top: 8px;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.note-label {
    display: block;
    font-weight: 600;
    color: var(--ink-2);
}

/* ---------- 规则说明 ---------- */
.rule-list {
    margin: 0;
    padding-left: 20px;
    color: var(--ink-2);
}

.rule-list li {
    margin-bottom: 6px;
}

.rule-list strong {
    color: var(--ink);
}

.terms {
    margin: 0;
    color: var(--ink-2);
    line-height: 1.9;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

/* ---------- 页脚 ---------- */
.site-foot {
    margin-top: 40px;
    padding: 22px 0 30px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.site-foot p {
    margin: 0;
}

.footer-note {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.footer-note a {
    color: #5a6b7b;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-note a:hover {
    color: var(--ink);
}

/* =========================================================
   响应式：手机 375px 也不横向滚动
   ========================================================= */
@media (max-width: 860px) {
    .verdict {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body {
        font-size: 15px;
    }

    .wrap {
        padding: 0 14px;
    }

    .intro {
        padding: 24px 0 4px;
    }

    .intro h1 {
        font-size: 22px;
    }

    .panel {
        padding: 18px 16px;
        margin: 16px 0;
    }

    .field-row--3,
    .field-row--2,
    .shape-options {
        grid-template-columns: 1fr;
    }

    .head-inner {
        align-items: flex-start;
    }

    .head-nav {
        gap: 14px;
    }

    .verdict {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .verdict-item {
        padding: 10px 12px;
    }

    .verdict-value {
        font-size: 16px;
    }

    /* 步骤表在手机上改为卡片式，避免横向滚动 */
    .table-wrap--stack {
        overflow-x: visible;
        border: 0;
        border-radius: 0;
    }

    .steps-table,
    .steps-table thead,
    .steps-table tbody,
    .steps-table tr,
    .steps-table td {
        display: block;
        width: 100%;
    }

    .steps-table thead {
        display: none;
    }

    .steps-table tr {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        margin-bottom: 10px;
        padding: 6px 2px;
        background: #fff;
    }

    .steps-table tbody tr:nth-child(even) {
        background: #fafbfc;
    }

    .steps-table td {
        display: flex;
        gap: 12px;
        align-items: flex-start;
        border: 0;
        padding: 7px 12px;
    }

    .steps-table td::before {
        content: attr(data-label);
        flex: 0 0 92px;
        font-size: 12px;
        font-weight: 600;
        color: var(--muted);
        padding-top: 2px;
    }

    .steps-table td.col-img {
        width: auto;
    }

    .steps-table td.col-img img {
        max-height: 96px;
    }

    .steps-table td[data-label="图示"]:empty {
        display: none;
    }

    .rules-table {
        font-size: 13px;
    }

    .rules-table th,
    .rules-table td {
        padding: 8px;
    }
}

/* ---------- 手机上的品牌区 ---------- */
@media (max-width: 720px) {
    .brand {
        font-size: 17px;
    }

    .brand-sub {
        font-size: 12px;
    }

    .brand-logo {
        width: 38px;
        height: 38px;
        padding: 4px;
    }
}

/* ---------- 打印 ---------- */
@media print {
    body {
        background: #fff;
        font-size: 12px;
    }

    .site-head,
    .site-foot,
    #calc,
    #rules,
    .btn-print,
    .head-nav {
        display: none !important;
    }

    .panel {
        border: 0;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }

    .intro {
        display: none;
    }

    .steps-table th,
    .steps-table td {
        border: 1px solid #bbb;
        padding: 5px 7px;
    }

    .steps-table {
        page-break-inside: auto;
    }

    .steps-table tr {
        page-break-inside: avoid;
    }

    .verdict {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .verdict-item {
        border: 1px solid #bbb;
        background: #fff !important;
    }
}
