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

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

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

/* 头部样式 */
header {
    text-align: center;
    margin: 30px 0;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

header h1 {
    font-size: 28px;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-weight: 600;
}

header p {
    font-size: 14px;
    color: #666;
}

/* 搜索区域样式 */
.search-section {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

#itemSearch {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

#itemSearch:focus {
    border-color: #666;
}

#searchBtn {
    padding: 10px 25px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

#searchBtn:hover {
    background: #34495e;
}

#searchBtn:active {
    background: #1a252f;
}

/* 结果卡片样式 */
.results-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.price-data-card, .prediction-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
}

.price-data-card h2, .prediction-card h2 {
    color: #1a1a1a;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

/* 价格信息样式 */
.price-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.current-price, .price-change {
    text-align: center;
    padding: 15px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 3px;
    flex: 1;
}

.current-price {
    margin-right: 10px;
}

.label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.price {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.change {
    font-size: 16px;
    font-weight: 600;
}

.change.positive {
    color: #16a34a;
}

.change.negative {
    color: #dc2626;
}

/* 预测按钮样式 */
.predict-button {
    width: 100%;
    padding: 12px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 15px;
}

.predict-button:hover {
    background: #34495e;
}

.predict-button:active {
    background: #1a252f;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 30px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #2c3e50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.loading p {
    font-size: 14px;
    color: #666;
}

/* 预测结果样式 */
.prediction-result {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 3px;
    padding: 15px;
    margin-top: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    font-size: 14px;
}

/* 热门饰品网格 */
.recommendations {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
}

.recommendations h2 {
    color: #1a1a1a;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

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

.item-card {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 3px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.item-card:hover {
    background: #f0f0f0;
    border-color: #d0d0d0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .results-section {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    #searchBtn {
        width: 100%;
    }
    
    .price-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .current-price {
        margin-right: 0;
    }
    
    header h1 {
        font-size: 24px;
    }
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px 0;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 13px;
}

footer p {
    margin-bottom: 5px;
}

/* 价格图表样式 */
.price-chart {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.price-trend, .platform-prices {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 3px;
    padding: 15px;
}

.price-trend h4, .platform-prices h4 {
    margin-bottom: 10px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
}

.trend-item, .platform-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

.trend-item:last-child, .platform-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.positive {
    color: #16a34a;
}

.negative {
    color: #dc2626;
}

/* 饰品选择器样式 */
.item-selector {
    max-width: 600px;
    margin: 20px auto 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.item-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

#itemDropdown {
    width: 70%;
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    font-size: 14px;
    background: white;
    margin-right: 10px;
    outline: none;
}

#itemDropdown:focus {
    border-color: #666;
}

#selectItemBtn {
    width: 25%;
    padding: 8px 15px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

#selectItemBtn:hover {
    background: #34495e;
}

#selectItemBtn:active {
    background: #1a252f;
}

#selectItemBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 多普勒选择器样式 */
.doppler-selector {
    margin-top: 15px;
    padding: 12px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.doppler-selector label {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

#dopplerStyleDropdown {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    background: white;
    outline: none;
    font-size: 14px;
}

#dopplerStyleDropdown:focus {
    border-color: #666;
}

/* 额外的细节调整 */
select {
    cursor: pointer;
}

input[type="text"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* 按钮禁用状态 */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 链接样式 */
a {
    color: #2c3e50;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 表格样式（如果需要） */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

th {
    background: #fafafa;
    font-weight: 600;
    color: #1a1a1a;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* 移动端优化 */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    header {
        margin: 20px 0;
        padding: 15px 0;
    }
    
    .price-data-card, .prediction-card, .recommendations {
        padding: 15px;
    }
    
    .item-grid {
        grid-template-columns: 1fr;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
    }
    
    header, footer {
        display: none;
    }
    
    .search-section {
        display: none;
    }
    
    .price-data-card, .prediction-card {
        border: 1px solid #000;
        break-inside: avoid;
    }
}

/* 新增：销售图表容器样式 */
.sales-chart {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0; /* 和其他图表保持风格一致 */
}

/* 新增：挂刀行情卡片样式 */
.exchange-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
}

.exchange-section h2 {
    color: #1a1a1a;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.exchange-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.exchange-controls label {
    font-size: 14px;
}

.exchange-controls select {
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    font-size: 14px;
}

.exchange-controls button {
    padding: 8px 20px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.exchange-controls button:hover {
    background: #34495e;
}

.exchange-result-card {
    margin-top: 15px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.platform-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.platform-selector label {
    font-size: 13px;
    color: #666;
}

#salesPlatformSelector {
    padding: 4px 8px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    font-size: 13px;
    background: #fff;
}

/* ========== 挂刀行情样式 ========== */

.exchange-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
}

.exchange-section h2 {
    color: #1a1a1a;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

/* 筛选器样式 */
.exchange-filters {
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}

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

.filter-group label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
}

.filter-group select,
.filter-group input[type="number"],
.filter-group input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    font-size: 14px;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
    min-width: 120px;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: #666;
}

.filter-group span {
    color: #666;
    margin: 0 5px;
}

.exchange-button {
    padding: 10px 20px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
}

.exchange-button:hover {
    background: #34495e;
}

.exchange-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 结果展示样式 */
.exchange-results {
    margin-top: 25px;
}

.exchange-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.exchange-header h3 {
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 600;
}

.pagination-info {
    color: #666;
    font-size: 13px;
}

/* 表格容器 */
.exchange-table-container {
    overflow-x: auto;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.exchange-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 1000px;
}

.exchange-table th {
    background: #f8f9fa;
    color: #1a1a1a;
    font-weight: 600;
    padding: 12px 10px;
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.exchange-table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.exchange-table tbody tr:hover {
    background: #f8f9fa;
}

/* 饰品信息样式 */
.item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    min-width: 200px;
}

.item-image {
    width: 40px;
    height: 30px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
}

.item-name {
    font-weight: 500;
    color: #1a1a1a;
    font-size: 12px;
    line-height: 1.3;
}

.market-name {
    color: #666;
    font-size: 11px;
    margin-top: 2px;
}

/* 利润显示样式 */
.profit {
    font-weight: 600;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 3px;
}

.profit-positive {
    color: #16a34a;
    background: #f0f9f4;
}

.profit-negative {
    color: #dc2626;
    background: #fef2f2;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
}

.page-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

.page-btn:disabled {
    background: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.6;
}

#currentPageInfo {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* 响应式设计 - 挂刀行情 */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        min-width: 100%;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100%;
    }
    
    .exchange-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .exchange-table-container {
        font-size: 11px;
    }
    
    .item-info {
        min-width: 150px;
    }
    
    .item-name {
        font-size: 11px;
    }
    
    .market-name {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .exchange-section {
        padding: 15px;
    }
    
    .filter-group {
        margin-bottom: 10px;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .page-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}