/* 工具网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
    padding: 0.5rem 0;
}

/* 移动端优化 - 确保双列布局 */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}
/* 工具卡片 */
.tool-card {
    background: var(--gradient-card);
    border-radius: 24px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    /* 增加微妙的渐变边框 */
    background-clip: padding-box;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
    border-radius: 24px 24px 0 0;
}

.tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-overlay);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
    border-radius: 24px;
}

.tool-card:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: var(--shadow-2xl), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border-color: var(--border-accent);
    background: var(--card-bg-hover);
    filter: brightness(1.02);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover::after {
    opacity: 1;
}

.tool-card:active {
    transform: translateY(-2px) scale(1.04);
    transition: all 0.1s ease;
}

.tool-card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 2;
}

/* 标题行布局 */
.tool-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0;
    background: var(--gradient-accent);
    color: white;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    /* 增加文字阴影 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tool-card:hover .tool-icon {
    transform: scale(1.2) rotate(12deg);
    box-shadow: var(--shadow-2xl), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    filter: brightness(1.1) saturate(1.1);
}

.tool-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--gradient-shimmer);
    transform: rotate(45deg) translate(-100%, -100%);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tool-card:hover .tool-icon::before {
    transform: rotate(45deg) translate(100%, 100%);
}

.tool-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0;
    line-height: 1.3;
    transition: color 0.3s ease;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
}

.tool-card:hover .tool-title {
    color: var(--accent-color);
}

.tool-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    transition: color 0.3s ease;
}

.tool-card:hover .tool-description {
    color: var(--text-primary);
}

.tool-card-footer {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.tool-status {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-active { 
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.tool-card:hover .status-active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.08));
    transform: scale(1.05);
}

.status-beta { 
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.05));
    color: #d97706;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.tool-card:hover .status-beta {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.08));
    transform: scale(1.05);
}

.status-coming { 
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.1), rgba(156, 163, 175, 0.05));
    color: #6b7280;
    border: 1px solid rgba(156, 163, 175, 0.2);
}

.tool-card:hover .status-coming {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.15), rgba(156, 163, 175, 0.08));
    transform: scale(1.05);
}

.tool-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tool-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: width 0.3s ease;
}

.tool-link:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

.tool-link:hover::after {
    width: 100%;
}

/* 工具卡片状态样式 */
.tool-card[data-status="coming"] {
    opacity: 0.7;
    cursor: not-allowed;
}

.tool-card[data-status="coming"]:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-color: var(--border-color);
}

.tool-card[data-status="coming"]::before {
    display: none;
}

/* 卡片加载动画 - 使用公共动画库 */
.tool-card {
    animation: cardSlideIn 0.6s ease-out;
}

/* 快速访问菜单 */
.quick-menu {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.quick-menu-btn {
    width: 56px;
    height: 56px;
    background: var(--gradient-accent);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    /* 添加浮动动画 */
    animation: float 4s ease-in-out infinite;
}

.quick-menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-shimmer);
    transition: left 0.6s ease;
    pointer-events: none;
}

.quick-menu-btn:hover {
    transform: scale(1.2) rotate(12deg);
    box-shadow: var(--shadow-2xl), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    filter: brightness(1.1);
    animation-play-state: paused;
}

.quick-menu-btn:hover::before {
    left: 100%;
}

.quick-menu-btn:active {
    transform: scale(0.9);
    transition: all 0.1s ease;
}

.quick-menu-btn:focus {
    outline: none;
    box-shadow: var(--shadow-2xl), 0 0 0 4px var(--focus-ring);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        margin-top: 1rem;
    }
    
    .tool-card {
        border-radius: 20px;
    }
    
    .tool-card-header {
        padding: 0.9rem;
    }
    
    .tool-card-footer {
        padding: 0.7rem 0.9rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
    }
    
    .tool-title-row {
        gap: 0.6rem;
        margin-bottom: 0.6rem;
    }
    
    .tool-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        border-radius: 14px;
        margin-bottom: 0;
    }
    
    .tool-title {
        font-size: 0.95rem;
        margin-bottom: 0;
    }
    
    .tool-description {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    
    .tool-status {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
        border-radius: 10px;
    }
    
    .tool-link {
        font-size: 0.8rem;
    }
    
    .quick-menu {
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .quick-menu-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .tools-grid {
        gap: 0.6rem;
        margin-top: 0.8rem;
    }
    
    .tool-card {
        border-radius: 18px;
        min-height: 140px; /* 确保卡片有最小高度 */
    }
    
    .tool-card-header {
        padding: 0.8rem 0.7rem;
    }
    
    .tool-card-footer {
        padding: 0.6rem 0.7rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
        min-height: 36px; /* 确保footer有足够高度 */
    }
    
    .tool-title-row {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .tool-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        border-radius: 12px;
        margin-bottom: 0;
    }
    
    .tool-title {
        font-size: 0.9rem;
        margin-bottom: 0;
        line-height: 1.2;
    }
    
    .tool-description {
        font-size: 0.7rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* 限制描述为2行 */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .tool-status {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
        border-radius: 8px;
        white-space: nowrap; /* 防止状态文字换行 */
    }
    
    .tool-link {
        font-size: 0.75rem;
        white-space: nowrap; /* 防止链接文字换行 */
    }
    
    .quick-menu {
        bottom: 1rem;
        right: 1rem;
    }
    
    .quick-menu-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .tools-grid {
        gap: 0.5rem;
    }
    
    .tool-card-header {
        padding: 0.7rem 0.6rem;
    }
    
    .tool-card-footer {
        padding: 0.5rem 0.6rem;
    }
    
    .tool-title {
        font-size: 0.85rem;
    }
    
    .tool-description {
        font-size: 0.65rem;
    }
    
    .tool-status {
        font-size: 0.55rem;
        padding: 0.1rem 0.3rem;
    }
    
    .tool-link {
        font-size: 0.7rem;
    }
}