/* style.css —— 暗黑风格简易论坛系统 */
* {
    box-sizing: border-box;
}

:root {
    --bg: #080b12;
    --panel: rgba(18, 24, 38, 0.86);
    --panel-solid: #121827;
    --line: rgba(148, 163, 184, 0.18);
    --text: #e5e7eb;
    --muted: #94a3b8;
    --primary: #7c3aed;
    --primary-2: #06b6d4;
    --danger: #f43f5e;
    --success: #22c55e;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
    --radius: 20px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 18% 12%, rgba(124, 58, 237, 0.32), transparent 30%),
        radial-gradient(circle at 82% 0%, rgba(6, 182, 212, 0.28), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(244, 63, 94, 0.15), transparent 35%),
        linear-gradient(135deg, #070a11 0%, #0f172a 50%, #080b12 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 90%);
}

.topbar {
    width: min(1120px, calc(100% - 32px));
    margin: 18px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 14px;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.brand-mark,
.avatar {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.35);
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

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

.nav a,
.user-pill {
    color: var(--text);
    text-decoration: none;
    padding: 9px 13px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 14px;
}

.nav a:hover,
.nav a.active,
.user-pill {
    border-color: var(--line);
    background: rgba(255,255,255,0.07);
}

.main {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto;
}

.main.narrow {
    width: min(760px, calc(100% - 32px));
}

.hero-card,
.form-card,
.message-card,
.search-card,
.empty-card,
.notice {
    border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.hero-card {
    padding: 32px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary-2);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
}

h1, h2, h3, p {
    margin-top: 0;
}

h1 {
    font-size: clamp(30px, 4vw, 54px);
    line-height: 1.05;
    margin-bottom: 16px;
}

h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.muted,
.form-tip,
.field-hint,
.footer {
    color: var(--muted);
}

code {
    color: #a5f3fc;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.22);
    padding: 2px 6px;
    border-radius: 7px;
}

.auth-layout,
.compose-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 24px;
    align-items: start;
}

.form-card {
    padding: 28px;
}

.form-card label {
    display: block;
    margin-bottom: 18px;
}

.form-card label > span {
    display: inline-block;
    color: #cbd5e1;
    margin-bottom: 8px;
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    color: var(--text);
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid var(--line);
    outline: none;
    border-radius: 14px;
    padding: 13px 15px;
    font: inherit;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

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

input:focus,
textarea:focus {
    border-color: rgba(6, 182, 212, 0.72);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
    background: rgba(2, 6, 23, 0.95);
}

input.invalid,
textarea.invalid {
    border-color: var(--danger);
}

.field-error {
    display: block;
    min-height: 18px;
    color: #fb7185;
    margin-top: 6px;
    font-size: 13px;
}

.btn,
button {
    appearance: none;
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .18s, opacity .18s, box-shadow .18s;
}

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

.primary {
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 14px 30px rgba(124, 58, 237, 0.3);
}

.ghost {
    color: var(--text);
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.06);
}

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

.danger,
.inline-delete button {
    color: white;
    background: rgba(244, 63, 94, 0.18);
    border: 1px solid rgba(244, 63, 94, 0.38);
}

.wide {
    width: 100%;
}

.notice {
    padding: 14px 16px;
    margin-bottom: 18px;
}

.notice.success {
    border-color: rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
    background: rgba(22, 101, 52, 0.18);
}

.notice.error {
    border-color: rgba(244, 63, 94, 0.35);
    color: #fecdd3;
    background: rgba(136, 19, 55, 0.18);
}

.demo-box,
.feature-list {
    margin-top: 22px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.05);
}

.demo-box span,
.demo-box strong {
    display: block;
    margin: 6px 0;
}

.feature-list {
    padding-left: 34px;
    color: #cbd5e1;
}

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

.search-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    margin-bottom: 18px;
}

.message-list {
    display: grid;
    gap: 16px;
}

.message-card {
    padding: 22px;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.message-meta.large {
    margin-bottom: 28px;
}

.message-meta strong,
.message-meta time {
    display: block;
}

.message-meta time {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.message-content {
    color: #dbeafe;
    line-height: 1.8;
    margin-bottom: 16px;
    word-break: break-word;
}

.message-actions,
.form-row,
.detail-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.message-actions a {
    color: #a5f3fc;
    text-decoration: none;
}

.inline-delete {
    display: inline;
    margin: 0;
}

.inline-delete button {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
}

.empty-card {
    padding: 44px;
    text-align: center;
}

.detail-card {
    max-width: 820px;
    margin-inline: auto;
}

.detail-content {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.58);
    color: #e0f2fe;
    line-height: 1.9;
    word-break: break-word;
    margin-bottom: 22px;
}

.footer {
    width: min(1120px, calc(100% - 32px));
    margin: 20px auto 32px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
}

@media (max-width: 820px) {
    .topbar,
    .list-head,
    .footer {
        border-radius: 24px;
        flex-direction: column;
        align-items: stretch;
    }

    .nav {
        justify-content: flex-start;
    }

    .auth-layout,
    .compose-layout {
        grid-template-columns: 1fr;
    }

    .search-card {
        flex-direction: column;
    }

    .hero-card,
    .form-card {
        padding: 24px;
    }
}
