/* pdf-manager.css */
/* PDF文件管理器样式 */

/* =============================================
   PDF搜索区域
   ============================================= */

/* PDF搜索区域容器 */
.terminal-pdf-search {
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.terminal-pdf-search .pdf-search-section {
    margin: 1rem 1rem 1.5rem 1rem;
}

/* PDF搜索区域 */
.pdf-search-section {
    margin: 1.5rem 1rem 2rem 1rem;
    animation: fadeIn 0.4s ease-out;
}

.pdf-search-container {
    position: relative;
}

.pdf-search-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

/* 搜索框 */
.pdf-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.pdf-search-box.focused {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.08);
    transform: translateY(-1px);
}

.pdf-search-input {
    flex: 1;
    padding: 0.875rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

.pdf-search-input::placeholder {
    color: var(--text-secondary);
}

.pdf-search-btn {
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--primary-600) 100%);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-search-btn:hover {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
}

.pdf-search-btn:active {
    transform: scale(0.95);
}

/* 搜索结果 */
.pdf-search-results {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    animation: slideInUp 0.3s ease-out;
}

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

.pdf-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.pdf-search-header span {
    font-weight: 600;
    color: var(--text-primary);
}

.pdf-search-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pdf-search-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

/* 搜索结果列表 */
.pdf-search-list {
    max-height: 300px;
    overflow-y: auto;
}

.pdf-search-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.pdf-search-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.pdf-search-item:last-child {
    border-bottom: none;
}



.pdf-info {
    flex: 1;
    min-width: 0;
}

.pdf-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pdf-select-btn {
    padding: 0.5rem 1rem;
    background: rgba(22, 119, 255, 0.12);
    border: 1px solid rgba(22, 119, 255, 0.25);
    border-radius: 6px;
    color: var(--accent-blue);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-select-btn:hover {
    background: rgba(22, 119, 255, 0.2);
    border-color: rgba(22, 119, 255, 0.35);
    transform: translateY(-1px);
}

/* 加载状态 */
.pdf-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem;
    color: var(--text-secondary);
}

/* 空状态 */
.pdf-search-empty,
.pdf-search-error {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.pdf-search-empty svg,
.pdf-search-error svg {
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* PDF文件指示器 */
.pdf-files-indicator {
    display: flex;
    align-items: center;
    position: relative;
}

.pdf-files-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 77, 79, 0.12);
    border: 1px solid rgba(255, 77, 79, 0.25);
    border-radius: 6px;
    color: #ff4444;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.pdf-files-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.pdf-files-btn:hover::before {
    left: 100%;
}

.pdf-files-btn:hover {
    background: rgba(255, 77, 79, 0.2);
    border-color: rgba(255, 77, 79, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 77, 79, 0.15);
}

.pdf-files-count {
    background: rgba(255, 77, 79, 0.8);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    animation: countPulse 0.3s ease-out;
}

@keyframes countPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* PDF文件列表弹窗 */
.pdf-files-popup {
    position: fixed;
    margin-bottom: 0.5rem;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    width: 300px;
    z-index: 3500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.pdf-files-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pdf-files-popup-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.pdf-files-popup-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pdf-files-popup-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pdf-files-popup-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.pdf-files-list {
    max-height: 200px;
    overflow-y: auto;
}

.pdf-file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.15s ease;
}

.pdf-file-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.pdf-file-item:last-child {
    border-bottom: none;
}

.pdf-file-icon {
    flex-shrink: 0;
    color: #ff4444;
}

.pdf-file-info {
    flex: 1;
    min-width: 0;
}

.pdf-file-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-file-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pdf-file-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.pdf-file-remove:hover {
    background: rgba(255, 77, 79, 0.1);
    color: var(--error-main);
}

.pdf-files-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* PDF标签样式 */
.pdf-tags {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.375rem;
    flex-wrap: wrap;
}

