/* 3D 机械拆解的公共外壳：米白底、墨黑字、红色细线，与主轴单元页面的控制台同一套语言。 */
:root {
    --ink: #16181b;
    --mute: #8b8f95;
    --line: #e1e3e6;
    --bg: #ecedef;
    --panel: #f8f8f9;
    --red: #d6182b;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
}

.mech-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* 顶栏 */
.mech-bar {
    flex: none;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.mech-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mech-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .2s ease;
}

.mech-back:hover { border-color: var(--ink); }

.mech-crumb {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--mute);
    white-space: nowrap;
}

.mech-crumb::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 2px;
    margin-right: 8px;
    background: var(--red);
    vertical-align: middle;
}

.mech-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mech-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .2s ease;
}

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

/* 跳转到下方正文：iframe 会吃掉滚轮，必须给一个可见入口 */
.mech-jump {
    border-color: rgba(214, 24, 43, .45);
    color: var(--red);
}

.mech-jump:hover {
    border-color: var(--red);
    background: #fff5f6;
}

.mech-jump .only-mobile { display: none; }

/* 标题与说明 */
.mech-intro {
    flex: none;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 14px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.mech-intro h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.2px;
}

.mech-intro h1 span {
    color: var(--red);
}

.mech-intro p {
    flex: 1 1 460px;
    min-width: 0;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--mute);
}

/* 画布 */
.mech-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    background: var(--bg);
}

.mech-stage iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--bg);
}

/* 页脚 */
.mech-footer {
    flex: none;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--panel);
    border-top: 1px solid var(--line);
    color: var(--mute);
    font-size: 11.5px;
    letter-spacing: .2px;
    white-space: nowrap;
}

.mech-footer a {
    color: #5d6670;
    text-decoration: none;
}

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

.mech-footer .sep { opacity: .5; }

/* 首屏之后的正文：原理、参数、操作与内链 */
.mech-doc {
    padding: 44px 20px 60px;
    background: #fff;
    border-top: 1px solid var(--line);
}

.mech-doc-in {
    max-width: 860px;
    margin: 0 auto;
}

.mech-doc h2 {
    margin: 0 0 14px;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.2px;
    line-height: 1.45;
}

.mech-doc h2::before {
    content: '';
    display: block;
    width: 28px;
    height: 3px;
    margin-bottom: 12px;
    background: var(--red);
}

.mech-doc .lead {
    margin: 0 0 30px;
    font-size: 14px;
    line-height: 1.95;
    color: #3c4249;
}

.mech-doc h3 {
    margin: 32px 0 12px;
    padding-left: 10px;
    border-left: 2px solid var(--red);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
}

.mech-points,
.mech-ops {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mech-points li,
.mech-ops li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 11px;
    font-size: 13.5px;
    line-height: 1.9;
    color: #33383f;
}

.mech-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .78em;
    width: 7px;
    height: 7px;
    border: 1px solid var(--red);
    border-radius: 50%;
}

.mech-ops li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .82em;
    width: 6px;
    height: 6px;
    background: var(--line);
    border-radius: 1px;
}

.mech-doc b {
    font-weight: 600;
    color: var(--ink);
}

.mech-doc kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #fbfbfc;
    font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
    color: var(--ink);
}

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

.mech-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.mech-table caption {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: #f6f7f8;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--mute);
    text-align: left;
}

.mech-table th,
.mech-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    line-height: 1.65;
}

.mech-table tr:last-child td { border-bottom: 0; }

.mech-table thead th {
    width: 38%;
    background: #fafafb;
    font-size: 12px;
    font-weight: 600;
    color: #5d6670;
    white-space: nowrap;
}

.mech-table td { color: #33383f; }

.mech-more {
    margin-top: 40px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.mech-more h3 { margin-top: 0; }

.mech-more ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mech-more a {
    display: block;
    height: 100%;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfbfc;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .2s ease;
}

.mech-more a:hover { border-color: var(--ink); }

.mech-more a span {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--mute);
}

.only-mobile { display: none; }

/* 手机竖屏：引导横屏，横屏后画布吃满 */
.mech-rotate { display: none; }

@media (max-width: 960px) and (orientation: portrait) {
    .mech-rotate {
        position: fixed;
        inset: 0;
        z-index: 50;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
        padding: 24px;
        background: var(--panel);
        text-align: center;
    }

    .mech-rotate.hide { display: none; }

    .mech-rotate .ico {
        width: 52px;
        height: 52px;
        border: 2px solid var(--ink);
        border-radius: 12px;
        animation: mech-rot 2s ease-in-out infinite;
    }

    @keyframes mech-rot {
        0%, 35% { transform: rotate(0deg); }
        65%, 100% { transform: rotate(90deg); }
    }

    .mech-rotate h2 {
        margin: 0;
        font-size: 19px;
        font-weight: 700;
    }

    .mech-rotate p {
        max-width: 280px;
        margin: 0;
        font-size: 13px;
        line-height: 1.7;
        color: var(--mute);
    }

    .mech-rotate button {
        margin-top: 4px;
        padding: 10px 20px;
        border: 0;
        border-radius: 999px;
        background: var(--ink);
        color: #fff;
        font: inherit;
        font-size: 14px;
        cursor: pointer;
    }

    .mech-rotate .skip {
        border: 0;
        background: none;
        padding: 4px;
        color: var(--mute);
        font: inherit;
        font-size: 12px;
        text-decoration: underline;
        cursor: pointer;
    }

    .mech-rotate .note {
        max-width: 280px;
        margin: 0;
        font-size: 12px;
        line-height: 1.7;
        color: #5d6670;
    }
}

@media (max-height: 480px) and (orientation: landscape) {
    .mech-intro,
    .mech-footer { display: none; }

    .mech-bar { height: 38px; }
}

@media (max-width: 720px) {
    .mech-bar { height: 48px; padding: 0 10px; gap: 8px; }
    .mech-crumb { display: none; }
    .mech-back { padding: 6px 10px; font-size: 12.5px; }
    .mech-btn { padding: 6px 9px; }
    .mech-btn span { display: none; }
    .mech-intro { padding: 10px 12px; gap: 4px; }
    .mech-intro h1 { font-size: 16.5px; }
    .mech-intro p { flex-basis: 100%; font-size: 11.5px; line-height: 1.55; }
    .mech-footer { height: 26px; font-size: 10.5px; }
    .mech-doc { padding: 30px 14px 40px; }
    .mech-doc h2 { font-size: 18px; }
    .mech-doc .lead { font-size: 13px; line-height: 1.85; }
    .mech-points li, .mech-ops li { font-size: 13px; line-height: 1.8; }
    .mech-table { font-size: 12px; }
    .mech-table th, .mech-table td { padding: 8px; }
    .mech-table thead th { width: 40%; white-space: normal; }
    .mech-more ul { grid-template-columns: 1fr; }
    .mech-jump span { display: inline; }
    .mech-jump .only-desktop { display: none; }
    .mech-jump .only-mobile { display: inline; }
    .mech-newwin { display: none; }
    .only-desktop { display: none; }
    .only-mobile { display: inline; }
}
