:root {
    --primary-color: #2563eb;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.app-header {
    background: var(--primary-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.date-bar {
    background: var(--primary-color);
    color: white;
    padding: 12px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.date-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 1.1rem;
    font-weight: 500;
}

.nav-arrow {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 1.2rem;
}

.nav-icon-btn {
    color: white;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 20px;
}

.nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-arrow:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.4);
}

.nav-arrow.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
}

.date-display-container {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    cursor: pointer;
}

.calendar-icon {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.calendar-icon svg {
    stroke: white;
}

.date-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
    z-index: 10;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: center;
    position: relative;
    align-items: center;
    background: var(--primary-color);
    position: relative;
}

.source-nav {
    display: flex;
    gap: 12px;
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-btn.active {
    background: white;
    color: var(--primary-color);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 40px 0;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 加载状态容器 */
.loading-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.progress-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.progress-section h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin: 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #60a5fa);
    width: 0%;
    transition: width 0.3s ease;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.log-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-section h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin: 0;
}

.log-stream {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #334155;
}

.log-entry {
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-entry:not(:last-child)::after {
    content: '';
    display: block;
    height: 8px;
}

/* 空状态容器 */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 80px 40px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    opacity: 0.6;
}

.empty-state-container h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin: 0;
}

.empty-state-container p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
    max-width: 400px;
}

.fetch-button {
    padding: 12px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.fetch-button:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.fetch-button:active {
    transform: translateY(0);
}

.fetch-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.news-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    /* For positioning star */
}

.star-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #ccc;
    /* Default gray */
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
    padding: 5px;
}

.star-btn:hover {
    transform: scale(1.2);
}

.star-btn.active {
    color: #f1c40f;
    /* Yellow */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

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

.news-source {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.news-section {
    font-size: 0.75rem;
    background: #e2e8f0;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.news-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.4;
    flex-grow: 1;
    cursor: pointer;
}

.title-cn {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.title-ko {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    background: var(--bg-color);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 16px;
    display: flex;
    justify-content: flex-end;
    background: var(--card-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.close-btn:hover {
    color: var(--primary-color);
}

.split-view {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.view-pane {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.view-pane:last-child {
    border-right: none;
}

.view-pane h3 {
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 4px;
}

.article-body {
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text-primary);
}

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

.ko-pane .article-body {
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

.news-meta {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
}

.read-more {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}
/* 应用标题样式 */
.app-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    position: absolute;
    left: 20px;
}

/* 筛选筐标签样式 */
.nav-label {
    color: white;
    font-size: 14px;
    margin-left: 6px;
    white-space: nowrap;
}

/* 调整 nav-icon-btn 以支持文字 */
.nav-icon-btn {
    display: flex;
    align-items: center;
}
