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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 600;
}

.subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 10px;
}

.last-update {
    font-size: 0.85rem;
    color: #999;
}

.auto-refresh-hint {
    font-size: 0.75rem;
    color: #4CAF50;
    margin-left: 8px;
    background: #e8f5e9;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: #f0f0f0;
    color: #666;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.tab-btn.active {
    background: #2c3e50;
    color: #fff;
    font-weight: 500;
}

/* Tab Content */
.tab-content {
    display: none;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.tab-header h2 {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
}

.refresh-btn {
    padding: 8px 16px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #34495e;
}

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

.news-item {
    background: #fafafa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #eee;
    border-left: 3px solid #2c3e50;
    transition: all 0.3s ease;
}

.news-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #ddd;
}

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

.news-title {
    font-size: 1.15rem;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    flex: 1;
    margin-right: 15px;
}

.news-title.clickable {
    cursor: pointer;
    transition: color 0.3s ease;
}

.news-title.clickable:hover {
    color: #3498db;
}

.news-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: #888;
}

.news-source {
    background: #e8f4f8;
    color: #2980b9;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.news-date {
    color: #999;
}

.news-summary {
    color: #555;
    line-height: 1.6;
    margin: 10px 0;
}

/* Analysis Section */
.news-analysis {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e0e0e0;
}

.analysis-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.analysis-label {
    min-width: 90px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-align: center;
}

.analysis-label.positive {
    background: #e8f5e9;
    color: #2e7d32;
}

.analysis-label.negative {
    background: #ffebee;
    color: #c62828;
}

.analysis-label.actions {
    background: #fff3e0;
    color: #ef6c00;
}

.analysis-content {
    flex: 1;
    margin-left: 12px;
    color: #444;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Competitor Sections */
.competitor-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.competitor-group {
    background: #fafafa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #eee;
}

.competitor-group h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
}

.competitor-news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.competitor-news-item {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #eee;
    border-left: 3px solid #7f8c8d;
    transition: all 0.3s ease;
}

.competitor-news-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Advertiser List */
.advertiser-item {
    background: #fafafa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #eee;
    border-left: 3px solid #8e44ad;
    transition: all 0.3s ease;
}

.advertiser-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.spend-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 8px;
}

.spend-badge.超高 {
    background: #e74c3c;
    color: white;
}

.spend-badge.高 {
    background: #e67e22;
    color: white;
}

.spend-badge.中高 {
    background: #27ae60;
    color: white;
}

.spend-badge.中 {
    background: #3498db;
    color: white;
}

.advertiser-name {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 8px;
}

.estimated-spend {
    color: #888;
    font-size: 0.85rem;
}

/* Article Content Expand/Collapse */
.article-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #fff;
    border-radius: 8px;
}

.article-content.expanded {
    max-height: 2000px;
    padding: 20px;
    margin-top: 15px;
    border: 1px solid #e0e0e0;
}

.full-content {
    color: #444;
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 20px;
    white-space: pre-line;
}

.expand-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 16px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.expand-btn:hover {
    background: #e0e0e0;
    color: #333;
}

/* External Link */
.external-link {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.link-label {
    font-weight: 500;
    color: #666;
    margin-right: 8px;
}

.link-url {
    color: #3498db;
    text-decoration: none;
    word-break: break-all;
    font-size: 0.9rem;
}

.link-url:hover {
    text-decoration: underline;
}

.visit-btn {
    display: inline-block;
    margin-left: 15px;
    padding: 6px 14px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.visit-btn:hover {
    background: #2980b9;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 0.9rem;
}

/* Modal for external links */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-text {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-link {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 6px;
    word-break: break-all;
    font-size: 0.9rem;
    color: #3498db;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.modal-btn.primary {
    background: #2c3e50;
    color: white;
}

.modal-btn.primary:hover {
    background: #34495e;
}

.modal-btn.secondary {
    background: #f0f0f0;
    color: #666;
}

.modal-btn.secondary:hover {
    background: #e0e0e0;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.6rem;
    }
    
    .tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tab-btn {
        width: 100%;
        text-align: center;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .news-header {
        flex-direction: column;
    }
    
    .news-title {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .analysis-item {
        flex-direction: column;
    }
    
    .analysis-label {
        margin-bottom: 5px;
        align-self: flex-start;
    }
    
    .analysis-content {
        margin-left: 0;
    }
}