:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #080808;
  --surface-2: #171717;
  --ink: #c8c8c8;
  --muted: #858585;
  --line: #383838;
  --strong-line: #707070;
  --title: #ffff66;
  --accent: #ffff66;
  --accent-ink: #000000;
  --board: #5fd7e5;
  --push: #65d88c;
  --boo: #ff5f5f;
  --rising: #ff5f5f;
  --selected: #343400;
  --header-bg: #050505;
  --toolbar-bg: #101d22;
  --shadow: 0 16px 42px rgba(0, 0, 0, .65);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Consolas, "Noto Sans Mono CJK TC", "Microsoft JhengHei", monospace;
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
.mobile-label { display: none; }
.shell { width: min(1080px, calc(100% - 32px)); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.site-header {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--strong-line);
  background: color-mix(in srgb, var(--header-bg) 94%, transparent);
  backdrop-filter: blur(8px);
}
.header-inner {
  min-height: 52px; display: flex; align-items: center;
  justify-content: space-between; gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--title); font-weight: 800; }
.brand-mark {
  display: grid; place-items: center; width: 25px; height: 25px;
  border: 1px solid currentColor; color: var(--title); font-weight: 800;
}
.main-nav { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.main-nav a {
  min-height: 32px; padding: 6px 9px; border: 1px solid transparent;
  background: transparent; cursor: pointer;
}
.main-nav a:hover { border-color: var(--line); color: var(--title); }
.terminal-link { color: var(--board); }

.board-toolbar { border-bottom: 1px solid var(--line); background: var(--toolbar-bg); }
.toolbar-inner {
  min-height: 48px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
}
.toolbar-inner > div:first-child { display: flex; align-items: baseline; gap: 12px; }
.toolbar-inner strong { color: var(--title); font-size: 17px; }
.toolbar-inner span { color: var(--muted); font-size: 12px; }
.toolbar-actions { display: flex; gap: 6px; }
.toolbar-actions button, .follow-dialog-actions button {
  border: 1px solid var(--strong-line); padding: 4px 9px;
  background: var(--surface); cursor: pointer; font-size: 12px;
}
.toolbar-actions button:hover, .follow-dialog-actions button:hover { color: var(--title); }

.filter-strip { border-bottom: 1px solid var(--line); background: var(--surface); }
.filter-scroll {
  display: flex; align-items: center; gap: 0; overflow-x: auto;
  padding-block: 5px; scrollbar-width: thin;
}
.filter-chip {
  flex: none; padding: 5px 9px; border-right: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.filter-chip:hover { color: var(--title); }
.filter-chip.active { background: var(--selected); color: var(--ink); font-weight: 700; }

.home-lists { padding-bottom: 55px; }
.content-section { padding-top: 35px; }
.section-heading {
  display: flex; align-items: end; justify-content: space-between;
  gap: 16px; margin-bottom: 9px;
}
.section-heading > div { display: flex; align-items: baseline; gap: 12px; }
.section-heading h1, .section-heading h2 {
  margin: 0; color: var(--title); font-size: 20px; line-height: 1.2;
}
.section-heading span, .update-note { margin: 0; color: var(--muted); font-size: 12px; }
.list-columns {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) 130px;
  padding: 5px 8px; border-block: 1px solid var(--strong-line);
  color: var(--muted); background: var(--surface-2); font-size: 11px;
}
.list-columns span:last-child { text-align: right; }
.article-list { border-bottom: 1px solid var(--strong-line); }
.article-card {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) 130px;
  min-height: 73px; padding: 8px; border-bottom: 1px solid var(--line);
  background: var(--surface); transition: background .1s;
}
.article-card:last-child { border-bottom: 0; }
.article-card:hover { background: color-mix(in srgb, var(--selected) 55%, var(--surface)); }
.article-card:focus { outline: 0; }
.article-card.keyboard-active {
  position: relative; z-index: 1; background: var(--selected);
  box-shadow: inset 4px 0 var(--accent);
}
.rank { align-self: center; color: var(--rising); font-size: 18px; font-weight: 800; }
.article-main { min-width: 0; padding-right: 12px; }
.article-kicker {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; color: var(--muted); font-size: 11px;
}
.board-tag { color: var(--board); font-weight: 700; }
.rising { color: var(--rising); font-weight: 700; }
.article-card h3 {
  margin: 2px 0; overflow: hidden; color: var(--title);
  font-size: 15px; font-weight: 500; line-height: 1.45;
  text-overflow: ellipsis; white-space: nowrap;
}
.article-card h3 a:hover { text-decoration: underline; }
.article-meta { display: flex; gap: 10px; margin: 0; color: var(--muted); font-size: 11px; }
.push { color: var(--push); }
.boo { color: var(--boo); }
.muted-link { margin-left: auto; color: var(--muted); }
.muted-link:hover { color: var(--title); }
.metrics {
  display: grid; align-content: center; justify-items: end;
  border-left: 1px solid var(--line); padding-left: 10px;
}
.metrics span {
  max-width: 115px; overflow: hidden; color: var(--muted);
  font-size: 11px; text-overflow: ellipsis; white-space: nowrap;
}
.metrics strong { color: var(--rising); font-size: 17px; }
.metrics time { color: var(--muted); font-size: 12px; }
.empty-state {
  padding: 28px 15px; border-bottom: 1px solid var(--line);
  background: var(--surface); color: var(--muted); text-align: center;
}
.empty-state p { margin: 5px 0 12px; }

