:root {
    --bg: #141414;
    --bg-alt: #191919;
    --text: #f5f5f5;
    --muted: #a0a0a0;
    --accent: #4f8cff;
    --accent-soft: rgba(79, 140, 255, 0.14);
    --border: #303030;
    --card-bg: #1b1b1b;
    --shadow-soft: 0 26px 44px rgba(0, 0, 0, 0.7);
}

[data-theme="light"] {
    --bg: #f5f5f5;
    --bg-alt: #ffffff;
    --text: #111111;
    --muted: #666666;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --border: #dddddd;
    --card-bg: #ffffff;
    --shadow-soft: 0 20px 32px rgba(15, 23, 42, 0.18);
}

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    display: block;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 40px;
    background: linear-gradient(90deg, #141414, #050505);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .site-header {
    background: linear-gradient(90deg, #ffffff, #f3f4f6);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
}

.branding {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-title {
    font-weight: 600;
    font-size: 20px;
}

.site-subtitle {
    font-size: 13px;
    color: var(--muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-form input {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    color: var(--text);
    font-size: 13px;
    min-width: 220px;
}

.theme-toggle {
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    padding: 8px 18px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: var(--shadow-soft);
}

.page-container {
    width: 100%;
    max-width: 1560px;
    margin: 28px auto 38px auto;
    padding: 0 22px;
    flex: 1;
}

.page-large {
    max-width: 1680px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.3fr);
    gap: 24px;
    margin-bottom: 32px;
}

.hero-left h1 {
    margin: 0 0 10px 0;
    font-size: 32px;
}

.hero-left p {
    margin: 0 0 16px 0;
    font-size: 15px;
    color: var(--muted);
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.stat-box {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    min-width: 130px;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.stat-value {
    display: block;
    margin-top: 4px;
    font-size: 20px;
    font-weight: 600;
}

.hero-right {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 14px 14px 16px 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.hero-right h3 {
    margin: 0 0 10px 0;
    font-size: 17px;
}

.trend-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--text);
}

.trend-item:hover {
    border-color: var(--border);
    background: rgba(148, 163, 184, 0.08);
}

.trend-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: 260px;
}

.trend-type {
    font-size: 11px;
    color: var(--muted);
}

.trend-title {
    font-size: 13px;
}

.trend-meta {
    font-size: 11px;
    color: var(--muted);
}

.section {
    margin-bottom: 36px;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.section-header h2 {
    margin: 0;
    font-size: 26px;
}

.section-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

/* Announcements grid */
.grid-announcements {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 1280px) {
    .grid-announcements {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .grid-announcements {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .grid-announcements {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .grid-announcements {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.card {
    background-color: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.card-cover {
    width: 100%;
    padding-bottom: 55%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.card-body {
    padding: 12px 14px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.card-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
}

.card-desc {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
}

.btn {
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-outline {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    margin-top: 4px;
}

.btn-outline:hover {
    background: var(--accent-soft);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    border: 1px solid transparent;
}

.badge-announcement {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(79, 140, 255, 0.4);
}

.badge-news {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.32);
}

/* News list */
.list-news {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.news-item {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.news-large {
    grid-template-columns: 320px minmax(0, 1fr);
}

.news-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.news-content {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.news-title {
    margin: 0;
    font-size: 18px;
}

.news-desc {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }
    .news-item,
    .news-large {
        grid-template-columns: minmax(0, 1fr);
    }
    .site-header {
        padding: 12px 16px;
    }
}

/* Post */
.post {
    max-width: 980px;
    margin: 0 auto;
}

.post-large {
    max-width: 1080px;
}

.post-cover-large {
    width: 100%;
    padding-bottom: 40%;
    background-size: cover;
    background-position: center;
    border-radius: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
}

.post-header {
    margin-bottom: 18px;
}

.post-badge-row {
    margin-bottom: 10px;
}

.post-title {
    margin: 0 0 10px 0;
    font-size: 32px;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    color: var(--muted);
}

.post-body {
    font-size: 16px;
    line-height: 1.75;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.post-body img {
    max-width: 100%;
    border-radius: 16px;
    margin: 14px 0;
}

.post-body iframe {
    width: 100%;
    min-height: 320px;
    border-radius: 20px;
    border: none;
}

/* Reactions */
.post-reactions {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px dashed var(--border);
    background: rgba(15, 23, 42, 0.55);
}

[data-theme="light"] .post-reactions {
    background: rgba(249, 250, 251, 0.9);
}

.reaction-buttons {
    display: flex;
    gap: 10px;
}

.reaction-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
}

.reaction-btn:hover {
    background: var(--accent-soft);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 18px 24px 22px 24px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

/* Back to top */
.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: none;
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    display: none;
}

.back-to-top.show {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Admin analytics table */
.admin-analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-analytics-table th,
.admin-analytics-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.admin-analytics-table th {
    text-align: left;
    font-weight: 500;
    color: var(--muted);
}

.admin-analytics-table tr:hover td {
    background: rgba(148, 163, 184, 0.06);
}
