:root {
    --bg: #ffffff;
    --bg-card: #f8f9fa;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --accent: #1e6f3e;
    --border: #e5e7eb;
    --tag-bg: #e8f5e9;
    --tag-text: #1b5e20;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111111;
        --bg-card: #1e1e1e;
        --text: #e5e5e5;
        --text-muted: #9ca3af;
        --accent: #4caf50;
        --border: #333333;
        --tag-bg: #1b3a1b;
        --tag-text: #81c784;
        --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
header {
    border-bottom: 2px solid var(--accent);
    padding: 12px 0;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}

header .container {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Page title */
.page-title {
    font-size: 1.5rem;
    margin: 20px 0 16px;
}

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

/* Tag filters */
.tag-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tag-filters::-webkit-scrollbar {
    display: none;
}

.tag-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.tag-filter.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.tag-filter:not(.active):hover {
    border-color: var(--accent);
    color: var(--text);
}

.tag-count {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Article list */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 24px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.15s ease;
}

.card:active {
    transform: scale(0.98);
}

.card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 14px 16px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 6px;
}

.card-teaser {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
}

.tag:hover {
    opacity: 0.8;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0 32px;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.page-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Article detail */
.back-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 16px 0;
}

.article-hero {
    margin: 0 -16px;
    border-radius: 8px;
    overflow: hidden;
}

.article-hero img {
    width: 100%;
    height: auto;
    display: block;
}

.article-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 16px 0 10px;
}

.article-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.article-meta .author {
    font-weight: 600;
}

.article-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.article-body {
    font-size: 1.05rem;
    line-height: 1.75;
}

.article-body p {
    margin-bottom: 16px;
}

.article-body h3 {
    font-size: 1.2rem;
    margin: 24px 0 12px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 12px 0;
}

.article-body a {
    color: var(--accent);
}

/* Comments */
.comments-section {
    margin-top: 40px;
    padding: 24px 16px 16px;
    border-top: 1px solid var(--border);
    border-radius: 10px;
}

.comments-section h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.comments-section [data-spotim-module] {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    color-scheme: light;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 16px 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

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