:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --ok: #16a34a;
    --warn: #d97706;
    --err: #dc2626;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

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

a:hover {
    text-decoration: underline;
}

.wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

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

.nav-user {
    color: var(--muted);
    font-size: 0.95rem;
}

.btn {
    display: inline-block;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 18px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

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

.btn-ghost:hover {
    background: var(--brand);
    color: #fff;
}

.hero {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    padding: 48px 0;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 2rem;
}

.hero p {
    margin: 0 0 16px;
    opacity: 0.9;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.9rem;
}

main {
    padding: 24px 0 40px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-card {
    margin-bottom: 24px;
}

.form-card h2,
.messages h2 {
    margin: 0 0 16px;
    font-size: 1.2rem;
}

label {
    display: block;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 0.95rem;
}

input,
textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-weight: 400;
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
    border-color: var(--brand);
}

button {
    cursor: pointer;
    border: 0;
    border-radius: 8px;
    padding: 11px 20px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 600;
    transition: background 0.15s ease;
}

button:hover {
    background: var(--brand-dark);
}

.actions {
    display: flex;
    gap: 10px;
}

.login-prompt p {
    margin: 0 0 16px;
    color: var(--muted);
}

.notice {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
}

.notice-ok {
    background: #dcfce7;
    color: var(--ok);
}

.notice-warn {
    background: #fef3c7;
    color: var(--warn);
}

.notice-error {
    background: #fee2e2;
    color: var(--err);
}

.messages {
    display: grid;
    gap: 14px;
}

.message-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}

.message-head strong {
    color: var(--brand);
}

.message-head time {
    color: var(--muted);
    font-size: 0.85rem;
}

.message p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

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

.auth-wrap {
    display: flex;
    justify-content: center;
    padding-top: 48px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    margin: 0 0 20px;
    font-size: 1.5rem;
}

.auth-card button {
    width: 100%;
}

.auth-alt {
    margin: 18px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

footer {
    padding: 20px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 480px) {
    .message-head {
        flex-direction: column;
        gap: 2px;
    }

    .nav-user {
        display: none;
    }
}
