/* 违章代码查询页面样式 */

/* 搜索区域样式 */
.search-area {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.search-title {
    font-size: 1.8em;
    margin: 0 0 10px 0;
    text-align: center;
    color: #333;
    font-weight: 600;
}

.search-title i {
    margin-right: 8px;
    color: #667eea;
}

.search-subtitle {
    text-align: center;
    margin: 0 0 25px 0;
    color: #666;
    font-size: 1em;
}

.search-form {
    max-width: 800px;
    margin: 0 auto;
}

.search-input-group {
    position: relative;
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.05em;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input::placeholder {
    color: #999;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: -8px;
    padding-top: 8px;
    border: 1px solid #dee2e6;
    border-top: none;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.search-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn {
    padding: 14px 36px;
    font-size: 1.05em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 消息提示样式 */
#message-container {
    margin: 20px 0;
}

.message {
    padding: 14px 18px;
    border-radius: 8px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.message-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* 常见违章代码列表样式 */
.common-codes-section {
    margin: 40px 0;
}

.section-title {
    font-size: 1.6em;
    margin: 0 0 10px 0;
    color: #333;
    text-align: center;
    font-weight: 600;
}

.section-title i {
    margin-right: 8px;
    color: #667eea;
}

.section-subtitle {
    text-align: center;
    color: #666;
    margin: 0 0 15px 0;
    font-size: 0.95em;
}

/* 加载进度显示 */
.loading-progress {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    display: inline-block;
    width: 100%;
}

.loading-progress span {
    font-weight: 600;
    color: #667eea;
}

/* 代码网格布局 */
.codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.code-item {
    display: block;
    padding: 14px 18px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    font-weight: 500;
}

.code-item:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

/* 加载更多按钮容器 */
.load-more-container {
    text-align: center;
    margin-top: 30px;
}

#load-more-btn {
    min-width: 200px;
}

#load-more-btn i {
    transition: transform 0.3s ease;
}

#load-more-btn:hover i {
    transform: translateY(3px);
}

/* 全宽布局 */
.full-width {
    width: 100%;
    max-width: 100%;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .codes-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .search-area {
        padding: 25px 20px;
    }

    .search-title {
        font-size: 1.5em;
    }

    .search-subtitle {
        font-size: 0.9em;
    }

    .search-input {
        padding: 14px 18px;
        font-size: 1em;
    }

    .search-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        padding: 12px 28px;
        font-size: 1em;
    }

    .codes-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .code-item {
        padding: 12px 15px;
        font-size: 0.9em;
    }

    .section-title {
        font-size: 1.4em;
    }

    .loading-progress {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .search-area {
        padding: 20px 15px;
    }

    .search-title {
        font-size: 1.3em;
    }

    .codes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .code-item {
        padding: 10px 12px;
        font-size: 0.85em;
    }
}

/* 打印样式 */
@media print {
    .search-area,
    .search-buttons,
    .load-more-container,
    .loading-progress {
        display: none;
    }

    .codes-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .code-item {
        border: 1px solid #ddd;
        background: white;
        color: #333;
    }
}
