:root {
  --bg: #0b0f0c;
  --surface: #131a15;
  --surface-hover: #18221a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8f0e4;
  --muted: #8fa38a;
  --accent: #a8e063;
  --accent-soft: rgba(168, 224, 99, 0.14);
  --gold: #f7c844;
  --platform: #ff6b6b;
  --danger: #ff9b8a;
  --radius: 14px;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  --sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -10%, rgba(122, 196, 107, 0.14), transparent 45%),
    radial-gradient(circle at 92% 0%, rgba(247, 224, 94, 0.06), transparent 40%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 12, 0.86);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  width: min(1120px, 100% - 40px);
  margin: 0 auto;
  padding: 14px 0;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
}

.site-brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: 15px;
}

.site-nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
}

.site-nav a.is-active,
.site-nav a:hover {
  color: var(--accent);
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  font-size: 15px;
}

.bell-dot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5c5c;
  box-shadow: 0 0 0 2px var(--bg);
}

.is-hidden {
  display: none !important;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 180px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--muted);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: #0b0f0c;
}

.btn-primary:hover {
  color: #0b0f0c;
  filter: brightness(1.04);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--muted);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: rgba(168, 224, 99, 0.5);
  color: var(--accent);
  outline: none;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.is-active {
  border-color: rgba(168, 224, 99, 0.55);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Layout */
.community-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 30px;
  width: min(1120px, 100% - 40px);
  margin: 28px auto 60px;
  align-items: start;
}

.community-sidebar {
  position: sticky;
  top: 82px;
}

.community-main {
  min-width: 0;
}

.site-footer {
  width: min(1120px, 100% - 40px);
  margin: 0 auto;
  padding: 26px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: rgba(143, 163, 138, 0.7);
}

.site-footer p {
  margin: 4px 0;
}

.site-footer-links a {
  color: var(--muted);
}

/* Sidebar */
.node-nav {
  display: grid;
  gap: 2px;
  padding: 16px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.node-nav-title {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(143, 163, 138, 0.7);
}

.node-nav-title-sub {
  margin-top: 14px;
}

.node-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--muted);
  transition: background 0.16s ease, color 0.16s ease;
}

.node-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.node-link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.node-icon {
  width: 20px;
  text-align: center;
}

.node-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.node-count {
  margin-left: auto;
  font-size: 11px;
  color: rgba(143, 163, 138, 0.7);
}

/* Mobile node scroll */
.node-scroll {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  scrollbar-width: none;
}

.node-scroll::-webkit-scrollbar {
  display: none;
}

.node-scroll-link {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}

.node-scroll-link.is-active {
  border-color: rgba(168, 224, 99, 0.5);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Page head */
.page-head,
.node-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 1px;
}

.page-sub {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.head-actions,
.node-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.node-head-meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: rgba(143, 163, 138, 0.7);
}

/* Sort tabs */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 12px;
}

.sort-tabs {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}

.sort-tab {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}

.sort-tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.toolbar-count {
  font-size: 12px;
  color: rgba(143, 163, 138, 0.7);
}

/* Topic list */
.topic-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}

.topic-item {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.16s ease;
}

.topic-item:last-child {
  border-bottom: 0;
}

.topic-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.topic-avatar .avatar,
.reply-avatar .avatar {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

.topic-body {
  min-width: 0;
  flex: 1;
}

.topic-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pin {
  flex: 0 0 auto;
  font-size: 12px;
}

.topic-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.topic-title:hover {
  color: var(--accent);
}

.topic-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  font-size: 12px;
  color: rgba(143, 163, 138, 0.85);
}

.node-chip {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
}

.node-chip:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.dot {
  color: rgba(143, 163, 138, 0.45);
}

.meta-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  color: rgba(143, 163, 138, 0.8);
}

/* Avatar */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  object-fit: cover;
  flex: 0 0 auto;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
}

.badge-official {
  border: 1px solid rgba(247, 200, 68, 0.55);
  background: rgba(247, 200, 68, 0.12);
  color: var(--gold);
}

.badge-platform {
  border: 1px solid rgba(255, 107, 107, 0.55);
  background: rgba(255, 107, 107, 0.12);
  color: var(--platform);
}

/* Empty & flash */
.empty-state {
  padding: 52px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

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

.flash {
  margin-bottom: 16px;
  padding: 11px 15px;
  border: 1px solid rgba(168, 224, 99, 0.35);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
}

.flash-error {
  border-color: rgba(255, 155, 138, 0.4);
  background: rgba(255, 155, 138, 0.1);
  color: var(--danger);
}

.flash ul {
  margin: 0;
  padding-left: 18px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  color: var(--muted);
}

.page-link:hover {
  border-color: rgba(168, 224, 99, 0.4);
  color: var(--accent);
}

.page-link.is-current {
  border-color: rgba(168, 224, 99, 0.5);
  background: var(--accent-soft);
  color: var(--accent);
}

.page-link.is-disabled {
  opacity: 0.4;
}

/* Topic detail */
.topic-detail {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.topic-detail-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.5px;
}

.topic-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 12px;
  color: rgba(143, 163, 138, 0.85);
}

.topic-detail-meta .author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topic-content {
  margin: 20px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  line-height: 1.85;
  word-break: break-word;
}

.topic-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topic-actions form {
  margin: 0;
}

.link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--accent);
}

