:root {
    --ink: #1e293b;
    --ink-muted: #526071;
    --ink-soft: #738294;
    --paper: #f7f5f0;
    --card: #ffffff;
    --line: #e4dfd5;
    --teal: #1b4965;
    --teal-deep: #123449;
    --teal-soft: #eaf2f7;
    --orange: #d95d00;
    --orange-dark: #b94c00;
    --orange-soft: #fff2e6;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 10px rgba(27, 73, 101, 0.06);
    --maxw: 1180px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--teal);
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.forum-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(18, 52, 73, 0.05);
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 70px;
    position: relative;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-link img {
    height: 46px;
    width: auto;
}

.brand-meta {
    display: none;
    flex-direction: column;
    border-left: 1px solid var(--line);
    padding-left: 10px;
    line-height: 1.25;
}

.brand-meta strong {
    font-size: 13.5px;
    color: var(--teal-deep);
}

.brand-meta em {
    font-style: normal;
    font-size: 11.5px;
    color: var(--ink-soft);
}

@media (min-width: 1160px) {
    .brand-meta {
        display: flex;
    }
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.top-nav a {
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 500;
    padding: 8px 11px;
    border-radius: 7px;
    white-space: nowrap;
}

.top-nav a:hover,
.top-nav a.active {
    background: var(--orange-soft);
    color: var(--orange-dark);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.search-pill {
    display: flex;
    align-items: center;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 5px 3px 12px;
}

.search-pill input {
    border: 0;
    background: transparent;
    outline: none;
    width: 145px;
    font-size: 13px;
    color: var(--ink);
}

.search-pill button {
    border: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
}

.menu-btn span {
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
}

/* Verbatim Announcement Strip */
.notice-strip {
    background: linear-gradient(90deg, #fff5eb 0%, #ffeedb 100%);
    border-bottom: 1px solid #f2cfa8;
    color: #7c3500;
}

.notice-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 9px;
    padding-bottom: 9px;
    flex-wrap: wrap;
}

.notice-tag {
    background: var(--orange);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 4px;
    flex-shrink: 0;
}

.notice-copy {
    font-size: 14px;
    font-weight: 500;
}

/* Hero Lobby */
.lobby-hero {
    background: linear-gradient(135deg, #123449 0%, #1b4965 58%, #265f7f 100%);
    color: #fff;
    padding: 40px 0 44px;
    border-bottom: 3px solid var(--orange);
}

.lobby-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr);
    gap: 28px;
    align-items: center;
}

.lobby-kicker {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 600;
    color: #ffd8b3;
    background: rgba(217, 93, 0, 0.25);
    border: 1px solid rgba(255, 198, 145, 0.35);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.lobby-intro h1 {
    margin: 0 0 12px;
    font-size: 32px;
    line-height: 1.28;
    font-weight: 800;
}

.lobby-desc {
    margin: 0 0 20px;
    font-size: 15px;
    color: rgba(238, 246, 252, 0.9);
}

.lobby-search {
    display: flex;
    background: #fff;
    border-radius: 10px;
    padding: 5px;
    max-width: 580px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.lobby-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    padding: 10px 14px;
    font-size: 14.5px;
    color: var(--ink);
}

.lobby-search button {
    border: 0;
    background: var(--orange);
    color: #fff;
    font-weight: 700;
    font-size: 14.5px;
    padding: 10px 22px;
    border-radius: 7px;
    cursor: pointer;
    flex-shrink: 0;
}

.lobby-search button:hover {
    background: var(--orange-dark);
}

.lobby-hot-tags {
    margin-top: 13px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.lobby-hot-tags a {
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12.5px;
}

.lobby-hot-tags a:hover {
    background: var(--orange);
    color: #fff;
}

.lobby-board-card {
    background: rgba(255, 255, 255, 0.97);
    color: var(--ink);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.lbc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}

.lbc-head strong {
    font-size: 15.5px;
    color: var(--teal-deep);
}

.lbc-head span {
    font-size: 12px;
    background: var(--teal-soft);
    color: var(--teal);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

.lbc-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    text-align: center;
    background: var(--paper);
    padding: 10px 6px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.lbc-stats strong {
    display: block;
    font-size: 20px;
    color: var(--orange);
    line-height: 1.2;
}

.lbc-stats span {
    font-size: 11.5px;
    color: var(--ink-muted);
}

.lbc-sub {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-muted);
    margin-bottom: 8px;
}

.lbc-pinned ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lbc-pinned li {
    display: flex;
    align-items: baseline;
    gap: 7px;
    font-size: 13.5px;
}

.pin-dot {
    background: var(--orange);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.lbc-pinned a {
    color: var(--ink);
    font-weight: 500;
}

.lbc-pinned a:hover {
    color: var(--orange);
}

/* Sections */
.forum-sec {
    padding: 38px 0;
}

.sec-tint {
    background: #efeae0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.sec-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.sec-bar.compact {
    margin-bottom: 16px;
}

.sec-bar h2 {
    margin: 0 0 4px;
    font-size: 22px;
    color: var(--teal-deep);
}

.sec-bar p {
    margin: 0;
    font-size: 14px;
    color: var(--ink-muted);
}

.sec-link {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* Boards Grid */
.boards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.board-tile {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--teal);
    border-radius: var(--radius);
    padding: 18px;
    color: var(--ink);
    box-shadow: var(--shadow);
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.board-tile:hover {
    transform: translateY(-2px);
    border-left-color: var(--orange);
    color: var(--ink);
}

.bt-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.bt-badge {
    font-size: 11.5px;
    font-weight: 800;
    background: var(--teal-soft);
    color: var(--teal);
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: 0.4px;
}

.bt-cnt {
    font-size: 12px;
    color: var(--ink-soft);
}

.board-tile h3 {
    margin: 0 0 6px;
    font-size: 17.5px;
}

.board-tile p {
    margin: 0 0 12px;
    font-size: 13.5px;
    color: var(--ink-muted);
    flex: 1;
}

.bt-mod {
    font-size: 12px;
    color: var(--orange-dark);
    background: var(--orange-soft);
    padding: 4px 9px;
    border-radius: 5px;
    align-self: flex-start;
}

/* Forum Columns & Thread Feed */
.forum-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 26px;
    align-items: start;
}

.thread-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thread-row {
    display: flex;
    gap: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.tr-votes {
    width: 58px;
    flex-shrink: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    align-self: flex-start;
}

.tr-floors {
    font-size: 19px;
    font-weight: 800;
    color: var(--teal);
    line-height: 1.1;
}

.tr-floors-lbl {
    font-size: 11px;
    color: var(--ink-soft);
    margin-top: 2px;
}

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

.tr-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.tag-pin {
    background: var(--orange);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 4px;
}

.tag-ess {
    background: #147d64;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 4px;
}

.tag-board {
    background: var(--teal-soft);
    color: var(--teal);
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.tr-body h2,
.tr-body h3 {
    margin: 7px 0 6px;
    font-size: 17.5px;
    line-height: 1.4;
}

.tr-body h2 a,
.tr-body h3 a {
    color: var(--ink);
}

.tr-body h2 a:hover,
.tr-body h3 a:hover {
    color: var(--orange);
}

.tr-body p {
    margin: 0 0 10px;
    font-size: 13.8px;
    color: var(--ink-muted);
}

.tr-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12.5px;
    color: var(--ink-soft);
    padding-top: 8px;
    border-top: 1px dashed var(--line);
}

.tr-tags {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-views {
    white-space: nowrap;
}

/* Side Rail */
.side-rail {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.rail-box {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.rail-head h3 {
    margin: 0;
    font-size: 16px;
    color: var(--teal-deep);
}

.rail-head a {
    font-size: 12.5px;
    font-weight: 600;
}

.dir-mini {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.dir-mini li {
    border-bottom: 1px dashed var(--line);
    padding-bottom: 10px;
}

.dir-mini li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dm-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px;
}

.dm-status {
    font-size: 11px;
    background: var(--orange-soft);
    color: var(--orange-dark);
    padding: 1px 7px;
    border-radius: 4px;
    font-weight: 600;
}

.dm-domain {
    font-size: 12px;
    color: var(--teal);
    font-family: Consolas, monospace;
}

.dir-mini p {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: var(--ink-muted);
}

.mini-chrono {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-chrono li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 13.5px;
}

.mc-year {
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: var(--teal);
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
}

.promo-rail {
    background: linear-gradient(145deg, #123449, #1b4965);
    color: #fff;
    border-color: transparent;
}

.promo-rail h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.promo-rail p {
    margin: 0 0 14px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.88);
}

.side-board-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.side-board-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 11px;
    border-radius: 7px;
    background: var(--paper);
    color: var(--ink);
    font-size: 13.8px;
}

.side-board-list a em {
    font-style: normal;
    font-size: 12px;
    color: var(--ink-soft);
}

.side-board-list a:hover,
.side-board-list a.active {
    background: var(--teal);
    color: #fff;
}

.side-board-list a:hover em,
.side-board-list a.active em {
    color: #ffd8b3;
}

.hot-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hot-list li {
    border-bottom: 1px dashed var(--line);
    padding-bottom: 8px;
}

.hot-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.hot-list a {
    display: block;
    font-size: 13.8px;
    color: var(--ink);
    line-height: 1.45;
}

.hot-list a:hover {
    color: var(--orange);
}

.hot-list span {
    font-size: 12px;
    color: var(--ink-soft);
}

/* Sub Hero */
.sub-hero {
    background: linear-gradient(125deg, #123449 0%, #1d5170 100%);
    color: #fff;
    padding: 28px 0;
}

.sub-hero.compact {
    padding: 13px 0;
}

.sub-hero h1 {
    margin: 8px 0 8px;
    font-size: 27px;
    line-height: 1.32;
}

.sub-hero p {
    margin: 0;
    max-width: 780px;
    font-size: 14.5px;
    color: rgba(240, 247, 252, 0.9);
}

.crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}

.crumbs a {
    color: rgba(255, 255, 255, 0.94);
}

.board-hero-badge {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(217, 93, 0, 0.32);
    border: 1px solid rgba(255, 198, 145, 0.4);
    padding: 2px 10px;
    border-radius: 999px;
}

/* Boards Wide */
.boards-wide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.board-wide-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.bwc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.bwc-head h2 {
    margin: 0;
    font-size: 19px;
    margin-right: auto;
}

.bwc-head h2 a {
    color: var(--ink);
}

.bwc-tag {
    margin: 0 0 8px;
    font-weight: 600;
    color: var(--orange-dark);
    font-size: 14px;
}

.bwc-desc {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--ink-muted);
    flex: 1;
}

.bwc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    font-size: 13px;
    color: var(--ink-soft);
}

/* Thread Floor Detail */
.post-floor {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 26px;
    box-shadow: var(--shadow);
}

.floor-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.floor-num {
    font-size: 12px;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 5px;
    background: var(--paper);
    color: var(--teal);
    border: 1px solid var(--line);
}

.floor-num.op {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

.op-floor h1 {
    margin: 12px 0 14px;
    font-size: 25px;
    line-height: 1.36;
}

.op-author-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px;
    background: var(--paper);
    border-radius: 9px;
    margin-bottom: 16px;
}

.avatar-dot {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-dot.alt {
    width: 34px;
    height: 34px;
    font-size: 14px;
    background: var(--orange);
}

.author-role {
    display: block;
    font-size: 12px;
    color: var(--ink-soft);
}

.op-stats {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.op-digest {
    background: var(--orange-soft);
    border-left: 4px solid var(--orange);
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    font-size: 14.5px;
    margin-bottom: 20px;
}

.floor-content {
    font-size: 15.5px;
    line-height: 1.85;
    color: #243040;
    overflow-wrap: break-word;
}

.floor-content h2 {
    margin: 26px 0 11px;
    font-size: 19.5px;
    color: var(--teal-deep);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
}

.floor-content h3 {
    margin: 18px 0 8px;
    font-size: 16.5px;
}

.floor-content p {
    margin: 0 0 14px;
}

.floor-content ul,
.floor-content ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.floor-content li {
    margin-bottom: 6px;
}

.floor-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    background: var(--paper);
    border-left: 4px solid var(--teal);
    color: var(--ink-muted);
    border-radius: 0 8px 8px 0;
}

.author-sign {
    margin-top: 22px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    font-size: 13px;
    color: var(--ink-soft);
    font-style: italic;
}

.thread-tags {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.thread-tags a {
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 2px 10px;
    border-radius: 999px;
    color: var(--ink-muted);
}

.floors-divider {
    margin: 22px 0 14px;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--teal-deep);
}

.replies-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reply-floor {
    padding: 18px 22px;
    border-left: 3px solid var(--line);
}

.reply-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.reply-author {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stance-pill {
    font-size: 11.5px;
    background: var(--teal-soft);
    color: var(--teal);
    padding: 1px 8px;
    border-radius: 999px;
    font-weight: 600;
}

.reply-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rep-date {
    font-size: 12px;
    color: var(--ink-soft);
}

.reply-body {
    font-size: 14.8px;
    line-height: 1.78;
    color: #2c3a4b;
}

.archive-note {
    margin-top: 18px;
    background: var(--teal-soft);
    border: 1px solid #c9dfed;
    border-radius: 9px;
    padding: 13px 16px;
    font-size: 13.5px;
    color: var(--teal-deep);
}

.prev-next-bar {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pn-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pn-card.right {
    text-align: right;
}

.pn-card span {
    font-size: 12px;
    color: var(--ink-soft);
}

.pn-card a {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

/* Directory */
.dir-group {
    margin-bottom: 34px;
}

.dir-heading {
    margin: 0 0 16px;
    font-size: 20px;
    padding-left: 12px;
    border-left: 4px solid var(--orange);
    color: var(--teal-deep);
}

.dir-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dir-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.dc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.dc-head h3 {
    margin: 0;
    font-size: 18px;
    color: var(--teal-deep);
}

.dc-status {
    font-size: 12px;
    font-weight: 700;
    background: var(--orange-soft);
    color: var(--orange-dark);
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

.dc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12.5px;
    color: var(--ink-soft);
    margin-bottom: 10px;
}

.dc-meta code {
    background: var(--paper);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--teal);
}

.dc-sum {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--ink-muted);
}

.dc-boards,
.dc-note {
    font-size: 13.2px;
    padding: 8px 10px;
    border-radius: 7px;
    background: var(--paper);
    margin-top: 8px;
    color: var(--ink-muted);
}

/* Chronicle & Glossary */
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tl-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.tl-year {
    font-size: 18px;
    font-weight: 800;
    color: var(--orange);
    padding-top: 2px;
}

.tl-era {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--teal);
    background: var(--teal-soft);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 5px;
}

.tl-body h3 {
    margin: 0 0 6px;
    font-size: 17.5px;
}

.tl-body p {
    margin: 0;
    font-size: 14px;
    color: var(--ink-muted);
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.gloss-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.gc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.gc-top h3 {
    margin: 0;
    font-size: 17px;
    color: var(--teal-deep);
}

.gc-top span {
    font-size: 11.5px;
    background: var(--paper);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--ink-soft);
}

.gc-def {
    margin: 0 0 8px;
    font-size: 13.8px;
    color: var(--ink-muted);
}

.gc-ex {
    font-size: 12.8px;
    color: var(--orange-dark);
    background: var(--orange-soft);
    padding: 7px 10px;
    border-radius: 6px;
}

/* Lab Tools */
.lab-stack {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.lab-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.lab-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--teal);
    background: var(--teal-soft);
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.lab-card h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.lab-card > p {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--ink-muted);
}

.lab-controls label,
.lab-row label,
.lab-grid-3 label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
}

.lab-controls textarea,
.lab-row select,
.lab-grid-3 select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
}

.lab-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.lab-row label {
    flex: 1;
    min-width: 240px;
}

.lab-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.lab-actions {
    margin-top: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.lab-stat {
    font-size: 13px;
    color: var(--ink-soft);
}

.lab-out {
    margin-top: 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 4px solid var(--teal);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

.nick-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.nick-chip {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
    font-weight: 700;
    color: var(--teal-deep);
    font-size: 14.5px;
}

/* Buttons & Misc */
.btn-solid,
.btn-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-solid {
    background: var(--orange);
    color: #fff;
}

.btn-solid:hover {
    background: var(--orange-dark);
    color: #fff;
}

.btn-line {
    background: transparent;
    border-color: var(--teal);
    color: var(--teal);
}

.btn-line:hover {
    background: var(--teal);
    color: #fff;
}

.btn-full {
    width: 100%;
}

.pager {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pager a {
    padding: 7px 13px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    font-size: 14px;
}

.pager a.active,
.pager a:hover {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.empty-panel,
.info-paper,
.nf-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
}

.empty-panel {
    text-align: center;
    color: var(--ink-muted);
}

.sub-search {
    margin-top: 14px;
}

.search-count {
    margin-top: 0;
    color: var(--ink-muted);
}

.search-sec-title {
    margin: 22px 0 12px;
    font-size: 19px;
    color: var(--teal-deep);
}

.search-dir-gap {
    margin-bottom: 24px;
}

.info-paper h2 {
    margin: 20px 0 10px;
    font-size: 20px;
    color: var(--teal-deep);
}

.info-paper h2:first-child {
    margin-top: 0;
}

.map-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    background: var(--paper);
    padding: 16px 20px;
    border-radius: 9px;
}

.map-two h3 {
    margin: 0 0 8px;
    font-size: 15.5px;
}

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

.nf-panel {
    max-width: 640px;
    text-align: center;
    padding: 44px 24px;
}

.nf-num {
    font-size: 62px;
    font-weight: 800;
    color: var(--teal);
    line-height: 1;
    margin-bottom: 10px;
}

.nf-btns {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Footer */
.forum-footer {
    background: #142636;
    color: rgba(226, 234, 242, 0.86);
    margin-top: 26px;
    padding-top: 38px;
}

.footer-cols {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 28px;
    padding-bottom: 28px;
}

.f-logo-card {
    display: inline-block;
    background: #fff;
    padding: 5px 11px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.f-about p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.72;
    color: rgba(203, 215, 228, 0.86);
}

.f-links h3 {
    margin: 0 0 11px;
    font-size: 15px;
    color: #fff;
}

.f-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13.5px;
}

.f-links a {
    color: rgba(203, 215, 228, 0.86);
}

.f-links a:hover {
    color: #ffb370;
}

.footer-legal {
    background: #0d1a26;
    padding: 15px 0;
    font-size: 13px;
    color: rgba(154, 171, 189, 0.9);
}

.legal-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    text-align: center;
}

.footer-legal a {
    color: rgba(226, 234, 242, 0.92);
}

.footer-legal a:hover {
    color: #ffb370;
}

/* Responsive (375px safe, zero horizontal scroll) */
@media (max-width: 1024px) {
    .top-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
        flex-direction: column;
        align-items: stretch;
        padding: 12px 20px;
        gap: 4px;
    }

    .top-nav.open {
        display: flex;
    }

    .menu-btn {
        display: inline-flex;
    }

    .lobby-grid,
    .forum-columns {
        grid-template-columns: 1fr;
    }

    .boards-grid,
    .glossary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .wrap {
        padding: 0 14px;
    }

    .search-pill {
        display: none;
    }

    .brand-link img {
        height: 40px;
    }

    .lobby-hero {
        padding: 26px 0 30px;
    }

    .lobby-intro h1 {
        font-size: 23px;
    }

    .lobby-search {
        flex-direction: column;
        gap: 6px;
    }

    .lobby-search button {
        width: 100%;
    }

    .lbc-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .forum-sec {
        padding: 26px 0;
    }

    .boards-grid,
    .boards-wide-grid,
    .dir-grid,
    .glossary-grid,
    .lab-grid-3,
    .nick-grid,
    .prev-next-bar,
    .map-two,
    .footer-cols {
        grid-template-columns: 1fr;
    }

    .thread-row {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .tr-votes {
        width: auto;
        flex-direction: row;
        gap: 6px;
        padding: 4px 10px;
    }

    .tl-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .post-floor,
    .lab-card,
    .info-paper {
        padding: 17px 15px;
    }

    .op-floor h1,
    .sub-hero h1 {
        font-size: 21px;
    }

    .op-stats,
    .reply-right {
        margin-left: 0;
    }

    .pn-card.right {
        text-align: left;
    }
}
