.attachment-reader {
    width: min(960px, calc(100% - 32px));
    height: min(840px, calc(100dvh - 32px));
    max-height: calc(100dvh - 32px);
    max-width: none;
    padding: 0;
    margin: auto;
    border: 1px solid #cdd8dc;
    border-radius: 8px;
    background: #fff;
    color: #24343b;
    box-shadow: 0 16px 60px #102f3440;
    font: 16px/1.6 system-ui, 'Microsoft YaHei', sans-serif;
    letter-spacing: 0;
}
.attachment-reader[open] { display: flex; flex-direction: column; }
.attachment-reader::backdrop { background: #132c3480; }
.ar-header { display: flex; align-items: flex-start; gap: 16px; padding: 20px 24px 12px; }
.ar-header h2 { flex: 1; min-width: 0; margin: 0; font-size: 22px; line-height: 1.4; overflow-wrap: anywhere; }
.ar-button { min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid #ccd8dc; border-radius: 4px; background: white; color: #186b71; font: inherit; cursor: pointer; }
.ar-button:hover:not(:disabled) { background: #eff7f7; }
.ar-button:focus-visible, .ar-download:focus-visible { outline: 2px solid #087b82; outline-offset: 2px; }
.ar-button:disabled { opacity: .45; cursor: default; }
.ar-header .ar-button { flex: 0 0 44px; font-size: 24px; padding: 0; }
.ar-meta { margin: 0; padding: 0 24px 12px; color: #586970; font-size: 14px; overflow-wrap: anywhere; }
.ar-notice { margin: 0 24px 12px; padding: 10px 12px; border-left: 3px solid #bb842b; background: #fff7e6; color: #705119; font-size: 14px; max-height: 100px; overflow: auto; overflow-wrap: anywhere; }
.ar-tabs { display: flex; gap: 0; padding: 0 24px; border-bottom: 1px solid #dce5e8; }
.ar-tabs .ar-button { border: 0; border-radius: 0; border-bottom: 3px solid transparent; color: #586970; }
.ar-tabs .ar-button[aria-pressed="true"] { border-bottom-color: #087b82; color: #087b82; font-weight: 600; background: #f2f8f8; }
.ar-status { padding: 0 24px; margin: 0; color: #875723; font-size: 14px; }
.ar-status:not(:empty) { padding-top: 10px; padding-bottom: 10px; }
.ar-status .ar-button { margin-left: 12px; }
.ar-body { flex: 1; min-height: 0; overflow: auto; padding: 24px; overscroll-behavior: contain; }
.ar-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; }
.ar-original { height: 100%; min-height: 240px; }
.ar-original iframe { display: block; width: 100%; height: calc(100% - 40px); min-height: 240px; border: 0; background: #f2f4f5; }
.ar-original img { display: block; max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; margin: auto; }
.ar-download { display: inline-block; padding: 8px 0; color: #087b82; }
.ar-footer { display: flex; align-items: center; justify-content: center; gap: 16px; border-top: 1px solid #dce5e8; padding: 12px 24px; }
.ar-page { min-width: 0; color: #586970; font-size: 14px; text-align: center; }
.attachment-reader [hidden] { display: none !important; }
.attachment-selection { margin: 12px 0; border-top: 1px solid #dce5e8; padding-top: 12px; width: 100%; color: #344951; font-size: 14px; }
.attachment-selection summary { color: #186b71; cursor: pointer; padding: 8px 0; font-weight: 600; }
.attachment-scope-note { margin: 4px 0 12px; color: #617078; line-height: 1.7; }
.attachment-selection-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid #e7edef; }
.attachment-selection-row strong, .attachment-selection-row span { grid-column: 1; overflow-wrap: anywhere; }
.attachment-selection-row .ar-button { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
.attachment-scope-warning { color: #8b601c; }
.attachment-card button.attachment-open { background: transparent; border: 0; font: inherit; cursor: pointer; white-space: nowrap; }
@media (max-width: 600px) {
    .attachment-reader { width: calc(100% - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); }
    .ar-header { padding: 16px 16px 10px; }
    .ar-header h2 { font-size: 18px; }
    .ar-meta { padding: 0 16px 10px; }
    .ar-notice { margin: 0 16px 10px; max-height: 110px; }
    .ar-tabs { padding: 0 16px; }
    .ar-body { padding: 16px; }
    .ar-footer { padding: 10px; gap: 8px; }
}
