@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0078ff;
    --primary-light: #e6f0ff;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --text-dark: #2d3748;
    --text-medium: #4a5568;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --card-bg: rgba(255, 255, 255, 0.95);
    --background-light: #f8fafc;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --transition-speed: 0.2s;
}

/* 表格设计增强 */
.table-container {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 0 0 20px 0;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.table-title {
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 12px 15px;
    font-weight: 600;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.table-container .table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0;
}

.table-container th {
    background-color: white;
    padding: 12px 15px;
    text-align: center;
    font-weight: 600;
    color: var(--text-medium);
    border-bottom: 2px solid #dee2e6;
    position: relative;
}

.table-container td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    text-align: center;
    transition: background-color 0.2s;
}

.table-container tr:hover td {
    background-color: var(--primary-light);
}

/* 表格中的颜色标记 */
.near-term {
    color: var(--danger-color);
    font-weight: 600;
}

.long-term {
    color: var(--success-color);
    font-weight: 600;
}

/* 股票卡片设计 */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 5px;
}

.stock-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    width: 95%;
}

.stock-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.stock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #4cc9f0);
}

.stock-info {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* 统计徽章和信息标签 */
.news-count {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.trade-news {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
}

.positive-news {
    background-color: rgba(25, 135, 84, 0.15);
    color: #198754;
    border: 1px solid rgba(25, 135, 84, 0.3);
}

.negative-news {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* 视图切换按钮 */
.view-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
    gap: 10px;
}

.view-btn {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover, .view-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 120, 255, 0.3);
}

/* 日期筛选容器 */
.date-filter-container {
    background-color: white;
    border-radius: 20px;
    padding: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 280px;
}

.date-filter-container .form-select {
    border-radius: 16px;
    border: 1px solid #e0e0e0;
    padding: 10px 15px;
    font-size: 0.9rem;
    color: var(--text-medium);
    background-position: right 0.75rem center;
    transition: all 0.2s ease;
}

.date-filter-container .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 120, 255, 0.25);
}

/* 内容卡片设计 */
.content-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #4cc9f0);
}

/* 加载中动画 */
.spinner-border {
    margin-top: 20px;
    width: 3rem;
    height: 3rem;
    color: var(--primary-color);
}

/* 预测卡片设计 */
.stock-prediction {
    margin-top: 1rem;
}

.prediction-card {
    border-radius: 8px;
    padding: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s ease;
}

.prediction-card.positive {
    background-color: rgba(25, 135, 84, 0.15);
    color: #198754;
    border: 1px solid rgba(25, 135, 84, 0.3);
}

.prediction-card.negative {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.prediction-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.prediction-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.prediction-title i {
    font-size: 1rem;
}

.prediction-value {
    font-size: 1.05rem;
    font-weight: 600;
}

.prediction-value strong {
    font-size: 1.2rem;
}

/* 响应式设计增强 */
@media (max-width: 992px) {
    .stock-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .table-container th, 
    .table-container td {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .stock-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .table-container th, 
    .table-container td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .news-count {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .content-card {
        padding: 1.25rem;
    }
}

@media (max-width: 576px) {
    .stock-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        margin: 0 -5px 15px -5px;
        border-radius: 8px;
    }
    
    .date-filter-container {
        max-width: 100%;
    }
    
    .prediction-title {
        font-size: 0.8rem;
    }
    
    .prediction-value {
        font-size: 0.95rem;
    }
    
    .prediction-value strong {
        font-size: 1.1rem;
    }
}

/* 新增漲跌榜卡片样式 */
.movers-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.movers-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.movers-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

.movers-title i {
    margin-right: 8px;
}

.movers-title.positive {
    color: var(--success-color);
}

.movers-title.negative {
    color: var(--danger-color);
}

.update-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.movers-list {
    padding: 0;
}

.mover-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
    cursor: pointer;
}

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

.mover-item:hover {
    background-color: var(--primary-light);
}

.mover-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    padding-right: 10px;
}

.mover-symbol {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 2px;
    text-align: left;
}

.mover-name {
    font-size: 0.85rem;
    color: var(--text-medium);
    text-align: left;
}

.mover-change {
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 4px;
    padding: 4px 8px;
}

.mover-change.positive {
    color: var(--success-color);
    background-color: rgba(25, 135, 84, 0.1);
}

.mover-change.negative {
    color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

/* 优化移动端显示 */
@media (max-width: 576px) {
    .stock-grid {
        grid-template-columns: 1fr;
    }
    
    .stock-card {
        padding: 1rem;
        margin-bottom: 15px;
    }
    
    .prediction-card {
        padding: 8px;
    }
    
    .prediction-title {
        font-size: 0.8rem;
    }
    
    .prediction-value {
        font-size: 0.9rem;
    }
    
    .stock-info {
        font-size: 1rem;
    }
    
    .mover-item {
        padding: 10px;
    }
    
    .mover-symbol {
        font-size: 0.9rem;
    }
    
    .mover-name {
        font-size: 0.75rem;
    }
    
    .mover-change {
        font-size: 0.9rem;
        padding: 3px 6px;
    }
    
    .movers-title {
        font-size: 1rem;
    }
    
    .date-filter-container {
        max-width: 100%;
    }
    
    .view-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .content-container {
        padding: 0 8px;
    }
}

@media (max-width: 768px) {
    .row.gy-3 {
        margin: 0;
    }
    
    .col-md-6 {
        padding: 0 8px;
    }
    
    .movers-card, .table-container {
        margin: 0 0 15px 0;
    }
}

/* 修复横向滚动问题 */
@media (max-width: 992px) {
    table {
        width: 100%;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .content-view {
        width: 100%;
        overflow-x: hidden;
    }
}

.change-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    text-align: center;
    min-width: 90px;
    width: 90px;
}

.change-pill.positive {
    background-color: rgba(25, 135, 84, 0.15);
    color: #198754;
    border: 1px solid rgba(25, 135, 84, 0.3);
}

.change-pill.positive .date-label {
    color: #198754;
}

.change-pill.negative {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.change-pill.negative .date-label {
    color: #dc3545;
}

.date-label {
    font-weight: 500;
    margin-bottom: 2px;
    font-size: 0.8rem;
}

.change-pills-container {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.text-success {
    color: #198754 !important;
}

.text-danger {
    color: #dc3545 !important;
} 