/* 首页样式 - index.php */

/* 图片加载优化 */
.agent-avatar {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* 减少重绘 */
.agent-card-mobile, .agent-card {
    contain: layout style paint;
}

/* 预设图片尺寸避免布局抖动 */
.agent-avatar {
    width: 60px;
    height: 60px;
    background-color: #f8f9fa;
}

@media (min-width: 768px) {
    .agent-avatar {
        width: 80px;
        height: 80px;
    }
}

/* 移动端响应式样式 */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px; /* 为底部导航留空间 */
    }

    .mobile-header {
        background: linear-gradient(135deg, #07C160 0%, #10D56A 100%);
        color: white;
        padding: 1rem;
        border-radius: 0 0 1rem 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 4px 15px rgba(7, 193, 96, 0.3);
    }

    .hero-mobile {
        text-align: center;
        padding: 2rem 1rem;
    }

    .hero-mobile h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
        font-weight: 700;
    }

    .hero-mobile p {
        opacity: 0.9;
        margin-bottom: 1.5rem;
    }

    .quick-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin: 1rem 0;
    }

    .quick-action {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 1rem;
        padding: 1rem;
        text-decoration: none;
        color: #2c3e50;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(10px);
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .quick-action:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        color: #2c3e50;
        text-decoration: none;
    }

    .quick-action i {
        font-size: 1.8rem;
        margin-bottom: 0.7rem;
    }

    .quick-action .fw-bold {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .quick-action small {
        font-size: 0.75rem;
    }

    /* 移动端特色功能区域 */
    .mobile-features {
        padding: 1.5rem 1rem;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 1rem;
        margin: 1rem 0;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(10px);
    }

    .mobile-features h3 {
        color: #2c3e50;
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 1rem;
        text-align: center;
    }

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

    .feature-item {
        text-align: center;
        padding: 1rem;
        background: rgba(7, 193, 96, 0.05);
        border-radius: 0.75rem;
        border: 1px solid rgba(7, 193, 96, 0.1);
    }

    .feature-item i {
        font-size: 1.5rem;
        color: #07C160;
        margin-bottom: 0.5rem;
        display: block;
    }

    .feature-item h5 {
        font-size: 0.9rem;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 0.25rem;
    }

    .feature-item p {
        font-size: 0.75rem;
        color: #6c757d;
        margin: 0;
        line-height: 1.3;
    }

    /* 移动端智能体卡片 */
    .agent-card-mobile {
        background: rgba(255, 255, 255, 0.95);
        border: none;
        border-radius: 1rem;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(10px);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .agent-card-mobile::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
        background-size: 200% 100%;
        animation: cardGlow 3s ease-in-out infinite;
    }

    @keyframes cardGlow {
        0%, 100% { background-position: 0% 0%; }
        50% { background-position: 100% 0%; }
    }

    .agent-card-mobile:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }

    /* 修复移动端智能体卡片头部布局 */
    .agent-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .agent-avatar-wrapper {
        position: relative;
        flex-shrink: 0;
    }

    .agent-avatar-wrapper .agent-avatar {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        border: 2px solid #fff;
        box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
        object-fit: cover;
        transition: all 0.3s ease;
    }

    .agent-card-mobile:hover .agent-avatar-wrapper .agent-avatar {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(7, 193, 96, 0.4);
    }

    .agent-info {
        flex-grow: 1;
        min-width: 0; /* 防止内容溢出 */
    }

    .agent-name {
        margin: 0 0 0.25rem 0;
        font-size: 1rem;
        font-weight: 700;
        color: #2c3e50;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .agent-title {
        font-size: 0.8rem;
        color: #6c757d;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 标签区域 */
    .agent-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .agent-badges .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0.5rem;
        font-weight: 600;
    }

    /* 描述区域 */
    .agent-description {
        font-size: 0.8rem;
        color: #6c757d;
        line-height: 1.4;
        margin-bottom: 1rem;
        padding: 0.75rem;
        background: rgba(7, 193, 96, 0.05);
        border-radius: 0.5rem;
        border-left: 3px solid #07C160;
    }

    /* 底部操作区域 */
    .agent-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .agent-stats {
        display: flex;
        gap: 1rem;
    }

    .stat-item {
        display: flex;
        align-items: center;
        gap: 0.3rem;
    }

    .stat-item i {
        color: #07C160;
        font-size: 0.8rem;
    }

    .stat-item span {
        font-size: 0.8rem;
        color: #6c757d;
        font-weight: 600;
    }

    .agent-action-btn {
        flex-shrink: 0;
    }

    .agent-action-btn .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        border-radius: 0.75rem;
        font-weight: 600;
        transition: all 0.3s ease;
        border: none;
        white-space: nowrap;
    }

    .agent-action-btn .btn-success {
        background: linear-gradient(135deg, #2ed573, #1dd1a1);
        box-shadow: 0 4px 10px rgba(46, 213, 115, 0.3);
    }

    .agent-action-btn .btn-warning {
        background: linear-gradient(135deg, #ffa502, #ff7f50);
        box-shadow: 0 4px 10px rgba(255, 165, 2, 0.3);
    }

    .agent-action-btn .btn-primary {
        background: linear-gradient(135deg, #667eea, #764ba2);
        box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    }

    .agent-action-btn .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    }

    /* 移动端统计信息 */
    .mobile-stats {
        display: flex;
        justify-content: space-around;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 1rem;
        margin: 1rem 0;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(10px);
    }

    .stat-item {
        text-align: center;
        flex: 1;
    }

    .stat-item i {
        font-size: 1.5rem;
        color: #07C160;
        margin-bottom: 0.5rem;
        display: block;
    }

    .stat-item .stat-number {
        font-size: 1.2rem;
        font-weight: 700;
        color: #2c3e50;
        display: block;
    }

    .stat-item .stat-label {
        font-size: 0.8rem;
        color: #6c757d;
        margin-top: 0.25rem;
    }

    /* 移动端底部导航 */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e9ecef;
        padding: 0.5rem 0;
        z-index: 1000;
        box-shadow: 0 -3px 10px rgba(0,0,0,0.05);
    }

    .bottom-nav .nav-item {
        flex: 1;
        text-align: center;
    }

    .bottom-nav .nav-link {
        color: #6c757d;
        padding: 0.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        font-size: 0.75rem;
        transition: all 0.3s ease;
    }

    .bottom-nav .nav-link:hover,
    .bottom-nav .nav-link.active {
        color: #07C160;
    }

    .bottom-nav .nav-link i {
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
    }

    /* 隐藏桌面版导航和英雄区域 */
    .navbar, .hero-section, .footer-section {
        display: none;
    }

    /* 调整智能体展示区域 */
    .agents-section {
        padding: 1rem 0;
    }

    .main-content {
        margin-top: 0;
    }
}

/* 桌面端隐藏移动端元素 */
@media (min-width: 769px) {
    .mobile-header, .quick-actions, .bottom-nav, .agent-card-mobile, .mobile-features {
        display: none;
    }
}
