/* EPO专利智能检索模块样式 */

/* 配额状态横幅 */
.quota-banner {
    transition: all 0.3s ease;
}

.quota-banner.warning {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%) !important;
    border-color: #FF9800 !important;
}

.quota-banner.danger {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%) !important;
    border-color: #F44336 !important;
}

#epo-quota-bar {
    transition: width 0.3s ease, background 0.3s ease;
}

#epo-quota-bar.warning {
    background: linear-gradient(90deg, #FF9800, #FFC107) !important;
}

#epo-quota-bar.danger {
    background: linear-gradient(90deg, #F44336, #EF5350) !important;
}

/* 检索容器布局 */
.epo-search-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

@media (max-width: 900px) {
    .epo-search-container {
        grid-template-columns: 1fr;
    }
}

/* 检索类型按钮 */
.search-type-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.search-type-btn:hover:not(.active) {
    background: #f5f5f5;
    border-color: #bbb;
}

.search-type-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 检索面板 */
.search-panel {
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
}

/* 快捷检索按钮 */
.quick-search-btn {
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 12px;
    transition: all 0.2s ease;
}

.quick-search-btn:hover {
    background: #f0f7ff;
    border-color: var(--primary-color);
}

/* 结果列表 */
.epo-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 结果项 */
.epo-result-item {
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.epo-result-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 结果头部 */
.epo-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

/* 专利号 */
.epo-result-patent-number {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

/* 标题 */
.epo-result-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    cursor: pointer;
    transition: color 0.2s ease;
}

.epo-result-title:hover {
    color: var(--primary-color);
}

/* 元数据 */
.epo-result-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

/* 摘要 */
.epo-result-abstract {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* 分类标签 */
.epo-result-classifications {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.epo-classification-tag {
    padding: 2px 8px;
    background: #E3F2FD;
    color: #1976D2;
    border-radius: 4px;
    font-size: 11px;
}

/* 操作按钮 */
.epo-result-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.epo-result-actions button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* 分页 */
#epo-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 16px 0;
    flex-wrap: wrap;
}

#epo-pagination .page-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

#epo-pagination .page-btn:hover {
    background: #e3f2fd;
    border-color: #1976d2;
    color: #1976d2;
}

#epo-pagination .page-btn.active {
    background: #1976d2;
    border-color: #1976d2;
    color: white;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载动画 */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 高级检索行 */
.advanced-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.advanced-search-row select,
.advanced-search-row input {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.remove-row-btn {
    padding: 6px 10px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.remove-row-btn:hover {
    background: #d32f2f;
}

/* Toast 通知 */
.toast {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 响应式调整 */
@media (max-width: 600px) {
    .epo-search-container {
        grid-template-columns: 1fr;
    }
    
    .epo-result-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    .epo-result-actions {
        flex-wrap: wrap;
    }
    
    .modal-content {
        width: 95% !important;
        max-height: 85vh;
    }
}

/* 深色模式支持 */
[data-theme="dark"] .search-panel {
    background: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] .epo-result-item {
    background: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] .epo-result-title {
    color: #e0e0e0;
}

[data-theme="dark"] .epo-result-abstract {
    color: #bbb;
}

[data-theme="dark"] .epo-classification-tag {
    background: #1a3a5c;
    color: #64b5f6;
}

[data-theme="dark"] .quick-search-btn {
    background: #333;
    border-color: #555;
    color: #ddd;
}

[data-theme="dark"] .quick-search-btn:hover {
    background: #3d5a80;
}

[data-theme="dark"] .search-type-btn {
    background: #333;
    border-color: #555;
    color: #ddd;
}

[data-theme="dark"] .search-type-btn:hover:not(.active) {
    background: #444;
}

[data-theme="dark"] .modal-content {
    background: #2a2a2a;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: #444;
}

[data-theme="dark"] #epo-pagination .page-btn {
    background: #333;
    border-color: #555;
    color: #ddd;
}
