/* 全局股票数据网站样式文件 */

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

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.6;
}

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

/* ===========================================
   头部导航样式 (所有页面通用)
   =========================================== */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #1e40af;
    letter-spacing: -0.5px;
    text-decoration: none;
}

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

.nav-item {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    color: #64748b;
    text-decoration: none;
}

.nav-item:hover {
    background: #f1f5f9;
    color: #1e40af;
}

.nav-item.active {
    background: #1e40af;
    color: white;
}

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

.search-bar {
    position: relative;
}

.search-input {
    padding: 10px 20px 10px 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    width: 250px;
    background: #ffffff;
    font-size: 14px;
    color: #374151;
}

.search-input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.user-menu {
    padding: 10px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
    font-weight: 500;
    text-decoration: none;
}

.user-menu:hover {
    background: #1e40af;
    color: white;
    border-color: #1e40af;
}

/* ===========================================
   卡片通用样式
   =========================================== */
.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

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

/* ===========================================
   首页样式
   =========================================== */
.hero-section {
    text-align: center;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 60px 40px;
    margin-bottom: 32px;
    border: none;
}

.hero-section:hover {
    transform: none;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 32px;
    font-weight: 400;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 0;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 24px;
}

.markets-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.market-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 24px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.market-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #1e40af;
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.market-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.market-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-open {
    background: #dcfce7;
    color: #166534;
}

.status-closed {
    background: #fee2e2;
    color: #dc2626;
}

.market-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f8fafc;
}

.market-item:last-child {
    border-bottom: none;
}

.market-name {
    font-weight: 500;
    color: #374151;
    font-size: 15px;
}

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

.market-price {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    font-family: 'JetBrains Mono', monospace;
}

.market-change {
    font-size: 13px;
    margin-top: 4px;
    font-weight: 500;
}

.positive { 
    color: #059669;
}

.negative { 
    color: #dc2626;
}

/* 实时指示器 */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #059669;
    font-weight: 500;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #059669;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

/* 数据表格样式 */
.data-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.summary-item {
    text-align: center;
}

.summary-value {
    font-size: 24px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 4px;
}

.summary-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 历史数据区块样式 */
.data-section {
    margin: 40px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.section-header p {
    font-size: 16px;
    color: #64748b;
}

.historical-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.data-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

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

.data-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.data-table-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-coverage {
    font-size: 12px;
    color: #059669;
    background: #dcfce7;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    font-size: 13px;
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    font-size: 14px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: #f8fafc;
}

.data-count {
    font-weight: 600;
    color: #1e40af;
}

.data-options {
    font-size: 12px;
    color: #059669;
    background: #f0fdf4;
    padding: 2px 6px;
    border-radius: 4px;
}

.data-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #64748b;
}

.download-section {
    margin-top: 20px;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.download-btn {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

/* 特色功能区 */
.feature-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 0;
}

.feature-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.feature-card:hover {
    background: #ffffff;
    border-color: #1e40af;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.1);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 16px;
    display: block;
}

.feature-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 14px;
}

.btn-primary {
    background: #1e40af;
    color: white;
}

.btn-primary:hover {
    background: #1e3a8a;
}

.btn-secondary {
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Footer样式 */
.footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #f1f5f9;
}

.footer-column h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 8px;
}

