/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #E60012 0%, #FF4458 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(230, 0, 18, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.update-time {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* 加载指示器 */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    margin-top: 10px;
    background-color: #fff8f8;
    border-radius: 8px;
    border: 1px solid #ffebee;
    transition: opacity 0.3s ease;
}

.loading-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #E60012;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 表格样式 */
.etf-table-container {
    overflow-x: auto;
}

.etf-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.etf-table th,
.etf-table td {
    padding: 18px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
}

.etf-table th:last-child,
.etf-table td:last-child {
    border-right: none;
}

.etf-table th {
    background: linear-gradient(135deg, #E60012 0%, #FF4458 100%);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.etf-table tbody tr {
    transition: all 0.3s ease;
    position: relative;
}

.etf-table tbody tr:hover {
    background-color: #fff8f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.1);
}

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

/* ETF名称样式 */
.etf-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: #E60012;
}

/* 时间样式 */
.settlement-time {
    color: #666;
    font-size: 0.95rem;
}

/* 行情价格样式 */
.price {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

/* 年化收益率样式 */
.yield {
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
}

.yield.high {
    color: #E60012;
}

.yield.medium {
    color: #FF6B35;
}

/* 涨跌样式 */
.change {
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
}

.change.positive {
    color: #E60012; /* 红色表示上涨 */
}

.change.negative {
    color: #00AA00; /* 绿色表示下跌 */
}

.change.neutral {
    color: #666; /* 灰色表示持平 */
}

/* 底部样式 */
.footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .etf-table th,
    .etf-table td {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    
    .etf-name {
        font-size: 1rem;
    }
    
    .price {
        font-size: 1rem;
    }
    
    .yield {
        font-size: 1rem;
    }
    
    .change {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .etf-table th,
    .etf-table td {
        padding: 8px 5px;
        font-size: 0.8rem;
    }
    
    .etf-name {
        font-size: 0.9rem;
    }
    
    .price {
        font-size: 0.9rem;
    }
    
    .yield {
        font-size: 0.9rem;
    }
    
    .change {
        font-size: 0.9rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.etf-table tbody tr {
    animation: fadeIn 0.5s ease forwards;
}

/* 数据更新动画 */
.data-updated {
    animation: pulse 0.6s ease;
}

@keyframes pulse {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: #ffebee;
    }
    100% {
        background-color: transparent;
    }
}