:root {
    --accent: #0d9488;
    --accent-hover: #0f766e;
    --accent-muted: rgba(13, 148, 136, 0.1);
    --bg: #fafaf9;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --text: #1c1917;
    --text-muted: #78716c;
    --text-subtle: #a8a29e;
    --border: #e7e5e4;
    --border-strong: #d6d3d1;
    --success: #059669;
    --success-muted: rgba(5, 150, 105, 0.1);
    --danger: #dc2626;
    --danger-muted: rgba(220, 38, 38, 0.1);
    --warning: #d97706;
    --warning-muted: rgba(217, 119, 6, 0.12);
    --shadow-xs: 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.06);
    --radius: 6px;
    --radius-full: 9999px;
    --container: 1120px;
    --nav-height: 60px;
    --transition: 0.15s ease;
    --font: 'Figtree', system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
}

[data-theme="dark"] {
    --accent: #14b8a6;
    --accent-hover: #0d9488;
    --accent-muted: rgba(20, 184, 166, 0.12);
    --bg: #0c0a09;
    --surface: #1c1917;
    --surface-raised: #292524;
    --text: #fafaf9;
    --text-muted: #a8a29e;
    --text-subtle: #78716c;
    --border: #292524;
    --border-strong: #44403c;
    --success: #34d399;
    --success-muted: rgba(52, 211, 153, 0.12);
    --danger: #f87171;
    --danger-muted: rgba(248, 113, 113, 0.12);
    --warning: #fbbf24;
    --warning-muted: rgba(251, 191, 36, 0.12);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.user-avatar,
.post-avatar,
.topic-avatar,
.topic-item-avatar {
    display: block;
    object-fit: cover;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

p + p {
    margin-top: 0.75rem;
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--accent-muted);
    color: var(--accent);
    padding: 0.125em 0.375em;
    border-radius: 4px;
}

pre {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.5;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    color: var(--text-muted);
    margin: 1rem 0;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.navbar-container {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.5rem;
    min-height: var(--nav-height);
}

.navbar-brand {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    grid-column: 1;
}

.navbar-brand:hover {
    color: var(--accent);
}

.navbar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    grid-column: 3;
    justify-self: end;
}

.navbar-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    grid-column: 2;
    min-width: 0;
}

.navbar-menu li {
    margin: 0;
}

.navbar-menu a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}

.navbar-menu a:hover {
    color: var(--text);
    background: var(--accent-muted);
}

.navbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    grid-column: 3;
    min-width: 0;
}

