/* Smart OA detail views: read first, mutate only after an explicit action. */
.oa-record-detail-mask {
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.oa-record-detail {
    display: flex;
    flex-direction: column;
    width: min(880px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 0;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 28px 90px rgba(20, 31, 50, .24);
}

.oa-record-detail > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px 18px;
    border-bottom: 1px solid #e4e9f0;
}

.oa-record-detail > header h2 {
    margin: 4px 0 5px;
    color: #202a3b;
    font-size: 22px;
}

.oa-record-detail > header p {
    margin: 0;
    color: #758094;
    font-size: 12px;
}

.oa-record-detail > header .modal-corner-close {
    position: static;
    flex: 0 0 auto;
}

.oa-record-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 26px;
    overflow-x: auto;
    border-bottom: 1px solid #e4e9f0;
    background: #fafbfe;
}

.oa-record-tabs button {
    padding: 8px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #667085;
    font: inherit;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
}

.oa-record-tabs button:hover {
    background: #f0f2f7;
}

.oa-record-tabs button.active,
.oa-record-tabs button[aria-selected="true"] {
    background: #eef1ff;
    color: #3449b9;
    font-weight: 750;
}

.oa-record-tabs button:focus-visible {
    outline: 3px solid rgba(79, 70, 229, .18);
    outline-offset: 1px;
}

.oa-record-detail-body {
    min-height: 260px;
    padding: 22px 26px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.oa-record-panel[hidden] {
    display: none;
}

.oa-record-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.oa-record-details > div {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #e1e7ef;
    border-radius: 11px;
    background: #fafbfe;
}

.oa-record-details > div.wide {
    grid-column: 1 / -1;
}

.oa-record-details dt {
    margin-bottom: 6px;
    color: #7b8495;
    font-size: 11px;
}

.oa-record-details dd {
    margin: 0;
    color: #2c3749;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.oa-audit-callout {
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid #cdd9ec;
    border-radius: 12px;
    background: #f5f8fd;
}

.oa-audit-callout strong {
    color: #344054;
}

.oa-audit-callout p {
    margin: 5px 0 0;
    color: #667085;
    font-size: 12px;
    line-height: 1.6;
}

.oa-record-detail > footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 26px;
    border-top: 1px solid #e0e6ef;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -10px 26px rgba(27, 42, 69, .06);
}

.oa-record-detail > footer .oa-ledger-permission-note {
    margin: 0 auto 0 0;
}

.oa-action-panel {
    margin: 16px 0;
    border: 1px solid #dde4ee;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.oa-action-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 11px 15px;
    color: #344054;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    list-style: none;
}

.oa-action-panel > summary::-webkit-details-marker {
    display: none;
}

.oa-action-panel > summary::after {
    content: "展开";
    color: #5363c9;
    font-size: 11px;
    font-weight: 650;
}

.oa-action-panel[open] > summary {
    border-bottom: 1px solid #e5e9f0;
    background: #fafbfe;
}

.oa-action-panel[open] > summary::after {
    content: "收起";
}

.oa-action-panel > .oa-action-panel-body {
    padding: 15px;
}

.oa-action-panel > .oa-action-panel-body > :first-child {
    margin-top: 0;
}

.oa-action-panel > .oa-action-panel-body > :last-child {
    margin-bottom: 0;
}

.oa-inline-action {
    margin-top: 8px;
}

.oa-inline-action > summary {
    width: max-content;
    color: #5363c9;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.oa-inline-action > form {
    margin-top: 8px;
}

@media (max-width: 640px) {
    .oa-record-detail-mask {
        padding: 8px;
    }

    .oa-record-detail {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 14px;
    }

    .oa-record-detail > header,
    .oa-record-detail-body,
    .oa-record-detail > footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .oa-record-tabs {
        padding-inline: 18px;
    }

    .oa-record-details {
        grid-template-columns: 1fr;
    }

    .oa-record-details > div.wide {
        grid-column: auto;
    }

    .oa-record-detail > footer {
        flex-wrap: wrap;
    }
}
