/**
 * 光学工具嵌入页：仅小屏覆盖（PC 保留原页双栏布局）
 */
@media only screen and (max-width: 1024px) {
    html,
    body {
        min-width: 0 !important;
        max-width: 100%;
        overflow-x: hidden;
    }

    .app,
    .app-shell {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100%;
        padding: 12px !important;
        box-sizing: border-box;
    }

    .topbar {
        height: auto !important;
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
        padding: 12px 14px !important;
    }

    .topbar .brand {
        font-size: 18px !important;
    }

    .top-actions,
    .topbar .top-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .top-actions button,
    .topbar .top-actions button {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
    }

    .layout,
    .workspace,
    .bottom {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        max-width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .workspace {
        display: grid !important;
    }

    .left,
    .right,
    .card {
        min-width: 0 !important;
        max-width: 100%;
    }

    .field-grid,
    .form-grid,
    .mini-row,
    .lists,
    .result-head,
    .summary-strip,
    .top-actions,
    .data-row,
    .footer-actions {
        grid-template-columns: 1fr !important;
    }

    .chart-head {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .chart-head > div {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .info-block {
        grid-template-columns: 1fr 1fr !important;
    }

    .stat .value {
        white-space: normal !important;
        word-break: break-word;
    }

    .data-item {
        grid-template-columns: 56px 1fr 1fr 28px !important;
        font-size: 12px !important;
    }

    .chart-wrap {
        height: min(52vw, 360px) !important;
        min-height: 240px;
    }

    .chart-tip {
        display: none;
    }

    .calc-row {
        flex-direction: column;
        align-items: stretch !important;
    }

    .btn-row .btn {
        min-width: 0;
        flex: 1 1 100%;
    }

    .formula,
    .output,
    .result-card .full-formula {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    table {
        min-width: 0 !important;
        max-width: 100%;
    }

    .right-panel {
        display: flex !important;
        flex-direction: column !important;
        grid-column: auto !important;
    }

    .input-panel,
    .result-panel {
        min-width: 0 !important;
        width: 100% !important;
    }
}

@media only screen and (max-width: 480px) {
    .info-block {
        grid-template-columns: 1fr !important;
    }

    .data-item {
        grid-template-columns: 1fr 1fr !important;
    }

    .data-item .g {
        grid-column: 1 / -1;
    }

    .brand-title {
        font-size: 20px !important;
    }

    .brand-subtitle {
        font-size: 12px !important;
        line-height: 1.4;
    }
}
