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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

/* 顶部导航 */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 2rem;
    color: #64b5f6;
}

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

.login-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* 搜索区域 */
.search-section {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e0e6ed;
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-box i {
    color: #64b5f6;
    margin: 0 12px;
    font-size: 1.2rem;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 8px;
    font-size: 1rem;
    background: transparent;
}

.advanced-btn {
    background: #64b5f6;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.advanced-btn:hover {
    background: #42a5f5;
}

/* 分类筛选 */
.category-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.category-btn {
    background: #f8f9fa;
    border: 1px solid #e0e6ed;
    color: #666;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background: #e3f2fd;
    border-color: #64b5f6;
}

.category-btn.active {
    background: #1e3c72;
    color: white;
    border-color: #1e3c72;
}

/* 高级搜索面板 */
.advanced-search-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.advanced-search-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.advanced-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e6ed;
}

.advanced-search-body {
    padding: 1.5rem;
    display: grid;
    gap: 1.5rem;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    font-size: 1rem;
}

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

.price-range input {
    flex: 1;
}

.advanced-search-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e6ed;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.reset-btn, .apply-btn {
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.reset-btn {
    background: #f8f9fa;
    border: 1px solid #e0e6ed;
    color: #666;
}

.apply-btn {
    background: #1e3c72;
    border: 1px solid #1e3c72;
    color: white;
}

/* 结果区域 */
.results-section {
    background: white;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e0e6ed;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h2 {
    color: #1e3c72;
    font-size: 1.5rem;
}

.results-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#resultsCount {
    color: #666;
    font-size: 0.9rem;
}

.sort-options select {
    padding: 8px 12px;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

/* 产品网格 */
.products-section {
    padding: 2rem 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 产品卡片 */
.product-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e0e6ed;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.product-category {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-details {
    margin-bottom: 1rem;
}

.product-detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

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

.product-detail-value {
    color: #333;
    font-weight: 600;
}

.product-pricing {
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.price-label {
    color: #666;
    font-size: 0.9rem;
}

.price-value {
    font-weight: 600;
    font-size: 1rem;
}

.standard-price {
    color: #666;
}

.min-price {
    color: #e53e3e;
    font-size: 1.1rem;
}

.discount-policy {
    color: #38a169;
    font-size: 0.85rem;
    text-align: right;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 2rem;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #e0e6ed;
    background: white;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: #f8f9fa;
}

.pagination button.active {
    background: #1e3c72;
    color: white;
    border-color: #1e3c72;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-body {
    padding: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

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

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

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    font-size: 1rem;
}

.login-submit-btn {
    width: 100%;
    background: #1e3c72;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-submit-btn:hover {
    background: #2a5298;
}

/* 管理面板 */
.admin-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 999;
    min-width: 250px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e0e6ed;
}

.admin-content {
    padding: 1rem;
}

.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.admin-btn:hover {
    background: #e3f2fd;
    border-color: #64b5f6;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1e3c72;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-box {
        flex-direction: column;
        gap: 8px;
    }
    
    .advanced-btn {
        width: 100%;
        justify-content: center;
    }
    
    .category-filters {
        justify-content: center;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-panel {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        border-radius: 0;
    }
}

/* 多选下拉框样式 */
select[multiple] {
    height: 120px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

/* 产品详情样式 */
.product-detail-full {
    max-width: 100%;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h4 {
    color: #1e3c72;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e3f2fd;
    font-size: 1.1rem;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.detail-item span {
    color: #333;
    font-size: 1rem;
}

.pricing-detail {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e6ed;
}

.price-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.price-large {
    font-size: 1.3rem;
    font-weight: 700;
}

.discount-text {
    color: #38a169;
    font-weight: 600;
}

/* 高亮搜索结果 */
.highlight {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
}