.pdf-tag {
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.pdf-tag-type {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.pdf-tag-industry {
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.pdf-tag-region {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.pdf-tag-mini {
    padding: 0.1rem 0.375rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    margin-left: 0.5rem;
}

/* PDF标准标签样式 */
.pdf-standards {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.standards-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: block;
    margin-bottom: 0.375rem;
}

.standards-list {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.standard-tag {
    padding: 0.1rem 0.375rem;
    background: rgba(251, 191, 36, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.standard-more {
    padding: 0.1rem 0.375rem;
    background: rgba(156, 163, 175, 0.12);
    color: var(--text-secondary);
    border: 1px solid rgba(156, 163, 175, 0.2);
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
}

/* 分页样式 */
.pdf-search-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(22, 119, 255, 0.12);
    border-color: rgba(22, 119, 255, 0.25);
    color: var(--accent-blue);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 标准模态框样式 */
.standards-modal {
    background: var(--panel-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.standards-modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, var(--title-bar-bg-start) 0%, var(--title-bar-bg-end) 100%);
}

.standards-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.standards-modal-close {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.standards-modal-close:hover {
    background: rgba(255, 77, 79, 0.12);
    border-color: rgba(255, 77, 79, 0.25);
    color: var(--error-main);
}

.standards-modal-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.standards-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.standards-full-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.standard-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.standard-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(251, 191, 36, 0.3);
}

.standard-number {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--accent-blue);
    min-width: 2rem;
}

.standard-text {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.5;
}

.standard-more {
    cursor: pointer;
    transition: all 0.2s ease;
}

.standard-more:hover {
    background: rgba(156, 163, 175, 0.2);
    border-color: rgba(156, 163, 175, 0.3);
    transform: translateY(-1px);
}

/* PDF操作按钮 */
.pdf-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.pdf-preview-btn,
.pdf-download-btn {
    padding: 0.375rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-preview-btn:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: var(--accent-blue);
}

.pdf-download-btn:hover {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
    color: #22c55e;
}

/* 可点击的标题样式 */
.pdf-clickable {
    cursor: pointer;
    transition: color 0.2s ease;
}

.pdf-clickable:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

/* PDF预览模态框 */
.pdf-preview-modal {
    background: var(--panel-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.pdf-preview-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, var(--title-bar-bg-start) 0%, var(--title-bar-bg-end) 100%);
}

.pdf-preview-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.pdf-preview-actions {
    display: flex;
    gap: 0.5rem;
}

.pdf-preview-download,
.pdf-preview-close {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-preview-download:hover {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
    color: #22c55e;
}

.pdf-preview-close:hover {
    background: rgba(255, 77, 79, 0.12);
    border-color: rgba(255, 77, 79, 0.25);
    color: var(--error-main);
}

.pdf-preview-body {
    flex: 1;
    padding: 0;
    background: #525659;
    overflow: hidden;
}

.pdf-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* PDF文件项操作按钮 */
.pdf-file-actions {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}

.pdf-file-preview {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.pdf-file-preview:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-blue);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .pdf-search-section {
        margin: 1rem 0.75rem 1.5rem 0.75rem;
    }
    
    .pdf-search-box {
        border-radius: 8px;
    }
    
    .pdf-search-input {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .pdf-search-btn {
        padding: 0.75rem 1rem;
    }
    
    .pdf-search-item {
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }
    

    
    .pdf-title {
        font-size: 0.875rem;
    }
    
    .pdf-select-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .pdf-tags {
        gap: 0.25rem;
    }
    
    .pdf-tag {
        padding: 0.1rem 0.375rem;
        font-size: 0.65rem;
    }
    
    .pdf-preview-modal {
        width: 95%;
        height: 90vh;
    }
    
    .pdf-preview-header {
        padding: 0.75rem 1rem;
    }
    
    .pdf-preview-title {
        font-size: 1rem;
    }
    
    .pdf-files-indicator {
        margin-right: 0.5rem;
    }
    
    .pdf-files-btn {
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
    }
    
    .pdf-files-popup {
        min-width: 250px;
        right: -50px;
    }
    
    .pdf-files-btn {
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
        font-size: 0.7rem;
    }
    
    .pdf-files-count {
        padding: 0.1rem 0.3rem;
        font-size: 0.65rem;
        min-width: 16px;
    }
    
    .pdf-standards {
        margin-top: 0.375rem;
        padding-top: 0.375rem;
    }
    
    .standards-label {
        font-size: 0.65rem;
        margin-bottom: 0.25rem;
    }
    
    .standard-tag,
    .standard-more {
        font-size: 0.6rem;
        padding: 0.075rem 0.3rem;
        max-width: 100px;
    }
    
    .pdf-search-pagination {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pagination-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .pagination-info {
        font-size: 0.8rem;
        text-align: center;
    }
    
    .standards-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .standards-modal-header {
        padding: 0.75rem 1rem;
    }
    
    .standards-modal-title {
        font-size: 1rem;
    }
    
    .standards-modal-body {
        padding: 1rem;
    }
    
    .standard-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .standard-number {
        min-width: 1.5rem;
        font-size: 0.875rem;
    }
    
    .standard-text {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .pdf-files-count {
        padding: 0.1rem 0.3rem;
        font-size: 0.65rem;
        min-width: 16px;
    }
}

/* 亮色主题适配 */
[data-theme="light"] .pdf-search-box {
    background: rgba(0, 0, 0, 0.02);
    border-color: #e2e8f0;
}

[data-theme="light"] .pdf-search-results {
    background: rgba(0, 0, 0, 0.01);
}

[data-theme="light"] .pdf-search-item:hover {
    background: rgba(0, 0, 0, 0.02);
}