:root {
  --bg: #12151b;
  --panel: #1a1f27;
  --panel-2: #202631;
  --line: #2c3441;
  --text: #d6dbe4;
  --muted: #8b95a5;
  --accent: #4f8ef7;
  --accent-2: #3ecf8e;
  --op: #f0a53c;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* ---- top bar ---- */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 56px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; user-select: none; }
.logo-mark { width: 30px; height: 30px; border-radius: var(--radius); display: block; }
.topnav { display: flex; gap: 18px; margin-left: auto; font-size: 14px; }
.topnav .dead { color: #4d5768; cursor: default; user-select: none; }
.btn-join {
  background: var(--accent);
  border: 0;
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  padding: 7px 16px;
  border-radius: 5px;
  cursor: pointer;
}
.btn-join:hover { background: #6aa0f9; }
.btn-join.wide { width: 100%; padding: 11px; font-size: 15px; margin-top: 4px; }

/* ---- breadcrumb (non-clickable, software name only) ---- */
.breadcrumb { font-size: 13px; color: var(--muted); padding: 18px 0 14px; }
.breadcrumb .crumb { color: var(--muted); }
.breadcrumb .crumb + .crumb::before { content: "/"; margin: 0 8px; color: #4a5464; }

/* ---- thread header ---- */
.thread-head {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.thread-head-main { flex: 1; min-width: 0; }
.thread-head h1 { margin: 0 0 10px; font-size: 21px; line-height: 1.35; font-weight: 600; }
.pin {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--op);
  border: 1px solid rgba(240,165,60,.4);
  border-radius: 3px;
  padding: 1px 6px;
  margin-right: 8px;
  vertical-align: 3px;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 8px;
}
.thread-stats { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.thread-stats b { display: block; color: var(--text); font-size: 16px; font-weight: 600; }

/* ---- posts ---- */
.posts { margin: 16px 0 24px; display: flex; flex-direction: column; gap: 12px; }

.post {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.post.op { border-color: #3a4658; }

.post-side {
  width: 168px;
  flex: none;
  background: var(--panel-2);
  border-right: 1px solid var(--line);
  padding: 16px 14px;
  text-align: center;
}
.avatar {
  width: 52px; height: 52px;
  margin: 0 auto 10px;
  border-radius: var(--radius);
  display: block;
}
.uname { font-weight: 600; font-size: 14px; }
.utitle { font-size: 12px; color: var(--muted); margin-top: 2px; }
.badge-op {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--op);
  border: 1px solid rgba(240,165,60,.4);
  border-radius: 3px;
  padding: 1px 7px;
}
.umeta { margin-top: 12px; font-size: 11.5px; color: var(--muted); line-height: 1.7; }

.post-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.post-head .permalink { color: var(--muted); cursor: default; }
.post-body { padding: 16px 18px; flex: 1; }
.post-body p { margin: 0 0 12px; white-space: pre-wrap; }
.post-body p:last-child { margin-bottom: 0; }
.post-body .mention { color: var(--accent); font-weight: 500; }

.sig {
  margin: 4px 18px 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: #6c7686;
  font-style: italic;
}
.post-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 18px 14px;
  font-size: 12.5px;
}
.post-foot button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font: inherit;
}
.post-foot button:hover { color: var(--text); border-color: #3d4757; }

/* ---- download block ---- */
.dl {
  margin: 6px 0 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.dl-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dl-file { font-weight: 600; font-size: 14px; word-break: break-all; }
.dl-btn {
  margin-left: auto;
  background: var(--accent-2);
  color: #0f1a15;
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 18px;
  border: none;
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
}
.dl-btn:hover { background: #4ade9d; }
.dl-meta {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.dl-meta span b { color: var(--text); font-weight: 500; }
.dl-file { font-size: 15px; }
.dl-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  flex-shrink: 0;
}
.dl-right .dl-btn { margin-left: 0; font-size: 14px; padding: 9px 22px; }
.dl-pw {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}
.dl-pw-code {
  background: var(--accent-2);
  color: #0f1a15;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 13px;
  font-family: Consolas, "Courier New", monospace;
  user-select: all;
}
.dl-pw-copy {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  padding: 3px 5px;
  display: flex;
  align-items: center;
  transition: color .2s, border-color .2s;
}
.dl-pw-copy:hover { color: var(--accent-2); border-color: var(--accent-2); }
.dl-pw-copy.copied { color: var(--accent-2); border-color: var(--accent-2); }
.dl-pw-info {
  color: var(--muted);
  cursor: help;
  display: flex;
  align-items: center;
}
.dl-pw-info:hover { color: var(--accent); }
.dl-hash {
  margin-top: 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11.5px;
  color: #6c7686;
  word-break: break-all;
}
.vt-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 14px 8px 10px;
  background: rgba(62,207,142,.08);
  border: 1px solid rgba(62,207,142,.35);
  border-radius: 6px;
  color: var(--text);
}
a.vt-badge:hover { text-decoration: none; background: rgba(62,207,142,.14); }
.vt-icon { width: 26px; height: 26px; flex: none; color: var(--accent-2); }
.vt-txt { display: flex; flex-direction: column; line-height: 1.35; font-size: 12.5px; }
.vt-txt b { font-size: 13px; }
.vt-ratio { color: var(--accent-2); font-weight: 600; }
.vt-label { color: var(--muted); font-size: 11.5px; }

/* ---- reply box ---- */
.reply-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.reply-box textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  cursor: pointer;
}
.reply-actions { display: flex; align-items: center; margin-top: 10px; }
.reply-actions .hint { font-size: 12.5px; color: var(--muted); }
.reply-actions button {
  margin-left: auto;
  background: var(--accent);
  border: 0;
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
}

/* ---- footer ---- */
.footer {
  margin-top: 32px;
  padding: 20px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

/* ---- registration modal ---- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6,8,12,.72); backdrop-filter: blur(2px); }
.modal-card {
  position: relative;
  width: min(380px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px 26px 22px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-close {
  position: absolute;
  top: 10px; right: 12px;
  background: none; border: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal-logo svg { width: 46px; height: 46px; }
.modal-card h2 { margin: 12px 0 6px; font-size: 19px; }
.modal-sub { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); }
.modal-form { display: flex; flex-direction: column; gap: 10px; }
.modal-form input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.modal-form input:focus { outline: none; border-color: var(--accent); }
.modal-foot { margin-top: 14px; font-size: 13px; color: var(--muted); }
.modal-foot .link { color: var(--accent); cursor: pointer; }
.modal-foot .link:hover { text-decoration: underline; }

.error {
  background: #2a1c1c;
  border: 1px solid #5c3030;
  border-radius: var(--radius);
  padding: 16px 18px;
  color: #e8b4b4;
}
.error code { color: #f0d0a0; }

@media (max-width: 640px) {
  .post { flex-direction: column; }
  .post-side {
    width: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
  }
  .avatar { margin: 0; width: 40px; height: 40px; }
  .umeta { margin: 0 0 0 auto; text-align: right; }
  .badge-op { margin-top: 4px; }
  .thread-head { flex-direction: column; }
  .thread-stats { text-align: left; }
  .topnav { display: none; }
  .dl-top { flex-direction: column; align-items: flex-start; }
  .dl-right { width: 100%; }
  .dl-btn { margin-left: 0; width: 100%; text-align: center; }
}
