@font-face {
  font-family: "Sora";
  src: url("/fonts/sora-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jbmono-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #080808;
  --panel: #0b0b0b;
  --panel-soft: #0e0e0e;
  --surface: #121212;
  --surface-hover: #181818;
  --line: #242424;
  --line-strong: #363636;
  --text: #f0f0f0;
  --muted: #929292;
  --faint: #5b5b5b;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --sans: "Sora", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .45;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 1px solid #dcdcdc;
  outline-offset: 3px;
}

::selection {
  background: #3c3c3c;
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #333;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-image {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
}

.brand-image-boot {
  width: 52px;
  height: 52px;
}

.brand-word {
  font-size: 18px;
  font-weight: 540;
  letter-spacing: -.035em;
}

.brand-divider {
  width: 1px;
  height: 14px;
  margin: 0 3px;
  background: var(--line-strong);
}

.brand-caption {
  color: #777;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------- boot ---------- */
.boot-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
}

.loading-line {
  position: relative;
  width: 144px;
  height: 1px;
  overflow: hidden;
  border-radius: 999px;
  background: #222;
}

.loading-line::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 38%;
  border-radius: inherit;
  background: #d0d0d0;
  animation: loading 1.8s ease-in-out infinite;
}

@keyframes loading {
  from { transform: translateX(-110%); }
  to { transform: translateX(370%); }
}

/* ---------- 登录 ---------- */
.login-layout {
  width: min(1480px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 32px 44px 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 370px);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: clamp(56px, 8vw, 124px);
}

.login-masthead {
  grid-column: 1 / -1;
  padding-bottom: 22px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.login-visual {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  border: 1px solid #242424;
  border-radius: 26px;
  background: #0b0b0b;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .2);
  transition: border-color 600ms ease, box-shadow 600ms ease;
}

.login-visual:hover {
  border-color: #343434;
  box-shadow: 0 26px 90px rgba(0, 0, 0, .26), 0 0 44px rgba(255, 255, 255, .015);
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to bottom, transparent 48%, rgba(0, 0, 0, .2) 68%, rgba(0, 0, 0, .74) 100%);
  pointer-events: none;
}

#ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.visual-copy {
  position: absolute;
  z-index: 1;
  right: 38px;
  bottom: 36px;
  left: 38px;
  pointer-events: none;
}

.visual-copy h1 {
  margin: 0;
  color: #e8e8e8;
  font-size: clamp(44px, 5vw, 70px);
  font-weight: 390;
  letter-spacing: -.055em;
  line-height: 1.15;
  text-shadow: 0 4px 28px rgba(0, 0, 0, .5);
  animation: copy-in 900ms var(--ease) both;
}

@keyframes copy-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-card-wrap {
  width: 100%;
  align-self: center;
  justify-self: end;
}

.login-card {
  width: 100%;
  animation: form-in 800ms 80ms var(--ease) both;
}

@keyframes form-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-form {
  margin: 0;
}

.login-footnote {
  margin: 17px 2px 0;
  color: #626262;
  font-size: 10px;
  line-height: 1.6;
}

/* ---------- 表单 ---------- */
.field-group {
  position: relative;
}

.field-group + .field-group {
  margin-top: 21px;
}

.field-group label {
  display: block;
  margin: 0 0 9px 3px;
  color: #888;
  font-size: 11px;
  font-weight: 450;
}

.field-group input,
.field-group textarea {
  width: 100%;
  padding: 0 14px;
  border: 1px solid #292929;
  border-radius: 12px;
  outline: 0;
  background: #0d0d0d;
  caret-color: #fff;
  font-size: 13px;
  transition: border-color 320ms ease, background 320ms ease, box-shadow 320ms ease;
}

.field-group input {
  height: 50px;
}

.field-group textarea {
  padding: 12px 14px;
  line-height: 1.75;
  resize: vertical;
}

.field-group input:hover,
.field-group textarea:hover {
  border-color: #383838;
  background: #101010;
}

.field-group input:focus,
.field-group textarea:focus {
  border-color: #686868;
  background: #111;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .025), 0 10px 30px rgba(255, 255, 255, .018);
}

.field-group input::placeholder,
.field-group textarea::placeholder {
  color: #505050;
}

#machine-code-input {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
}

.field-count {
  position: absolute;
  right: 3px;
  bottom: -17px;
  color: #4c4c4c;
  font-family: var(--mono);
  font-size: 8px;
}

.field-hint {
  margin: 10px 3px 0;
  color: #5f5f5f;
  font-size: 10px;
  line-height: 1.7;
}

.form-error {
  min-height: 18px;
  margin: 10px 2px 0;
  color: #bdbdbd;
  font-size: 11px;
  line-height: 1.6;
}

