:root,
html[data-theme="dark"] {
  --bg: #0c0d0f;
  --bg-elevated: #141518;
  --surface: #1a1b1f;
  --surface-2: #222328;
  --surface-hover: #2a2b31;
  --bar: #0a0a0c;
  --heading: #f2f3f5;
  --text: #c8cbd0;
  --muted: #8b8f98;
  --faint: #6a6e76;
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.1);
  --blue: #3d7eff;
  --blue-bright: #5a9fff;
  --blue-dim: rgba(61, 126, 255, 0.15);
  --link: #7eb0ff;
  --input: #121316;
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Outfit", system-ui, sans-serif;
  --prefix-discussion: #4a8fd4;
  --prefix-question: #c9a227;
  --prefix-guide: #3daa6d;
  --prefix-news: #c45c8a;
  --prefix-deal: #d4783a;
  --side-w: 200px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #eef0f3;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --surface-hover: #e9ebef;
  --bar: #ffffff;
  --heading: #12141a;
  --text: #2c3038;
  --muted: #5c6370;
  --faint: #7a8290;
  --line: rgba(18, 20, 28, 0.08);
  --line-strong: rgba(18, 20, 28, 0.14);
  --blue: #2f6db8;
  --blue-bright: #1f5aa0;
  --blue-dim: rgba(47, 109, 184, 0.1);
  --link: #1f5aa0;
  --input: #ffffff;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body.forum-site {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.theme-when-light {
  display: none;
}

html[data-theme="light"] .theme-when-dark {
  display: none;
}

html[data-theme="light"] .theme-when-light {
  display: block;
}

/* —— Header (XDA-like) —— */
.xf-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bar);
  border-bottom: 1px solid var(--line-strong);
}

.xf-header-row {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.xf-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--heading);
  text-decoration: none !important;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.xf-logo-mark {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  background: linear-gradient(135deg, #ff4d4d 0%, #3d7eff 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 4px;
  line-height: 1;
}

.xf-nav {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 0.15rem;
}

.xf-nav button {
  height: 100%;
  padding: 0 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}

.xf-nav button:hover {
  color: var(--heading);
}

.xf-nav button.is-active {
  color: var(--heading);
  border-bottom-color: #fff;
}

html[data-theme="light"] .xf-nav button.is-active {
  border-bottom-color: var(--blue);
}

.xf-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.xf-search {
  display: flex;
  align-items: stretch;
  width: 11rem;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--input);
  overflow: hidden;
}

.xf-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.35rem 0.75rem;
  outline: none;
  color: var(--heading);
  font-size: 0.85rem;
}

.xf-search input::placeholder {
  color: var(--faint);
}

.xf-search button {
  display: grid;
  place-items: center;
  padding: 0 0.65rem;
  color: var(--muted);
}

.xf-search button:hover {
  color: var(--blue-bright);
}

.xf-text-btn {
  padding: 0.35rem 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.xf-text-btn:hover {
  color: var(--heading);
  background: var(--surface-hover);
}

.xf-auth {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.xf-subnav {
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
}

.xf-subnav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  overflow-x: auto;
}

.xf-subnav button {
  padding: 0.35rem 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.xf-subnav button:hover {
  color: var(--heading);
  background: var(--surface-hover);
}

/* —— Shell —— */
.xf-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}

.xf-root {
  min-height: 55vh;
}

.xf-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 1rem;
  color: var(--faint);
  font-size: 0.8rem;
}

.xf-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.xf-footer a {
  color: var(--muted);
}

/* —— Layout: Topics rail + main —— */
.x-layout {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.x-layout-single {
  grid-template-columns: 1fr;
}

.x-main {
  min-width: 0;
}

.x-side {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-bottom: 1rem;
}

.x-side-label {
  padding: 0.35rem 0.5rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.x-side-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.x-side-link:hover {
  background: var(--surface-hover);
  color: var(--heading);
}

.x-side-link.is-active {
  background: var(--surface);
  color: var(--heading);
}

.x-side-link em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.x-side-ico {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: #fff;
}

.x-side-ico svg {
  width: 0.75rem;
  height: 0.75rem;
}

@media (max-width: 900px) {
  .x-layout {
    grid-template-columns: 1fr;
  }

  .x-side {
    position: static;
    max-height: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .x-side-label {
    width: 100%;
  }

  .x-side-link {
    width: auto;
    background: var(--surface);
    border: 1px solid var(--line);
  }

  .x-side-link em {
    display: none;
  }

  .xf-nav {
    display: none;
  }

  .xf-search {
    width: 8rem;
  }
}

/* —— Buttons —— */
.x-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 2rem;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.x-btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
}

.x-btn-primary:hover {
  filter: brightness(1.1);
}

.x-btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
  background: transparent;
}

.x-btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--heading);
}

