/* Mixed books/videos share one media stage; their covers retain their own aspect ratios. */
.tb-resource-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;align-items:stretch}
.tb-resource-grid .tb-resource-card{padding:0;display:flex;flex-direction:column;min-width:0;overflow:hidden;border:1px solid var(--ui-line,#e8ebf0);border-radius:16px;background:var(--ui-surface,#fff);transition:border-color .18s,box-shadow .18s}
.tb-resource-grid .tb-resource-card:hover{border-color:color-mix(in srgb,var(--ui-accent,#2563eb) 28%,var(--ui-line,#e8ebf0));box-shadow:0 6px 22px #14284908}
.tb-resource-stage{position:relative;width:100%;aspect-ratio:4/3;max-height:240px;flex:none;overflow:hidden;background:color-mix(in srgb,var(--ui-accent,#2563eb) 4%,#f5f6f8);border-bottom:1px solid var(--ui-line,#e8ebf0)}
.tb-resource-media{position:absolute;inset:18px;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0}
.tb-resource-grid .tb-resource-stage .tb-resource-cover{display:block;margin:0;min-width:0;min-height:0;max-width:100%;max-height:100%;background:transparent;object-fit:contain;border-radius:4px}
.tb-resource-grid .is-portrait .tb-resource-cover{height:100%;width:auto;aspect-ratio:3/4;box-shadow:0 5px 12px #1b30451a}
.tb-resource-grid .is-landscape .tb-resource-cover{width:100%;height:auto;aspect-ratio:16/9;box-shadow:none;border-radius:6px}
.tb-resource-grid .tb-resource-stage .tb-cover-fallback{display:flex;align-items:center;justify-content:center;background:var(--ui-soft,#eaf0fb);color:var(--ui-accent,#2563eb);box-shadow:none}
.tb-resource-grid .tb-cover-fallback svg{width:44px;height:44px}.tb-cover-fallback .tb-config-icon{max-width:56px;max-height:56px}
.tb-resource-type{position:absolute;top:12px;left:12px;display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:6px;background:var(--ui-surface,#fff);color:var(--ui-muted,#626b7b);font-size:11px;line-height:18px;box-shadow:0 1px 4px #14284908}
.tb-page .tb-resource-type svg{width:13px;height:13px}
.tb-resource-grid .tb-resource-copy{padding:18px 18px 16px;display:flex;flex-direction:column;min-width:0;flex:1}
.tb-resource-grid .tb-resource-copy h3{font-size:16px;line-height:1.55;height:3.1em;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin:0 0 8px;overflow-wrap:anywhere}
.tb-resource-grid .tb-resource-copy p{line-height:1.75;height:3.5em;font-size:13px;margin:0 0 14px;-webkit-line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}
.tb-resource-grid .tb-resource-copy .tb-permission{margin-top:auto;font-size:11px;line-height:20px}
.tb-resource-grid .tb-get-button{margin-top:12px;width:100%;min-height:36px;padding:8px 14px;font-size:13px}
@media(min-width:1760px){.tb-resource-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1199px){.tb-resource-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}}
@media(max-width:600px){
 .tb-resource-grid{grid-template-columns:1fr;gap:12px}
 .tb-resource-grid .tb-resource-card{flex-direction:row;border-radius:14px;padding:14px;gap:14px;align-items:stretch}
 .tb-resource-grid .tb-resource-stage{width:104px;min-width:104px;aspect-ratio:auto;max-height:none;min-height:142px;border:0;border-radius:8px;background:color-mix(in srgb,var(--ui-accent,#2563eb) 4%,#f5f6f8)}
 .tb-resource-media{inset:8px}
 .tb-resource-type{left:5px;top:5px;font-size:10px;padding:1px 5px;line-height:16px;gap:3px}
 .tb-page .tb-resource-type svg{width:11px;height:11px}
 .tb-resource-grid .tb-resource-copy{padding:0}
 .tb-resource-grid .tb-resource-copy h3{font-size:15px;height:auto;max-height:3.1em;min-height:1.55em;margin:0 0 6px}
 .tb-resource-grid .tb-resource-copy p{font-size:12px;height:3.5em;margin:0 0 8px}
 .tb-resource-grid .tb-resource-copy .tb-permission{font-size:10px;line-height:17px;padding:1px 5px}
 .tb-resource-grid .tb-get-button{font-size:12px;margin-top:8px;min-height:32px;padding:6px 10px}
}
@media(max-width:359px){.tb-resource-grid .tb-resource-card{gap:10px;padding:12px}.tb-resource-grid .tb-resource-stage{width:88px;min-width:88px}.tb-resource-grid .tb-resource-copy h3{font-size:14px}}