/* ---------- 按钮 ---------- */
.primary-button {
  width: 100%;
  height: 50px;
  margin-top: 12px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #e6e6e6;
  color: #0a0a0a;
  font-size: 12px;
  font-weight: 600;
  transition: transform 260ms var(--ease), background 260ms ease, box-shadow 260ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #f2f2f2;
  box-shadow: 0 10px 30px rgba(255, 255, 255, .075);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0) scale(.995);
  box-shadow: 0 4px 14px rgba(255, 255, 255, .04);
}

.primary-button.compact {
  width: auto;
  height: 38px;
  margin: 0;
  padding: 0 16px;
  gap: 18px;
  border-radius: 10px;
  font-size: 11px;
}

.button-arrow {
  font-size: 18px;
  transition: transform 260ms var(--ease);
}

.primary-button:hover:not(:disabled) .button-arrow {
  transform: translateX(3px);
}

.ghost-button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  transition: color 200ms ease, background 200ms ease, border-color 200ms ease;
}

.ghost-button:hover:not(:disabled) {
  border-color: var(--line);
  background: rgba(255, 255, 255, .035);
  color: var(--text);
}

.back-button {
  margin-bottom: 20px;
  padding: 6px 2px;
  background: none;
  color: var(--faint);
  font-size: 11px;
  transition: color 220ms ease, transform 220ms var(--ease);
}

.back-button:hover {
  color: var(--text);
  transform: translateX(-2px);
}

/* ---------- 论坛布局 ---------- */
.forum-layout {
  width: calc(100% - 40px);
  max-width: 1640px;
  height: calc(100vh - 40px);
  height: calc(100dvh - 40px);
  min-height: 560px;
  margin: 20px auto;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0a0a0a;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .22);
}

.forum-topbar {
  grid-column: 1 / -1;
  padding: 0 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.forum-topbar .brand-image {
  width: 27px;
  height: 27px;
}

.topbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  max-width: 190px;
  height: 30px;
  padding: 0 12px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: #c5c5c5;
  font-size: 10px;
}

.user-badge > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #1d1d1d;
  color: #cfcfcf;
  font-family: var(--mono);
  font-size: 8px;
}

.sidebar {
  min-height: 0;
  padding: 24px 16px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .012);
}

.sidebar-heading {
  padding: 0 8px 20px;
}

.section-label {
  margin: 0;
  color: #717171;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .13em;
}

.sidebar-heading h2 {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.02em;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.side-item {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #9a9a9a;
  font-size: 11px;
  text-align: left;
  transition: color 220ms ease, background 220ms ease, border-color 220ms ease, transform 220ms var(--ease);
}

.side-item:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  transform: translateX(2px);
}

.side-item.is-active {
  border-color: #2f2f2f;
  background: rgba(255, 255, 255, .055);
  color: #eee;
}

.side-count {
  color: #6b6b6b;
  font-family: var(--mono);
  font-size: 9px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid var(--line);
}

.sidebar-foot p {
  margin: 0;
  color: #4e4e4e;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .08em;
}

.forum-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  background: #0a0a0a;
}