.nav-toolbar {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.nav-toolbar-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-toolbar-account {
    position: relative;
}

.nav-toolbar-guest {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-toolbar-tools + .nav-toolbar-account,
.nav-toolbar-tools + .nav-toolbar-guest {
    padding-left: 0.875rem;
    border-left: 1px solid var(--border);
}

.nav-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.625rem 0.25rem 0.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
    transition: border-color var(--transition), background var(--transition);
}

.nav-user-trigger:hover,
.nav-user-trigger[aria-expanded="true"] {
    border-color: var(--accent);
    background: var(--accent-muted);
}

.nav-user-name {
    font-size: 0.875rem;
    font-weight: 500;
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-toolbar-compact .nav-toolbar-tools {
    gap: 0.375rem;
}

.nav-toolbar-compact .nav-toolbar-account {
    padding-left: 0.5rem;
}

.nav-toolbar-compact .nav-user-trigger {
    padding: 0.125rem;
    border-radius: var(--radius-full);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 1px solid var(--border);
}

.user-dropdown {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

footer.site-footer,
.site-footer {
    background: var(--surface);
    color: var(--text);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    padding: 2.5rem 0 1.5rem;
}

.site-footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.site-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.site-footer h3,
.site-footer h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.site-footer p,
.site-footer a {
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

.site-footer ul {
    list-style: none;
}

.site-footer li {
    margin-bottom: 0.5rem;
}

.site-footer-bottom {
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    padding-top: 1.25rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-theme-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-theme-label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0;
}

.footer-theme-select {
    appearance: none;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--text);
    background: var(--surface-2, var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, var(--radius));
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    min-width: 10rem;
}

.footer-theme-select:hover {
    border-color: var(--accent);
}

.footer-theme-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-outline:hover {
    background: var(--accent-muted);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--accent-muted);
    color: var(--accent);
}

.btn-sm,
.btn-small {
    padding: 0.3125rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-secondary,
.btn-cancel {
    background: var(--surface-raised);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover,
.btn-cancel:hover {
    background: var(--border);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    transition: background var(--transition), color var(--transition);
}

.btn-icon:hover {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.form-label-strong {
    font-weight: 600;
}

.form-label-optional {
    font-weight: 400;
    color: var(--text-subtle);
    font-size: 0.8125rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5625rem 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-textarea-large {
    min-height: 200px;
}

.form-hint {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

.form-error {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--danger);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-checkbox label {
    margin: 0;
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.form-checkbox-item input[type="checkbox"] {
    margin-top: 0.125rem;
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.form-checkbox-item-content h4 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.form-checkbox-item-content p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.form-button {
    width: 100%;
    padding: 0.625rem 1rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}

.form-button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.form-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.form-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-footer a {
    font-weight: 500;
}

.card,
.surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    padding: 1.5rem;
}

.page-head,
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-title,
.page-head h1,
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text);
}

.page-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: calc(100vh - var(--nav-height) - 10rem);
    padding: 2rem 0;
}

.auth-card,
.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
}

.auth-container-wide {
    max-width: 480px;
}

.auth-title {
    text-align: center;
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.form-container {
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    padding: 2rem;
}

.form-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.form-header h1 {
    font-size: 1.375rem;
    margin-bottom: 0.375rem;
}

.form-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.create-container {
    max-width: 720px;
    margin: 0 auto;
}

.create-header {
    margin-bottom: 1.5rem;
}

.create-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.375rem;
}

.create-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: var(--success-muted);
    border-color: var(--success);
    color: var(--success);
}

.alert-error,
.alert-danger {
    background: var(--danger-muted);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-info {
    background: var(--accent-muted);
    border-color: var(--accent);
    color: var(--accent);
}

.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.search-input {
    flex: 1;
    padding: 0.5625rem 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
    padding: 0.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-tab {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: background var(--transition), color var(--transition);
}

.filter-tab:hover {
    color: var(--text);
    background: var(--surface);
}

.filter-tab.active {
    background: var(--surface);
    color: var(--accent);
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
}

.topic-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.topic-row {
    display: grid;
    grid-template-columns: 44px 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.topic-row:last-child {
    border-bottom: none;
}

.topic-row:hover {
    background: var(--bg);
}

.topic-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 1px solid var(--border);
}

.topic-content {
    min-width: 0;
}

.topic-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    letter-spacing: -0.01em;
}

.topic-title a {
    color: var(--text);
    text-decoration: none;
}

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

.topic-meta {
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

.topic-stat {
    text-align: center;
    min-width: 64px;
}

.topic-stat .stat-number {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    display: block;
}

.topic-stat .stat-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-subtle);
}

.topic-item {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    transition: border-color var(--transition), background var(--transition);
}

.topic-item:hover {
    border-color: var(--border-strong);
    background: var(--bg);
}

.topic-count {
    font-size: 0.8125rem;
    color: var(--text-subtle);
    white-space: nowrap;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-subtle);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--text-muted);
}

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

.topic-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.topic-title-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.topic-title-area h1 {
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

.topic-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.topic-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.75rem;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.post,
.post-item {
    display: grid;
    grid-template-columns: 160px 1fr;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.post.solution,
.post-item.solution {
    border-color: var(--success);
    box-shadow: 0 0 0 1px var(--success);
}

.post-side,
.post-sidebar {
    padding: 1.25rem 1rem;
    background: var(--bg);
    border-right: 1px solid var(--border);
    text-align: center;
}

.post-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    object-fit: cover;
    margin: 0 auto 0.75rem;
    border: 1px solid var(--border);
}

.post-username {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.post-username:hover {
    color: var(--accent);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-subtle);
    margin-bottom: 0.75rem;
}

.user-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    text-align: left;
}

.user-stats div {
    margin-bottom: 0.25rem;
}

.post-content-area {
    padding: 1.25rem;
    min-width: 0;
}

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.post-date {
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

.post-actions {
    display: flex;
    gap: 0.375rem;
}

.post-body,
.post-content {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text);
    word-wrap: break-word;
    margin-bottom: 1rem;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-content h1,
.post-content h2,
.post-content h3 {
    margin: 1rem 0 0.5rem;
}

.post-body p,
.post-content p {
    margin-bottom: 0.75rem;
}

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.solution-badge,
.badge-solution {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--success-muted);
    color: var(--success);
    border: 1px solid var(--success);
    border-radius: var(--radius);
}

.reply-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.reply-box h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.reply-textarea {
    width: 100%;
    min-height: 140px;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    resize: vertical;
    margin-bottom: 0.75rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.reply-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.category-grid,
.categories-grid {
    display: grid;
    gap: 0.75rem;
}

.category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color var(--transition);
}

.category-card:hover {
    border-color: var(--border-strong);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 0.875rem;
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
}

.category-info h3 {
    font-size: 1rem;
    margin-bottom: 0.125rem;
}

.category-info h3 a {
    color: var(--text);
    text-decoration: none;
}

.category-info h3 a:hover {
    color: var(--accent);
}

.category-info p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.category-stats {
    display: flex;
    gap: 1.25rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.topics-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.topics-list .topic-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0;
    padding: 0.625rem 0.75rem;
}

.category-header-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-header-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0.375rem;
}

