:root {
    --bg-primary: #0d1117;
    --bg-card: #161b22;
    --bg-hover: #1c2128;
    --border: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --accent-mint: #6cbf84;
    --accent-geo: #6cbf84;
    --accent-econ: #e4a54a;
    --accent-crypto: #e8983a;
    --accent-tech: #a78bfa;
    --accent-science: #60a5fa;
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
    --radius: 6px;
    --transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    display: none;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}

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

/* Header */
.header {
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border);
    padding: 12px 16px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    cursor: pointer;
}

.logo-radar {
    color: var(--accent-mint);
}

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

.header-date {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
}

.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.btn-icon.active {
    color: var(--accent-mint);
}

.live-badge {
    font-size: 10px;
    color: var(--bg-primary);
    background: var(--accent-mint);
    padding: 2px 6px;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-weight: 600;
}

/* Category tabs */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.category-tab {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all var(--transition);
    font-weight: 500;
    background: var(--bg-card);
    color: var(--text-secondary);
}

.category-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.category-tab.active {
    font-weight: 600;
}

/* Article card */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    border-left: 3px solid var(--accent-mint);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.card:hover {
    background: var(--bg-hover);
}

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

.card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    font-family: var(--font-mono);
}

.card-source {
    color: var(--accent-mint);
}

.card-dot {
    color: var(--border);
}

.card-time {
    color: var(--text-muted);
}

.card-breaking {
    margin-left: auto;
    color: var(--accent-mint);
}


.card.read .card-title {
    color: var(--text-secondary);
}

/* Content area */
.content {
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Article panel (slide-in) */
.article-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 640px;
    background: var(--bg-primary);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 200;
    overflow: hidden;
    border-left: 1px solid var(--border);
}

.article-panel-scroll {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.article-panel.open {
    transform: translateX(0);
}

.article-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.article-panel-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.article-header {
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 1;
}

.article-body {
    padding: 16px;
}

.article-body h1 {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 12px;
}

.article-body .article-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

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

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

.article-body > img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.3s ease forwards;
}

/* Archive calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: var(--radius);
    cursor: default;
    color: var(--text-muted);
}

.calendar-day.has-articles {
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
}

.calendar-day.has-articles:hover {
    background: var(--bg-hover);
}

.calendar-day.today {
    border: 1px solid var(--accent-mint);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