.button {
  display: inline-flex; min-height: 34px; align-items: center; justify-content: center;
  padding: 6px 11px; border: 1px solid var(--strong-line);
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.button:hover { color: var(--title); }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button.secondary { background: var(--surface); }
.button.quiet { color: var(--muted); font-size: 12px; }

.follow-dialog, .shortcut-dialog {
  width: min(680px, calc(100% - 24px)); max-height: calc(100vh - 36px);
  padding: 0; border: 1px solid var(--strong-line);
  border-radius: 2px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.follow-dialog::backdrop, .shortcut-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.follow-dialog form, .shortcut-dialog-inner { padding: 20px; }
.follow-dialog-header, .shortcut-dialog header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--strong-line);
}
.follow-dialog h2, .shortcut-dialog h2 { margin: 0; color: var(--title); font-size: 20px; }
.dialog-close {
  width: 30px; height: 30px; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; font-size: 20px; line-height: 1;
}
.follow-dialog-actions {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.follow-dialog-actions span { margin-left: auto; color: var(--muted); font-size: 12px; }
.board-options {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  max-height: 410px; margin: 12px 0 0; padding: 1px;
  border: 0; background: var(--line); overflow-y: auto;
}
.board-option {
  display: flex; align-items: center; gap: 10px; padding: 9px;
  background: var(--surface); cursor: pointer;
}
.board-option:has(input:checked) { background: var(--selected); }
.board-option input { width: 16px; height: 16px; accent-color: var(--accent); }
.board-option span { display: grid; min-width: 0; line-height: 1.3; }
.board-option strong { overflow: hidden; text-overflow: ellipsis; }
.board-option small { color: var(--muted); }
.follow-dialog-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 15px; margin-top: 16px;
}
.follow-dialog-footer > span { color: var(--muted); font-size: 11px; }

.reading-shell { padding-block: 25px 55px; }
.breadcrumb { display: flex; gap: 8px; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.breadcrumb a:hover { color: var(--title); }
.article-header { max-width: 920px; }
.article-header h1, .board-hero h1, .status-hero h1 {
  margin: 10px 0; color: var(--title); font-size: clamp(24px, 4vw, 36px);
  line-height: 1.3; letter-spacing: 0;
}
.article-byline { display: flex; gap: 22px; color: var(--muted); font-size: 12px; }
.reading-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.article-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px;
  gap: 20px; margin-top: 20px; align-items: start;
}
.article-body {
  min-width: 0; padding: 20px; border: 1px solid var(--strong-line);
  border-radius: 0; background: var(--surface);
}
.ptt-content {
  white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: Consolas, "Noto Sans Mono CJK TC", "Microsoft JhengHei", monospace;
  font-size: 15px; line-height: 1.75;
}
.ptt-content a { color: var(--board); text-decoration: underline; }
.article-stats {
  position: sticky; top: 72px; padding: 14px;
  border: 1px solid var(--strong-line); background: var(--surface);
}
.section-label {
  margin: 0 0 8px; color: var(--muted);
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
}
.stat-big {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.stat-big span, .stat-grid span { color: var(--muted); font-size: 11px; }
.stat-big strong { color: var(--rising); font-size: 23px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 10px; }
.stat-grid div { display: grid; }
.stat-grid strong { font-size: 16px; }
.media-section { margin-top: 28px; }
.media-section h2 { margin-bottom: 10px; color: var(--title); font-size: 18px; }
.image-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.image-preview, .video-preview {
  margin: 0; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2);
}
.image-grid img {
  display: block; width: 100%; aspect-ratio: 16 / 10;
  object-fit: contain; background: #000;
}
.image-preview figcaption, .video-preview figcaption {
  padding: 7px 9px; color: var(--board); font-size: 11px; overflow-wrap: anywhere;
}
.video-grid { display: grid; gap: 10px; }
.video-preview iframe, .video-preview video {
  display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000;
}

.comments-section { margin-top: 35px; }
.comment-tools {
  display: grid; grid-template-columns: auto 180px 1fr;
  gap: 7px; margin-bottom: 10px;
}
.segmented { display: flex; border: 1px solid var(--line); }
.segmented button {
  border: 0; border-right: 1px solid var(--line); padding: 6px 8px;
  background: var(--surface); cursor: pointer; font-size: 11px;
}
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--selected); color: var(--ink); }
.comment-tools input {
  min-width: 0; border: 1px solid var(--line);
  padding: 6px 8px; background: var(--surface); color: var(--ink);
}
.comment-list { border-top: 1px solid var(--strong-line); }
.comment {
  display: grid; grid-template-columns: 28px 105px minmax(0, 1fr) 130px;
  gap: 8px; align-items: baseline; padding: 8px 4px;
  border-bottom: 1px solid var(--line); font-size: 12px;
}
.comment[hidden] { display: none; }
.comment p { margin: 0; overflow-wrap: anywhere; }
.comment time { color: var(--muted); font-size: 10px; text-align: right; }
.comment-tag { font-weight: 800; }
.comment-tag.push { color: var(--push); }
.comment-tag.boo { color: var(--boo); }

