/**
 * 钢材报价系统 - 前端样式
 * 响应式设计，移动优先
 */

/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

a {
    color: #1890ff;
    text-decoration: none;
}

a:hover {
    color: #40a9ff;
}

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

/* ========== 头部 ========== */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
}

.admin-link {
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
}

.admin-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* ========== 主内容 ========== */
.main {
    padding: 20px 0 40px;
}

/* ========== 筛选区 ========== */
.filter-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-item {
    flex: 1;
    min-width: 140px;
}

.filter-item label {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 5px;
}

.filter-item select,
.filter-item input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 0.9375rem;
    background: #fff;
    transition: border-color 0.2s;
}

.filter-item select:focus,
.filter-item input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

.keyword-item {
    flex: 2;
    min-width: 200px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

.btn-primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
    color: #fff;
}

.btn-default {
    background: #fff;
    color: #333;
    border-color: #d9d9d9;
}

.btn-default:hover {
    color: #1890ff;
    border-color: #1890ff;
}

/* ========== 提示 ========== */
.notice {
    background: #fff7e6;
    border: 1px solid #ffd591;
    color: #d46b08;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.9375rem;
}

/* ========== 价格区域 ========== */
.price-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.section-header h2 {
    font-size: 1.125rem;
    color: #333;
}

.total {
    font-size: 0.875rem;
    color: #999;
}

/* ========== 移动端卡片 ========== */
.price-list-mobile {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-card {
    background: #fafafa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e8e8e8;
    transition: box-shadow 0.2s;
}

.price-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.card-header {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.brand-tag,
.type-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 3px;
}

.brand-tag {
    background: #e6f7ff;
    color: #1890ff;
}

.type-tag {
    background: #f6ffed;
    color: #52c41a;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.info-row {
    font-size: 0.875rem;
}

.info-row .label {
    color: #999;
}

.info-row .value {
    color: #333;
}

.card-footer {
    padding-top: 12px;
    border-top: 1px dashed #e8e8e8;
}

.card-footer .price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.card-footer .amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f5222d;
}

.card-footer .unit {
    font-size: 0.875rem;
    color: #999;
}

/* ========== PC端表格 ========== */
.price-table-wrapper {
    display: none;
    overflow-x: auto;
}

.price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

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

.price-table th {
    background: #fafafa;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.price-table tr:hover {
    background: #fafafa;
}

.price-table .product-name {
    font-weight: 500;
}

.price-table .price-cell .amount {
    color: #f5222d;
    font-weight: 600;
}

.price-table .price-cell .unit {
    color: #999;
    font-size: 0.875rem;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    font-size: 0.875rem;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    color: #333;
}

.pagination a:hover {
    color: #1890ff;
    border-color: #1890ff;
}

.pagination .current {
    background: #1890ff;
    color: #fff;
    border-color: #1890ff;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    font-size: 1.125rem;
    margin-bottom: 10px;
}

.empty-state .tip {
    font-size: 0.875rem;
}

/* ========== 联系方式 ========== */
.contact-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.contact-section h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.contact-section p {
    font-size: 0.9375rem;
    color: #666;
    margin-bottom: 5px;
}

.contact-section a {
    color: #1890ff;
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 0.875rem;
    border-top: 1px solid #e8e8e8;
    background: #fff;
}

/* ========== 响应式 - PC端 ========== */
@media (min-width: 768px) {
    .price-list-mobile {
        display: none;
    }
    
    .price-table-wrapper {
        display: block;
    }
    
    .filter-item {
        min-width: 160px;
    }
    
    .header {
        padding: 20px 0;
    }
    
    .logo {
        font-size: 1.5rem;
    }
}

/* ========== 响应式 - 小屏幕 ========== */
@media (max-width: 480px) {
    .filter-item {
        min-width: 100%;
    }
    
    .filter-actions {
        width: 100%;
    }
    
    .filter-actions .btn {
        flex: 1;
    }
    
    .card-body {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