.category-header-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.category-stats-row {
    display: flex;
    gap: 1.5rem;
}

.category-stat {
    text-align: center;
}

.category-stat .stat-number {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.tag:hover {
    background: var(--accent);
    color: #ffffff;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 1.5rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.pagination a:hover {
    background: var(--accent-muted);
    color: var(--accent);
    border-color: var(--accent);
}

.pagination .active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.stat-grid,
.stats-container,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-item,
.stat-card,
.stat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--accent);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-subtle);
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
}

.empty-state h2 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.empty-state p {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.category-card .empty-state {
    padding: 1rem 1.25rem;
    margin-top: 0.25rem;
    background: var(--bg);
    border-style: dashed;
}

.category-card .empty-state p {
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--text-subtle);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius);
    border: 1px solid transparent;
}

.badge-pinned {
    background: var(--warning-muted);
    color: var(--warning);
    border-color: var(--warning);
}

.badge-locked {
    background: var(--bg);
    color: var(--text-muted);
    border-color: var(--border-strong);
}

.badge-category {
    background: var(--accent-muted);
    color: var(--accent);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-up {
    background: var(--success-muted);
    color: var(--success);
}

.badge-down {
    background: var(--danger-muted);
    color: var(--danger);
}

.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

.icon-spin {
    animation: icon-spin 0.8s linear infinite;
}

@keyframes icon-spin {
    to { transform: rotate(360deg); }
}

.vote-group,
.vote-buttons {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.625rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.vote-btn:hover {
    background: var(--bg);
    border-color: var(--border-strong);
    color: var(--text);
}

.vote-btn.active-up {
    background: var(--success-muted);
    color: var(--success);
    border-color: var(--success);
}

.vote-btn.active-down {
    background: var(--danger-muted);
    color: var(--danger);
    border-color: var(--danger);
}

.vote-score {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
    min-width: 1.5rem;
    text-align: center;
}

.vote-score.positive {
    color: var(--success);
}

.vote-score.negative {
    color: var(--danger);
}

.markdown-preview {
    padding: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 0.5rem;
    min-height: 120px;
}

.profile-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    align-items: start;
}

.profile-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    position: sticky;
    top: calc(var(--nav-height) + 1rem);
}

.profile-avatar,
.profile-avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-full);
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 1px solid var(--border);
}

.profile-username {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.375rem;
}

.profile-level {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.profile-reputation {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.profile-bio {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: left;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
}

.profile-stats .stat-item {
    padding: 0.5rem;
    border: none;
    background: transparent;
}

.profile-stats .stat-number {
    font-size: 1.125rem;
}

.profile-meta {
    font-size: 0.8125rem;
    color: var(--text-subtle);
    text-align: left;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.profile-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.content-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.tab-button {
    padding: 0.625rem 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}

.tab-button:hover {
    color: var(--text);
}

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

.tab-content {
    min-height: 200px;
}

.content-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.7;
}

.content-box h1,
.content-box h2,
.content-box h3 {
    margin: 1.25rem 0 0.5rem;
}

.content-box p {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 0;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 0.75rem;
}

.hero p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 1.5rem;
}

.home-stats {
    margin-bottom: 0;
}

.home-stats .stat-card {
    padding: 0.875rem 0.75rem;
}

.home-stats .stat-number {
    font-size: 1.375rem;
}

.home-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.25rem;
    align-items: start;
}

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

