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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f8fafc;
    --bg-white: #ffffff;
    --text: #1e293b;
    --text-gray: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --radius: 8px;
}

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

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

/* Header */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Main */
.main {
    min-height: calc(100vh - 120px);
    padding: 24px 0;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-gray);
}

/* Filter Bar */
.filter-bar {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab {
    padding: 6px 16px;
    border-radius: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tab:hover,
.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Sort Toggle */
.sort-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border-radius: 8px;
    padding: 4px;
}

.sort-btn {
    padding: 6px 16px;
    border-radius: 6px;
    background: transparent;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.sort-btn:hover {
    background: var(--bg-white);
    color: var(--text);
}

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

/* Content Layout */
.content-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 24px;
    margin-top: 24px;
}

.sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}

/* Keyword List */
.keyword-list {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.keyword-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--bg);
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
}

.keyword-tag:hover {
    background: var(--primary);
    color: white;
}

.keyword-tag:hover .keyword-term {
    color: white;
}

.keyword-tag:hover .keyword-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

.keyword-term {
    font-size: 0.85rem;
    color: var(--text);
    transition: color 0.2s;
}

.keyword-count {
    font-size: 0.75rem;
    background: var(--bg-white);
    padding: 1px 6px;
    border-radius: 10px;
    color: var(--text-gray);
    transition: all 0.2s;
}

/* Entity Nav */
.entity-nav {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.entity-nav-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.entity-type-tabs {
    margin-bottom: 12px;
}

.entity-type-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.entity-type-btn {
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-gray);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.entity-type-btn:hover,
.entity-type-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.entity-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.entity-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--bg);
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
}

.entity-tag:hover {
    background: var(--primary);
    color: white;
}

.entity-tag:hover .entity-tag-name {
    color: white;
}

.entity-tag:hover .entity-tag-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

.entity-tag-name {
    font-size: 0.85rem;
    color: var(--text);
    transition: color 0.2s;
}

.entity-tag-count {
    font-size: 0.75rem;
    background: var(--bg-white);
    padding: 1px 6px;
    border-radius: 10px;
    color: var(--text-gray);
    transition: all 0.2s;
}

/* News Weight */
.news-weight {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* News Type */
.news-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.news-type.type-opinion {
    background: #dbeafe;
    color: #1e40af;
}

.news-type.type-analysis {
    background: #dcfce7;
    color: #166534;
}

.news-type.type-data {
    background: #fef3c7;
    color: #92400e;
}

/* Type Tabs */
.type-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.type-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.type-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}

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

.type-item.active {
    background: var(--primary);
    color: white;
}

.type-count {
    font-size: 0.8rem;
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
}

.type-item.active .type-count {
    background: rgba(255,255,255,0.2);
}

/* Analysis */
.analysis-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

.analysis-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.analysis-date {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 12px;
}

.analysis-content {
    line-height: 1.8;
}

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

.sidebar-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.sidebar-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Category List */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}

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

.category-item.active {
    background: var(--primary);
    color: white;
}

.category-count {
    font-size: 0.8rem;
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
}

.category-item.active .category-count {
    background: rgba(255,255,255,0.2);
}

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

.news-item {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.news-item:hover {
    transform: translateY(-2px);
}

.news-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.news-source {
    color: var(--primary);
    font-weight: 600;
}

.news-category {
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-gray);
}

.news-date {
    color: var(--text-gray);
}

.news-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.news-title a {
    color: var(--text);
    text-decoration: none;
}

.news-title a:hover {
    color: var(--primary);
}

.news-original {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.news-summary {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.6;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px;
}

.page-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.page-btn:hover {
    background: var(--primary-dark);
}

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

/* Analysis Detail */
.analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.analysis-perspective {
    background: var(--bg);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-gray);
}

.analysis-body {
    line-height: 1.8;
    margin-bottom: 20px;
}

.analysis-keywords h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
}

/* Loading & Empty States */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-gray);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.coming-soon {
    text-align: center;
    padding: 100px 20px;
    font-size: 1.2rem;
    color: var(--text-gray);
}

/* Footer */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* News Section */
.news-section {
    margin-top: 32px;
}

.news-section h3 {
    margin-bottom: 16px;
}

/* Back Link */
.back-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

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

/* News Detail Link */
.news-detail-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: auto;
}

.news-detail-link:hover {
    text-decoration: underline;
}

/* News Detail Page */
.news-detail {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-article {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.detail-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.detail-title {
    font-size: 1.6rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.detail-title a {
    color: var(--text);
    text-decoration: none;
}

.detail-title a:hover {
    color: var(--primary);
}

.detail-translated {
    color: var(--text-gray);
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.detail-summary,
.detail-content {
    margin-bottom: 16px;
}

.detail-summary h4,
.detail-content h4 {
    font-size: 0.95rem;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.detail-summary p,
.detail-content p {
    line-height: 1.8;
    color: var(--text);
}

.read-original {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    margin-top: 8px;
}

.read-original:hover {
    text-decoration: underline;
}

/* Detail Sections */
.detail-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.detail-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Entity Grid */
.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.entity-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-radius: 6px;
    background: var(--bg);
}

.entity-type {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-transform: uppercase;
}

.entity-name {
    font-weight: 600;
    color: var(--text);
}

.entity-context {
    font-size: 0.8rem;
    color: var(--text-gray);
    line-height: 1.4;
}

.entity-company { border-left: 3px solid #3b82f6; }
.entity-indicator { border-left: 3px solid #10b981; }
.entity-organization { border-left: 3px solid #8b5cf6; }
.entity-country { border-left: 3px solid #f59e0b; }
.entity-currency { border-left: 3px solid #ef4444; }
.entity-percentage { border-left: 3px solid #06b6d4; }

/* Related List */
.related-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: 6px;
    background: var(--bg);
    text-decoration: none;
    transition: background 0.2s;
}

.related-item:hover {
    background: var(--border);
}

.related-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
}

.related-source {
    color: var(--primary);
    font-weight: 600;
}

.related-category {
    background: var(--bg-white);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--text-gray);
}

.related-date {
    color: var(--text-gray);
}

.related-score {
    margin-left: auto;
    color: var(--primary);
    font-weight: 500;
}

.related-title {
    color: var(--text);
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .analysis-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
    
    .header .container {
        flex-direction: column;
        height: auto;
        padding: 12px 20px;
        gap: 12px;
    }
    
    .nav {
        gap: 16px;
    }
    
    .content-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}
