/* 管理员面板样式 */

/* CSS变量定义 */
.admin-panel-modal {
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e5e7eb;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
}

/* 管理员面板模态框 */
.admin-panel-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.admin-panel-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.admin-panel-modal .modal-content {
    max-width: 1200px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.admin-panel-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-bottom: none;
}

.admin-panel-header h2 {
    color: white;
}

.admin-panel-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 标签页导航 */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem 0;
    border-bottom: 2px solid #e5e7eb;
    background: #f8fafc;
    flex-shrink: 0;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
    position: relative;
}

.admin-tab:hover {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.admin-tab.active {
    background: white;
    color: #f59e0b;
    font-weight: 600;
}

.admin-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #f59e0b;
}

/* 标签页内容 */
.admin-tab-content {
    display: none;
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    background: white;
}

.admin-tab-content.active {
    display: block;
}

/* 滚动条样式 */
.admin-tab-content::-webkit-scrollbar {
    width: 8px;
}

.admin-tab-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.admin-tab-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.admin-tab-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 统计卡片网格 */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #f59e0b;
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f59e0b;
}

/* 工具管理区域 */
.admin-tools-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-search-box {
    flex: 1;
    min-width: 250px;
}

.admin-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.admin-search-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.admin-filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.admin-filter-btn {
    padding: 0.75rem 1.25rem;
    border: 1px solid #e5e7eb;
    background: white;
    color: #64748b;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-filter-btn:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}

.admin-filter-btn.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-color: #f59e0b;
}

/* 工具列表 */
.admin-tools-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-tool-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.admin-tool-item:hover {
    border-color: #f59e0b;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.1);
}

.admin-tool-info {
    flex: 1;
}

.admin-tool-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-tool-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.5rem;
}

.admin-tool-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-action-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-action-btn:hover {
    background: #f8fafc;
}

.admin-action-btn.edit {
    color: #3b82f6;
    border-color: #3b82f6;
}

.admin-action-btn.edit:hover {
    background: #eff6ff;
}

.admin-action-btn.delete {
    color: #ef4444;
    border-color: #ef4444;
}

.admin-action-btn.delete:hover {
    background: #fef2f2;
}

/* 用户列表 */
.admin-users-header {
    margin-bottom: 1.5rem;
}

.admin-users-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-user-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.admin-user-item:hover {
    border-color: #f59e0b;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.1);
}

.admin-user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.admin-user-avatar.admin {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

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

.admin-user-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.admin-user-email {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-admin-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-user-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #64748b;
    flex-wrap: wrap;
}

.admin-user-stats span {
    white-space: nowrap;
}

.admin-user-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* 用户工具模态框 */
.user-tools-header {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.user-tools-info p {
    margin: 0.5rem 0;
    color: #64748b;
}

.user-tools-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.user-tool-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.user-tool-item:hover {
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.user-tool-info {
    flex: 1;
}

.user-tool-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-tool-desc {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.user-tool-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #64748b;
}

.user-tool-actions {
    flex-shrink: 0;
}

.tool-link-btn {
    padding: 0.5rem 1rem;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.tool-link-btn:hover {
    background: #d97706;
    transform: translateY(-1px);
}

/* 角色管理 */
.role-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* 统计详情容器 */
.stats-details-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.stats-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
}

.stats-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 分类统计 */
.category-stats-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.category-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-stat-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
}

.category-stat-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f59e0b;
}

.category-stat-bar {
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.category-stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.category-stat-detail {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #64748b;
}

/* 特性统计 */
.feature-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.feature-stat-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.feature-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature-stat-icon.free {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.feature-stat-icon.paid {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.feature-stat-icon.chinese {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.feature-stat-icon.english {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.feature-stat-info {
    flex: 1;
}

.feature-stat-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.feature-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.feature-stat-percentage {
    font-size: 0.85rem;
    color: #f59e0b;
    font-weight: 600;
}

/* 时间趋势 */
.time-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.time-stat-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
}

.time-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.time-stat-period {
    font-size: 0.85rem;
    color: #92400e;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.time-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 0.25rem;
}

.time-stat-label {
    font-size: 0.85rem;
    color: #92400e;
}

/* 热门工具 */
.top-tools-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-tool-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.top-tool-item:hover {
    border-color: #f59e0b;
    background: white;
}

.top-tool-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

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

.top-tool-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-tool-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #64748b;
}

.top-tool-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f59e0b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.2s;
}

.top-tool-link:hover {
    background: #d97706;
    transform: scale(1.1);
}

/* 加载状态 */
.admin-loading {
    text-align: center;
    padding: 3rem;
    color: #64748b;
    font-size: 1rem;
}

/* 空状态 */
.admin-empty {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.admin-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.admin-empty-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.admin-empty-hint {
    font-size: 0.9rem;
    color: #94a3b8;
}

/* 批量操作工具栏 */
.admin-batch-actions {
    display: none;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    animation: slideDown 0.3s ease;
}

.admin-batch-actions.show {
    display: flex;
}

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

.batch-actions-info {
    font-size: 1rem;
    color: #92400e;
    font-weight: 500;
}

.batch-actions-info strong {
    color: #f59e0b;
    font-size: 1.2rem;
}

.batch-actions-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.batch-action-btn {
    padding: 0.6rem 1.25rem;
    border: 2px solid #f59e0b;
    background: white;
    color: #f59e0b;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.batch-action-btn:hover {
    background: #f59e0b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.batch-action-btn.batch-delete {
    border-color: #ef4444;
    color: #ef4444;
}

.batch-action-btn.batch-delete:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.batch-action-btn.batch-category {
    border-color: #3b82f6;
    color: #3b82f6;
}

.batch-action-btn.batch-category:hover {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 工具项复选框 */
.admin-tool-checkbox {
    display: flex;
    align-items: center;
    padding-right: 1rem;
}

.tool-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #f59e0b;
}

.admin-tool-item {
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.admin-tool-item.selected {
    background: #fef3c7;
    border-color: #f59e0b;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-panel-modal .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .admin-tabs {
        padding: 0.75rem 1rem 0;
        overflow-x: auto;
    }

    .admin-tab {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .admin-stat-card {
        padding: 1rem;
    }

    .stat-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .admin-tools-header {
        flex-direction: column;
    }

    .admin-filter-buttons {
        overflow-x: auto;
    }

    .admin-tool-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-tool-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .admin-batch-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .batch-actions-info {
        text-align: center;
    }

    .batch-actions-buttons {
        justify-content: center;
    }

    .batch-action-btn {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-tool-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-user-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-user-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .admin-user-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .user-tool-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-tool-actions {
        width: 100%;
    }

    .tool-link-btn {
        width: 100%;
        text-align: center;
    }

    .stats-details-container {
        grid-template-columns: 1fr;
    }

    .feature-stats-grid {
        grid-template-columns: 1fr;
    }

    .time-stats-grid {
        grid-template-columns: 1fr;
    }

    .top-tool-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}


/* 管理面板按钮（导航栏） */
.admin-panel-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
    transition: all 0.2s;
}

.admin-panel-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.admin-panel-btn.hidden {
    display: none;
}
