/* aitool-redirect.css - AI工具网址跳转页面样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', 'PingFang SC', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* 主容器 */
.aitool-redirect-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 头部 */
.aitool-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.aitool-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 500;
}

.aitool-header p {
    font-size: 14px;
    opacity: 0.9;
}

/* 搜索区域 */
.search-section {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.search-label {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

.search-label i {
    margin-right: 8px;
    color: #667eea;
}

/* 分类按钮区域 */
.category-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.cat-btn {
    padding: 10px 24px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.cat-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.cat-btn:active {
    transform: translateY(0);
}

/* 输入框区域 */
.category-input-group {
    margin-top: 10px;
}

.category-input-group input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    transition: all 0.3s;
}

.category-input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.category-input-group input::placeholder {
    color: #999;
}

.category-hint {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}

.category-hint i {
    margin-right: 5px;
}

/* 统计信息 */
.stats-info {
    background: #e8f4fd;
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #d0e8f5;
}

.stats-count {
    font-size: 14px;
    color: #0066cc;
}

.stats-count strong {
    font-size: 18px;
    color: #004499;
}

.selected-count {
    font-size: 14px;
    color: #28a745;
    transition: color 0.3s;
}

.selected-count span {
    font-weight: bold;
    font-size: 16px;
}

/* 推介名片网格 */
.cards-grid {
    padding: 30px;
    min-height: 500px;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 单个名片卡片 */
.business-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid #eee;
}

.business-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.business-card.selected {
    border: 2px solid #28a745;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.2);
}

/* 复选框（右上角小框） */
.card-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-checkbox:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.card-checkbox.checked {
    background: #28a745;
    border-color: #28a745;
}

.card-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* 卡片图片区域 */
.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.card-image img:hover {
    transform: scale(1.05);
}

.card-image .pdf-icon {
    font-size: 60px;
    color: #dc3545;
    text-align: center;
}

.card-image .default-icon {
    font-size: 60px;
    color: #999;
    text-align: center;
}

/* 卡片内容 */
.card-content {
    padding: 15px;
    border-top: 1px solid #f0f0f0;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-website {
    font-size: 12px;
    color: #667eea;
    word-break: break-all;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.card-website:hover {
    text-decoration: underline;
}

.card-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 放大查看模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 8px;
    overflow: auto;
    position: relative;
    cursor: default;
}

.modal-content img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* 分页和按钮区域 */
.pagination-section {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 24px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.page-info {
    padding: 8px 16px;
    background: white;
    border-radius: 6px;
    color: #333;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
}

/* 加载提示 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.loading-content {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 40px;
    border-radius: 12px;
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 提示弹窗 */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 40px;
    font-size: 14px;
    z-index: 1500;
    animation: fadeInUp 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.toast-message.error {
    background: #dc3545;
}

.toast-message.success {
    background: #28a745;
}

.toast-message.warning {
    background: #ffc107;
    color: #333;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin-top: 10px;
}

/* PDF和默认图标样式 */
.pdf-icon {
    font-size: 60px;
    color: #dc3545;
    text-align: center;
}

.default-icon {
    font-size: 60px;
    color: #999;
    text-align: center;
}

/* 下拉菜单样式（动态创建） */
.category-dropdown-content {
    animation: fadeInScale 0.2s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.dropdown-tree {
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-tree-node {
    cursor: pointer;
    user-select: none;
}

.dropdown-tree-node-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    transition: background 0.2s;
    border-radius: 6px;
}

.dropdown-tree-node-header:hover {
    background: #f5f5f5;
}

.dropdown-tree-node-icon {
    margin-right: 10px;
    font-size: 16px;
}

.dropdown-tree-node-label {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* 滚动条样式 */
.dropdown-tree::-webkit-scrollbar,
.category-tree::-webkit-scrollbar {
    width: 6px;
}

.dropdown-tree::-webkit-scrollbar-track,
.category-tree::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dropdown-tree::-webkit-scrollbar-thumb,
.category-tree::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.dropdown-tree::-webkit-scrollbar-thumb:hover,
.category-tree::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .aitool-header {
        padding: 15px 20px;
    }
    
    .aitool-header h1 {
        font-size: 22px;
    }
    
    .aitool-header p {
        font-size: 12px;
    }
    
    .search-section {
        padding: 15px 20px;
    }
    
    .category-buttons {
        justify-content: center;
        gap: 10px;
    }
    
    .cat-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .stats-info {
        padding: 10px 20px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .cards-grid {
        padding: 20px;
    }
    
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .pagination-section {
        padding: 15px 20px;
        gap: 8px;
    }
    
    .page-info {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .toast-message {
        white-space: normal;
        max-width: 90%;
        text-align: center;
        font-size: 12px;
        padding: 10px 20px;
    }
    
    .dropdown-tree-node-header {
        padding: 8px 10px;
    }
    
    .dropdown-tree-node-label {
        font-size: 13px;
    }
}

/* 平板设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
    
    .aitool-header h1 {
        font-size: 26px;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .aitool-header,
    .search-section,
    .stats-info,
    .pagination-section,
    .card-checkbox,
    .btn {
        display: none;
    }
    
    .business-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.business-card.selected {
    animation: pulse 0.3s ease;
}



