/* PC配件价格查看系统样式 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 标签页样式 */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 5px;
}

.tab-button {
    background: transparent;
    border: none;
    padding: 12px 24px;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 16px;
}

.tab-button:hover {
    background: rgba(255,255,255,0.2);
}

.tab-button.active {
    background: white;
    color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 内容区域 */
.tab-content {
    display: none;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-height: 600px;
}

.tab-content.active {
    display: block;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-card p {
    font-size: 2em;
    font-weight: bold;
}

/* 章节样式 */
.section {
    margin-bottom: 40px;
}

.section h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

/* 类型统计网格 */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.type-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #667eea;
}

.type-item .type-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.type-item .type-count {
    color: #666;
    font-size: 1.2em;
}

/* 价格统计 */
.price-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.price-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #FF9800;
}

.price-item h4 {
    margin-bottom: 10px;
    color: #333;
}

.price-range {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.price-avg {
    text-align: center;
    font-weight: bold;
    color: #FF9800;
    margin-top: 10px;
}

/* 热门产品 */
.hot-products {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.product-column h3 {
    margin-bottom: 15px;
    color: #333;
}

.product-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #2196F3;
}

.product-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.product-price {
    color: #E91E63;
    font-size: 1.1em;
    font-weight: bold;
}

/* 筛选器 */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: bold;
    color: #555;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

#search-btn, #history-search-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

#search-btn:hover, #history-search-btn:hover {
    background: #5a6fd8;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

tr:hover {
    background: #f5f5f5;
}

.price-cell {
    color: #E91E63;
    font-weight: bold;
}

.history-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.history-btn:hover {
    background: #1976D2;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.page-btn:hover {
    background: #f0f0f0;
}

.page-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 历史搜索 */
.history-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

#history-search {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

/* 图表容器 */
#history-chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

#history-chart {
    max-height: 400px;
}

#history-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .hot-products {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px;
    }
}

/* ============= 装机页面样式 ============= */

/* 装机页面头部 */
.builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

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

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5a6fd8;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#build-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

/* 装机容器 */
.build-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    min-height: 600px;
}

/* 组件选择区域 */
.component-selection {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.component-category {
    background: white;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.component-category.selected {
    border-color: #667eea;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
}

.component-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 6px 6px 0 0;
}

.component-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.component-price {
    font-weight: bold;
    color: #E91E63;
}

.component-content {
    padding: 15px 20px;
}

.selected-component {
    margin-bottom: 10px;
    min-height: 20px;
}

.no-selection {
    color: #999;
    font-style: italic;
}

.selected-item {
    color: #333;
    font-weight: 500;
}

.select-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.select-btn:hover {
    background: #5a6fd8;
}

/* 配置总览 */
.build-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    height: fit-content;
}

.build-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.total-price h4 {
    margin-bottom: 10px;
    color: #333;
}

.price-display {
    font-size: 2em;
    font-weight: bold;
    color: #E91E63;
    margin-bottom: 15px;
}

.component-count {
    color: #666;
    font-size: 14px;
}