.board-hero, .status-hero {
  padding: 22px 0; border-bottom: 1px solid var(--strong-line); background: var(--toolbar-bg);
}
.board-hero p, .status-hero p { color: var(--muted); font-size: 12px; }
.board-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 250px;
  gap: 22px; align-items: start;
}
.board-hot {
  position: sticky; top: 70px; margin-top: 35px; padding: 13px;
  border: 1px solid var(--strong-line); background: var(--surface);
}
.board-hot h2 { margin: 0; color: var(--title); font-size: 17px; }
.board-hot ol { margin: 9px 0 0; padding: 0; list-style: none; }
.board-hot li {
  display: grid; grid-template-columns: 23px 1fr; gap: 7px;
  padding: 7px 0; border-top: 1px solid var(--line); font-size: 11px;
}
.board-hot li span { color: var(--rising); font-weight: 800; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 20px; }
.status-content { padding-block: 25px 55px; }
.status-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.status-card { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.status-card span { color: var(--muted); font-size: 11px; }
.status-card strong { font-size: 16px; }
.ok { color: var(--push); }
.error { color: var(--boo); }
.status-table-wrap { margin-top: 30px; }
.status-table { border-top: 1px solid var(--strong-line); }
.status-row {
  display: grid; grid-template-columns: 1fr 130px 1fr;
  gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 12px;
}
.status-head { color: var(--muted); font-size: 10px; font-weight: 800; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.footer-line {
  min-height: 48px; display: flex; align-items: center;
  justify-content: space-between; gap: 15px;
}
.footer-line a:hover { color: var(--title); }
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: 18px;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 7px 11px; border: 1px solid var(--strong-line);
  background: var(--surface); color: var(--ink); font-size: 12px; transition: .15s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.keyboard-guide {
  position: fixed; z-index: 25; right: 14px; bottom: 14px;
  display: flex; align-items: center; gap: 5px; padding: 5px 8px;
  border: 1px solid var(--strong-line); background: var(--surface);
  color: var(--muted); box-shadow: var(--shadow); cursor: pointer; font-size: 11px;
}
kbd {
  display: inline-grid; min-width: 21px; height: 21px; place-items: center;
  padding-inline: 4px; border: 1px solid var(--strong-line);
  background: var(--surface-2); color: var(--ink); font: 700 11px/1 Consolas, monospace;
}
.shortcut-dialog-inner { padding: 18px; }
.shortcut-list { margin-top: 10px; border-top: 1px solid var(--strong-line); }
.shortcut-list > div {
  display: grid; grid-template-columns: 100px 1fr;
  gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.shortcut-list p { display: grid; margin: 0; }
.shortcut-list small { color: var(--muted); }

.ptt-mode {
  min-width: 320px;
  background: #000;
  color: #b8b8b8;
  font-family: "Noto Sans Mono CJK TC", "Microsoft JhengHei", Consolas, monospace;
  font-size: 19px;
  line-height: 1.18;
}
.ptt-mode main { min-height: 100vh; background: #000; }
.ptt-mode .keyboard-guide { display: none; }
.ptt-topbar { background: #090563; color: #aaa; }
.ptt-terminal-shell { width: min(1200px, calc(100% - 32px)); margin-inline: auto; }
.ptt-topbar .ptt-terminal-shell {
  min-height: 40px; display: flex; align-items: center; gap: 13px;
}
.ptt-brand { color: #ffff66; font-size: 21px; }
.ptt-topbar strong { color: #fff; }
.ptt-topbar nav {
  display: flex; gap: 15px; margin-left: auto; color: #aaa; font-size: 12px;
}
.ptt-topbar nav a:hover { color: #fff; }
.ptt-article { padding-bottom: 35px; }
.ptt-meta-panel { position: relative; margin-bottom: 18px; background: #000099; color: #999; }
.ptt-meta-row {
  display: grid; grid-template-columns: 70px minmax(0, 1fr);
  min-height: 24px; align-items: center;
}
.ptt-meta-row:first-child { grid-template-columns: 70px minmax(0, 1fr) 70px auto; }
.ptt-meta-row > span {
  align-self: stretch; display: flex; align-items: center;
  padding-inline: 10px; background: #aaa; color: #101060;
}
.ptt-meta-row > strong { padding-inline: 10px; color: #999; font-weight: 400; }
.ptt-board-label { margin-left: auto; }
.ptt-article-body { min-height: 180px; white-space: pre-wrap; overflow-wrap: anywhere; color: #b8b8b8; }
.ptt-content-root { display: contents; }
.ptt-article-body a, .ptt-source-line a { color: #929292; text-decoration: underline; }
.ptt-article-body a:hover, .ptt-source-line a:hover { color: #fff; }
.ptt-article-body .push {
  display: grid; grid-template-columns: 28px 130px minmax(0, 1fr) 115px;
  gap: 7px; min-height: 28px; align-items: baseline;
  color: #b8b8b8; white-space: normal;
}
.ptt-article-body .push-tag { color: #ddd; }
.ptt-article-body .push-tag.f1 { color: #ff4b55; }
.ptt-article-body .push-userid {
  min-width: 0; overflow: hidden; color: #ffff66;
  text-overflow: ellipsis; white-space: nowrap;
}
.ptt-article-body .push-content {
  min-width: 0; color: #9c970f; overflow-wrap: anywhere;
}
.ptt-article-body .push-ipdatetime {
  color: #bbb; text-align: right; white-space: nowrap;
}
.ptt-muted { color: #777; }
.ptt-source-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px;
  margin-top: 28px; color: #20a34a; overflow-wrap: anywhere;
}
.ptt-source-copy {
  min-height: 27px; padding: 2px 10px; border: 1px solid #20a34a;
  border-radius: 2px; background: #073d18; color: #62d982;
  font: 13px/1.3 "Noto Sans Mono CJK TC", "Microsoft JhengHei", sans-serif;
  cursor: pointer;
}
.ptt-source-copy:hover, .ptt-source-copy:focus-visible {
  background: #20a34a; color: #001a08;
}
.ptt-source-copy:disabled { cursor: default; opacity: .75; }
.ptt-comments { margin-top: 3px; }
.ptt-comment-toolbar {
  position: static;
  display: flex; min-height: 38px; align-items: center; gap: 10px;
  margin: 8px 0; padding: 4px 7px; border-block: 1px solid #333;
  background: rgba(0, 0, 0, .94); color: #888; font-size: 12px;
}
.ptt-comment-view-switch { display: flex; }
.ptt-comment-toolbar button {
  min-height: 27px; padding: 3px 8px; border: 1px solid #444;
  background: #111; color: #999; cursor: pointer;
}
.ptt-comment-toolbar button + button { border-left: 0; }
.ptt-comment-toolbar button:hover, .ptt-comment-toolbar button.active {
  background: #aaa; color: #111;
}
.ptt-comment-group {
  display: block;
  content-visibility: auto;
  contain-intrinsic-size: auto 30px;
}
.ptt-comment {
  display: grid; grid-template-columns: 28px 130px minmax(0, 1fr) 115px;
  gap: 7px; min-height: 28px; align-items: baseline;
}
.ptt-comment-tag { color: #ddd; }
.ptt-comment.boo .ptt-comment-tag, .ptt-comment.neutral .ptt-comment-tag { color: #ff4b55; }
.ptt-comment-user {
  min-width: 0; overflow: hidden; padding: 0; border: 0; background: transparent;
  color: #ffff66; font: inherit; font-weight: 400;
  text-align: left; text-overflow: ellipsis; white-space: nowrap;
}
.ptt-comment-body { min-width: 0; color: #9c970f; overflow-wrap: anywhere; }
.ptt-comment-body > a { color: #929292; text-decoration: underline; }
.ptt-comment time { color: #bbb; text-align: right; white-space: nowrap; }
.ptt-author-edit {
  min-height: 28px; color: #b8b8b8; white-space: normal;
  overflow-wrap: anywhere;
}
.ptt-author-edit .comment-media-preview { margin-left: 0; }
.ptt-comment-end {
  margin-top: 9px; padding: 9px 0 5px; border-top: 1px solid #333;
  color: #777; text-align: left;
}
.ptt-comment-load {
  display: block; width: 100%; margin-top: 8px; padding: 9px 0;
  border: 0; border-top: 1px solid #292929; background: transparent;
  color: #777; font: inherit; text-align: left; cursor: pointer;
}
.ptt-comment-load:hover { color: #bbb; }
.ptt-comment-load:disabled { cursor: wait; opacity: .75; }
.ptt-comment-load[hidden], .ptt-comment-end[hidden] { display: none; }
.ptt-comment-stream.continuation-mode .ptt-comment-group.is-continuation {
  display: flex; flex-direction: column; margin: 7px 0; padding: 5px 0 6px 7px;
  border-left: 3px solid #777; background: transparent;
}
.ptt-comment-stream.continuation-mode
  .ptt-comment-group.is-continuation
  .ptt-comment {
  grid-template-columns: 18px 130px minmax(0, 1fr) 115px;
}
.ptt-comment-stream.continuation-mode
  .ptt-comment-group.is-continuation
  .ptt-comment.neutral
  .ptt-comment-tag {
  transform: scaleX(.72);
  transform-origin: left center;
}
.ptt-comment-stream.continuation-mode
  .ptt-comment-group.is-continuation
  .ptt-comment[data-continuation-primary="true"] { order: 1; }
.ptt-comment-stream.continuation-mode
  .ptt-comment-group.is-continuation
  .ptt-comment[data-continuation-primary="false"] {
  order: 2; margin-top: 3px; padding-top: 3px; border-top: 0;
}
.ptt-comment-stream.continuation-mode .ptt-comment.continuation-next {
  min-height: 22px;
}
.ptt-comment-stream.continuation-mode .ptt-comment.continuation-next .ptt-comment-tag,
.ptt-comment-stream.continuation-mode .ptt-comment.continuation-next .ptt-comment-user,
.ptt-comment-stream.continuation-mode .ptt-comment.continuation-next time,
.ptt-comment-stream.continuation-mode .ptt-comment.continuation-next .ptt-comment-separator {
  visibility: hidden;
}
.inline-media-previews-enabled .inline-media-source:not(.is-visible) {
  display: none;
}
.inline-media-preview {
  position: relative; width: min(420px, 70vw); margin: 8px 0 12px 40px;
  border: 1px solid #343434; background: #0b0b0b; line-height: 0;
}
.inline-media-preview img, .inline-media-preview video {
  display: block; width: 100%; max-height: 280px; object-fit: contain;
}
.inline-image.is-portrait {
  width: min(420px, calc(100vw - 80px));
}
.comment-image.is-portrait {
  width: min(320px, 100%);
}
.inline-image.is-portrait img, .comment-image.is-portrait img {
  width: auto; height: auto; max-width: 100%;
  max-height: min(68dvh, 640px); object-fit: contain;
}
.inline-media-preview img:not([src]),
.inline-media-preview video:not([src]) {
  min-height: 160px; background: #111;
}
.youtube-play {
  position: relative; display: block; width: 100%; padding: 0; border: 0;
  background: #000; color: #fff; line-height: 0; cursor: pointer;
}
.inline-youtube img, .comment-youtube img {
  aspect-ratio: 16 / 9; object-fit: cover;
}
.inline-youtube span, .comment-youtube span {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center;
  border-radius: 8px; background: rgba(210, 0, 0, .9); color: #fff;
  text-decoration: none;
}
.inline-youtube span { width: 52px; height: 38px; font-size: 20px; }
.youtube-play:hover span, .youtube-play:focus-visible span {
  background: #f00; transform: translate(-50%, -50%) scale(1.08);
}
.inline-youtube iframe, .comment-youtube iframe {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  border: 0; background: #000;
}
.comment-media-preview {
  position: relative; width: min(320px, 100%); margin: 7px 0 9px;
  border: 1px solid #343434; background: #0b0b0b; line-height: 0;
}
.comment-media-preview img, .comment-media-preview video {
  display: block; width: 100%; max-height: 220px; object-fit: contain;
}
.comment-media-preview img:not([src]),
.comment-media-preview video:not([src]) {
  min-height: 120px; background: #111;
}
.inline-media-preview > a, .comment-media-preview > a { display: block; }
.inline-media-preview.inline-image,
.comment-media-preview.comment-image {
  width: fit-content; border: 0; background: transparent;
}
.inline-media-preview.inline-image {
  max-width: min(420px, calc(100vw - 80px));
}
.comment-media-preview.comment-image {
  max-width: min(320px, 100%);
}
.inline-image > a, .comment-image > a {
  width: fit-content; max-width: 100%; cursor: zoom-in;
}
.inline-image img, .comment-image img {
  width: auto; height: auto; max-width: 100%;
}
.inline-image img:not([src]) {
  width: min(420px, calc(100vw - 80px));
}
.comment-image img:not([src]) {
  width: min(320px, 100%);
}
.gif-toggle {
  position: absolute; inset: 0; display: grid; width: 100%; place-items: center;
  border: 0; background: rgba(0, 0, 0, .42); color: #eee;
  font: 15px/1.2 "Noto Sans Mono CJK TC", "Microsoft JhengHei", sans-serif;
  cursor: pointer;
}
.gif-toggle span {
  padding: 7px 11px; border: 1px solid #777; border-radius: 4px;
  background: rgba(0, 0, 0, .82);
}
.gif-preview.is-gif-playing .gif-toggle {
  inset: 6px 6px auto auto; width: auto; opacity: .2;
}
.gif-preview.is-gif-playing .gif-toggle:hover,
.gif-preview.is-gif-playing .gif-toggle:focus-visible { opacity: 1; }
.gif-preview.is-gif-playing .gif-toggle span {
  padding: 5px 8px; font-size: 12px;
}
.comment-youtube span {
  width: 44px; height: 32px; border-radius: 7px;
  font-size: 16px; line-height: 1;
}
.x-post-preview {
  display: flow-root; clear: both; float: none !important;
  width: min(380px, 100%); min-height: 58px;
  margin: 8px 0 12px; padding: 0; border: 0; background: transparent;
  line-height: 1.35; overflow: clip; isolation: isolate;
}
.inline-x-post { margin-left: 40px; }
.x-post-widget { display: flow-root; width: 100%; }
.x-post-widget iframe {
  display: block !important; float: none !important;
  width: 100% !important; max-width: 100% !important; margin: 0 !important;
}
.x-post-fallback {
  display: inline-flex; align-items: center; min-height: 38px; padding: 7px 12px;
  border: 1px solid #536471; border-radius: 18px;
  color: #e7e9ea; background: #0f1419; font-size: 15px; text-decoration: none;
}
.x-post-fallback:hover { border-color: #1d9bf0; color: #fff; }
.x-post-preview.is-rendered .x-post-fallback { display: none; }
.x-post-preview.is-loading .x-post-fallback { opacity: .72; }
.social-post-preview {
  position: relative; display: flow-root; clear: both; float: none !important;
  width: min(360px, 100%); min-height: 120px; margin: 8px 0 12px;
  border: 1px solid #343434; background: #0b0b0b;
  overflow: hidden; isolation: isolate; line-height: 1.35;
}
.inline-social-post { margin-left: 40px; }
.social-post-preview iframe {
  display: block; width: 100%; border: 0; background: #111;
}
.instagram-post-preview iframe { height: 480px; }
.facebook-post-preview iframe { height: 430px; }
.social-post-fallback {
  position: absolute; inset: 42px auto auto 50%; transform: translateX(-50%);
  display: inline-flex; min-width: 170px; min-height: 38px;
  align-items: center; justify-content: center; padding: 7px 12px;
  border: 1px solid #555; border-radius: 4px; background: #111;
  color: #bbb; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.social-post-fallback:hover { border-color: #999; color: #fff; }
.social-post-preview.is-loaded .social-post-fallback { display: none; }

.media-lightbox {
  width: min(96vw, 1500px); max-width: none; height: min(94dvh, 1100px);
  max-height: none; margin: auto; padding: 44px 12px 46px;
  border: 1px solid #555; background: #050505; color: #bbb;
  overflow: hidden;
}
.media-lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.media-lightbox-stage {
  display: grid; width: 100%; height: 100%; place-items: center;
  overflow: auto;
}
.media-lightbox-stage img {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 100%;
  object-fit: contain;
}
.media-lightbox[data-image-orientation="portrait"] .media-lightbox-stage {
  place-items: start center;
}
.media-lightbox[data-image-orientation="portrait"] .media-lightbox-stage img {
  max-height: none;
}
.media-lightbox-close {
  position: absolute; top: 6px; right: 8px; width: 38px; height: 34px;
  border: 1px solid #555; background: #111; color: #ddd;
  cursor: pointer; font-size: 24px; line-height: 1;
}
.media-lightbox-source {
  position: absolute; left: 12px; bottom: 10px;
  color: #aaa; font-size: 13px; text-decoration: underline;
}
.media-lightbox-source:hover { color: #fff; }

.ptt-list-mode {
  --ptt-list-bg: #000;
  --ptt-list-row: #111;
  --ptt-list-row-hover: #1a1a1a;
  --ptt-list-control: #444;
  --ptt-list-control-active: #aaa;
  --ptt-list-text: #aaa;
  --ptt-list-muted: #888;
  min-width: 320px;
  background: var(--ptt-list-bg);
  color: var(--ptt-list-text);
  font-family: "Noto Sans Mono CJK TC", "Microsoft JhengHei", Consolas, monospace;
  font-size: 18px;
}
.ptt-list-mode main { min-height: calc(100vh - 65px); background: var(--ptt-list-bg); }
.ptt-list-shell { width: calc(100% - 40px); margin-inline: auto; }
.ptt-list-header {
  min-height: 65px; display: flex; align-items: center; gap: 15px;
  font-size: 18px;
}
.ptt-list-header .ptt-brand { font-size: 28px; }
.ptt-list-header nav {
  display: flex; align-items: center; gap: 16px; margin-left: auto;
  color: #aaa; font-size: 14px;
}
.ptt-list-header a:hover { color: #fff; }
.ptt-board-page { padding: 0 0 40px; }
.ptt-list-toolbar {
  min-height: 70px; display: flex; align-items: center; justify-content: space-between;
}
.ptt-ranking-tabs, .ptt-list-actions { display: flex; align-items: stretch; }
.ptt-ranking-tabs a, .ptt-list-actions button {
  min-width: 108px; min-height: 58px; display: grid; place-items: center;
  padding: 10px 18px; border: 1px solid #666; background: var(--ptt-list-control);
  color: var(--ptt-list-text); cursor: pointer;
}
.ptt-ranking-tabs a + a, .ptt-list-actions button + button { border-left: 0; }
.ptt-ranking-tabs a.active {
  background: var(--ptt-list-control-active);
  color: #111;
}
.ptt-ranking-tabs a:hover, .ptt-list-actions button:hover { filter: brightness(1.16); }
.ptt-board-filters {
  display: flex; gap: 1px; padding-bottom: 15px; overflow-x: auto;
  color: var(--ptt-list-muted); font-size: 13px; scrollbar-width: thin;
}
.ptt-board-filters a {
  flex: none; padding: 5px 9px; border: 1px solid #333;
  background: var(--ptt-list-row);
}
.ptt-board-filters a.active { color: #111; background: #aaa; }
.ptt-ranking-heading {
  min-height: 40px; display: flex; align-items: baseline; gap: 14px;
  padding-inline: 2px; color: var(--ptt-list-muted);
}
.ptt-ranking-heading h1 { margin: 0; color: var(--ptt-list-text); font-size: 17px; font-weight: 400; }
.ptt-ranking-heading span { font-size: 12px; }
.ptt-list-mode .article-list {
  display: grid; gap: 10px; border: 0; background: var(--ptt-list-bg);
}
.ptt-list-mode .article-card {
  grid-template-columns: 58px minmax(0, 1fr) 125px;
  min-height: 90px; padding: 8px 14px 8px 18px; border: 0;
  background: var(--ptt-list-row); color: var(--ptt-list-text);
}
.ptt-list-mode .article-card[hidden] { display: none; }
.ptt-list-mode .article-card:hover { background: var(--ptt-list-row-hover); }
.ptt-list-mode .article-card.keyboard-active {
  background: #aaa; color: #111; box-shadow: none;
}
.ptt-list-mode .article-card.keyboard-active h3,
.ptt-list-mode .article-card.keyboard-active .article-meta,
.ptt-list-mode .article-card.keyboard-active .metrics,
.ptt-list-mode .article-card.keyboard-active .board-prefix { color: #111; }
.ptt-list-mode .rank {
  align-self: start; padding-top: 5px; color: var(--ptt-list-muted);
  font-size: 22px; font-weight: 400; text-align: right;
}
.ptt-list-mode .rank.positive { color: #48d864; }
.ptt-list-mode .rank.hot { color: #ffff55; }
.ptt-list-mode .rank.negative { color: #ff5555; }
.ptt-list-mode .article-main {
  display: grid; align-content: center; min-width: 0; padding: 0 14px;
}
.ptt-list-mode .article-card h3 {
  margin: 0; color: var(--ptt-list-text); font-size: 20px;
  font-weight: 700; line-height: 1.45;
}
.ptt-list-mode .board-prefix { color: #d7d7d7; font-weight: 400; }
.ptt-list-mode .article-card:not(.is-read) h3 { color: #f0f0f0; }
.ptt-list-mode .article-card.is-read h3 {
  color: #707070;
  font-weight: 400;
}
.ptt-list-mode .article-card.is-read .board-prefix,
.ptt-list-mode .article-card.is-read .article-meta,
.ptt-list-mode .article-card.is-read .metrics {
  color: #696969;
}
.ptt-list-mode .article-meta {
  margin: 2px 0 0; color: var(--ptt-list-text); font-size: 16px;
}
.ptt-list-mode .metrics {
  display: flex; align-items: end; justify-content: flex-end; gap: 22px;
  border: 0; padding: 0 0 2px; color: var(--ptt-list-text);
}
.ptt-list-mode .metrics time, .ptt-list-mode .metrics span {
  color: inherit; font-size: 17px;
}
.ptt-list-mode .empty-state { border: 0; background: var(--ptt-list-row); }

@media (max-width: 820px) {
  .article-layout, .board-layout { grid-template-columns: 1fr; }
  .article-stats, .board-hot { position: static; }
  .comment-tools { grid-template-columns: 1fr 1fr; }
  .segmented { grid-column: 1 / -1; overflow-x: auto; }
  .comment { grid-template-columns: 28px 1fr; }
  .comment p, .comment time { grid-column: 2; text-align: left; }
  .status-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  html {
    scroll-padding-top: 104px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  body { font-size: 16px; }
  button, a, input, label { touch-action: manipulation; }
  .desktop-label { display: none; }
  .mobile-label { display: inline; }
  .shell { width: min(100% - 20px, 1080px); }
  .header-inner {
    min-height: 48px; padding-top: env(safe-area-inset-top);
  }
  .main-nav > a:not(.terminal-link) { display: none; }
  .main-nav a { min-width: 44px; min-height: 44px; place-content: center; }
  .toolbar-inner { min-height: 45px; }
  .toolbar-inner > div:first-child span { display: none; }
  .toolbar-actions button { padding-inline: 7px; }
  .content-section { padding-top: 25px; }
  .section-heading { align-items: baseline; }
  .section-heading > div { gap: 8px; }
  .list-columns { grid-template-columns: 42px minmax(0, 1fr); }
  .list-columns span:last-child { display: none; }
  .article-card {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 68px; padding: 7px 4px;
  }
  .rank { font-size: 14px; }
  .article-main { padding-right: 2px; }
  .article-card h3 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .metrics { display: none; }
  .article-meta { gap: 7px; }
  .follow-dialog, .shortcut-dialog {
    width: calc(100% - 16px); max-height: calc(100dvh - 16px);
  }
  .follow-dialog form {
    display: flex; max-height: calc(100dvh - 18px); flex-direction: column;
    padding: 12px;
  }
  .follow-dialog-header { flex: none; }
  .dialog-close { width: 44px; height: 44px; }
  .follow-dialog-actions { flex: none; flex-wrap: wrap; }
  .follow-dialog-actions button { min-height: 42px; }
  .follow-dialog-actions span { flex-basis: 100%; margin-left: 0; }
  .board-options {
    grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 0;
    max-height: 58dvh; flex: 1;
  }
  .board-option { min-height: 50px; padding: 8px; }
  .board-option input { width: 20px; height: 20px; flex: none; }
  .follow-dialog-footer { flex: none; align-items: stretch; flex-direction: column; }
  .follow-dialog-footer .button { min-height: 48px; }
  .article-body { padding: 13px 10px; }
  .reading-actions .button { flex: 1 1 45%; }
  .article-byline { flex-direction: column; gap: 2px; }
  .comment-tools { grid-template-columns: 1fr; }
  .segmented { grid-column: auto; }
  .image-grid { grid-template-columns: 1fr; }
  .status-row { grid-template-columns: 1fr auto; }
  .status-row > :last-child { grid-column: 1 / -1; color: var(--muted); }
  .keyboard-guide { display: none; }
  .shortcut-list > div { grid-template-columns: 86px 1fr; }
  .ptt-mode {
    font-size: 16px; line-height: 1.5;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .ptt-mode main { min-height: 100dvh; }
  .ptt-topbar {
    position: sticky; top: 0; z-index: 30;
    padding-top: env(safe-area-inset-top);
  }
  .ptt-terminal-shell { width: 100%; padding-inline: 10px; }
  .ptt-topbar .ptt-terminal-shell { min-height: 44px; gap: 8px; }
  .ptt-brand { flex: none; font-size: 17px; }
  .ptt-topbar .ptt-terminal-shell > span { font-size: 13px; }
  .ptt-topbar nav { gap: 0; }
  .ptt-topbar nav a {
    display: grid; min-width: 44px; min-height: 44px; place-items: center;
  }
  .ptt-topbar nav a:not(:last-child) { display: none; }
  .ptt-article { padding: 0 10px calc(28px + env(safe-area-inset-bottom)); }
  .ptt-meta-panel { margin-inline: -10px; margin-bottom: 14px; }
  .ptt-meta-row {
    grid-template-columns: 48px minmax(0, 1fr); min-height: 30px;
  }
  .ptt-meta-row:first-child { grid-template-columns: 48px minmax(0, 1fr); }
  .ptt-meta-row:first-child .ptt-board-label {
    grid-column: 1; margin-left: 0;
  }
  .ptt-meta-row > span, .ptt-meta-row > strong { padding: 4px 7px; }
  .ptt-meta-row > strong { line-height: 1.35; overflow-wrap: anywhere; }
  .ptt-article-body {
    min-height: 120px; font-size: 16px; line-height: 1.62;
  }
  .ptt-source-line {
    margin-top: 22px; font-size: 13px; line-height: 1.45;
  }
  .ptt-comments { margin-top: 7px; }
  .ptt-comment {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 1px 6px; min-height: 0; padding: 5px 0; align-items: baseline;
    border-bottom: 1px solid #111;
  }
  .ptt-comment-user { min-height: 27px; line-height: 27px; }
  .ptt-comment-body {
    grid-column: 2 / -1; line-height: 1.5; padding: 0 0 3px;
  }
  .ptt-comment time {
    grid-column: 3; grid-row: 1; align-self: center; font-size: 12px;
  }
  .ptt-article-body .push {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 1px 6px; padding-block: 4px;
  }
  .ptt-article-body .push-content {
    grid-column: 2 / -1; line-height: 1.5;
  }
  .ptt-article-body .push-ipdatetime {
    grid-column: 3; grid-row: 1; font-size: 12px;
  }
  .ptt-author-edit {
    padding: 6px 0; font-size: 16px; line-height: 1.58;
  }
  .ptt-comment-stream.continuation-mode
    .ptt-comment-group.is-continuation
    .ptt-comment {
    grid-template-columns: 14px minmax(0, 1fr) auto;
  }
  .ptt-comment-toolbar {
    top: calc(44px + env(safe-area-inset-top));
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    min-height: 50px; gap: 5px 8px; margin-inline: -10px;
    padding: 5px 10px;
  }
  .ptt-comment-toolbar > [data-comment-view-status] {
    justify-self: end; white-space: nowrap;
  }
  .ptt-comment-toolbar button { min-height: 40px; padding-inline: 10px; }
  .ptt-comment-load, .ptt-comment-end {
    min-height: 48px; padding: 13px 0; font-size: 14px;
  }
  .comment-media-preview {
    width: min(100%, 340px); margin: 7px 0 9px;
  }
  .comment-media-preview img, .comment-media-preview video { max-height: 260px; }
  .inline-media-preview {
    width: min(100%, 420px); margin: 9px 0 13px;
  }
  .inline-media-preview img, .inline-media-preview video { max-height: 320px; }
  .inline-image.is-portrait {
    width: fit-content; max-width: min(100%, 380px);
  }
  .comment-image.is-portrait {
    width: fit-content; max-width: min(100%, 320px);
  }
  .inline-image.is-portrait img, .comment-image.is-portrait img {
    max-height: 64dvh;
  }
  .media-lightbox {
    width: 100vw; height: 100dvh; padding: calc(48px + env(safe-area-inset-top))
      8px calc(48px + env(safe-area-inset-bottom));
    border: 0;
  }
  .media-lightbox-close {
    top: calc(6px + env(safe-area-inset-top)); width: 44px; height: 40px;
  }
  .media-lightbox-source {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .comment-x-post, .comment-social-post { width: min(100%, 340px); }
  .inline-x-post, .inline-social-post {
    width: min(100%, 380px); margin-left: 0;
  }
  .instagram-post-preview iframe { height: 440px; }
  .facebook-post-preview iframe { height: 360px; }
  .ptt-list-mode { font-size: 16px; }
  .ptt-list-mode main {
    min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom);
  }
  .ptt-list-shell { width: 100%; padding-inline: 10px; }
  .ptt-list-header {
    min-height: 48px; gap: 8px; padding-top: env(safe-area-inset-top);
  }
  .ptt-list-header .ptt-brand { font-size: 19px; }
  .ptt-list-header > span { font-size: 13px; }
  .ptt-list-header nav a { display: none; }
  .ptt-board-page { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .ptt-list-toolbar {
    position: sticky; top: calc(48px + env(safe-area-inset-top)); z-index: 20;
    min-height: 54px; margin-inline: -10px; padding-inline: 10px;
    background: color-mix(in srgb, var(--ptt-list-bg) 95%, transparent);
    backdrop-filter: blur(8px);
  }
  .ptt-ranking-tabs { flex: 1; }
  .ptt-ranking-tabs a { flex: 1; }
  .ptt-ranking-tabs a, .ptt-list-actions button {
    min-width: 0; min-height: 44px; padding: 7px 10px; font-size: 14px;
  }
  .ptt-list-actions { flex: none; margin-left: 6px; }
  .ptt-list-actions button { width: 52px; padding-inline: 4px; }
  .ptt-board-filters {
    margin-inline: -10px; padding: 0 10px 10px;
    scroll-padding-inline: 10px;
  }
  .ptt-board-filters a {
    min-height: 40px; display: grid; place-items: center; padding: 7px 11px;
  }
  .ptt-ranking-heading {
    align-items: flex-start; flex-direction: column; gap: 0;
    min-height: 48px; padding: 0 2px 8px;
  }
  .ptt-ranking-heading h1 { font-size: 16px; }
  .ptt-list-mode .article-list { gap: 6px; }
  .ptt-list-mode .article-card {
    grid-template-columns: 42px minmax(0, 1fr) 50px; min-height: 82px;
    padding: 8px 8px; cursor: pointer;
  }
  .ptt-list-mode .article-card:active {
    background: var(--ptt-list-row-hover); transform: translateY(1px);
  }
  .ptt-list-mode .rank {
    align-self: center; padding-top: 0; font-size: 17px;
  }
  .ptt-list-mode .article-main { padding-inline: 8px; }
  .ptt-list-mode .article-card h3 {
    display: -webkit-box; overflow: hidden; font-size: 16px;
    line-height: 1.38; white-space: normal;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }
  .ptt-list-mode .article-meta { font-size: 13px; }
  .ptt-list-mode .metrics { display: flex; align-items: flex-end; gap: 0; }
  .ptt-list-mode .metrics span { display: none; }
  .ptt-list-mode .metrics time { font-size: 12px; white-space: nowrap; }
}

@media (max-width: 380px) {
  .ptt-list-header > span { display: none; }
  .ptt-list-header .ptt-brand { font-size: 18px; }
  .ptt-ranking-tabs a, .ptt-list-actions button { font-size: 13px; }
  .ptt-list-actions button { width: 46px; }
  .board-options { grid-template-columns: 1fr; }
  .ptt-comment-toolbar {
    grid-template-columns: 1fr;
  }
  .ptt-comment-toolbar > [data-comment-view-status] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (pointer: coarse) {
  .keyboard-guide { display: none; }
}