.x-btn-outline {
  border-color: var(--blue);
  color: var(--blue-bright);
  background: transparent;
}

.x-btn-outline:hover {
  background: var(--blue-dim);
}

.x-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 99px;
  background: var(--blue);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
}

/* —— Home: page title —— */
.x-home-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.x-home-top h1 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.x-home-top .x-link {
  font-size: 0.9rem;
  font-weight: 500;
}

/* —— Section + card grid —— */
.x-section {
  margin-bottom: 1.15rem;
}

.x-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.55rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.x-section-head h2 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--heading);
}

.x-section-head .x-view-all {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.x-section-head .x-view-all:hover {
  color: var(--link);
  text-decoration: none;
}

.x-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

@media (max-width: 720px) {
  .x-card-grid {
    grid-template-columns: 1fr;
  }
}

.x-forum-card {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  color: inherit;
  width: 100%;
  transition: background 0.12s, border-color 0.12s;
  min-height: 4.6rem;
}

.x-forum-card:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.x-forum-card:hover .x-card-title {
  color: var(--link);
}

.x-card-icon {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: #fff;
}

.x-card-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.x-card-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.x-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.25;
}

.x-card-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.x-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.x-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.x-card-meta svg {
  width: 0.85rem;
  height: 0.85rem;
  opacity: 0.7;
}

/* —— Join / stats strip —— */
.x-join {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.x-join-stats {
  display: flex;
  gap: 1.5rem;
}

.x-join-stats div {
  display: flex;
  flex-direction: column;
}

.x-join-stats strong {
  color: var(--heading);
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.x-join-stats span {
  color: var(--muted);
  font-size: 0.75rem;
}

/* —— Widgets under home —— */
.x-home-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (max-width: 720px) {
  .x-home-widgets {
    grid-template-columns: 1fr;
  }
}

.x-widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.x-widget-head {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--heading);
  font-weight: 600;
  font-size: 0.88rem;
}

.x-widget-list {
  padding: 0.15rem 0;
}

.x-widget-list li button {
  display: block;
  width: 100%;
  padding: 0.55rem 0.85rem;
  text-align: left;
  color: inherit;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}

.x-widget-list li:last-child button {
  border-bottom: none;
}

.x-widget-list li button:hover {
  background: var(--surface-hover);
}

.x-widget-list strong {
  display: block;
  color: var(--link);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
}

.x-widget-list span {
  display: block;
  margin-top: 0.12rem;
  color: var(--faint);
  font-size: 0.74rem;
}

.x-widget .x-btn {
  margin: 0.65rem 0.85rem 0.85rem;
}

/* —— Prefix / pins —— */
.x-prefix {
  display: inline-block;
  padding: 0.08rem 0.35rem;
  margin-right: 0.3rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
  line-height: 1.4;
  color: #fff;
}

.x-prefix-discussion {
  background: var(--prefix-discussion);
}

.x-prefix-question {
  background: var(--prefix-question);
  color: #1a1400;
}

.x-prefix-guide {
  background: var(--prefix-guide);
}

.x-prefix-news {
  background: var(--prefix-news);
}

.x-prefix-deal {
  background: var(--prefix-deal);
}

.x-pin,
.x-lock {
  display: inline-block;
  margin-right: 0.25rem;
  padding: 0.06rem 0.3rem;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  font-style: normal;
  vertical-align: middle;
}

.x-pin {
  background: rgba(201, 162, 39, 0.25);
  color: #e0c35a;
}

.x-lock {
  background: rgba(139, 149, 165, 0.2);
  color: var(--muted);
}

/* —— Breadcrumbs —— */
.x-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.x-crumbs button {
  color: var(--link);
  font-weight: 500;
}

.x-crumbs button:hover {
  text-decoration: underline;
}

.x-crumb-sep {
  color: var(--faint);
  user-select: none;
}

/* —— Topic list —— */
.x-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.x-list-head h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.x-list-head p {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.x-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
}

.x-sort button {
  padding: 0.35rem 0.7rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid transparent;
}

.x-sort button:hover {
  color: var(--heading);
  background: var(--surface-hover);
}

.x-sort button.is-active {
  color: var(--heading);
  background: var(--surface);
  border-color: var(--line-strong);
}

.x-thread-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem 5.5rem 9rem;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.x-thread-cols span:nth-child(2),
.x-thread-cols span:nth-child(3) {
  text-align: center;
}

.x-thread-table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.x-thread-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem 5.5rem 9rem;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  padding: 0.7rem 0.85rem;
  text-align: left;
  color: inherit;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}

