:root {
    --bg: #08132b;
    --bg-soft: #101d3f;
    --bg-panel: rgba(14, 24, 50, 0.92);
    --bg-panel-strong: rgba(19, 32, 67, 0.98);
    --line: rgba(126, 160, 255, 0.22);
    --line-strong: rgba(126, 160, 255, 0.4);
    --text: #f4f7ff;
    --muted: #9fb2d9;
    --accent: #73a7ff;
    --accent-strong: #99bdff;
    --accent-soft: rgba(115, 167, 255, 0.12);
    --gold: #ffd76d;
    --danger: #ff8e72;
    --success: #7fe0b6;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top, rgba(115, 167, 255, 0.16), transparent 28%),
        linear-gradient(180deg, #050b19 0%, var(--bg) 42%, #050913 100%);
    color: var(--text);
}

a {
    color: var(--accent-strong);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

a:hover {
    color: #c9dbff;
}

p {
    margin: 0;
}

h1,
h2,
h3 {
    margin: 0;
}

.wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(126, 160, 255, 0.16);
    background: rgba(5, 10, 22, 0.82);
}

.header-bar {
    border-bottom: 1px solid rgba(126, 160, 255, 0.08);
}

.header-bar-inner,
.header-inner,
.section-head,
.page-head,
.site-footer-inner,
.board-card-head,
.board-card-foot,
.thread-row,
.thread-stats,
.topic-meta-strip,
.board-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.header-bar-inner {
    min-height: 42px;
    color: var(--muted);
    font-size: 13px;
}

.header-kicker {
    color: var(--gold);
    font-weight: 600;
}

.header-account-links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.header-inner {
    padding: 18px 0;
}

.brand-block {
    display: grid;
    gap: 8px;
}

.site-brand {
    display: inline-block;
    color: #f8fbff;
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.site-tagline,
.muted,
label small,
.list-meta {
    color: var(--muted);
}

.site-nav {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.site-nav a,
.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(126, 160, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
    color: #dce8ff;
    font: inherit;
}

.site-nav a.is-active {
    border-color: rgba(126, 160, 255, 0.42);
    background: rgba(115, 167, 255, 0.16);
    color: #fff;
}

.site-nav form {
    margin: 0;
}

.link-button {
    cursor: pointer;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, #4c79ff 100%);
    color: #091224;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(76, 121, 255, 0.26);
}

.button:hover,
button:hover,
.link-button:hover {
    transform: translateY(-1px);
}

.button-secondary {
    border-color: rgba(126, 160, 255, 0.24);
    background: rgba(255, 255, 255, 0.02);
    color: #dce8ff;
    box-shadow: none;
}

.main-shell {
    padding: 24px 0 56px;
}

.breadcrumb {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb span::before,
.breadcrumb a + span::before,
.breadcrumb a + a::before {
    content: "/";
    margin-right: 10px;
    color: rgba(159, 178, 217, 0.45);
}

.breadcrumb a:first-child::before {
    content: "";
    margin: 0;
}

.panel,
.hero-card {
    margin-bottom: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(18, 31, 62, 0.96) 0%, rgba(10, 19, 41, 0.95) 100%);
    box-shadow: var(--shadow);
}

.panel {
    padding: 24px;
}

.hero-card {
    padding: 30px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.9fr);
    gap: 24px;
}

.hero-copy,
.hero-side,
.board-hero-actions,
.empty-state,
.board-card,
.thread-main,
.profile-hero,
.profile-hero-copy {
    display: grid;
    gap: 14px;
}

.section-kicker,
.author-label,
.foot-label,
.stat-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #c9dbff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.hero-intro {
    max-width: 60ch;
    color: #dce8ff;
    line-height: 1.8;
    font-size: 17px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-points {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.8;
}

.hero-side {
    align-content: start;
}

.stat-card,
.hero-note,
.author-card,
.thread-row,
.board-card,
.empty-state {
    border: 1px solid rgba(126, 160, 255, 0.14);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
}

.stat-card,
.hero-note {
    padding: 18px;
}

.stat-card strong {
    font-size: 30px;
    color: #fff;
}

.stat-card.compact {
    min-width: 140px;
}

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

.section-head {
    margin-bottom: 18px;
}

.section-head h2 {
    margin-top: 4px;
}

.topic-list,
.notice-list,
.reply-stack {
    list-style: none;
    margin: 0;
    padding: 0;
}

.content-list-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(126, 160, 255, 0.12);
}

.content-list-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.topic-link,
.thread-title,
.board-title {
    color: #f4f7ff;
    font-weight: 700;
}

.category-section + .category-section {
    margin-top: 26px;
}

.category-title {
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 215, 109, 0.14);
    border-radius: var(--radius-md);
    background: rgba(255, 215, 109, 0.08);
    color: #fff;
    font-weight: 700;
}

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