.compatibility-check {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.compatibility-check h4 {
    margin-bottom: 10px;
    color: #333;
}

.compatibility-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.compatibility-item.ok .icon {
    color: #28a745;
}

.compatibility-item.warning .icon {
    color: #ffc107;
}

.compatibility-item.error .icon {
    color: #dc3545;
}

.build-actions-bottom {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.build-actions-bottom .btn {
    flex: 1;
}

.saved-builds {
    background: white;
    padding: 15px;
    border-radius: 8px;
}

.saved-builds h4 {
    margin-bottom: 10px;
    color: #333;
}

.no-builds {
    color: #999;
    font-style: italic;
    margin: 0;
}

.saved-build-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.saved-build-name {
    font-weight: 500;
    color: #333;
}

.saved-build-price {
    color: #E91E63;
    font-weight: bold;
}

.saved-build-actions {
    display: flex;
    gap: 5px;
}

.saved-build-actions button {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.load-btn {
    background: #667eea;
    color: white;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.modal-filters {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

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

.modal-search {
    flex: 1;
}

.modal-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.component-list {
    max-height: 400px;
    overflow-y: auto;
}

.component-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.component-list-item:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.component-info {
    flex: 1;
}

.component-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.component-price-modal {
    color: #E91E63;
    font-weight: bold;
    font-size: 18px;
}

.select-component-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.select-component-btn:hover {
    background: #5a6fd8;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 响应式 - 装机页面 */
@media (max-width: 768px) {
    .build-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .builder-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .builder-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .component-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 95vh;
    }
    
    .modal-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .build-actions-bottom {
        flex-direction: column;
    }
}

/* AI分析样式 */
.ai-analysis-result {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.ai-analysis-result h5 {
    margin: 0 0 10px 0;
    color: #17a2b8;
    font-size: 16px;
}

#ai-analysis-content {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #17a2b8;
    line-height: 1.6;
    font-size: 14px;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ai-analysis-time {
    text-align: right;
    font-size: 12px;
    color: #6c757d;
    margin-top: 8px;
}

#ai-analysis-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

#ai-analysis-btn.loading {
    background: #17a2b8;
    opacity: 0.7;
}

#ai-analysis-btn.loading::after {
    content: " ⏳";
}

/* ============= 装机方案页面样式 ============= */

/* 方案页面头部 */
.builds-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

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

/* 方案筛选器 */
.builds-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* 方案统计信息 */
.builds-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-label {
    font-weight: 500;
    color: #666;
}

.stat-item span:last-child {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
}

/* 方案网格 */
.builds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* 方案卡片 */
.build-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.build-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.build-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 10px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.build-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.build-price {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}

.build-card-body {
    padding: 20px;
    flex: 1;
}

.build-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.build-dates {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.build-dates small {
    color: #999;
    font-size: 12px;
}

.build-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 0 20px 20px 20px;
}

.btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* 加载和错误状态 */
.loading-message, .error-message, .no-builds-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

.no-builds-message a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.no-builds-message a:hover {
    text-decoration: underline;
}

.error-message {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 20px 0;
}

/* 方案详情弹窗 */
.large-modal .modal-content {
    max-width: 900px;
}

.build-detail-info {
    margin-bottom: 30px;
}

.build-basic-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item strong {
    color: #555;
    font-size: 14px;
}

.info-item span {
    font-size: 16px;
    color: #333;
}

.price-highlight {
    color: #E91E63 !important;
    font-weight: bold !important;
    font-size: 18px !important;
}

.build-description {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.build-description strong {
    color: #555;
    display: block;
    margin-bottom: 8px;
}

.build-description p {
    margin: 0;
    line-height: 1.6;
    color: #666;
}

.build-components h4 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.components-detail-list {
    display: grid;
    gap: 15px;
}

.component-detail-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.component-type-badge {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.component-detail-item .component-info {
    flex: 1;
}

.component-detail-item .component-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.component-detail-item .component-price {
    color: #E91E63;
    font-weight: bold;
}

.no-components {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

.error-text {
    color: #dc3545;
    text-align: center;
    padding: 20px;
}

.build-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.build-actions .btn {
    min-width: 120px;
}

/* 分页信息 */
.pagination-info {
    text-align: center;
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

/* 响应式 - 方案页面 */
@media (max-width: 768px) {
    .builds-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .builds-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .builds-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .builds-stats {
        grid-template-columns: 1fr;
    }
    
    .builds-grid {
        grid-template-columns: 1fr;
    }
    
    .build-card-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .build-card-actions {
        justify-content: center;
    }
    
    .build-basic-info {
        grid-template-columns: 1fr;
    }
    
    .build-actions {
        flex-direction: column;
    }
    
    .build-actions .btn {
        width: 100%;
    }
    
    .component-detail-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .component-type-badge {
        align-self: center;
    }
}