:root {
    color-scheme: light;
    --bg: #f7f7f9;
    --card: #ffffff;
    --ink: #111827;
    --muted: #4b5563;
    --accent: #3056d3;
    --accent-soft: rgba(48, 86, 211, 0.08);
    --border: #e5e7eb;
    --success: #0d9488;
    font-family: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}

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

a:hover {
    text-decoration: underline;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3vw;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header.detail {
    position: static;
}

.header-brand {
    display: flex;
    flex-direction: column;
}

.brand-mark {
    font-weight: 700;
    font-size: 1.2rem;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
}

.header-nav a {
    margin-left: 1.5rem;
    font-weight: 500;
}

.page {
    padding: 2rem 3vw 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(30, 41, 59, 0.06);
}

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

.hero-metrics {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.submission-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2.5rem;
}

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

input, textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-top: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}

textarea {
    resize: vertical;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1rem;
}

.button {
    appearance: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button.primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 12px 24px rgba(48, 86, 211, 0.25);
}

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

.button.subtle {
    background: var(--accent-soft);
    color: var(--accent);
}

.form-hint {
    color: var(--muted);
    font-size: 0.9rem;
}

.layout {
    display: grid;
    grid-template-columns: 3fr 1.2fr;
    gap: 2rem;
    align-items: start;
}

.feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.forum-post {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.8rem;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.forum-post.detail {
    max-width: 860px;
    margin: 2rem auto;
}

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

.post-taxonomy {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.category {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
}

.post-title h2, .post-title h1 {
    margin: 0.6rem 0 0.4rem;
}

.post-summary {
    color: var(--muted);
    margin: 0;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.post-body p {
    margin: 0 0 1rem;
}

.post-reading-list {
    background: #f4f6ff;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin: 1.5rem 0;
}

.post-reading-list h3, .post-reading-list h2 {
    margin-top: 0;
}

.post-reading-list ul {
    margin: 0;
    padding-left: 1.4rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    border: 1px solid var(--border);
}

.comment-item.empty {
    text-align: center;
    color: var(--muted);
    font-style: italic;
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
}

.sidebar-card ul {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
}

.site-footer {
    text-align: center;
    padding: 2rem 1rem 3rem;
    color: var(--muted);
}

@media (max-width: 980px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .hero {
        padding: 2rem;
    }
    .hero-metrics {
        flex-wrap: wrap;
    }
}

@media (max-width: 680px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    .header-nav a {
        margin-left: 0;
        margin-right: 1rem;
    }
    .submission-section {
        padding: 1.5rem;
    }
}