.home-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: calc(var(--nav-height) + 1rem);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.section-head h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.125rem;
}

.sidebar-card h3 {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.hot-topic-row {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.hot-topic-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hot-topic-row:first-of-type {
    padding-top: 0;
}

.hot-topic-meta {
    color: var(--text-subtle);
    font-size: 0.8125rem;
}

.trend-tags {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.trend-tags h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-right: 0.25rem;
}

.hot-topics {
    margin-top: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.hot-topics h2 {
    display: none;
}

.sidebar-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    height: fit-content;
    position: sticky;
    top: calc(var(--nav-height) + 1rem);
}

.sidebar h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-subtle);
    margin-bottom: 0.75rem;
}

.main-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.writing-tips {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.writing-tips h3 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.writing-tips ul {
    padding-left: 1.25rem;
}

.writing-tips li {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.password-requirements {
    font-size: 0.75rem;
    color: var(--text-subtle);
    margin-top: 0.375rem;
}

.avatar-upload {
    text-align: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.vote-list-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.vote-list-item:hover {
    background: var(--bg);
}

.vote-list-item:last-child {
    border-bottom: none;
}

.vote-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.vote-list-score {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

.vote-list-content {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.vote-list-meta {
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

.topic-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
}

.topic-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: border-color var(--transition);
}

.topic-card:hover {
    border-color: var(--border-strong);
}

.topic-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.topic-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
}

.topic-card-title a {
    color: var(--text);
    text-decoration: none;
}

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

.topic-card-meta {
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

.topic-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

@media (max-width: 1100px) {
    .navbar-menu a > span {
        display: none;
    }

    .navbar-menu a {
        padding: 0.5rem;
    }
}

@media (max-width: 768px) {
    .stat-grid,
    .stats-container,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-layout {
        grid-template-columns: 1fr;
    }

    .home-sidebar {
        position: static;
    }

    .navbar-toggle {
        display: inline-flex;
    }

    .navbar-container {
        grid-template-columns: 1fr auto auto;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .navbar-brand {
        grid-column: 1;
        grid-row: 1;
    }

    .navbar-toggle {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .navbar-actions {
        grid-column: 3;
        grid-row: 1;
    }

    .navbar-menu {
        display: none;
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem 0 0;
        border-top: 1px solid var(--border);
        gap: 0.125rem;
    }

    .navbar-menu.open {
        display: flex;
    }

    .navbar-menu a > span {
        display: inline;
    }

    .navbar-menu a {
        padding: 0.625rem 0.75rem;
    }

    .nav-toolbar {
        gap: 0.5rem;
    }

    .nav-toolbar-tools {
        gap: 0.375rem;
    }

    .nav-toolbar-tools + .nav-toolbar-account,
    .nav-toolbar-tools + .nav-toolbar-guest {
        padding-left: 0.5rem;
    }

    .nav-user-name {
        display: none;
    }

    .nav-toolbar .btn-with-icon > span {
        display: none;
    }

    .nav-toolbar .btn-with-icon {
        width: 38px;
        padding: 0;
    }

    .topic-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .topic-avatar {
        display: none;
    }

    .topic-stat {
        display: none;
    }

    .post,
    .post-item {
        grid-template-columns: 1fr;
    }

    .post-side,
    .post-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        gap: 0.75rem;
        text-align: left;
        padding: 0.875rem 1rem;
    }

    .post-avatar {
        width: 40px;
        height: 40px;
        margin: 0;
    }

    .user-stats {
        display: none;
    }

    .profile-container {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        position: static;
    }

    .sidebar-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .page-head,
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .category-header-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-card,
    .auth-container,
    .form-container {
        padding: 1.5rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
}

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

.notification-badge.is-hidden {
    display: none;
}

.theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: inline-flex;
}

.flash-message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: #fff;
}

.flash-success { background: var(--success); }
.flash-error { background: var(--danger); }
.flash-warning { background: var(--warning); color: var(--text); }
.flash-info { background: var(--accent); }

.post-content.is-hidden {
    display: none;
}

.post-item.is-fading {
    opacity: 0;
    transition: opacity 0.3s;
}

.notification-error {
    color: var(--danger);
}

.scroll-to-top {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
}

.scroll-to-top.is-visible {
    display: block;
}

.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.form-container-narrow {
    max-width: 700px;
}

.text-muted-center {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.text-muted {
    color: var(--text-muted);
}

.mt-20 {
    margin-top: 1.25rem;
}

.mt-30 {
    margin-top: 1.5rem;
}

.category-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--accent-muted);
    color: var(--accent);
}

.category-card-link {
    color: inherit;
    text-decoration: none;
}

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

.category-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.category-count {
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

.topic-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

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

.topic-item-title {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.125rem;
}

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

.topic-item-meta {
    font-size: 0.75rem;
    color: var(--text-subtle);
}

.topic-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg);
    border-radius: var(--radius-full);
}

.page-head-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.badge-with-icon,
.role-badge,
.meta-inline,
.vote-meta-stats {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.vote-count {
    margin-left: 0.125rem;
}

.vote-display {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.vote-list-row {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
}

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

.search-results-summary {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.reply-box-center {
    text-align: center;
}

.post-edited {
    color: var(--text-subtle);
}

.solution-marker {
    margin-bottom: 0.875rem;
}

.post-edit-actions {
    display: flex;
    gap: 0.625rem;
    margin-top: 0.625rem;
}

.post-edit-textarea {
    min-height: 150px;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 0.875rem 0;
}

.profile-topic-item {
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.875rem;
}

.profile-empty {
    color: var(--text-subtle);
    text-align: center;
    padding: 2.5rem 0;
}

.notifications-page {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.notifications-sidebar,
.notifications-main {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.notifications-sidebar h3 {
    font-size: 0.9375rem;
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.notifications-sidebar h3.section-spaced {
    margin-top: 1.5rem;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.875rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.notifications-header h1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.type-breakdown {
    font-size: 0.8125rem;
}

.type-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.type-breakdown-label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.type-breakdown-count {
    font-weight: 600;
}

.notification-message {
    font-size: 0.9375rem;
    margin-bottom: 0.375rem;
    line-height: 1.5;
}

.notification-meta-row {
    display: flex;
    gap: 0.875rem;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

.notification-type-label {
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.notification-actions-btn {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.notification-item.is-fading {
    opacity: 0;
    transition: opacity 0.3s;
}

.form-hint-success {
    color: var(--success);
}

.form-hint-error {
    color: var(--danger);
}

@media (max-width: 768px) {
    .notifications-page {
        grid-template-columns: 1fr;
    }
}

.forum-table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.forum-table-head,
.forum-row {
    display: grid;
    grid-template-columns: 1fr 220px 100px;
    gap: 1rem;
    align-items: center;
    padding: 0.875rem 1.25rem;
}

.forum-table-head {
    background: var(--bg);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-subtle);
    border-bottom: 1px solid var(--border);
}

.forum-section-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
}

.forum-section-block {
    --tree-line-x: calc(1rem + 0.4375rem);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.forum-table:not(.forum-table-compact) .forum-section-block {
    --tree-line-x: calc(1.25rem + 0.4375rem);
}

.forum-section-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    text-decoration: none;
    color: inherit;
    background: color-mix(in srgb, var(--section-color, var(--accent)) 8%, var(--surface));
    border-left: 4px solid var(--section-color, var(--accent));
    transition: background var(--transition);
}

.forum-section-head:hover {
    background: color-mix(in srgb, var(--section-color, var(--accent)) 14%, var(--surface));
}

.forum-section-icon {
    flex-shrink: 0;
    color: var(--section-color, var(--accent));
}

.forum-section-icon .icon {
    width: 22px;
    height: 22px;
}

.forum-section-info {
    flex: 1;
    min-width: 0;
}

.forum-section-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--section-color, var(--accent));
    margin-bottom: 0.125rem;
}

.forum-section-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.forum-section-desc {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-subtle);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.forum-section-count {
    flex-shrink: 0;
    align-self: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-subtle);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.25rem 0.625rem;
    white-space: nowrap;
}

.forum-section-body {
    border-top: 1px solid var(--border);
}

.forum-row-child {
    position: relative;
    background: var(--surface);
}

.forum-row-child::before {
    content: '';
    position: absolute;
    left: var(--tree-line-x);
    top: 0;
    bottom: 0;
    width: 2px;
    background: color-mix(in srgb, var(--section-color, var(--accent)) 35%, var(--border));
    pointer-events: none;
}

.forum-row-child:first-child::before {
    top: -1px;
}

.forum-row-child:not(:last-child)::before {
    bottom: -1px;
}

.forum-row-child:last-child::before {
    bottom: 50%;
}

.forum-row-child .forum-col-forum {
    position: relative;
    padding-left: 1.625rem;
}

.forum-row-child .forum-col-forum::after {
    content: '';
    position: absolute;
    left: 0.4375rem;
    top: 50%;
    width: 0.875rem;
    height: 2px;
    margin-top: -1px;
    background: color-mix(in srgb, var(--section-color, var(--accent)) 35%, var(--border));
    pointer-events: none;
}

.forum-row-child .forum-row-icon {
    position: relative;
    z-index: 1;
}

.forum-row-child .forum-row-title {
    font-size: 0.9375rem;
}

.forum-row-empty {
    color: var(--text-subtle);
    font-size: 0.875rem;
    font-style: italic;
}

.forum-table-compact .forum-table-head,
.forum-table-compact .forum-row {
    padding: 0.5rem 1rem;
    gap: 0.75rem;
}

.forum-table-compact .forum-table-head {
    padding: 0.4375rem 1rem;
}

.forum-table-compact .forum-row-icon .icon {
    width: 18px;
    height: 18px;
}

.forum-table-compact .forum-row-desc {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.forum-table-compact {
    margin-bottom: 1rem;
}

.page-header-compact {
    margin-bottom: 1rem;
}

.page-header-compact h1 {
    margin: 0;
    font-size: 1.375rem;
}

.page-header-desc {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.forum-row {
    border-bottom: 1px solid var(--border);
}

.forum-row:last-child {
    border-bottom: none;
}

.forum-col-forum {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    min-width: 0;
}

.forum-row-icon {
    flex-shrink: 0;
    color: var(--primary);
}

.forum-row-title {
    font-weight: 600;
    color: var(--text);
}

.forum-row-desc {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

.forum-last-topic {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
}

.forum-last-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--text-subtle);
    margin-top: 0.25rem;
}

.forum-col-stats {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
}

.forum-stat-sep {
    color: var(--text-subtle);
    margin: 0 0.25rem;
}

.activity-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.activity-widget-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.activity-tab {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-subtle);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.activity-tab:hover {
    color: var(--text);
}

.activity-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.activity-widget-table {
    width: 100%;
    border-collapse: collapse;
}

.activity-widget-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-subtle);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.activity-widget-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    vertical-align: middle;
}

.activity-col-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.activity-dot {
    color: var(--primary);
}

.activity-load-more {
    width: 100%;
    margin: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--border);
}

.activity-loading,
.activity-empty {
    text-align: center;
    color: var(--text-subtle);
    padding: 2rem !important;
}

@media (max-width: 768px) {
    .forum-table-head,
    .forum-row {
        grid-template-columns: 1fr;
    }
    .forum-col-last,
    .forum-col-stats {
        padding-left: 2.5rem;
    }
    .forum-section-head {
        flex-wrap: wrap;
    }
    .forum-section-count {
        width: 100%;
        align-self: flex-start;
        margin-top: 0.25rem;
    }
    .forum-section-list {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    .activity-widget-table-wrap {
        overflow-x: auto;
    }
}

.editor-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.editor-wrap .markdown-toolbar,
.editor-wrap .bbcode-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.editor-toolbar-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.editor-toolbar-sep {
    width: 1px;
    height: 1.25rem;
    background: var(--border);
    margin: 0 0.125rem;
}

.editor-wrap .bbcode-toolbar button.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.editor-bbcode-store {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.editor-visual {
    min-height: 220px;
    max-height: 480px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--surface);
    outline: none;
    line-height: 1.7;
    word-wrap: break-word;
}

.editor-visual:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.bbcode-toolbar-compact + .editor-popover ~ .editor-panels .editor-visual,
.reply-box .editor-visual {
    min-height: 140px;
    max-height: 320px;
}

.editor-source-input {
    display: block;
    width: 100%;
    min-height: 220px;
    max-height: 480px;
    margin: 0;
    padding: 1rem;
    border: none;
    border-radius: 0;
    background: #1e293b;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

.editor-preview {
    padding: 1rem;
    min-height: 220px;
    max-height: 480px;
    overflow-y: auto;
    background: var(--surface);
    pointer-events: none;
    user-select: none;
}

.editor-preview-loading {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.editor-popover {
    position: absolute;
    z-index: 50;
    min-width: 240px;
    max-width: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 0.75rem;
}

.editor-popover-panel label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    margin-top: 0.5rem;
}

.editor-popover-panel label:first-child {
    margin-top: 0;
}

.editor-popover-input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
}

.editor-popover-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--accent-muted);
}

.editor-popover-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.editor-popover-cancel,
.editor-popover-apply {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.editor-popover-apply {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.editor-popover-cancel:hover {
    background: var(--bg);
}

.editor-popover-apply:hover {
    filter: brightness(1.05);
}

.editor-color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.editor-color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0;
}

.editor-color-swatch:hover {
    transform: scale(1.08);
}

.editor-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.editor-size-btn {
    min-width: 2.25rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 0.8125rem;
    cursor: pointer;
    font-family: inherit;
}

.editor-size-btn:hover {
    background: var(--accent-muted);
    border-color: var(--primary);
}

.editor-visual .bbcode-spoiler {
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    border: 1px dashed var(--border);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

.editor-visual .bbcode-spoiler.revealed {
    background: transparent;
    border-style: solid;
}

.editor-mention-dropdown {
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    z-index: 60;
    max-height: 200px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.editor-mention-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
}

.editor-mention-item img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.editor-mention-item:hover,
.editor-mention-item.is-active {
    background: var(--accent-muted);
}

.editor-panels {
    position: relative;
}

.post-edit-editor-host {
    margin-top: 0.5rem;
}

.post-edit-editor-host .editor-wrap {
    border-radius: var(--radius);
}

.mention-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.mention-link:hover {
    text-decoration: underline;
}

.bbcode-toolbar-compact button {
    min-width: 28px;
    height: 28px;
    font-size: 0.75rem;
    padding: 0 0.35rem;
}

.bbcode-toolbar button u,
.bbcode-toolbar button s {
    text-decoration: inherit;
}

.reply-box .editor-wrap {
    margin-bottom: 1rem;
}

.post-content.bbcode-body,
.editor-preview.bbcode-body,
.bbcode-body {
    line-height: 1.7;
    word-wrap: break-word;
}

.bbcode-quote {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--primary);
    background: var(--bg);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.bbcode-quote-author {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.bbcode-quote-body {
    color: var(--text);
}

.bbcode-code {
    margin: 0.75rem 0;
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.875rem;
}

.bbcode-code code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: pre-wrap;
}

.bbcode-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 0.5rem 0;
}

.bbcode-list {
    margin: 0.5rem 0 0.5rem 1.5rem;
}

.bbcode-center {
    text-align: center;
    margin: 0.5rem 0;
}

.bbcode-hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

.bbcode-spoiler,
.spoiler {
    background: var(--text);
    color: var(--text);
    border-radius: 4px;
    padding: 0 0.25rem;
    cursor: pointer;
}

.bbcode-spoiler.revealed,
.spoiler.revealed {
    background: transparent;
    color: inherit;
}

.bbcode-youtube {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0.75rem 0;
    aspect-ratio: 16 / 9;
}

.bbcode-youtube iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--radius);
}

.editor-tabs {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
}

.editor-tabs button {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.8125rem;
}

.editor-tabs button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.editor-panels textarea.editor-write {
    border: none;
    border-radius: 0;
    min-height: 220px;
}

.editor-panels [hidden] {
    display: none !important;
}

.markdown-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
}

.spoiler {
    background: var(--text);
    color: var(--text);
    border-radius: 4px;
    padding: 0 0.25rem;
    cursor: pointer;
}

.spoiler.revealed {
    background: transparent;
    color: inherit;
}

.topic-mod-actions {
    margin-top: 0.5rem;
}

.mod-action-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.maintenance-banner {
    padding: 0.625rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
}

.maintenance-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.maintenance-banner a {
    text-decoration: none;
}

.maintenance-banner a:hover {
    text-decoration: underline;
}

.quote-of-day-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    font-style: italic;
    color: var(--text-muted);
}

.quote-of-day-author {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: normal;
}
