/* 组件样式 */

/* 搜索结果样式 */
.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-result-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-result-item h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.search-result-item .category {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.search-result-item .description {
    color: #34495e;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.search-result-item .current-price {
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.search-result-item .price-change {
    font-size: 0.9rem;
    font-weight: 500;
}

/* 材料详情样式 */
.material-detail {
    padding: 1rem;
}

.basic-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.price-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.current-price-large {
    font-size: 2rem;
    font-weight: bold;
    color: #e74c3c;
}

.price-change {
    font-size: 1.1rem;
    font-weight: 500;
}

.category-info,
.market-info,
.unit-info {
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.description {
    margin-bottom: 2rem;
}

.description h4,
.specifications h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.description p {
    line-height: 1.6;
    color: #34495e;
}

.specifications ul {
    list-style: none;
    padding: 0;
}

.specifications li {
    background: #f8f9fa;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid #3498db;
    border-radius: 0 4px 4px 0;
}

.actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* 按钮样式 */
.btn-primary,
.btn-secondary {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

/* 通知样式 */
.notification {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.notification-success {
    background-color: #27ae60 !important;
}

.notification-error {
    background-color: #e74c3c !important;
}

.notification-warning {
    background-color: #f39c12 !important;
}

.notification-info {
    background-color: #3498db !important;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* 数据表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* 分页组件 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: #f8f9fa;
}

.pagination button.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination button:disabled {
    background: #f8f9fa;
    color: #ccc;
    cursor: not-allowed;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #e9ecef;
    color: #495057;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag-primary {
    background: #3498db;
    color: white;
}

.tag-success {
    background: #27ae60;
    color: white;
}

.tag-warning {
    background: #f39c12;
    color: white;
}

.tag-danger {
    background: #e74c3c;
    color: white;
}

/* 进度条样式 */
.progress {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background: #3498db;
    transition: width 0.3s ease;
}

.progress-bar-success {
    background: #27ae60;
}

.progress-bar-warning {
    background: #f39c12;
}

.progress-bar-danger {
    background: #e74c3c;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    font-size: 0.9rem;
}

.breadcrumb-item {
    color: #7f8c8d;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: #bdc3c7;
}

.breadcrumb-item:last-child {
    color: #2c3e50;
    font-weight: 500;
}

.breadcrumb-item a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #2980b9;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-primary {
    background: #3498db;
    color: white;
}

.badge-success {
    background: #27ae60;
    color: white;
}

.badge-warning {
    background: #f39c12;
    color: white;
}

.badge-danger {
    background: #e74c3c;
    color: white;
}

/* 卡片样式增强 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.card-body {
    color: #34495e;
    line-height: 1.6;
}

.card-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* 材料页面样式 */
.material-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
}

.material-hero-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: center;
}

.material-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.material-meta {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.price-display {
    text-align: right;
}

.current-price-large {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.price-change .change-value {
    font-size: 1.2rem;
    font-weight: 500;
}

.update-time {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

.material-info-section {
    padding: 3rem 0;
    background: white;
}

.material-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-card {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.info-card h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: 600;
    color: #495057;
}

.chart-section {
    padding: 3rem 0;
    background: #f8f9fa;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    height: 500px;
}

.data-quality-info {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 1rem;
}

.quality-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quality-label {
    font-weight: 600;
    color: #495057;
}

.quality-value {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.quality-value.quality-high {
    background: #d4edda;
    color: #155724;
}

.quality-value.quality-medium {
    background: #fff3cd;
    color: #856404;
}

.quality-value.quality-low {
    background: #f8d7da;
    color: #721c24;
}

.statistics-section {
    padding: 3rem 0;
    background: white;
}

.statistics-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: #2c3e50;
}

.additional-stats {
    margin-top: 3rem;
}

.additional-stats h3 {
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.stat-detail-card {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
}

.stat-detail-card h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.stat-detail-card .stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 1rem;
}

.stat-detail-card p {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

.related-section {
    padding: 3rem 0;
    background: #f8f9fa;
}

.related-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: #2c3e50;
}

.related-materials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.related-material-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.related-material-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.related-material-card h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.related-material-card .price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.related-material-card .change {
    font-size: 0.9rem;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
}

.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f8f9fa;
}

.error-content {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.error-content h1 {
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error-content p {
    color: #6c757d;
    margin-bottom: 2rem;
}