.x-thread-table li:last-child .x-thread-row {
  border-bottom: none;
}

.x-thread-row:hover {
  background: var(--surface-hover);
}

.x-thread-main {
  min-width: 0;
}

.x-thread-main strong {
  display: inline;
  color: var(--heading);
  font-weight: 600;
  font-size: 0.92rem;
}

.x-thread-row:hover .x-thread-main strong {
  color: var(--link);
}

.x-thread-main small {
  display: block;
  margin-top: 0.15rem;
  color: var(--faint);
  font-size: 0.75rem;
}

.x-thread-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  color: var(--text);
}

.x-thread-last {
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.3;
}

.x-thread-last strong {
  display: block;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.x-thread-last em {
  font-style: normal;
  color: var(--faint);
  font-size: 0.72rem;
}

@media (max-width: 720px) {
  .x-thread-cols {
    display: none;
  }

  .x-thread-row {
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.75rem;
  }

  .x-thread-main {
    grid-column: 1 / -1;
  }

  .x-thread-last {
    grid-column: 1 / -1;
  }
}

.x-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.85rem;
}

.x-pager button {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
}

.x-pager button.is-active,
.x-pager button:hover {
  border-color: var(--blue);
  color: var(--heading);
}

/* —— Posts / thread view —— */
.x-post {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0;
  margin-bottom: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.x-post-side {
  padding: 0.85rem 0.65rem;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  text-align: center;
  font-size: 0.82rem;
}

.x-post-side .x-avatar {
  margin: 0 auto 0.45rem;
}

.x-post-body {
  padding: 0.75rem 1rem 0.9rem;
  min-width: 0;
}

.x-post-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  color: var(--faint);
}

.x-post-content {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
  word-break: break-word;
}

.x-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.x-replies-title {
  margin: 1.1rem 0 0.55rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading);
}

@media (max-width: 640px) {
  .x-post {
    grid-template-columns: 1fr;
  }

  .x-post-side {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-align: left;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 0.65rem 0.85rem;
  }

  .x-post-side .x-avatar {
    margin: 0;
  }
}

.x-avatar {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blue-bright), var(--blue));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

/* —— Forms —— */
.x-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.x-form-narrow {
  max-width: 26rem;
  margin: 0 auto;
}

.x-form h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--heading);
}

.x-lead {
  color: var(--muted);
  font-size: 0.9rem;
}

.x-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.x-form input,
.x-form textarea,
.x-form select {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--input);
  color: var(--heading);
  outline: none;
}

.x-form input:focus,
.x-form textarea:focus,
.x-form select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim);
}

.x-form textarea {
  min-height: 8rem;
  resize: vertical;
}

.x-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.x-link {
  color: var(--link);
  font-weight: 500;
}

.x-link:hover {
  text-decoration: underline;
}

.x-note {
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--blue-dim);
  color: var(--heading);
  font-size: 0.88rem;
  border: 1px solid rgba(61, 126, 255, 0.25);
}

.x-note.is-error {
  background: rgba(200, 60, 60, 0.15);
  border-color: rgba(200, 60, 60, 0.35);
  color: #f0a0a0;
}

.x-loading {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.x-empty,
.x-empty-inline {
  padding: 1.25rem 0.85rem;
  text-align: center;
  color: var(--faint);
  font-size: 0.9rem;
}

.x-profile {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.15rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.x-profile .x-avatar {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.1rem;
}

.x-profile h2 {
  font-size: 1.2rem;
  color: var(--heading);
}

.x-bio {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* —— v6 polish —— */
.xf-icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
}

.xf-icon-btn:hover {
  color: var(--heading);
  background: var(--surface-hover);
}

.xf-icon-btn .x-badge-dot {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 0.95rem;
  height: 0.95rem;
  font-size: 0.6rem;
}

.xf-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
  border-radius: 99px;
  color: var(--heading);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--surface);
}

.xf-user-chip:hover {
  background: var(--surface-hover);
}

.x-btn-sm {
  min-height: 1.9rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.xf-subnav button.is-active {
  color: var(--heading);
  background: var(--surface-hover);
}

.xf-desktop-only {
  display: inline-flex;
}

@media (max-width: 900px) {
  .xf-desktop-only {
    display: none;
  }
}

.xf-footer-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--heading);
}

