:root {
  color-scheme: light;
  --page: #f5f7fb;
  --paper: #fff;
  --ink: #17243b;
  --muted: #526179;
  --line: #e3e8f0;
  --blue: #224cca;
  --blue-soft: #edf2ff;
  --radius: 12px;
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid #375ae4; outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; }
.wrap, .topbar-inner { width: min(1280px, calc(100% - 64px)); margin-inline: auto; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; min-height: 70px; align-items: center; gap: 42px; }
.brand { display: inline-flex; gap: 10px; align-items: center; flex-shrink: 0; font-size: 19px; font-weight: 750; letter-spacing: -.025em; }
.brand-mark, .mini-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 9px; color: white; background: #244bcd; font-weight: 800; }
.tabs { display: flex; align-self: stretch; gap: 24px; }
.tabs a { position: relative; display: flex; align-items: center; color: var(--muted); font-weight: 600; font-size: .9rem; }
.tabs a:hover, .tabs .active { color: var(--blue); }
.tabs .active::after { position: absolute; inset: auto 0 -1px; height: 3px; border-radius: 2px 2px 0 0; background: var(--blue); content: ""; }
.top-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.search { display: flex; align-items: center; gap: 10px; height: 40px; min-width: 190px; padding: 0 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; background: #f8faff; font-size: .83rem; }
.search:hover { border-color: #9babd8; }
.glass { position: relative; width: 12px; height: 12px; flex-shrink: 0; border: 1.6px solid currentColor; border-radius: 50%; }
.glass::after { content: ""; position: absolute; width: 6px; height: 1.6px; background: currentColor; top: 9px; left: 8px; transform: rotate(45deg); transform-origin: left center; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; padding: 8px 15px; border: 1px solid transparent; border-radius: 8px; font-weight: 650; font-size: .88rem; white-space: nowrap; }
.button-outline { border-color: var(--line); background: white; }
.button-outline:hover { background: var(--blue-soft); color: var(--blue); }
.button-primary { background: var(--blue); color: white; }
.button-primary:hover { background: #193aa4; }
.button-primary span { font-size: 1.18em; line-height: 1; }

.intro { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 37px 0 29px; }
.intro .button { margin-bottom: 2px; }
.section-label { display: flex; align-items: center; gap: 8px; color: var(--blue); font-size: .72rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.live-dot { display: inline-block; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: #15845c; }
.intro h1 { font-size: clamp(2.15rem, 3.5vw, 3.1rem); line-height: 1.12; letter-spacing: -.05em; margin: 10px 0; }
.intro p { color: var(--muted); max-width: 58ch; }
.forum-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr) 248px; align-items: start; gap: 22px; }

.sections h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 13px 10px 9px; }
.category { display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: 8px; min-height: 42px; font-size: .87rem; font-weight: 600; }
.category:hover, .category.current { color: var(--blue); background: #e7edff; }
.category-count { font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--muted); margin-left: auto; }
.category-dot { width: 8px; height: 8px; display: inline-block; flex-shrink: 0; border-radius: 3px; }
.category-dot.all { background: #4163d2; }
.category-dot.violet { background: #9063d1; }
.category-dot.blue { background: #2585c5; }
.category-dot.green { background: #25896a; }
.category-dot.amber { background: #bd7816; }
.category-dot.pink { background: #cb5889; }
.side-foot { display: grid; gap: 10px; margin: 20px 10px 0; border-top: 1px solid var(--line); padding-top: 18px; font-size: .8rem; color: var(--muted); }
.side-foot a:hover, .footer a:hover { color: var(--blue); text-decoration: underline; }

.topics, .card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.topics-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 19px; }
.topics-header h2, .card h2 { font-size: 1rem; line-height: 1.3; letter-spacing: -.015em; }
.view-options { display: flex; gap: 2px; color: var(--muted); font-size: .75rem; font-weight: 650; }
.view-options a { padding: 6px 8px; border-radius: 6px; }
.view-options a:hover, .view-options .selected { color: var(--blue); background: var(--blue-soft); }
.topic { display: grid; grid-template-columns: 39px minmax(0, 1fr) 44px; align-items: start; gap: 13px; padding: 16px 19px; border-top: 1px solid var(--line); }
.topic:hover { background: #f9fbff; }
.topic.pinned { background: #f7f9ff; }
.avatar { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; font-size: .73rem; font-weight: 750; }
.a0 { background: #e2eaff; color: #2a4cb6; }
.a1 { background: #f0e8ff; color: #5a3187; }
.a2 { background: #e2effd; color: #225d8e; }
.a3 { background: #e4f5ea; color: #276343; }
.a4 { background: #fff0d9; color: #855013; }
.a5 { background: #fce6ed; color: #952e58; }
.tags { display: flex; gap: 7px; align-items: center; min-height: 18px; }
.topic-category, .badge { display: inline-flex; gap: 5px; align-items: center; font-size: .7rem; font-weight: 650; }
.topic-category { color: var(--muted); }
.topic-category .category-dot { width: 6px; height: 6px; border-radius: 2px; }
.badge { border-radius: 4px; padding: 1px 5px; }
.pin { background: #e5ecff; color: #2e4fae; }
.hot { background: #fff1df; color: #8d430c; }
.solved { background: #e3f5e9; color: #266442; }
.topic h3 { font-size: .98rem; letter-spacing: -.01em; line-height: 1.35; margin: 4px 0; }
.topic h3 a:hover { color: var(--blue); text-decoration: underline; }
.topic p { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .8rem; color: var(--muted); }
.topic-meta { margin-top: 6px; font-size: .73rem; color: var(--muted); }
.topic-meta span { margin-inline: 3px; }
.topic-count { display: grid; text-align: right; gap: 1px; padding-top: 16px; }
.topic-count b { font-size: .95rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.topic-count span { color: var(--muted); font-size: .67rem; }
.topics-footer { padding: 15px 19px; border-top: 1px solid var(--line); color: var(--blue); font-size: .83rem; font-weight: 650; }
.topics-footer a:hover { text-decoration: underline; }

.sidebar { display: grid; gap: 14px; }
.card { padding: 17px; }
.welcome { background: linear-gradient(160deg, #f8faff 0%, #fff 80%); }
.mini-mark { margin-bottom: 12px; width: 29px; height: 29px; border-radius: 8px; font-size: .85rem; }
.welcome p { color: var(--muted); font-size: .83rem; margin: 7px 0 13px; }
.welcome .button { width: 100%; }
.activity dl { margin: 10px 0 12px; }
.activity dl div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: .83rem; }
.activity dt { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.activity dd { font-weight: 700; margin: 0; }
.people { display: flex; padding-top: 2px; }
.people .avatar { width: 30px; height: 30px; border-radius: 50%; border: 2px solid white; font-size: .61rem; }
.people .avatar + .avatar { margin-left: -3px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.tag-list a { padding: 4px 7px; background: #eff3fb; color: #405373; border-radius: 5px; font-size: .72rem; }
.tag-list a:hover { background: var(--blue-soft); color: var(--blue); text-decoration: underline; }
.footer { margin-top: 34px; padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; }
.footer span { font-weight: 700; color: var(--ink); }

.login-layout { display: grid; place-items: start center; min-height: calc(100vh - 71px); padding: clamp(38px, 11vh, 105px) 20px 40px; }
.login-card { max-width: 440px; width: 100%; padding: 30px; box-shadow: 0 14px 35px #20376812; }
.lock-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 17px; border-radius: 12px; color: var(--blue); background: var(--blue-soft); }
.lock { position: relative; width: 17px; height: 13px; margin-top: 5px; border: 1.8px solid currentColor; border-radius: 3px; }
.lock::before { content: ""; position: absolute; left: 2px; right: 2px; bottom: 10px; height: 8px; border: 1.8px solid currentColor; border-bottom: 0; border-radius: 7px 7px 0 0; }
.login-card h1 { margin: 7px 0 8px; font-size: clamp(1.7rem, 5vw, 2.15rem); line-height: 1.15; letter-spacing: -.045em; }
.login-card > p, .login-note p { color: var(--muted); }
.login-note { margin: 22px 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fd; font-size: .86rem; }
.login-note p { margin-top: 3px; }

@media (max-width: 1120px) {
  .forum-layout { grid-template-columns: 172px minmax(0, 1fr) 210px; gap: 15px; }
  .wrap, .topbar-inner { width: calc(100% - 44px); }
  .topbar-inner { gap: 27px; }
}
@media (max-width: 930px) {
  .forum-layout { grid-template-columns: 162px minmax(0, 1fr); }
  .sidebar { grid-column: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .popular { grid-column: 1 / -1; }
  .search { min-width: 38px; justify-content: center; }
  .search span:last-child { display: none; }
}
@media (max-width: 650px) {
  .wrap, .topbar-inner { width: calc(100% - 28px); }
  .topbar-inner { min-height: 60px; gap: 10px; }
  .topbar .tabs { display: none; }
  .intro { padding: 24px 0 15px; align-items: start; flex-direction: column; gap: 13px; }
  .forum-layout { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .sections h2, .side-foot, .category-count { display: none; }
  .sections nav { display: flex; flex-wrap: wrap; gap: 3px; }
  .category { font-size: .74rem; min-height: 34px; padding: 6px 7px; gap: 6px; }
  .sidebar { grid-column: 1; }
  .topics-header { flex-wrap: wrap; padding: 12px; }
  .topic { grid-template-columns: 31px minmax(0, 1fr) 35px; gap: 8px; padding: 12px; }
  .topic > .avatar { width: 31px; height: 31px; border-radius: 9px; font-size: .65rem; }
  .topic h3 { font-size: .91rem; }
  .topic p { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .topic-count { padding-top: 14px; }
  .login-layout { min-height: calc(100vh - 61px); }
}
@media (max-width: 365px) {
  .sidebar { grid-template-columns: 1fr; }
  .topics-header h2 { flex-basis: 100%; }
}