.footer-column ul li a {
    font-size: 14px;
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-column ul li a:hover {
    color: #1e40af;
}

.footer-bottom {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-bottom a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-bottom a:hover {
    color: #1e40af;
}

/* ===========================================
   页面标题样式 (实时行情、历史行情页面)
   =========================================== */
.page-header {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-subtitle {
    font-size: 16px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-range-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #7c3aed;
    font-weight: 600;
    background: #ede9fe;
    padding: 4px 8px;
    border-radius: 12px;
}

/* ===========================================
   主内容区域布局
   =========================================== */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

.stock-main-content {
    /* 股票详情页面的主内容区域 */
}

.main-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    min-height: 70vh;
}

/* ===========================================
   左侧地区导航样式
   =========================================== */
.region-sidebar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.region-list {
    list-style: none;
}

.region-item {
    margin-bottom: 8px;
}

.region-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #374151;
}

.region-header:hover {
    background: #f1f5f9;
    border-color: #1e40af;
}

.region-header.active {
    background: #1e40af;
    color: white;
    border-color: #1e40af;
}

.expand-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.expand-icon.expanded {
    transform: rotate(180deg);
}

.country-list {
    display: none;
    padding: 8px 0 0 0;
    animation: slideDown 0.3s ease;
}

.country-list.show {
    display: block;
}

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

.country-item {
    padding: 8px 24px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin: 2px 0;
    font-size: 14px;
}

.country-item:hover {
    background: #f1f5f9;
    color: #1e40af;
}

.country-item.active {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 500;
}

/* ===========================================
   数据内容区域样式
   =========================================== */
.data-content {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 数据类型导航 */
.data-nav {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0;
}

.data-nav-item {
    flex: 1;
    padding: 16px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #64748b;
    border-right: 1px solid #e2e8f0;
    font-size: 14px;
}

.data-nav-item:last-child {
    border-right: none;
}

.data-nav-item:hover {
    background: #f1f5f9;
    color: #1e40af;
}

.data-nav-item.active {
    background: #1e40af;
    color: white;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.current-selection {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.result-count {
    font-size: 14px;
    color: #64748b;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.refresh-btn, .export-btn {
    padding: 8px 16px;
    background: #1e40af;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: #1e3a8a;
}

.export-btn {
    background: #059669;
}

.export-btn:hover {
    background: #047857;
}

/* ===========================================
   数据表格通用样式
   =========================================== */
.data-table-container {
    max-height: 115vh;
    overflow: auto;
}

.stock-name {
    font-weight: 500;
    color: #1e293b;
}

.stock-code {
    font-family: 'JetBrains Mono', monospace;
    color: #64748b;
    font-size: 12px;
}

.price, .price-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #1e293b;
}

.change-positive {
    color: #059669;
    font-weight: 500;
}

.change-negative {
    color: #dc2626;
    font-weight: 500;
}

.change-neutral {
    color: #64748b;
}

.volume, .volume-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #64748b;
}

.market-cap {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #7c3aed;
}

.time-info {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #64748b;
}

.action-links {
    display: flex;
    gap: 8px;
}

.action-link {
    padding: 4px 8px;
    background: #f1f5f9;
    color: #1e40af;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.action-link:hover {
    background: #1e40af;
    color: white;
}

.download-link {
    background: #059669;
    color: white;
}

.download-link:hover {
    background: #047857;
}

.favorite-btn {
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.favorite-btn:hover {
    color: #fbbf24;
}

.favorite-btn.active {
    color: #f59e0b;
}

.last-update {
    font-size: 11px;
    color: #9ca3af;
}

/* ===========================================
   历史数据表格特殊样式
   =========================================== */
.price-date {
    font-size: 9px;
    color: #9ca3af;
    display: block;
    margin-top: 2px;
}

.high-value {
    color: #059669;
}

.low-value {
    color: #dc2626;
}

.kline-types {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kline-tag {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 500;
}

/* ===========================================
   股票详情页样式
   =========================================== */
.stock-header {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.stock-basic-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.stock-name-code {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.current-price {
    font-size: 20px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #1e293b;
}

.price-change {
    display: flex;
    align-items: center;
    gap: 8px;
}

.change-amount {
    font-size: 16px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.change-percent {
    font-size: 16px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* 数据和图表区域 */
.data-chart-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.historical-overview {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 展开切换按钮 */
.section-header-with-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.expand-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.expand-toggle:hover {
    background: #e2e8f0;
    color: #1e40af;
    border-color: #1e40af;
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 10px;
}

.expand-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.expand-toggle.expanded .toggle-text::before {
    content: "收起";
}

.expand-toggle.expanded .toggle-text {
    color: transparent;
}

.expand-toggle.expanded .toggle-text::before {
    color: #64748b;
}

/* 可展开项动画 */
.expandable-item {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.expandable-item.show {
    opacity: 1;
    transform: translateY(0);
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.data-item {
    padding: 16px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.data-label {
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 12px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.data-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.stat-box {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    background: #f8fafc;
}

.stat-title {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #1e293b;
    margin-bottom: 2px;
}

.stat-date {
    font-size: 10px;
    color: #9ca3af;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, #d1d5db 20%, #d1d5db 80%, transparent);
    flex-shrink: 0;
}

/* 特殊样式 */
.high-stat .stat-value {
    color: #059669;
}

.low-stat .stat-value {
    color: #dc2626;
}

.gain-stat .stat-value {
    color: #059669;
}

.loss-stat .stat-value {
    color: #dc2626;
}

.gain-stat {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.loss-stat {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.high-stat {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.low-stat {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

/* 图表区域 */
.chart-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 308px;
}

.chart-placeholder {
    width: 100%;
    height: 226px;
    background: #f8fafc;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 14px;
}

/* 历史数据详情区域 */
.historical-data-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.data-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab-item {
    flex: 1;
    padding: 16px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #64748b;
    border-right: 1px solid #e2e8f0;
    font-size: 14px;
    text-decoration: none;
}

.tab-item:last-child {
    border-right: none;
}

.tab-item:hover {
    background: #f1f5f9;
    color: #1e40af;
}

.tab-item.active {
    background: #1e40af;
    color: white;
}

.tab-content {
    padding: 24px;
}

/* 日期选择器 */
.date-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

/* K线数据表格 */
.kline-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.kline-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.kline-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    color: #374151;
    font-family: 'JetBrains Mono', monospace;
}

.kline-table tr:hover {
    background: #f8fafc;
}

/* API 调用示例 */
.api-examples {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.api-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.api-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    margin-bottom: 12px;
    overflow-x: auto;
}

.api-description {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

/* 相关研究 */
.research-list {
    list-style: none;
}

.research-item {
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}

.research-item:last-child {
    border-bottom: none;
}

.research-link {
    color: #1e40af;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.5;
}

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

.research-date {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* 数据统计 */
.data-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.data-value.positive {
    color: #059669;
}

.data-value.negative {
    color: #dc2626;
}

/* 右侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.related-stocks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.stock-item:hover {
    background: #f1f5f9;
    border-color: #1e40af;
}

.stock-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

.stock-item-code {
    font-size: 12px;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
}

.stock-item-change {
    font-size: 12px;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

/* 资讯列表 */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-title {
    font-size: 14px;
    color: #1e40af;
    text-decoration: none;
    line-height: 1.4;
    font-weight: 500;
}

.news-title:hover {
    text-decoration: underline;
}

.news-date {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* ===========================================
   响应式设计
   =========================================== */
@media (max-width: 1400px) {
    .nav { display: none; }
}

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        grid-template-columns: 250px 1fr;
    }
    
    .sidebar {
        order: -1;
        flex-direction: row;
        gap: 16px;
    }
    
    .sidebar-card {
        flex: 1;
    }
    
    .historical-data-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .region-sidebar {
        order: 2;
    }
    
    .data-content {
        order: 1;
    }
    
    .data-chart-section {
        grid-template-columns: 1fr;
    }
    
    .stock-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .last-update {
        margin-left: 0;
    }
    
    .data-tabs {
        flex-wrap: wrap;
    }
    
    .tab-item {
        flex: auto;
        min-width: 120px;
    }
    
    .data-nav {
        flex-wrap: wrap;
    }
    
    .data-nav-item {
        flex: auto;
        min-width: 120px;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .search-input {
        width: 100%;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .markets-overview {
        grid-template-columns: 1fr;
    }
    
    .feature-highlights {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .data-table-card {
        padding: 16px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .data-table-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .stock-basic-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .price-info {
        flex-wrap: wrap;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .data-item {
        padding: 16px;
    }
    
    .data-stats-row {
        gap: 16px;
    }
    
    .chart-container {
        height: auto;
    }
    
    .chart-placeholder {
        height: 240px;
    }
    
    .sidebar {
        flex-direction: column;
    }
    
    .action-links {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .footer-links {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 4px;
    }
}

/* 自定义滚动条 */
.data-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.data-table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.data-table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.data-table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}