/* style.css —— 简易论坛系统样式，体现 CSS 布局与响应式设计 */
* {
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f3f6fb;
    --card: #ffffff;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, #dbeafe 0, transparent 34%), var(--bg);
}

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

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.85);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 16px;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text);
}

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

.nav .user {
    color: var(--muted);
    font-size: 14px;
}

.btn-link {
    padding: 8px 14px;
    border-radius: 999px;
    background: #eef2ff;
}

.main {
    padding: 34px 0 52px;
}

.card {
    background: var(--card);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
}

.hero-card {
    background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
}

h1, h2 {
    margin-top: 0;
    line-height: 1.25;
}

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

.hero-actions, .form-row, .section-title {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.section-title {
    justify-content: space-between;
    margin-bottom: 16px;
}

.between {
    justify-content: space-between;
}

.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    padding: 11px 20px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

.button:hover, button:hover {
    background: var(--primary-dark);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.button.ghost {
    background: #eef2ff;
    color: var(--primary-dark);
}

form label {
    display: block;
    margin: 15px 0 7px;
    font-weight: 700;
}

input, textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    background: #fff;
}

input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
    gap: 24px;
    align-items: stretch;
}

.auth-card {
    margin-bottom: 0;
}

.side-panel {
    border-radius: 18px;
    padding: 34px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #0f172a);
    box-shadow: var(--shadow);
}

.notice {
    padding: 12px 14px;
    border-radius: 12px;
    margin: 14px 0;
}

.notice.error {
    color: #991b1b;
    background: #fee2e2;
}

.notice.success {
    color: #166534;
    background: #dcfce7;
}

.form-tip {
    margin-bottom: 0;
    color: var(--muted);
}

.search-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

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

.message-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    background: #fff;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.message-meta strong {
    color: var(--primary-dark);
    font-size: 16px;
}

.message-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 12px;
}

.inline-delete {
    display: inline;
}

.link-danger {
    background: transparent;
    color: var(--danger);
    padding: 0;
    border-radius: 0;
}

.link-danger:hover {
    background: transparent;
    color: #991b1b;
    transform: none;
    text-decoration: underline;
}

.danger-button {
    background: var(--danger);
    margin-top: 18px;
}

.detail-content {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fafc;
    padding: 22px;
    line-height: 1.8;
    white-space: normal;
}

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

.empty {
    text-align: center;
    color: var(--muted);
    padding: 38px 0;
}

.footer {
    color: var(--muted);
    text-align: center;
    padding: 24px 0 36px;
}

code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
}

@media (max-width: 760px) {
    .header-inner, .auth-layout, .search-form {
        display: block;
    }

    .nav {
        margin-top: 12px;
    }

    .side-panel {
        margin-top: 18px;
    }

    .card {
        padding: 22px;
    }

    .search-form button, .search-form a {
        margin-top: 10px;
    }

    .message-meta {
        display: block;
    }
}
