/* 市场行情页面样式 */

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

/* 搜索工具栏 */
.market-toolbar {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box input {
    width: 100%;
    padding-right: 40px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.market-filters {
    display: flex;
    gap: 10px;
}

.form-select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

/* 价格卡片网格 */
.price-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.price-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.price-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.price-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.product-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    font-size: 24px;
    color: white;
}

.product-name h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.market-name {
    font-size: 12px;
    color: var(--text-secondary);
}

.price-card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 15px;
}

.current-price {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.price-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.price-unit {
    font-size: 12px;
    color: var(--text-secondary);
}

.price-change {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.price-change.positive {
    color: #e74c3c;
    background: #fee;
}

.price-change.negative {
    color: #27ae60;
    background: #e8f5e9;
}

.price-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.price-level {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.price-level.level-high {
    background: #fee;
    color: #e74c3c;
}

.price-level.level-normal {
    background: #e3f2fd;
    color: #2196f3;
}

.price-level.level-low {
    background: #e8f5e9;
    color: #27ae60;
}

.update-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 产品列表 */
.product-list {
    padding: 10px 0;
}

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

.product-item:hover {
    background: var(--hover-color);
}

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

.product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-icon-sm {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 20px;
    color: var(--primary-color);
}

.product-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.product-unit {
    font-size: 12px;
    color: var(--text-secondary);
}

.product-action {
    color: var(--text-tertiary);
}

/* 市场分析 */
.market-analysis {
    padding: 10px 0;
}

.analysis-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-radius: 12px;
    background: var(--bg-secondary);
    margin-bottom: 15px;
}

.analysis-item:last-child {
    margin-bottom: 0;
}

.analysis-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 24px;
}

.analysis-item:nth-child(1) .analysis-icon {
    background: #fee;
    color: #e74c3c;
}

.analysis-item:nth-child(2) .analysis-icon {
    background: #e8f5e9;
    color: #27ae60;
}

.analysis-item:nth-child(3) .analysis-icon {
    background: #e3f2fd;
    color: #2196f3;
}

.analysis-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.analysis-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 产品详情页 */
.product-detail-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-nav {
    margin-bottom: 20px;
}

/* 价格概览统计 */
.price-overview {
    padding: 30px;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

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

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

/* 价格趋势图 */
.price-chart {
    padding: 20px;
    min-height: 300px;
}

.simple-chart {
    width: 100%;
    height: 250px;
    position: relative;
}

.chart-line {
    display: flex;
    align-items: flex-end;
    height: 200px;
    gap: 2px;
    padding: 20px 0;
}

.chart-point {
    flex: 1;
    background: linear-gradient(to top, rgba(102, 126, 234, 0.3), rgba(102, 126, 234, 0.1));
    position: relative;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s;
    cursor: pointer;
}

.chart-point:hover {
    background: linear-gradient(to top, rgba(102, 126, 234, 0.5), rgba(102, 126, 234, 0.2));
}

.point-dot {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.point-dot.up {
    background: #e74c3c;
}

.point-dot.down {
    background: #27ae60;
}

.chart-axis {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* 趋势数据表格 */
.trend-table-container {
    overflow-x: auto;
}

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

.trend-table th,
.trend-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.trend-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 14px;
}

.trend-table td {
    font-size: 14px;
}

.trend-table tr:hover {
    background: var(--hover-color);
}

/* 数据来源提示 */
.data-source-note {
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    font-size: 13px;
    color: #856404;
    text-align: center;
}

.data-source-note i {
    margin-right: 8px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .market-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .market-filters {
        flex-direction: column;
    }

    .price-cards {
        grid-template-columns: 1fr;
    }

    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .stat-value {
        font-size: 24px;
    }

    .analysis-item {
        flex-direction: column;
    }
}
