/* 全局样式 */
* {
    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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* 头部样式 */
.header {
    max-width: 1400px;
    margin: 0 auto 20px;
    text-align: center;
    color: white;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

/* 主容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    min-height: calc(100vh - 140px);
}

/* 左侧表单区域 */
.form-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.form-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #667eea;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
}

.form-group label.required::before {
    content: '*';
    color: #e53e3e;
    margin-right: 4px;
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-row select,
.input-row input[type="number"],
.input-row input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.input-row select:focus,
.input-row input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-row .unit-select {
    width: 80px;
    flex: none;
}

.arrow-icon {
    color: #a0aec0;
    font-size: 20px;
}

/* 单选框组 */
.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.radio-item input[type="radio"] {
    cursor: pointer;
    accent-color: #667eea;
}

/* 尺寸输入 */
.size-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.size-inputs .input-with-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.size-inputs .input-with-label span {
    font-size: 14px;
    color: #718096;
    white-space: nowrap;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #718096;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f7fafc;
}

/* 右侧结果区域 */
.result-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
}

.result-title span {
    font-size: 14px;
    color: #a0aec0;
    font-weight: normal;
    margin-left: 8px;
}

/* 排序按钮 */
.sort-buttons {
    display: flex;
    gap: 8px;
    background: #f7fafc;
    padding: 4px;
    border-radius: 6px;
}

.sort-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: #718096;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.sort-btn.active {
    background: white;
    color: #667eea;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 提示文本 */
.notice-text {
    font-size: 13px;
    color: #a0aec0;
    margin-bottom: 16px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

/* 产品列表 */
.product-list {
    display: grid;
    gap: 16px;
}

/* 产品卡片 */
.product-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

/* 产品徽章 */
.product-badge {
    position: absolute;
    top: -8px;
    right: 16px;
    background: #e53e3e;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* 产品头部 */
.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.product-info {
    flex: 1;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 4px;
}

.product-code {
    font-size: 13px;
    color: #a0aec0;
}

/* 产品标签 */
.product-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

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

.tag-recommend {
    background: #48bb78;
    color: white;
}

.tag-type {
    background: #bee3f8;
    color: #2b6cb0;
}

.tag-feature {
    background: #e9d8fd;
    color: #6b46c1;
}

.tag-goods {
    background: #feebc8;
    color: #c05621;
}

/* 产品价格信息 */
.product-price-info {
    text-align: right;
}

.product-time {
    font-size: 14px;
    color: #718096;
    margin-bottom: 4px;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: #e53e3e;
}

.product-price span {
    font-size: 14px;
    font-weight: normal;
}

/* 价格明细小字 */
.price-detail-small {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
    text-align: right;
    line-height: 1.4;
}

/* 产品描述 */
.product-description {
    font-size: 13px;
    color: #718096;
    line-height: 1.6;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f7fafc;
}

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

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 16px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }

    .form-section {
        position: static;
    }
}

@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .form-section,
    .result-section {
        padding: 16px;
    }

    .size-inputs {
        grid-template-columns: 1fr;
    }

    .product-header {
        flex-direction: column;
    }

    .product-price-info {
        text-align: left;
        margin-top: 12px;
    }
}