/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1378F0;
    --text-primary: #222;
    --text-secondary: #666;
    --text-tertiary: #999;
    --border-color: #e5e5e5;
    --bg-hover: #f5f5f5;
    --red: #e62e4d;
    --green: #00a862;
    --header-height: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text-primary);
    background: #fff;
    line-height: 1.6;
}

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

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-icon {
    width: 40px;
    height: 40px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.main-nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.language-selector {
    position: relative;
    margin-left: 20px;
}

.lang-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.lang-btn:hover {
    background: #e8e8e8;
    border-color: var(--primary-color);
}

.lang-btn .arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.lang-btn.active .arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    overflow: hidden;
    z-index: 1000;
}

.lang-dropdown.hidden {
    display: none;
}

.lang-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

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

.lang-option.active {
    background: #e3f2fd;
    color: var(--primary-color);
    font-weight: 500;
}

.translating {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.translating::after {
    content: 'Translating...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.translation-badge {
    display: inline-block;
    background: #4caf50;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

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

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    padding: 18px 0;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav-link:hover {
    color: var(--primary-color);
}

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

/* Main Content */
.main-content {
    padding: 0;
    min-height: calc(100vh - var(--header-height));
    background: #f5f7fa;
}

/* Hero Section */
.hero-section {
    background: #fff;
    padding: 20px 0;
    margin-bottom: 20px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
    height: 400px;
}

.hero-main {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.hero-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.hero-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-main-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    padding: 30px;
    color: white;
}

.hero-main-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-main-meta {
    font-size: 14px;
    opacity: 0.9;
}

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

.hero-card {
    position: relative;
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.hero-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.hero-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    padding: 20px;
    color: white;
}

.hero-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Market Bar */
.market-bar {
    background: #fff;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    margin-bottom: 20px;
    overflow: hidden;
}

.market-bar-scroll {
    display: flex;
    gap: 30px;
    animation: scroll 30s linear infinite;
}

.market-bar-scroll:hover {
    animation-play-state: paused;
}

.market-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.market-bar-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.market-bar-value {
    font-size: 16px;
    font-weight: 700;
}

.market-bar-value.positive {
    color: var(--red);
}

.market-bar-value.negative {
    color: var(--green);
}

.market-bar-change {
    font-size: 13px;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Content Wrapper */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    padding: 0 0 40px 0;
}

/* News Column */
.news-column {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

/* Section Tabs */
.section-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
    position: sticky;
    top: var(--header-height);
    z-index: 100;
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    font-family: inherit;
}

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

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--border-color);
}

.news-card {
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.news-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.news-card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: #f0f0f0;
}

.news-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-image {
    transform: scale(1.05);
}

.news-card-content {
    padding: 20px;
}

.news-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.news-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-tertiary);
}

.news-card-author {
    color: var(--text-secondary);
}

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

/* Text-only card variant */
.news-card.text-only .news-card-content {
    padding: 24px;
}

.news-card.text-only .news-card-title {
    font-size: 18px;
    -webkit-line-clamp: 3;
}

/* Featured card (spans full width) */
.news-card.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.news-card.featured .news-card-image-wrapper {
    padding-top: 0;
    height: 100%;
}

.news-card.featured .news-card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-card.featured .news-card-title {
    font-size: 22px;
    -webkit-line-clamp: 3;
    margin-bottom: 16px;
}

/* Sidebar */
.sidebar {
    position: relative;
}

.sidebar-sticky {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.market-data {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.market-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    font-size: 13px;
    background: var(--bg-hover);
    border-radius: 6px;
    transition: background 0.2s;
}

.market-item:hover {
    background: #e8e8e8;
}

.market-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.market-value {
    text-align: right;
}

.market-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.market-change {
    font-size: 12px;
    margin-top: 2px;
    font-weight: 500;
}

.market-change.positive {
    color: var(--red);
}

.market-change.negative {
    color: var(--green);
}

/* Hot Topics */
.hot-topics {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hot-topic-item {
    padding: 12px 16px;
    background: var(--bg-hover);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.hot-topic-item:hover {
    background: #e3f2fd;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(4px);
}

/* Load More Button */
.load-more {
    text-align: center;
    padding: 30px 0;
}

.load-more-btn {
    padding: 10px 40px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-primary);
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading States */
.loading, .loading-small {
    text-align: center;
    padding: 40px 0;
    color: var(--text-tertiary);
}

.loading-small {
    padding: 20px 0;
    font-size: 14px;
}

/* Utility Classes */
.text-red {
    color: var(--red);
}

.text-green {
    color: var(--green);
}

.hidden {
    display: none !important;
}

/* News Title Links */
.news-title a {
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    z-index: 1;
    cursor: pointer;
    pointer-events: auto;
}

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

.news-content {
    position: relative;
}
