/**
 * 前端查询页面样式
 * 
 * @package WPCH_SaaS_Traceability
 * @since 2.0.0
 */

/* ==================== 查询容器 ==================== */
.wpch-query-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 40px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* ==================== 头部样式 ==================== */
.wpch-header {
    text-align: center;
    margin-bottom: 40px;
}

.wpch-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.wpch-title {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin: 0 0 10px 0;
}

.wpch-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* ==================== 搜索表单 ==================== */
.wpch-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.wpch-search-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s;
}

.wpch-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wpch-search-btn {
    padding: 15px 40px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.wpch-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.wpch-search-btn:active {
    transform: translateY(0);
}

/* ==================== 结果显示 ==================== */
.wpch-result {
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpch-result.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    color: #155724;
}

.wpch-result.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.wpch-result.loading {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border: 1px solid #bee5eb;
    color: #0c5460;
    display: block;
}

/* ==================== 产品信息卡片 ==================== */
.wpch-product-info {
    margin-top: 20px;
}

.wpch-info-item {
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 5px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.wpch-info-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wpch-info-label {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpch-info-value {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* ==================== 页脚 ==================== */
.wpch-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 14px;
}

.wpch-footer p {
    margin: 5px 0;
}

.wpch-footer a {
    color: #667eea;
    text-decoration: none;
}

.wpch-footer a:hover {
    text-decoration: underline;
}

/* ==================== 警告提示 ==================== */
.wpch-warning {
    background: #fff3cd;
    border-left-color: #ffc107 !important;
    color: #856404;
}

.wpch-warning .wpch-info-label {
    color: #856404;
}

/* ==================== 加载动画 ==================== */
.wpch-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .wpch-query-container {
        margin: 20px;
        padding: 20px;
    }
    
    .wpch-title {
        font-size: 24px;
    }
    
    .wpch-search-form {
        flex-direction: column;
    }
    
    .wpch-search-input,
    .wpch-search-btn {
        width: 100%;
    }
    
    .wpch-logo {
        max-width: 150px;
    }
}

/* ==================== 短代码样式 ==================== */
.wpch-query-form {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wpch-query-form h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.wpch-query-form input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: border-color 0.3s;
}

.wpch-query-form input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.wpch-query-form button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: #667eea;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.wpch-query-form button:hover {
    background: #5568d3;
}

#wpch-query-result {
    margin-top: 20px;
}

/* ==================== 我的验证码列表 ==================== */
.wpch-my-codes {
    margin: 30px 0;
}

.wpch-my-codes h3 {
    color: #333;
    margin-bottom: 20px;
}

.wpch-codes-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wpch-codes-table thead {
    background: #667eea;
    color: #fff;
}

.wpch-codes-table th,
.wpch-codes-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.wpch-codes-table tr:hover {
    background: #f9f9f9;
}

.wpch-codes-table code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* ==================== 打印样式 ==================== */
@media print {
    .wpch-search-form,
    .wpch-search-btn {
        display: none;
    }
    
    .wpch-query-container {
        box-shadow: none;
        margin: 0;
    }
}
