/* AI接单推广平台 - 样式 */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray: #6b7280;
    --bg: #f9fafb;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-secondary: #6b7280;
}

/* 暗色模式 */
[data-theme="dark"] {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --border: #334155;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    color-scheme: dark;
}

[data-theme="dark"] body {
    background: var(--bg);
    color: var(--text);
}

[data-theme="dark"] .card {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #334155;
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .modal-content {
    background: var(--card-bg);
}

[data-theme="dark"] table {
    background: var(--card-bg);
}

[data-theme="dark"] th {
    background: #334155;
}

[data-theme="dark"] tr:hover {
    background: #334155;
}

[data-theme="dark"] .task-item {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .stat-card {
    background: var(--card-bg);
}

[data-theme="dark"] .admin-table th {
    background: #334155;
}

/* 暗色模式切换按钮 */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    transition: transform 0.2s;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: #1f2937;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

header h1 {
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info {
    background: var(--card-bg);
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#userPoints {
    font-weight: 600;
    color: var(--primary);
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    border: none;
    background: var(--card-bg);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tab:hover {
    transform: translateY(-2px);
}

.tab.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

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

/* 筛选 */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filters select, .filters button {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

.stats-bar {
    background: var(--card-bg);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filters button {
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
}

/* 任务列表 */
.task-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.task-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.task-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.task-type {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #e0e7ff;
    color: var(--primary-dark);
}

.task-desc {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-points {
    font-weight: 600;
    color: var(--warning);
}

.task-platform {
    font-size: 12px;
    color: var(--gray);
}

.task-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
}

.task-status.completed {
    background: #d1fae5;
    color: var(--success);
}

.task-status.pending {
    background: #fef3c7;
    color: var(--warning);
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 积分商城 */
.mall-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.mall-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.mall-item:hover {
    transform: translateY(-4px);
}

.mall-item .icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.mall-item h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.mall-item .points {
    font-size: 20px;
    font-weight: 700;
    color: var(--warning);
    margin-bottom: 15px;
}

.mall-item .stock {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 15px;
}

.mall-item button {
    width: 100%;
    padding: 10px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.mall-item button:hover {
    background: #059669;
}

/* 个人中心 */
.profile-card {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--gray);
}

.profile-card .avatar {
    font-size: 64px;
    margin-bottom: 15px;
}

.profile-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.points-display {
    font-size: 32px;
    font-weight: 700;
}

.history {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
}

.history h4 {
    margin-bottom: 15px;
    color: #374151;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.history-item .amount {
    font-weight: 600;
}

.history-item .amount.positive {
    color: var(--success);
}

.history-item .amount.negative {
    color: var(--danger);
}

.history-item .reason {
    color: var(--gray);
    font-size: 14px;
}

.history-item .date {
    color: var(--gray);
    font-size: 12px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background: var(--card-bg);
    margin: 5% auto;
    padding: 30px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    position: relative;
    animation: slideDown 0.3s ease;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
}

.close:hover {
    color: #1f2937;
}

#modalBody {
    margin-top: 20px;
}

#modalBody .content {
    background: #f3f4f6;
    padding: 20px;
    border-radius: 8px;
    white-space: pre-wrap;
    font-family: monospace;
    margin-top: 15px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

/* 空状态 */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .tabs {
        flex-wrap: wrap;
        gap: 5px;
    }

    .tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .task-list, .mall-items {
        grid-template-columns: 1fr;
    }

    .stats-cards, .promo-stats, .admin-stats, .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card, .promo-stat {
        padding: 12px;
    }

    .stat-value {
        font-size: 18px;
    }

    .filters {
        gap: 8px;
    }

    .filters select {
        width: calc(50% - 4px);
    }

    .user-info {
        gap: 8px;
    }

    .user-info button, .user-info span {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* 充值样式 */
.recharge-card {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
}

.balance-display {
    font-size: 48px;
    font-weight: 700;
    margin: 15px 0;
}

.recharge-form {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
}

.recharge-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.recharge-options button {
    flex: 1;
    min-width: 80px;
    padding: 12px;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.recharge-options button:hover {
    background: var(--primary);
    color: white;
}

/* 确认弹窗按钮 */
.confirm-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-confirm {
    flex: 1;
    padding: 14px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-confirm:hover {
    background: #059669;
}

.btn-reject {
    flex: 1;
    padding: 14px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-reject:hover {
    background: #dc2626;
}

/* 小按钮 */
.btn-small {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
}

.btn-small:hover {
    background: var(--primary-dark);
}

/* 商城信息 */
.mall-info {
    background: #e0f2fe;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #0369a1;
}

/* 状态颜色 */
.task-status.ai_generated {
    background: #fef3c7;
    color: #d97706;
}

.task-status.rejected {
    background: #fee2e2;
    color: #dc2626;
}

/* 登录/注册弹窗 */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

.auth-tab.active {
    background: var(--primary);
    color: white;
}

/* VIP徽章 */
#vipBadge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
}

/* VIP特权 */
.vip-benefit {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.vip-benefit h4 {
    color: #92400e;
    margin-bottom: 10px;
}

.vip-benefit ul {
    list-style: none;
    padding: 0;
}

.vip-benefit li {
    color: #92400e;
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.vip-benefit li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #059669;
}

/* 按钮样式 */
#loginBtn, #logoutBtn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
}

#loginBtn {
    background: var(--primary);
    color: white;
}

#logoutBtn {
    background: #6b7280;
    color: white;
}

/* 推广中心 */
.promo-banner {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.promo-banner h3 { margin: 0 0 10px 0; font-size: 24px; }

.promo-code-box {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.promo-code-box strong {
    font-size: 24px;
    color: var(--primary);
    letter-spacing: 2px;
}

.promo-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.promo-stat {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.promo-rules {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.promo-rules h4 { margin: 0 0 15px 0; }
.promo-rules ul { padding-left: 20px; }
.promo-rules li { margin-bottom: 8px; color: var(--gray); }

/* 企业入驻 */
.enterprise-info {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.enterprise-benefits {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.enterprise-benefits h4 { margin: 0 0 15px 0; }
.enterprise-benefits ul { padding-left: 20px; }
.enterprise-benefits li { margin-bottom: 10px; }

/* 管理中心 */
.admin-header {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.admin-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.admin-section h4 { margin: 0 0 15px 0; border-bottom: 1px solid var(--border); padding-bottom: 10px; }

.pending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

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

.pending-info { flex: 1; }
.pending-title { font-weight: 600; margin-bottom: 4px; }
.pending-meta { font-size: 12px; color: var(--gray); }

.pending-actions { display: flex; gap: 8px; }
.pending-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.approve-btn { background: #10b981; color: white; }
.reject-btn { background: #ef4444; color: white; }

/* 任务模板 */
.templates-header {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.template-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.template-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.template-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.template-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.template-desc {
    font-size: 12px;
    color: var(--gray);
}

/* 通知中心 */
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.notifications-header h3 { margin: 0; }

.btn-small {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.notifications-list {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.notification-item:last-child { border-bottom: none; }
.notification-item.unread { background: rgba(59, 130, 246, 0.05); }

.notification-icon {
    font-size: 24px;
}

.notification-content { flex: 1; }
.notification-title { font-weight: 600; margin-bottom: 4px; }
.notification-body { font-size: 14px; color: var(--gray); margin-bottom: 4px; }
.notification-time { font-size: 12px; color: var(--gray); }

/* API文档 */
.api-header {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.api-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.api-section h4 {
    margin: 0 0 15px 0;
    color: var(--primary);
}

.api-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 10px;
    gap: 15px;
}

.api-method {
    background: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.api-path {
    font-family: monospace;
    color: #e11d48;
    font-size: 14px;
}

.api-desc {
    color: var(--gray);
    font-size: 14px;
    flex: 1;
}

.api-key-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.api-key-section h4 { margin: 0 0 10px 0; }
.api-key-section p { color: var(--gray); margin-bottom: 15px; }

/* 数据分析 */
.analytics-header {
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.analytics-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.analytics-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.analytics-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.analytics-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.analytics-label {
    font-size: 14px;
    color: var(--gray);
}

.analytics-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
}

.chart-section h4 {
    margin: 0 0 15px 0;
}

.chart-container {
    min-height: 200px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.chart-bar {
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    min-width: 40px;
    text-align: center;
    color: white;
    font-size: 12px;
    padding: 5px;
}

.chart-placeholder {
    color: var(--gray);
    width: 100%;
    text-align: center;
    padding: 50px 0;
}

@media (max-width: 768px) {
    .analytics-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    .analytics-charts {
        grid-template-columns: 1fr;
    }
}

/* AI代理中心 */
.agents-header {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.agents-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.agent-stat {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.agent-create {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.agent-create h4 { margin: 0 0 15px 0; }

.capability-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.capability-checks label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.agent-list-section h4 { margin: 0 0 15px 0; }

.agent-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary);
}

.agent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.agent-card-name {
    font-size: 18px;
    font-weight: 600;
}

.agent-card-type {
    font-size: 12px;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
}

.agent-card-desc {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 15px;
}

.agent-card-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.agent-card-stat {
    text-align: center;
}

.agent-card-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.agent-card-stat-label {
    font-size: 12px;
    color: var(--gray);
}

.agent-card-api {
    background: var(--bg);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
}

.agent-card-actions {
    display: flex;
    gap: 10px;
}

.agent-card-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.btn-edit { background: #3b82f6; color: white; }
.btn-regen { background: #f59e0b; color: white; }
.btn-delete { background: #ef4444; color: white; }

.agent-api-docs {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
}

.agent-api-docs h4 { margin: 0 0 10px 0; }
.agent-api-docs p { color: var(--gray); margin-bottom: 15px; }

.api-note {
    background: var(--bg);
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 10px;
}

.api-note code {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
    color: #e11d48;
}

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

/* AI代理市场 */
.agent-market-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.agent-market-filters select {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--card-bg);
}

.agent-market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.agent-market-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.agent-market-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.agent-market-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.agent-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.agent-market-card-name {
    font-size: 18px;
    font-weight: 600;
}

.agent-market-card-type {
    font-size: 12px;
    color: var(--gray);
}

.agent-verified-badge {
    display: inline-block;
    background: #10b981;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}

.agent-market-card-desc {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.agent-market-card-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.agent-cap-tag {
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--gray);
}

.agent-market-card-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.agent-market-stat {
    text-align: center;
}

.agent-market-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.agent-market-stat-label {
    font-size: 11px;
    color: var(--gray);
}

.agent-market-card-price {
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 10px;
}

.agent-register-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.agent-register-section h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.agent-register-section > p {
    color: var(--gray);
    margin-bottom: 25px;
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

/* SDK代码块 */
.sdk-section {
    margin-bottom: 20px;
}

.sdk-section h5 {
    margin: 0 0 10px 0;
    color: var(--primary);
    font-size: 14px;
}

.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    overflow-x: auto;
    margin-bottom: 10px;
}

.code-block code {
    color: #22d3ee;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.agent-quick-start {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.agent-quick-start h5 {
    margin: 0 0 15px 0;
    color: #22d3ee;
}

/* 快速启动 */
.quick-start-box {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
}

.quick-start-box h3 {
    margin: 0 0 10px 0;
    color: #22d3ee;
}

.quick-start-box p {
    color: #94a3b8;
    margin-bottom: 15px;
}

.command-line {
    background: #000;
    padding: 15px 20px;
    border-radius: 8px;
    overflow-x: auto;
}

.command-line code {
    color: #22d3ee;
    font-size: 12px;
    white-space: pre;
}

.quick-tip {
    font-size: 13px;
    color: #64748b;
    margin: 15px 0;
}

.btn-download {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Toast通知 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}

.toast.success { border-left: 4px solid #10b981; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.warning { border-left: 4px solid #f59e0b; }
.toast.info { border-left: 4px solid #3b82f6; }

.toast-icon {
    font-size: 20px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: #6b7280;
}

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

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

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
}

/* API文档样式 */
.api-endpoints {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.api-endpoint .method {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.api-endpoint .method.get {
    background: #dcfce7;
    color: #166534;
}

.api-endpoint .method.post {
    background: #dbeafe;
    color: #1e40af;
}

.api-endpoint .method.put {
    background: #fef3c7;
    color: #92400e;
}

.api-endpoint .method.delete {
    background: #fee2e2;
    color: #991b1b;
}

.api-endpoint .path {
    font-family: monospace;
    font-size: 14px;
    color: #1e293b;
    flex: 1;
}

.api-endpoint .desc {
    font-size: 13px;
    color: #64748b;
}

.api-endpoints + .card {
    margin-top: 15px;
}

/* 管理后台样式 */
.admin-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-tab-btn {
    padding: 10px 20px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.admin-tab-btn:hover {
    background: #e2e8f0;
}

.admin-tab-btn.active {
    background: #3b82f6;
    color: white;
}

.admin-tab-content {
    display: none;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h4 {
    margin: 0;
}

.card-header input,
.card-header select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

/* 数据图表样式 */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--card-bg, #fff);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-card h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-primary, #1e293b);
}

.chart-card canvas {
    max-height: 250px;
}

#usersChartContainer,
#tasksChartContainer,
#revenueChartContainer,
#agentsChartContainer {
    position: relative;
    height: 250px;
}

/* 响应式图表 */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card {
        padding: 15px;
    }

    #usersChartContainer,
    #tasksChartContainer,
    #revenueChartContainer,
    #agentsChartContainer {
        height: 200px;
    }
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.admin-table tr:hover {
    background: #f8fafc;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* 管理后台状态徽章 */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.blocked {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.completed {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.inactive {
    background: #f1f5f9;
    color: #64748b;
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: #f3e8ff;
    color: #7c3aed;
}

.role-badge.admin {
    background: #fef2f2;
    color: #dc2626;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #cbd5e1;
}

.pending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
}

.pending-info {
    flex: 1;
}

.pending-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.pending-meta {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 3px;
}

.pending-content {
    font-size: 12px;
    color: #94a3b8;
}

.pending-actions {
    display: flex;
    gap: 8px;
}

.approve-btn {
    padding: 8px 16px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.approve-btn:hover {
    background: #059669;
}

.reject-btn {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.reject-btn:hover {
    background: #dc2626;
}

/* ==================== 响应式设计 ==================== */

/* 平板 (≤768px) */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    header h1 {
        font-size: 20px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    .tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 12px;
    }

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

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 20px;
    }

    .task-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 15px;
    }

    .auth-tabs {
        flex-direction: column;
    }

    .admin-nav {
        flex-direction: column;
    }

    .admin-tab-btn {
        width: 100%;
        text-align: center;
    }

    .admin-table {
        font-size: 12px;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 4px;
    }

    .toast-container {
        left: 10px;
        right: 10px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* 手机 (≤480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    header h1 {
        font-size: 18px;
    }

    nav {
        gap: 3px;
    }

    .tab {
        padding: 6px 10px;
        font-size: 11px;
    }

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

    .card h3 {
        font-size: 16px;
    }

    .filters {
        flex-direction: column;
    }

    .filters select,
    .filters input {
        width: 100%;
    }

    .task-item {
        padding: 12px;
    }

    .task-header {
        flex-direction: column;
        gap: 8px;
    }

    .task-title {
        font-size: 14px;
    }

    .task-meta {
        font-size: 12px;
        flex-wrap: wrap;
    }

    .modal-content {
        width: 98%;
        padding: 10px;
    }

    input, select, textarea {
        font-size: 14px;
    }

    .api-endpoint {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .api-endpoint .path {
        word-break: break-all;
    }

    .toast {
        padding: 12px;
    }

    .toast-title {
        font-size: 13px;
    }

    .toast-message {
        font-size: 12px;
    }
}

/* 大屏幕 (>1200px) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }

    .task-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 打印样式 */
@media print {
    nav, .btn-primary, .btn-secondary, .filters {
        display: none;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