.board-card {
    padding: 18px;
}

.board-count {
    color: var(--muted);
    font-size: 14px;
}

.board-description {
    color: var(--muted);
    line-height: 1.7;
}

.board-card-foot {
    align-items: flex-end;
}

.board-hero,
.topic-hero {
    overflow: hidden;
}

.board-summary,
.topic-meta-strip {
    flex-wrap: wrap;
}

.topic-meta-chip {
    color: #dce8ff;
    font-size: 14px;
}

.thread-list {
    display: grid;
    gap: 14px;
}

.thread-row {
    padding: 18px;
}

.thread-meta {
    color: var(--muted);
    line-height: 1.7;
}

.thread-stats {
    min-width: 160px;
    justify-content: flex-end;
}

.thread-stats div {
    display: grid;
    place-items: center;
    min-width: 68px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.thread-stats strong {
    font-size: 20px;
}

.form-panel {
    max-width: 820px;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.stack-form label {
    display: grid;
    gap: 8px;
}

input,
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(126, 160, 255, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(126, 160, 255, 0.5);
    background: rgba(255, 255, 255, 0.06);
}

textarea {
    resize: vertical;
    min-height: 140px;
}

.post-panel {
    padding-top: 8px;
}

.post-shell,
.reply-item {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    padding: 18px 0;
}

.reply-item + .reply-item,
.post-shell {
    border-top: 1px solid rgba(126, 160, 255, 0.12);
}

.post-shell:first-child {
    border-top: 0;
}

.author-card {
    align-content: start;
    padding: 16px;
}

.avatar-badge {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(115, 167, 255, 0.3), rgba(255, 215, 109, 0.18));
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

.avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    font-size: 26px;
}

.author-card strong {
    font-size: 18px;
}

.post-content {
    min-width: 0;
    color: #eef4ff;
    line-height: 1.85;
    word-break: break-word;
}

.post-content > *:first-child {
    margin-top: 0;
}

.post-content > *:last-child {
    margin-bottom: 0;
}

.quote-chip {
    display: inline-flex;
    align-items: center;
    margin-bottom: 14px;
    padding: 8px 12px;
    border: 1px solid rgba(126, 160, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: #d6e4ff;
    font-size: 13px;
}

.quote-chip-active {
    width: fit-content;
    background: rgba(115, 167, 255, 0.14);
}

.reply-actions {
    margin-top: 16px;
}

.reply-actions a {
    color: var(--accent-strong);
    font-size: 14px;
    font-weight: 600;
}

.tag {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 215, 109, 0.18);
    color: #ffe6a6;
    font-size: 12px;
    font-weight: 700;
}

.tag-muted {
    background: rgba(159, 178, 217, 0.15);
    color: #d6def0;
}

.message-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.message {
    padding: 14px 16px;
    border: 1px solid rgba(127, 224, 182, 0.26);
    border-radius: 14px;
    background: rgba(127, 224, 182, 0.08);
    color: #dff8ed;
}

.message.error {
    border-color: rgba(255, 142, 114, 0.36);
    background: rgba(255, 142, 114, 0.1);
    color: #ffd9cf;
}

.empty-state {
    padding: 22px;
    color: var(--muted);
}

.site-footer {
    border-top: 1px solid rgba(126, 160, 255, 0.12);
    background: rgba(5, 10, 22, 0.76);
}

.site-footer-inner {
    padding: 24px 0 36px;
    align-items: flex-start;
}

.profile-hero {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

ul.errorlist {
    margin: 0;
    padding-left: 18px;
    color: #ffd1c6;
}

@media (max-width: 960px) {
    .hero-card,
    .grid-two,
    .board-grid,
    .post-shell,
    .reply-item,
    .thread-row,
    .profile-hero,
    .site-footer-inner,
    .header-inner,
    .section-head,
    .page-head {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .thread-stats {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .wrap {
        width: min(100% - 24px, 1180px);
    }

    .panel,
    .hero-card {
        padding: 20px;
        border-radius: 20px;
    }

    .site-nav {
        gap: 8px;
    }

    .site-nav a,
    .link-button,
    .button {
        width: 100%;
    }

    .thread-stats {
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .header-bar-inner,
    .header-account-links,
    .board-summary,
    .topic-meta-strip,
    .hero-actions,
    .footer-links {
        flex-direction: column;
        align-items: flex-start;
    }
}