.content-heading {
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.content-heading h2 {
  margin: 7px 0 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.02em;
}

.view-meta {
  color: #686868;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .04em;
}

.content-body {
  min-height: 0;
  overflow: hidden;
}

.view-panel {
  height: 100%;
  padding: 24px 28px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ---------- 主题列表 ---------- */
.list-toolbar {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.search-form {
  min-width: 0;
  max-width: 430px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-form input {
  width: 100%;
  height: 38px;
  padding: 0 13px;
  border: 1px solid #292929;
  border-radius: 10px;
  outline: 0;
  background: #0d0d0d;
  font-size: 12px;
  transition: border-color 280ms ease, background 280ms ease, box-shadow 280ms ease;
}

.search-form input:hover {
  border-color: #383838;
  background: #101010;
}

.search-form input:focus {
  border-color: #686868;
  background: #111;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .025);
}

.search-form input::placeholder {
  color: #505050;
}

.search-button {
  height: 38px;
  padding: 0 14px;
  flex: 0 0 auto;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #d0d0d0;
  font-size: 10px;
  letter-spacing: .04em;
  transition: border-color 220ms ease, background 220ms ease, transform 220ms var(--ease);
}

.search-button:hover:not(:disabled) {
  border-color: #6a6a6a;
  background: rgba(255, 255, 255, .075);
  transform: translateY(-1px);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-item {
  width: 100%;
  padding: 17px 19px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .018);
  color: inherit;
  text-align: left;
  transition: transform 260ms var(--ease), border-color 260ms ease, background 260ms ease, box-shadow 260ms ease;
  animation: item-in 420ms var(--ease) both;
}

@keyframes item-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-item:hover {
  transform: translateY(-2px);
  border-color: #383838;
  background: rgba(255, 255, 255, .035);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

.post-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.post-item-title {
  min-width: 0;
  color: #ececec;
  font-size: 14px;
  font-weight: 480;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.post-item-title .own-mark {
  margin-left: 8px;
  color: #6f6f6f;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .08em;
}

.post-item-time {
  flex: 0 0 auto;
  color: #5d5d5d;
  font-family: var(--mono);
  font-size: 8px;
}

.post-item-excerpt {
  margin: 9px 0 0;
  display: -webkit-box;
  overflow: hidden;
  color: #8b8b8b;
  font-size: 11.5px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-item-meta {
  margin-top: 13px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #666;
  font-family: var(--mono);
  font-size: 8.5px;
}

.status-badge {
  padding: 3px 8px;
  border: 1px solid #333;
  border-radius: 999px;
  color: #969696;
  letter-spacing: .04em;
}

.status-badge.is-pending {
  border-color: #4a4a4a;
  color: #bdbdbd;
}

.status-badge.is-approved {
  border-color: #d0d0d0;
  color: #eaeaea;
}

.status-badge.is-rejected {
  border-color: #2f2f2f;
  color: #616161;
  text-decoration: line-through;
}

.empty-state {
  padding: 70px 20px;
  text-align: center;
  color: #686868;
}

.empty-state.small {
  padding: 26px 10px 6px;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: #a6a6a6;
  font-size: 14px;
  font-weight: 450;
}

.empty-state p {
  margin: 0;
  font-size: 11px;
}

.list-error {
  margin-top: 14px;
}

.pager {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: #6c6c6c;
  font-family: var(--mono);
  font-size: 9px;
}

.pager button {
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: #9a9a9a;
  font-size: 10px;
  transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.pager button:hover:not(:disabled) {
  border-color: #4a4a4a;
  background: rgba(255, 255, 255, .035);
  color: #eee;
}

.pager button:disabled {
  opacity: .35;
  cursor: default;
}

/* ---------- 新帖 ---------- */
.compose-panel,
.detail-panel {
  max-width: 880px;
  margin: 0 auto;
}

.panel-title {
  margin: 0 0 28px;
  font-size: 20px;
  font-weight: 440;
  letter-spacing: -.03em;
}

.stack-form .field-group + .field-group {
  margin-top: 32px;
}

.file-group input[type="file"] {
  height: auto;
  padding: 12px;
  border-style: dashed;
  color: #8d8d8d;
  font-size: 11px;
}

.file-group input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 13px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #151515;
  color: #ddd;
  font: inherit;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
}

.file-group input[type="file"]::file-selector-button:hover {
  border-color: #666;
  background: #1d1d1d;
}

.upload-progress {
  margin-top: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-bar {
  flex: 1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #1e1e1e;
}

.upload-bar > div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #d8d8d8;
  transition: width 180ms ease;
}

#upload-percent {
  color: #8a8a8a;
  font-family: var(--mono);
  font-size: 9px;
}

/* ---------- 主题详情 ---------- */
.post-card {
  padding: 24px 25px 21px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, .02);
  animation: item-in 420ms var(--ease) both;
}

.post-title {
  margin: 0;
  color: #f0f0f0;
  font-size: 19px;
  font-weight: 460;
  line-height: 1.5;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.post-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  color: #6c6c6c;
  font-family: var(--mono);
  font-size: 9px;
}

.post-content {
  margin: 20px 0 0;
  color: #c8c8c8;
  font-size: 13px;
  line-height: 1.95;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.attachment-box {
  margin-top: 22px;
  padding: 14px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #2c2c2c;
  border-radius: 13px;
  background: rgba(255, 255, 255, .022);
}

.attachment-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.attachment-name {
  color: #d2d2d2;
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.attachment-note {
  color: #6a6a6a;
  font-family: var(--mono);
  font-size: 8.5px;
}

.download-link {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid #d6d6d6;
  border-radius: 9px;
  background: #dedede;
  color: #0b0b0b;
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 220ms var(--ease), background 220ms ease;
}

.download-link:hover {
  transform: translateY(-1px);
  background: #f0f0f0;
}

.replies-section {
  margin-top: 34px;
}

.replies-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px 12px;
  border-bottom: 1px solid var(--line);
}

.replies-heading h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
}

.reply-list {
  display: flex;
  flex-direction: column;
}

.reply-item {
  padding: 16px 3px;
  border-bottom: 1px solid #1b1b1b;
  animation: item-in 380ms var(--ease) both;
}

.reply-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #646464;
  font-family: var(--mono);
  font-size: 8.5px;
}

.reply-author {
  color: #a5a5a5;
  font-family: var(--sans);
  font-size: 10.5px;
}

.reply-text {
  margin: 8px 0 0;
  color: #c4c4c4;
  font-size: 12.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reply-form {
  margin-top: 22px;
  padding: 14px;
  border: 1px solid #2d2d2d;
  border-radius: 14px;
  background: #0e0e0e;
  transition: border-color 300ms ease, box-shadow 300ms ease;
}

.reply-form:focus-within {
  border-color: #686868;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .02);
}

.reply-form textarea {
  width: 100%;
  padding: 3px;
  border: 0;
  outline: 0;
  background: transparent;
  caret-color: #fff;
  font-size: 12.5px;
  line-height: 1.75;
  resize: vertical;
}

.reply-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.reply-actions .form-error {
  margin: 0;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 16px;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  background: rgba(20, 20, 20, .96);
  color: #e4e4e4;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .45);
  font-size: 11.5px;
  line-height: 1.6;
  animation: toast-in 320ms var(--ease) both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .login-layout {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 350px);
    column-gap: 42px;
    padding: 30px 32px 32px;
  }

  .login-visual {
    min-height: 500px;
  }

  .visual-copy {
    right: 28px;
    bottom: 29px;
    left: 28px;
  }

  .forum-layout {
    width: calc(100% - 24px);
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    margin: 12px auto;
    grid-template-columns: 200px minmax(0, 1fr);
    border-radius: 16px;
  }

  .brand-caption,
  .brand-divider {
    display: none;
  }

  .view-panel {
    padding: 20px 20px 24px;
  }
}

@media (max-width: 740px) {
  .login-layout {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 23px 18px 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 0;
  }

  .login-masthead {
    padding-bottom: 19px;
  }

  .login-visual {
    min-height: 0;
    height: 230px;
    border-radius: 20px;
  }

  .visual-copy {
    right: 24px;
    bottom: 23px;
    left: 24px;
  }

  .visual-copy h1 {
    font-size: 42px;
  }

  .login-card-wrap {
    max-width: none;
    padding-top: 29px;
  }

  .forum-layout {
    width: calc(100% - 16px);
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    min-height: 480px;
    margin: 8px auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 58px auto minmax(0, 1fr);
    border-radius: 15px;
  }

  .forum-topbar {
    padding: 0 13px;
  }

  .forum-topbar .brand-image {
    width: 25px;
    height: 25px;
  }

  .forum-topbar .brand-word {
    font-size: 16px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .user-badge {
    max-width: 104px;
    padding: 0 7px;
    background: transparent;
  }

  .user-avatar {
    display: none;
  }

  .ghost-button {
    padding: 0 6px;
  }

  .sidebar {
    padding: 9px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-heading,
  .sidebar-foot {
    display: none;
  }

  .side-nav {
    flex-direction: row;
    gap: 7px;
  }

  .side-item {
    min-height: 34px;
    padding: 0 11px;
    border-color: var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .02);
    font-size: 10px;
  }

  .side-item.is-active {
    border-color: #4a4a4a;
  }

  .side-count {
    display: none;
  }

  .forum-content {
    grid-template-rows: 52px minmax(0, 1fr);
  }

  .content-heading {
    padding: 0 16px;
  }

  .content-heading h2 {
    margin: 4px 0 0;
    font-size: 12px;
  }

  .view-panel {
    padding: 16px 14px 22px;
  }

  .list-toolbar {
    margin-bottom: 13px;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 9px;
  }

  .search-form {
    max-width: none;
  }

  .list-toolbar .primary-button.compact {
    align-self: flex-end;
  }

  .post-item {
    padding: 14px 15px;
    border-radius: 13px;
  }

  .post-item-top {
    flex-direction: column;
    gap: 6px;
  }

  .post-item-time {
    order: 2;
  }

  .post-card {
    padding: 19px 17px 17px;
    border-radius: 14px;
  }

  .post-title {
    font-size: 16px;
  }

  .attachment-box {
    flex-direction: column;
    align-items: stretch;
  }

  .download-link {
    text-align: center;
  }

  .reply-form {
    border-radius: 12px;
  }

  .reply-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .reply-actions .primary-button.compact {
    width: 100%;
  }

  .toast {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 390px) {
  .login-layout {
    padding-right: 15px;
    padding-left: 15px;
  }

  .login-visual {
    height: 215px;
  }

  .user-badge {
    max-width: 92px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-line::after {
    width: 100%;
    animation: none;
    opacity: .35;
  }

  .post-item,
  .post-card,
  .reply-item,
  .toast {
    animation: none;
  }
}
