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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 28px;
    margin-bottom: 15px;
}

header nav {
    display: flex;
    gap: 20px;
}

header nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

header nav a:hover,
header nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.search-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-section h2 {
    margin-bottom: 20px;
    color: #667eea;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.price-range,
.screen-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-range input,
.screen-range input {
    flex: 1;
}

.price-range span,
.screen-range span {
    color: #999;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.results-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.results-header h2 {
    color: #667eea;
}

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

.phone-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.phone-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e0e0e0;
}

.phone-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.phone-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 18px;
}

.phone-card .brand {
    color: #667eea;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
}

.phone-card .price {
    color: #e74c3c;
    font-size: 20px;
    font-weight: bold;
    margin: 10px 0;
}

.phone-card .specs {
    font-size: 13px;
    color: #666;
}

.phone-card .specs p {
    margin: 3px 0;
}

.phone-card .specs span {
    color: #999;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.pagination button:hover {
    background-color: #f0f0f0;
}

.pagination button.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

#modal-body h2 {
    color: #667eea;
    margin-bottom: 20px;
}

#modal-body .detail-section {
    margin-bottom: 25px;
}

#modal-body .detail-section h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #667eea;
}

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

#modal-body .detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

#modal-body .detail-item:last-child {
    border-bottom: none;
}

#modal-body .detail-label {
    color: #666;
    font-weight: bold;
}

#modal-body .detail-value {
    color: #333;
    text-align: right;
}

#modal-body .price-large {
    font-size: 32px;
    color: #e74c3c;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 22px;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .phone-list {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    #modal-body .detail-grid {
        grid-template-columns: 1fr;
    }
}