/* base + grid + modal */
.saa-wiki { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; line-height: 1.5; }
.saa-wiki * { box-sizing: border-box; }
.saa-wiki .container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.saa-wiki h1 { font-size: 28px; margin: 0 0 8px; }
.saa-wiki .muted { color: #666; margin-bottom: 16px; }
.saa-wiki .toolbar { display: grid; grid-template-columns: 1fr 220px; gap: 12px; margin-bottom: 16px; }
.saa-wiki input[type="search"], .saa-wiki select { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 10px; }

.saa-wiki .grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; }
@media (max-width: 900px) { .saa-wiki .grid { grid-template-columns: 1fr; } .saa-wiki .toolbar { grid-template-columns: 1fr; } }

.saa-wiki .toc { position: sticky; top: 10px; align-self: start; background: #f8f9fa; border: 1px solid #eee; border-radius: 14px; padding: 14px; max-height: 75vh; overflow: auto; }
.saa-wiki .toc h3 { margin-top: 0; font-size: 16px; }
.saa-wiki .toc ul { list-style: none; padding: 0; margin: 0; }
.saa-wiki .toc li { margin: 6px 0; }
.saa-wiki .toc a { text-decoration: none; color: #0f172a; }

.saa-wiki .badge { display: inline-block; font-size: 12px; background: #eef2ff; color: #1e40af; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }

.saa-wiki .section { margin-bottom: 20px; border: 1px solid #eee; border-radius: 14px; overflow: hidden; background: #fff; }
.saa-wiki .section summary { cursor: pointer; padding: 14px 16px; font-weight: 600; background: #fff; }
.saa-wiki .section .content { padding: 0 16px 14px; background: #fff; }
.saa-wiki .hint { background: #f5faff; border-left: 4px solid #3b82f6; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }

.saa-wiki .yt-grid { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
@media (max-width: 1024px) { .saa-wiki .yt-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .saa-wiki .yt-grid { grid-template-columns: 1fr; } }

.saa-wiki .yt-card { cursor: pointer; border: 1px solid #e5e7eb; background: #fff; border-radius: 14px; overflow: hidden; transition: box-shadow .15s ease, transform .04s ease; }
.saa-wiki .yt-card:hover { box-shadow: 0 10px 24px rgba(16,24,40,.08); transform: translateY(-1px); }

.saa-wiki .yt-thumb { aspect-ratio: 16/9; background: #eef2f7; }
.saa-wiki .yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.saa-wiki .yt-thumb-fallback { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(180deg,#f6f7fb,#eaeef7); }
.saa-wiki .yt-fallback-ico { font-size: 42px; line-height: 1; opacity: .5; }

.saa-wiki .yt-meta { padding: 10px 12px 12px; }
.saa-wiki .yt-title { margin: 0 0 6px; font-size: 14.5px; font-weight: 600; color: #0f172a; letter-spacing: .2px; }
.saa-wiki .yt-badges .badge { background: #eef2ff; color: #1e40af; }

/* Modal */
.saa-wiki .yt-modal { position: fixed; inset: 0; display: none; z-index: 100000; }
.saa-wiki .yt-modal.open { display: block; }
.saa-wiki .yt-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.6); }
.saa-wiki .yt-dialog { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; }
.saa-wiki .yt-player-wrap { width: min(100%, 960px); background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.saa-wiki .yt-player { width: 100%; height: auto; display: block; }
.saa-wiki .yt-close { position: absolute; top: 16px; right: 20px; width: 36px; height: 36px; border: 0; border-radius: 999px; background: #fff; color: #111; cursor: pointer; font-size: 20px; line-height: 1; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.saa-wiki .yt-close:focus { outline: 2px solid #2563eb; outline-offset: 2px; }