:root {
  --bg: #ffffff;
  --text: #1f2328;
  --muted: #656d76;
  --line: #d8dee4;
  --soft: #f6f8fa;
  --link: #0b62c4;
  --btn: #1f6f43;
  --btn-text: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --text: #e3e6ea;
    --muted: #8b949e;
    --line: #2b3138;
    --soft: #161a1f;
    --link: #5aa2f0;
    --btn: #2e8a55;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 28px 0 8px; }
p { margin: 0 0 10px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Header */
.top { border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 20px; min-height: 52px; }
.brand { font-weight: 700; font-size: 17px; color: var(--text); }
.brand span { font-weight: 400; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.nav a { color: var(--muted); }
.nav a.on { color: var(--text); font-weight: 600; }
.lang { margin-left: auto; background: none; border: 0; color: var(--link); cursor: pointer; font: inherit; padding: 4px 0; }
.lang:hover { text-decoration: underline; }

main.wrap { padding-top: 22px; padding-bottom: 40px; min-height: 60vh; }
.foot { border-top: 1px solid var(--line); padding-top: 14px; padding-bottom: 24px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }
.foot a { color: var(--muted); text-decoration: underline; }

/* Buttons */
.btn { display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.main { background: var(--btn); border-color: var(--btn); color: var(--btn-text); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.head p { margin: 0; }
.notice { border-left: 3px solid #d4a72c; padding: 4px 0 4px 12px; margin: 12px 0; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 8px; }
.list td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; }
.list tr:hover td { background: var(--soft); }
.list .num { color: var(--muted); white-space: nowrap; width: 1%; }
.list .r { text-align: right; white-space: nowrap; color: var(--muted); font-size: 13px; width: 1%; }
.list .sub { color: var(--muted); font-size: 13px; }
.list .ttl { font-weight: 600; }
.list .st { white-space: nowrap; width: 1%; }
.empty { color: var(--muted); padding: 16px 0; }
.more { margin-top: 8px; font-size: 14px; }

/* Status */
.status { font-size: 13px; white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: currentColor; vertical-align: 1px; }
.s-new { color: #0969da; }
.s-confirmed { color: #bc4c00; }
.s-progress { color: #8250df; }
.s-needs-info { color: #6e7781; }
.s-fixed-next, .s-fixed { color: #1a7f37; }
.s-closed { color: #6e7781; }
@media (prefers-color-scheme: dark) {
  .s-new { color: #4493f8; } .s-confirmed { color: #e3893b; } .s-progress { color: #ab7df8; } .s-fixed-next, .s-fixed { color: #3fb950; }
}

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.filters select, .filters input { font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); }
.filters input { flex: 1; min-width: 160px; }
.cats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; font-size: 14px; }
.cats a.on { color: var(--text); font-weight: 600; }

/* Detail */
.back { display: inline-block; margin-bottom: 12px; font-size: 14px; }
.facts { border-collapse: collapse; margin: 10px 0 16px; font-size: 14px; }
.facts th { text-align: left; color: var(--muted); font-weight: 400; padding: 2px 16px 2px 0; vertical-align: top; white-space: nowrap; }
.facts td { padding: 2px 0; white-space: pre-wrap; }
.post { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 12px; }
.post-h { background: var(--soft); border-bottom: 1px solid var(--line); padding: 6px 12px; font-size: 13px; color: var(--muted); border-radius: 6px 6px 0 0; }
.post-h b { color: var(--text); }
.post-b { padding: 12px; }
.post.answer { border-color: #1a7f37; }
.replies { margin-left: 24px; }
.av { width: 18px; height: 18px; border-radius: 50%; vertical-align: -4px; margin-right: 4px; }

/* Rendered GitHub text */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { font-size: 15px; margin: 14px 0 4px; }
.md img { max-width: 100%; height: auto; }
.md video { display: block; width: 100%; max-height: 480px; background: #000; margin: 4px 0; }
.md pre { background: var(--soft); border: 1px solid var(--line); padding: 8px 10px; overflow-x: auto; font-size: 13px; }
.md code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.md blockquote { margin: 0 0 10px; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.md table { border-collapse: collapse; display: block; overflow-x: auto; }
.md td, .md th { border: 1px solid var(--line); padding: 4px 8px; }
.md .yt { position: relative; aspect-ratio: 16/9; margin: 6px 0 10px; background: #000; }
.md .yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vfail { display: block; padding: 12px; border: 1px dashed var(--line); margin: 4px 0; }

/* Videos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { color: var(--text); font-size: 14px; }
.tile:hover { text-decoration: none; }
.tile:hover .cap { text-decoration: underline; }
.tile .pic { position: relative; aspect-ratio: 16/9; background: #000; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.tile .pic img, .tile .pic video { width: 100%; height: 100%; object-fit: cover; }
.tile .pic .tag { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 3px; }
.tile .pic .site { color: #ccc; font-size: 13px; }
.tile .cap { margin-top: 4px; }
.tile .from { color: var(--muted); font-size: 12px; }

/* Guide */
.guide { max-width: 720px; }
.guide code { background: var(--soft); padding: 1px 5px; font-size: 13px; word-break: break-all; }
.guide li { margin-bottom: 4px; }
.legend { border-collapse: collapse; font-size: 14px; }
.legend td { padding: 3px 14px 3px 0; vertical-align: top; }

@media (max-width: 640px) {
  .list .hide-s { display: none; }
  .replies { margin-left: 12px; }
}
