﻿/* search.css - 物品检索页面样式 */

/* ===== 重置和基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* ===== 头部样式 ===== */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eaeaea;
}

.header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 700;
}

.header h1 i {
    color: #667eea;
    margin-right: 15px;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* ===== 搜索区域样式 ===== */
.search-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 40px;
    color: white;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-box button {
    padding: 15px 30px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-box button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== 筛选器样式 ===== */
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group select {
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    cursor: pointer;
}

.range-inputs {
    display: flex;
    gap: 10px;
}

.range-inputs input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.range-inputs input:focus {
    outline: none;
    background: white;
}

.filter-actions {
    margin-top: 20px;
    text-align: right;
}

.btn-outline {
    padding: 10px 20px;
    background: transparent;
    color: white;
    border: 2px solid white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-outline:hover {
    background: white;
    color: #764ba2;
}

/* ===== 结果区域样式 ===== */
.results-section {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.results-count {
    font-size: 18px;
    color: #666;
    font-weight: 500;
}

.sort-controls select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.sort-controls select:focus {
    outline: none;
    border-color: #667eea;
}

/* ===== 物品网格样式 ===== */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.item-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #eaeaea;
    cursor: pointer;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.item-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.rarity-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.rarity-common {
    background: #bdc3c7;
    color: #333;
}

.rarity-uncommon {
    background: #2ecc71;
    color: white;
}

.rarity-epic {
    background: #9b59b6;
    color: white;
}

.rarity-legendary {
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: white;
}

.item-body {
    padding: 20px;
}

.item-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.detail-label {
    color: #7f8c8d;
    font-weight: 500;
}

.detail-value {
    color: #2c3e50;
    font-weight: 600;
}

.item-description {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ===== 加载状态样式 ===== */
.loading {
    text-align: center;
    padding: 50px;
    color: #7f8c8d;
    font-size: 16px;
    grid-column: 1 / -1;
}

.loading i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ===== 空状态样式 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 48px;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #7f8c8d;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.empty-state p {
    color: #95a5a6;
    margin-bottom: 20px;
}

.empty-state button {
    margin-top: 20px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.empty-state button:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* ===== 分页样式 ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.pagination button:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    padding: 0 5px;
    color: #7f8c8d;
}

/* ===== 错误状态样式 ===== */
.error-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.error-state i {
    font-size: 48px;
    color: #e74c3c;
    margin-bottom: 20px;
}

.error-state h3 {
    color: #e74c3c;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.error-state p {
    color: #95a5a6;
    margin-bottom: 20px;
}

.error-state button {
    margin-top: 20px;
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-state button:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .search-section {
        padding: 20px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .range-inputs {
        flex-direction: column;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .search-box input {
        padding: 12px 15px;
    }
    
    .search-box button {
        padding: 12px 20px;
    }
    
    .item-card {
        margin: 0 5px;
    }
}

/* ===== 工具类 ===== */
.hidden {
    display: none !important;
}

.visible {
    display: block;
}

/* 添加类型标签样式 */
.type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #667eea;
    color: white;
}

/* 物品图片样式 */
.item-image {
    margin-bottom: 15px;
    text-align: center;
}