:root {
  color-scheme: light;
  --ink: #021323;
  --ink-soft: #0b2033;
  --text: #1c1c25;
  --muted: #8b8d96;
  --line: #dedfe3;
  --surface: #ffffff;
  --surface-soft: #f8f8fa;
  --indigo: #3e3d98;
  --lavender: #a8aaf1;
  --cyan: #65dce1;
  --coral: #ff8d82;
  --blue: #0e9bd2;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
  --shell: 1200px;
}

* { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; stroke-width: 2; }

.shell { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }

.site-header { color: #fff; background: var(--ink); }
.brand-bar { height: 96px; display: flex; align-items: center; }
.brand img { width: 150px; height: auto; }

.main-nav { height: 44px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.nav-inner { height: 100%; display: flex; align-items: stretch; gap: 6px; }
.nav-links { display: flex; align-items: stretch; gap: 3px; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 92px;
  padding: 0 17px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 600;
}
.nav-link:hover, .nav-link.is-active { background: rgba(255, 255, 255, 0.07); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--coral);
}
.nav-link svg { font-size: 19px; }

.auth-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.auth-link, .icon-button {
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.auth-links a.auth-link { text-decoration: none; }
.auth-link {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 0 10px;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
}
.auth-link:hover { background: rgba(255, 255, 255, 0.1); }
.mobile-menu-button { display: none; align-items: center; justify-content: center; width: 42px; }

.hotbar { height: 34px; background: #031726; }
.hotbar .shell { height: 100%; display: flex; align-items: center; }
.hotbar a { display: flex; align-items: center; gap: 7px; color: #95a2af; font-size: 13px; font-weight: 700; }

.page-shell { min-height: calc(100vh - 288px); padding-block: 10px 34px; }
.notice {
  min-height: 70px;
  margin: 0 0 10px;
  padding: 15px 48px 15px 20px;
  border: 1px solid #e2e3e6;
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.notice::before { content: ""; align-self: stretch; width: 5px; margin-left: -20px; background: var(--blue); border-radius: 0 4px 4px 0; }
.notice-mark { color: var(--blue); flex: 0 0 auto; }
.notice p { margin: 0; font-weight: 600; }
.notice code { padding: 3px 8px; color: #dd3a77; background: #f7f3f5; border-radius: 4px; }
.notice a { color: #078abc; text-decoration: underline; }
.notice-close { position: absolute; top: 10px; right: 10px; color: #b6b7bb; padding: 5px; }

.hero {
  position: relative;
  min-height: 102px;
  margin-bottom: 20px;
  padding: 22px 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--indigo) url("./assets/bodyheader.jpg") center/cover no-repeat;
  overflow: hidden;
}
.hero.home-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.hero h1 { margin: 0; font-size: 32px; line-height: 1.2; font-weight: 400; }
.hero-button, .primary-button {
  border: 2px solid #1e1e29;
  border-radius: 8px;
  color: #111827;
  background: var(--lavender);
  box-shadow: 0 2px 0 #111827;
  cursor: pointer;
  font-weight: 800;
}
.hero-button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; }
.hero-button:hover, .primary-button:hover { filter: brightness(0.97); transform: translateY(-1px); }

.breadcrumbs {
  width: 100%;
  min-height: 39px;
  margin-bottom: 22px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  color: #22252e;
  background: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  font-weight: 600;
}
.breadcrumbs span + span::before { content: "›"; margin-right: 8px; color: #777b86; }
.detail-hero { min-height: 140px; padding: 15px 14px 20px; }
.detail-hero h1 { max-width: 1000px; margin: 0 auto; text-align: left; font-size: 31px; }
.detail-hero .hero-meta { margin: 12px 0 0; text-align: center; color: rgba(255,255,255,.82); font-size: 13px; }
.thread-hero h1 { text-align: center; }

.category {
  margin-bottom: 20px;
  padding: 16px 10px 18px;
  border-radius: 12px;
  background: var(--surface-soft);
}
.category-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; padding: 0 2px 0 10px; }
.category-header h2 { margin: 0; font-size: 23px; line-height: 1.2; }
.collapse-button { width: 26px; height: 26px; border: 0; border-radius: 50%; color: #e77772; background: #ffd3d0; cursor: pointer; display: grid; place-items: center; }
.collapse-button svg { transition: transform .2s ease; }
.category.is-collapsed .collapse-button svg { transform: rotate(180deg); }
.category.is-collapsed .forum-grid { display: none; }

.forum-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.forum-card {
  min-height: 100px;
  padding: 14px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid #d9dade;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  transition: border-color .15s ease, transform .15s ease;
}
.forum-card:hover { border-color: #b8b9c0; transform: translateY(-1px); }
.forum-card > span:last-child { display: block; min-width: 0; }
.forum-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 2px solid #20202a;
  border-radius: 12px;
  color: #171723;
  background: var(--icon-color, var(--lavender));
}
.forum-icon svg { width: 30px; height: 30px; }
.forum-title-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.forum-title { overflow: hidden; margin: 0; font-size: 19px; line-height: 1.3; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.new-badge { flex: 0 0 auto; padding: 2px 5px; border-radius: 5px; color: #fff; background: #a5a8ee; font-size: 11px; font-weight: 800; }
.forum-latest { display: block; overflow: hidden; margin: 3px 0 8px; color: #9a9ba3; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.forum-stats { display: flex; align-items: center; gap: 16px; color: #454751; font-size: 13px; }
.forum-stats span { display: inline-flex; align-items: center; gap: 5px; }

.pager { display: flex; gap: 3px; margin: 0 0 16px; }
.pager button { min-width: 36px; height: 38px; padding: 0 11px; border: 0; color: #fff; background: var(--coral); cursor: pointer; font-weight: 700; }
.pager button:first-child { border-radius: 5px 0 0 5px; }
.pager button:last-child { border-radius: 0 5px 5px 0; }
.pager .is-current { background: var(--lavender); }

.thread-list-wrap { padding: 12px; border-radius: 12px; background: var(--surface-soft); }
.filter-bar {
  min-height: 45px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 2px solid #20202a;
  border-radius: 12px;
  background: var(--coral);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.filter-bar button { display: flex; align-items: center; gap: 5px; border: 0; background: transparent; cursor: pointer; font-weight: 700; }
.filter-input { width: min(340px, 100%); height: 32px; padding: 0 11px; border: 1px solid rgba(0,0,0,.25); border-radius: 6px; background: rgba(255,255,255,.9); outline: none; }
.filter-input:focus { border-color: var(--indigo); box-shadow: 0 0 0 2px rgba(62,61,152,.15); }

.thread-list { display: grid; gap: 7px; }
.thread-row {
  min-height: 60px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px 130px;
  align-items: center;
  gap: 12px;
  border: 1px solid #dedfe3;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.thread-avatar, .avatar {
  display: grid;
  place-items: center;
  border: 1.5px solid #2a2630;
  color: #5e3369;
  background: linear-gradient(135deg, #d6a7d3, #b57bc5);
  font-weight: 600;
}
.thread-avatar { width: 36px; height: 36px; border-radius: 10px; }
.thread-main { min-width: 0; }
.thread-title { overflow: hidden; margin: 0; font-size: 15px; line-height: 1.35; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.thread-title a:hover { color: var(--indigo); }
.thread-meta { overflow: hidden; margin: 2px 0 0; color: #9a9ba3; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.prefix { margin-right: 5px; padding: 2px 5px; border-radius: 4px; color: #fff; background: #8b8e93; font-size: 10px; font-weight: 700; vertical-align: 1px; }
.prefix.pc { color: #f16f68; background: #ffe0de; }
.pin { color: #a2a4aa; }
.thread-latest { text-align: right; }
.thread-latest strong { display: block; font-size: 13px; font-weight: 500; }
.thread-latest span { color: #9a9ba3; font-size: 11px; }
.empty-state { padding: 44px 20px; text-align: center; color: #7e8088; }

.author-panel {
  min-height: 123px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #e0e1e4;
  border-radius: 10px 10px 0 0;
  background: #f8f9fb;
}
.avatar { width: 92px; height: 92px; border-radius: 50%; color: #fff; background: #168b32; font-size: 52px; }
.author-copy h2 { margin: 0; font-size: 17px; }
.author-copy p { margin: 1px 0; color: #6f7179; font-size: 12px; }
.role-badge { display: inline-block; margin-top: 3px; padding: 3px 11px; border-radius: 10px; color: #fff; background: var(--coral); font-size: 11px; }
.author-stats { margin-left: auto; width: 125px; color: #73757e; font-size: 12px; }
.author-stats div { display: flex; justify-content: space-between; padding: 4px 8px; background: #eef0f2; }
.post-card { border: 1px solid #e0e1e4; border-top: 0; border-radius: 0 0 10px 10px; background: #fff; }
.post-toolbar { min-height: 37px; padding: 8px 12px; display: flex; justify-content: space-between; color: #9b9da4; font-size: 12px; border-bottom: 1px solid #ececef; }
.post-body { padding: 10px 10px 30px; font-size: 15px; line-height: 1.75; }
.post-body > * { max-width: 100%; }
.post-cover { width: 456px; margin: 0 0 20px; }
.post-lead { font-weight: 700; }
.post-body h3 { margin: 22px 0 8px; font-size: 17px; }
.post-body p { margin: 0 0 14px; }
.requirements { padding: 14px 16px; border-left: 4px solid var(--lavender); background: #f7f7fb; }
.download-box { margin-top: 24px; padding: 16px; border: 1px solid #dddde4; border-radius: 8px; background: #fafafa; }
.download-box button { margin-top: 8px; padding: 8px 12px; border: 0; border-radius: 5px; color: #fff; background: var(--indigo); cursor: pointer; }
.reply-gate { margin-top: 12px; padding: 16px; border: 1px solid #dedfe3; border-radius: 8px; background: #fff; text-align: center; color: #64666f; }
.reply-gate button { border: 0; color: #137fa8; background: transparent; cursor: pointer; text-decoration: underline; }
.inline-admin-link { margin-inline: 4px; color: #137fa8; text-decoration: underline; }

.loading-panel, .load-error {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #686a72;
}
.loading-panel svg { animation: loader-spin .9s linear infinite; }
.load-error { flex-direction: column; text-align: center; }
.load-error svg { width: 34px; height: 34px; color: #d65f58; }
.load-error h1 { margin: 6px 0 0; color: var(--text); font-size: 22px; }
.load-error p { margin: 0; }
.load-error button { padding: 8px 13px; border: 0; border-radius: 5px; color: #fff; background: var(--indigo); cursor: pointer; }
@keyframes loader-spin { to { transform: rotate(360deg); } }

.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.resource-card { padding: 18px; border: 1px solid #dcdde1; border-radius: 8px; background: #fff; }
.resource-card .resource-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; color: var(--indigo); background: #e7e7fb; }
.resource-card h2 { margin: 14px 0 5px; font-size: 17px; }
.resource-card p { margin: 0; color: #85878f; font-size: 13px; }

.site-footer { position: relative; min-height: 126px; color: rgba(255,255,255,.6); background: var(--text) url("./assets/footer-city.png") center bottom/auto 100% no-repeat; }
.footer-inner { min-height: 126px; padding: 26px 0; }
.footer-inner nav { display: flex; justify-content: flex-end; gap: 24px; font-size: 13px; font-weight: 700; }
.footer-inner a:hover { color: #fff; }
.footer-inner p { margin: 30px 0 0; font-size: 12px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 19, 35, .72);
}
.modal-backdrop[hidden] { display: none; }
.auth-modal { position: relative; width: min(100%, 410px); padding: 28px; border-radius: 8px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.32); }
.modal-close { position: absolute; top: 10px; right: 10px; padding: 7px; color: #73757e; }
.modal-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: var(--indigo); background: #eeeefd; }
.modal-icon svg { width: 24px; height: 24px; }
.auth-modal h2 { margin: 12px 0 4px; font-size: 24px; }
.demo-note { margin: 0 0 18px; color: #7d7f87; font-size: 12px; }
.auth-modal label:not(.check-row) { display: grid; gap: 6px; margin: 0 0 14px; font-weight: 600; }
.auth-modal input:not([type=checkbox]) { width: 100%; height: 42px; padding: 0 11px; border: 1px solid #cfd0d5; border-radius: 6px; outline: none; }
.auth-modal input:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(62,61,152,.12); }
.check-row { display: flex; align-items: center; gap: 6px; color: #686a72; font-size: 13px; }
.modal-submit { width: 100%; margin-top: 16px; padding: 10px 14px; }
.modal-result { min-height: 20px; margin: 12px 0 0; color: #248441; font-size: 13px; text-align: center; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 30; padding: 11px 15px; border-radius: 6px; color: #fff; background: #262731; box-shadow: 0 8px 24px rgba(0,0,0,.22); animation: toast-in .18s ease-out; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 900px) {
  .shell { width: calc(100% - 20px); }
  .forum-grid { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: 1fr 1fr; }
  .detail-hero h1 { font-size: 27px; }
}

@media (max-width: 680px) {
  .brand-bar { height: 82px; }
  .brand img { width: 132px; }
  .main-nav { height: 44px; }
  .nav-inner { position: relative; }
  .mobile-menu-button { display: flex; }
  .nav-links {
    position: absolute;
    top: 44px;
    left: 0;
    z-index: 12;
    width: min(260px, calc(100vw - 20px));
    padding: 8px;
    display: none;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 0 0 8px 8px;
    background: var(--ink-soft);
    box-shadow: 0 16px 30px rgba(0,0,0,.25);
  }
  .nav-links.is-open { display: grid; }
  .nav-link { min-height: 42px; }
  .nav-link.is-active::after { top: 6px; right: auto; bottom: 6px; left: 0; width: 3px; height: auto; }
  .auth-link { width: 34px; justify-content: center; padding: 0; }
  .auth-link span { display: none; }
  .page-shell { padding-top: 8px; }
  .notice { min-height: 66px; padding: 12px 38px 12px 14px; font-size: 12px; }
  .notice::before { margin-left: -14px; }
  .notice-mark { display: none; }
  .notice code { display: inline-block; }
  .hero { min-height: 96px; margin-bottom: 16px; padding: 16px 13px; }
  .hero.home-hero { align-items: flex-end; }
  .hero h1 { font-size: 23px; }
  .hero-button { padding: 7px 9px; font-size: 12px; }
  .detail-hero { min-height: 132px; }
  .detail-hero h1 { font-size: 22px; }
  .breadcrumbs { margin-bottom: 16px; overflow: hidden; white-space: nowrap; }
  .category { padding: 14px 9px; }
  .category-header { padding-left: 5px; }
  .category-header h2 { font-size: 20px; }
  .forum-card { min-height: 94px; grid-template-columns: 56px minmax(0, 1fr); gap: 11px; padding: 12px; }
  .forum-icon { width: 56px; height: 56px; }
  .forum-title { font-size: 17px; }
  .thread-list-wrap { padding: 8px; }
  .filter-bar { padding: 6px 9px; flex-wrap: wrap; }
  .filter-input { order: 2; width: 100%; }
  .thread-row { grid-template-columns: 36px minmax(0,1fr); gap: 9px; }
  .pin, .thread-latest { display: none; }
  .author-panel { align-items: flex-start; flex-wrap: wrap; }
  .avatar { width: 68px; height: 68px; font-size: 38px; }
  .author-stats { width: 100%; margin: 0; display: grid; grid-template-columns: repeat(3,1fr); }
  .post-cover { width: 100%; }
  .resource-grid { grid-template-columns: 1fr; }
  .footer-inner nav { flex-wrap: wrap; justify-content: flex-start; gap: 12px 18px; }
  .footer-inner p { margin-top: 22px; }
}

@media (max-width: 420px) {
  .hero.home-hero { display: block; }
  .hero-button { margin-top: 12px; }
  .forum-stats { gap: 10px; font-size: 12px; }
  .detail-hero h1 { font-size: 19px; }
}

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