/* Replies */
.reply-section {
  margin-top: 26px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.reply-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}

.reply-item {
  display: flex;
  gap: 13px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.reply-item:last-child {
  border-bottom: 0;
}

.reply-item:target {
  background: var(--accent-soft);
}

.reply-body {
  min-width: 0;
  flex: 1;
}

.reply-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: rgba(143, 163, 138, 0.85);
}

.reply-floor {
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
}

.reply-author {
  color: var(--text);
  font-weight: 600;
}

.reply-content {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.8;
  word-break: break-word;
}

.mention {
  color: var(--accent);
  font-weight: 600;
}

.reply-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Reply editor */
.reply-editor {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.reply-editor-guest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reply-editor-guest p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input::placeholder {
  color: rgba(143, 163, 138, 0.55);
}

.input:focus {
  outline: none;
  border-color: rgba(168, 224, 99, 0.6);
  box-shadow: 0 0 0 3px rgba(168, 224, 99, 0.1);
}

.textarea {
  resize: vertical;
  line-height: 1.75;
}

select.input {
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238fa38a' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

select.input option {
  background-color: var(--surface);
  color: var(--text);
}

select.input option:checked {
  background-color: var(--surface-hover);
  color: var(--accent);
}

.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}

.hint {
  margin: 0;
  font-size: 12px;
  color: rgba(143, 163, 138, 0.7);
}

/* Forms */
.form-card {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.field {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.field label,
.field legend {
  font-size: 13px;
  color: var(--muted);
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.radio-chip input {
  accent-color: var(--accent);
}

.radio-chip:has(input:checked) {
  border-color: rgba(168, 224, 99, 0.5);
  background: var(--accent-soft);
  color: var(--accent);
}

.error {
  margin: 0;
  font-size: 12px;
  color: var(--danger);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* My */
.my-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 18px;
  border-bottom: 1px solid var(--border);
}

.my-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  color: var(--muted);
}

.my-tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.tab-dot {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff5c5c;
  color: #fff;
  font-size: 10px;
  line-height: 1;
}

.my-reply-list {
  display: grid;
  gap: 10px;
}

.my-reply {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
}

.my-reply-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.my-reply-topic {
  font-size: 14px;
  font-weight: 600;
}

.my-reply-meta {
  flex: 0 0 auto;
  font-size: 12px;
  color: rgba(143, 163, 138, 0.7);
}

.my-reply-content {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  word-break: break-word;
}

.favorite-nodes,
.favorite-topics {
  margin-bottom: 24px;
}

.node-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.node-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 14px;
  color: var(--muted);
}

.node-card:hover {
  border-color: rgba(168, 224, 99, 0.4);
  color: var(--accent);
}

/* Notifications */
.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.notification-head form {
  margin: 0;
}

.notification-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}

.notification-item {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-dot {
  width: 7px;
  height: 7px;
  margin-top: 8px;
  border-radius: 50%;
  background: transparent;
  flex: 0 0 auto;
}

.notification-item.is-unread .notification-dot {
  background: #ff5c5c;
}

.notification-item.is-unread {
  background: rgba(168, 224, 99, 0.04);
}

.notification-body {
  min-width: 0;
  font-size: 14px;
  color: var(--muted);
}

.notification-link {
  color: var(--text);
}

.notification-time {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: rgba(143, 163, 138, 0.65);
}

/* Responsive */
@media (max-width: 1024px) {
  .community-layout {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 22px;
  }
}

@media (max-width: 768px) {
  .site-header-inner {
    gap: 14px;
    width: calc(100% - 28px);
  }

  .site-nav {
    gap: 12px;
    font-size: 13px;
  }

  .site-brand span:last-child {
    display: none;
  }

  .user-chip span:last-child {
    display: none;
  }

  .user-chip {
    padding: 3px;
  }

  .node-scroll {
    display: flex;
  }

  .community-layout {
    display: block;
    width: calc(100% - 28px);
    margin-top: 18px;
  }

  .community-sidebar {
    display: none;
  }

  .page-head,
  .node-head {
    flex-direction: column;
  }

  .head-actions,
  .node-head-actions {
    width: 100%;
  }

  .page-head .btn-primary,
  .node-head .btn-primary {
    position: fixed;
    right: 16px;
    bottom: 86px;
    z-index: 25;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  }

  .topic-detail {
    padding: 16px;
  }

  .topic-detail-title {
    font-size: 21px;
  }

  .reply-editor {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 28;
    margin: 0;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    background: rgba(19, 26, 21, 0.98);
    backdrop-filter: blur(10px);
  }

  .reply-editor .section-title,
  .reply-editor .hint {
    display: none;
  }

  .reply-editor .editor-foot {
    justify-content: flex-end;
  }

  .reply-editor-guest {
    display: none;
  }

  .community-main {
    padding-bottom: 150px;
  }
}

/* 通关战报 */
.clear-chip {
  flex: 0 0 auto;
  padding: 0 7px;
  border: 1px solid rgba(168, 224, 99, 0.45);
  border-radius: 5px;
  background: rgba(168, 224, 99, 0.12);
  color: var(--accent);
  font-size: 11px;
  line-height: 18px;
  font-weight: 600;
}

.clear-card {
  margin: 0 0 20px;
}

.clear-card-img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(168, 224, 99, 0.22);
  border-radius: 16px;
  background: #0b0f0c;
}