.xf-footer-brand .xf-logo-mark {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.75rem;
}

.xf-footer-links {
  display: flex;
  gap: 1rem;
}

.xf-footer-copy {
  margin-left: auto;
}

.x-side-foot {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.x-side-foot button {
  text-align: left;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  color: var(--faint);
}

.x-side-foot button:hover {
  color: var(--link);
}

.x-avatar-sm {
  width: 1.65rem;
  height: 1.65rem;
  font-size: 0.6rem;
}

.x-avatar-md {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 0.72rem;
}

.x-fade {
  animation: xFade 0.28s ease both;
}

@keyframes xFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.x-section,
.x-forum-card {
  animation: xFade 0.35s ease both;
  animation-delay: var(--d, 0ms);
}

.x-home-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 980px) {
  .x-home-split {
    grid-template-columns: 1fr;
  }
}

.x-rail {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: sticky;
  top: 100px;
}

.x-explore {
  padding: 1.1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.x-explore h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 0.4rem;
}

.x-explore p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 0.85rem;
}

.x-explore .x-btn {
  width: 100%;
  margin-bottom: 0.9rem;
}

.x-explore-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.x-explore-stats strong {
  display: block;
  color: var(--heading);
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.x-explore-stats span {
  font-size: 0.68rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.x-feed {
  padding: 0.2rem 0;
}

.x-feed-item {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  width: 100%;
  padding: 0.55rem 0.75rem;
  text-align: left;
  color: inherit;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}

.x-feed li:last-child .x-feed-item {
  border-bottom: none;
}

.x-feed-item:hover {
  background: var(--surface-hover);
}

.x-feed-item strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 560;
  color: var(--heading);
  line-height: 1.3;
}

.x-feed-item:hover strong {
  color: var(--link);
}

.x-feed-item em {
  display: block;
  margin-top: 0.12rem;
  font-style: normal;
  font-size: 0.7rem;
  color: var(--faint);
}

.x-hot-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  padding: 0.55rem 0.75rem;
  background: linear-gradient(90deg, rgba(231, 76, 60, 0.12), transparent 70%);
  border: 1px solid rgba(231, 76, 60, 0.2);
  border-radius: var(--radius);
}

.x-hot-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #e74c3c;
  margin-right: 0.25rem;
}

.x-hot-strip button {
  padding: 0.25rem 0.55rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.x-hot-strip button:hover {
  border-color: var(--blue);
  color: var(--heading);
}

.x-card-last {
  display: block;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--line);
  font-size: 0.7rem;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.x-card-last em {
  font-style: normal;
  color: var(--muted);
}

.x-card-meta b {
  color: var(--text);
  font-weight: 600;
}

.x-forum-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

html[data-theme="light"] .x-forum-card:hover {
  box-shadow: 0 4px 14px rgba(18, 20, 28, 0.08);
}

.x-topic-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.x-topic-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  padding: 0.75rem 0.9rem;
  text-align: left;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.x-topic-card:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.x-topic-title {
  display: block;
  line-height: 1.35;
}

.x-topic-title strong {
  color: var(--heading);
  font-weight: 600;
  font-size: 0.95rem;
}

.x-topic-card:hover .x-topic-title strong {
  color: var(--link);
}

.x-topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.74rem;
  color: var(--faint);
}

.x-topic-meta em {
  font-style: normal;
}

.x-topic-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-end;
  min-width: 3.5rem;
}

.x-topic-stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--faint);
}

.x-topic-stats svg {
  width: 0.85rem;
  height: 0.85rem;
}

.x-topic-stats b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .x-topic-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .x-topic-stats {
    grid-column: 2;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
  }
}

.x-skel-line,
.x-skel-block,
.x-skel-card {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: xShimmer 1.2s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes xShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.x-skel-title {
  height: 1.6rem;
  width: 10rem;
  margin-bottom: 1rem;
}

.x-skel-block {
  height: 2rem;
  margin-bottom: 0.55rem;
}

.x-skel-tall {
  height: 12rem;
}

.x-skel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.x-skel-card {
  height: 5rem;
}

.x-post-head h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.35;
}

.x-home-top {
  margin-bottom: 0.85rem;
}

.x-home-top h1 {
  font-size: 1.65rem;
}

.x-banner {
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius);
  border: 1px solid rgba(61, 126, 255, 0.35);
  background: linear-gradient(90deg, rgba(61, 126, 255, 0.16), rgba(61, 126, 255, 0.04));
  color: var(--heading);
  font-size: 0.9rem;
  font-weight: 500;
}
