* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f0f0f1;
    color: #1d2327;
}

.rt-view-page {
    max-width: 960px;
    margin: 34px auto;
    padding: 42px 52px;
    background: #ffffff;
    color: #1d2327;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
}

.rt-view-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.rt-view-actions form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.rt-view-header {
    padding-bottom: 24px;
    margin-bottom: 28px;
    border-bottom: 2px solid #1d2327;
}

.rt-view-header h1 {
    margin: 7px 0 11px;
    font-size: 36px;
    line-height: 1.15;
}

.rt-brand {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.rt-muted { color: #646970; }

.rt-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border: 1px solid #2271b1;
    border-radius: 4px;
    background: #ffffff;
    color: #2271b1;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.rt-button.rt-primary {
    background: #2271b1;
    color: #ffffff;
}

.rt-view-block {
    padding: 18px 20px;
    margin: 0 0 18px;
    border: 1px solid #dcdcde;
    border-left: 5px solid #2271b1;
    border-radius: 5px;
    break-inside: avoid;
    page-break-inside: avoid;
}

.rt-block-listen { border-left-color: #008a20; }
.rt-block-watch { border-left-color: #3858e9; }
.rt-block-observe { border-left-color: #dba617; }
.rt-block-story { border-left-color: #8c5fb1; }
.rt-block-exam { border-left-color: #b32d2e; }
.rt-block-teacher_note { border-left-color: #996800; background: #fff8e5; }
.rt-block-quote { border-left-color: #646970; }
.rt-block-image { border-left-color: #2271b1; }

.rt-block-top {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 8px;
}

.rt-block-type {
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #50575e;
}

.rt-scope {
    padding: 3px 7px;
    border-radius: 999px;
    background: #f0f0f1;
    font-size: 11px;
}

.rt-view-block h2 {
    margin: 4px 0 10px;
    font-size: 23px;
    line-height: 1.25;
}

.rt-block-content p:first-child { margin-top: 0; }
.rt-block-content p:last-child { margin-bottom: 0; }

.rt-block-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 13px;
    padding-top: 11px;
    border-top: 1px solid #dcdcde;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.rt-qr {
    width: 80px;
    height: 80px;
    margin-left: auto;
}

.rt-entity-card-inline {
    padding: 14px;
    border: 1px solid #dcdcde;
    border-radius: 5px;
    background: #fafafa;
}

.rt-entity-card-inline h3 { margin: 3px 0 7px; }
.rt-entity-kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #646970; }
.rt-entity-inline-image { display: block; max-width: 180px; max-height: 150px; object-fit: cover; border-radius: 5px; margin: 0 0 10px; }
.rt-embed-wrap { margin-top: 14px; }
.rt-embed-wrap iframe { display: block; max-width: 100%; }
.rt-view-block img { max-width: 100%; height: auto; }
.rt-image-block img { display: block; max-width: 100%; height: auto; border-radius: 5px; }
.rt-empty { padding: 25px; text-align: center; border: 2px dashed #c3c4c7; color: #646970; }
.rt-view-footer { margin-top: 38px; padding-top: 13px; border-top: 1px solid #dcdcde; color: #646970; font-size: 12px; }

@media (max-width: 760px) {
    .rt-view-page { margin: 0; padding: 24px 17px; }
    .rt-view-header h1 { font-size: 29px; }
    .rt-block-top, .rt-view-actions { align-items: flex-start; flex-direction: column; }
}

@media print {
    @page { margin: 16mm; }
    body { background: #ffffff; color: #000000; font-size: 11pt; }
    .rt-no-print { display: none !important; }
    .rt-embed-wrap { display: none !important; }
    .rt-view-page { width: auto; max-width: none; margin: 0; padding: 0; }
    .rt-view-header { margin-bottom: 16px; padding-bottom: 12px; }
    .rt-view-header h1 { font-size: 23pt; }
    .rt-view-block { padding: 11px 13px; margin-bottom: 10px; border-color: #999999; }
    .rt-view-block h2 { font-size: 15pt; }
    .rt-view-footer { margin-top: 24px; }
    a { color: #000000; }
}
.rt-private-file-links{display:inline-flex;max-width:100%;width:auto;box-sizing:border-box;flex-wrap:wrap;align-items:center;gap:7px;margin-top:14px;padding:8px 10px;border:1px solid var(--rt-line-strong);border-radius:9px;background:color-mix(in srgb,var(--rt-card-2) 92%,transparent);color:var(--rt-text);box-shadow:none}.rt-private-file-links::before{content:'📎';flex:0 0 auto;font-size:15px;line-height:1}.rt-private-file-links strong{color:var(--rt-muted);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.035em}.rt-private-file-links span{min-width:0;max-width:min(52ch,55vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--rt-text);font-weight:700}.rt-private-file-links .rt-button{flex:0 0 auto;margin-left:2px}.rt-image-with-badge{position:relative;display:inline-block;max-width:100%}.rt-ai-badge{position:absolute;right:8px;bottom:8px;z-index:3;display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;background:rgba(7,17,26,.82);color:#f4efe6;font-size:11px;font-weight:700;letter-spacing:.02em;backdrop-filter:blur(4px);box-shadow:0 2px 10px rgba(0,0,0,.22)}
@media(max-width:600px){.rt-private-file-links{display:flex;width:100%;padding:9px 10px}.rt-private-file-links span{max-width:100%;flex:1 1 180px}}
@media print{.rt-ai-badge{position:static;display:inline-block;margin-top:5px;background:#fff;color:#333;border:1px solid #999}.rt-private-file-links{background:#fff;color:#000;border-color:#999}.rt-private-file-links strong,.rt-private-file-links span{color:#000}.rt-private-file-links .rt-button{display:none!important}}
