/* 动画定义 */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 108, 247, 0.3);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 108, 247, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 108, 247, 0);
    }
}

/* 页面标题区域 */
.page-header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
    animation: slideUp 0.8s ease forwards;
}

.page-header p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 30px;
    color: var(--text-secondary-light);
    animation: slideUp 0.8s ease 0.2s forwards;
    opacity: 0;
}

body.dark-mode .page-header p {
    color: var(--text-secondary-dark);
}

/* 通知信息样式 */
.notice {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 15px 20px;
    font-size: 15px;
    color: white;
    margin: 0 auto 30px;
    width: 90%;
    max-width: 800px;
    box-sizing: border-box;
    box-shadow: 0 10px 25px -5px rgba(74, 108, 247, 0.3);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease 0.4s forwards;
    opacity: 0;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 100%);
    z-index: -1;
    border-radius: 12px;
}

.notice::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shine 4s linear infinite;
}

.notice p {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-weight: 500;
}

.notice p::before {
    content: '\f3ed'; /* FontAwesome 盾牌图标 */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 12px;
    font-size: 20px;
    position: relative;
    animation: pulse 2s infinite;
}

/* 工具卡片容器 */
#tool-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* 工具卡片基础样式 */
.tool-card {
    background: var(--card-light);
    border-radius: 18px;
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    text-align: center;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: slideUp 0.5s ease forwards;
    animation-delay: calc(var(--card-index, 0) * 0.05s + 0.6s);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.04),
        0 15px 35px rgba(74, 108, 247, 0.05);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.tool-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background-image: 
        radial-gradient(circle at bottom right, 
            rgba(74, 108, 247, 0.08), 
            transparent 70%);
    border-radius: 0 0 18px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

body.dark-mode .tool-card {
    background: var(--card-dark);
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.15),
        0 15px 35px rgba(74, 108, 247, 0.1);
}

.tool-card, .tool-card * {
    text-decoration: none !important;
}

.tool-card .icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tool-card:hover .icon-wrapper {
    transform: translateY(-5px);
}

.tool-card .icon-bg {
    position: absolute;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, rgba(74, 108, 247, 0.1) 0%, rgba(22, 219, 147, 0.1) 100%);
    border-radius: 16px;
    transform: rotate(10deg);
    transition: all 0.3s ease;
}

.tool-card:hover .icon-bg {
    transform: rotate(0deg) scale(1.1);
}

.tool-card i {
    font-size: 32px;
    color: var(--primary-color);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.tool-card h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s;
    position: relative;
    z-index: 2;
}

body.dark-mode .tool-card h3 {
    color: var(--text-dark);
}

.tool-card .card-description {
    font-size: 14px;
    color: var(--text-secondary-light);
    margin: 0;
    transition: all 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark-mode .tool-card .card-description {
    color: var(--text-secondary-dark);
}

/* 卡片悬停效果 */
.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.08),
        0 15px 35px rgba(74, 108, 247, 0.1);
}

body.dark-mode .tool-card:hover {
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 15px 35px rgba(74, 108, 247, 0.15);
}

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

body.dark-mode .tool-card:hover h3 {
    color: var(--primary-light);
}

/* 类别标签 */
.tool-card .category-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(74, 108, 247, 0.1);
    color: var(--primary-color);
    font-weight: 500;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

body.dark-mode .tool-card .category-tag {
    background: rgba(74, 108, 247, 0.2);
    color: var(--primary-light);
}

.tool-card:hover .category-tag {
    opacity: 1;
    transform: translateY(0);
}

/* 各工具卡片的独特样式 */
/* JSON格式化工具 */
.tool-card[data-category="format"] i {
    color: #F15A2B;
}

.tool-card[data-category="format"] .icon-bg {
    background: linear-gradient(135deg, rgba(241, 90, 43, 0.1) 0%, rgba(252, 176, 69, 0.1) 100%);
}

.tool-card[data-category="format"] .category-tag {
    background: rgba(241, 90, 43, 0.1);
    color: #F15A2B;
}

.tool-card[data-category="format"]::before {
    background: linear-gradient(90deg, #F15A2B, #FCB045);
}

/* HTML预览工具 */
.tool-card[data-category="preview"] i {
    color: #FF6B6B;
}

.tool-card[data-category="preview"] .icon-bg {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 158, 94, 0.1) 100%);
}

.tool-card[data-category="preview"] .category-tag {
    background: rgba(255, 107, 107, 0.1);
    color: #FF6B6B;
}

.tool-card[data-category="preview"]::before {
    background: linear-gradient(90deg, #FF6B6B, #FF9E5E);
}

/* 密码生成工具 */
.tool-card[data-category="security"] i {
    color: #16DB93;
}

.tool-card[data-category="security"] .icon-bg {
    background: linear-gradient(135deg, rgba(22, 219, 147, 0.1) 0%, rgba(126, 217, 87, 0.1) 100%);
}

.tool-card[data-category="security"] .category-tag {
    background: rgba(22, 219, 147, 0.1);
    color: #16DB93;
}

.tool-card[data-category="security"]::before {
    background: linear-gradient(90deg, #16DB93, #7ED957);
}

/* UUID生成工具 */
.tool-card[data-category="generator"] i {
    color: #4DC9F6;
}

.tool-card[data-category="generator"] .icon-bg {
    background: linear-gradient(135deg, rgba(77, 201, 246, 0.1) 0%, rgba(34, 163, 211, 0.1) 100%);
}

.tool-card[data-category="generator"] .category-tag {
    background: rgba(77, 201, 246, 0.1);
    color: #4DC9F6;
}

.tool-card[data-category="generator"]::before {
    background: linear-gradient(90deg, #4DC9F6, #22A3D3);
}

/* 九宫格工具 */
.tool-card[data-category="grid"] i {
    color: #A06AF9;
}

.tool-card[data-category="grid"] .icon-bg {
    background: linear-gradient(135deg, rgba(160, 106, 249, 0.1) 0%, rgba(116, 59, 211, 0.1) 100%);
}

.tool-card[data-category="grid"] .category-tag {
    background: rgba(160, 106, 249, 0.1);
    color: #A06AF9;
}

.tool-card[data-category="grid"]::before {
    background: linear-gradient(90deg, #A06AF9, #743BD3);
}

/* Base64转换工具 */
.tool-card[data-category="converter"] i {
    color: #FF9E5E;
}

.tool-card[data-category="converter"] .icon-bg {
    background: linear-gradient(135deg, rgba(255, 158, 94, 0.1) 0%, rgba(255, 179, 64, 0.1) 100%);
}

.tool-card[data-category="converter"] .category-tag {
    background: rgba(255, 158, 94, 0.1);
    color: #FF9E5E;
}

.tool-card[data-category="converter"]::before {
    background: linear-gradient(90deg, #FF9E5E, #FFB340);
}

/* Emoji选择器 */
.tool-card[data-category="emoji"] i {
    color: #FFD93D;
}

.tool-card[data-category="emoji"] .icon-bg {
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.1) 0%, rgba(255, 189, 46, 0.1) 100%);
}

.tool-card[data-category="emoji"] .category-tag {
    background: rgba(255, 217, 61, 0.1);
    color: #EB9E1D;
}

.tool-card[data-category="emoji"]::before {
    background: linear-gradient(90deg, #FFD93D, #FFBD2E);
}

/* 趣味数学大冒险 */
.tool-card[data-category="math"] i {
    color: #6C63FF;
}

.tool-card[data-category="math"] .icon-bg {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1) 0%, rgba(63, 81, 181, 0.1) 100%);
}

.tool-card[data-category="math"] .category-tag {
    background: rgba(108, 99, 255, 0.1);
    color: #6C63FF;
}

.tool-card[data-category="math"]::before {
    background: linear-gradient(90deg, #6C63FF, #3F51B5);
}

/* 封面图制作 */
.tool-card[data-category="image"] i {
    color: #F86E6E;
}

.tool-card[data-category="image"] .icon-bg {
    background: linear-gradient(135deg, rgba(248, 110, 110, 0.1) 0%, rgba(255, 89, 89, 0.1) 100%);
}

.tool-card[data-category="image"] .category-tag {
    background: rgba(248, 110, 110, 0.1);
    color: #F86E6E;
}

.tool-card[data-category="image"]::before {
    background: linear-gradient(90deg, #F86E6E, #FF5959);
}

/* 字幕截图生成器 */
.tool-card[data-category="subtitle"] i {
    color: #20BFA9;
}

.tool-card[data-category="subtitle"] .icon-bg {
    background: linear-gradient(135deg, rgba(32, 191, 169, 0.1) 0%, rgba(44, 216, 213, 0.1) 100%);
}

.tool-card[data-category="subtitle"] .category-tag {
    background: rgba(32, 191, 169, 0.1);
    color: #20BFA9;
}

.tool-card[data-category="subtitle"]::before {
    background: linear-gradient(90deg, #20BFA9, #2CD8D5);
}

/* 游戏类别样式 */
/* 无限射击游戏 - 红色主题 */
.tool-card[style*="--card-index: 12"] i {
    color: #FF4757;
}

.tool-card[style*="--card-index: 12"] .icon-bg {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.1) 0%, rgba(255, 99, 99, 0.1) 100%);
}

.tool-card[style*="--card-index: 12"] .category-tag {
    background: rgba(255, 71, 87, 0.1);
    color: #FF4757;
}

.tool-card[style*="--card-index: 12"]::before {
    background: linear-gradient(90deg, #FF4757, #FF6B6B);
}

/* 无限防守游戏 - 绿色主题 */
.tool-card[style*="--card-index: 13"] i {
    color: #2ED573;
}

.tool-card[style*="--card-index: 13"] .icon-bg {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.1) 0%, rgba(0, 206, 201, 0.1) 100%);
}

.tool-card[style*="--card-index: 13"] .category-tag {
    background: rgba(46, 213, 115, 0.1);
    color: #2ED573;
}

.tool-card[style*="--card-index: 13"]::before {
    background: linear-gradient(90deg, #2ED573, #00CEC9);
}

/* 符文法师游戏 - 紫色主题 */
.tool-card[style*="--card-index: 14"] i {
    color: #A55EEA;
}

.tool-card[style*="--card-index: 14"] .icon-bg {
    background: linear-gradient(135deg, rgba(165, 94, 234, 0.1) 0%, rgba(116, 59, 211, 0.1) 100%);
}

.tool-card[style*="--card-index: 14"] .category-tag {
    background: rgba(165, 94, 234, 0.1);
    color: #A55EEA;
}

.tool-card[style*="--card-index: 14"]::before {
    background: linear-gradient(90deg, #A55EEA, #743BD3);
}

/* 生态瓶工程师（经典版）- 橙色主题 */
.tool-card[style*="--card-index: 15"] i {
    color: #FF9F43;
}

.tool-card[style*="--card-index: 15"] .icon-bg {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.1) 0%, rgba(255, 177, 43, 0.1) 100%);
}

.tool-card[style*="--card-index: 15"] .category-tag {
    background: rgba(255, 159, 67, 0.1);
    color: #FF9F43;
}

.tool-card[style*="--card-index: 15"]::before {
    background: linear-gradient(90deg, #FF9F43, #FFB12B);
}

/* 生态瓶工程师（增强版）- 青色主题 */
.tool-card[style*="--card-index: 16"] i {
    color: #26D0CE;
}

.tool-card[style*="--card-index: 16"] .icon-bg {
    background: linear-gradient(135deg, rgba(38, 208, 206, 0.1) 0%, rgba(0, 184, 169, 0.1) 100%);
}

.tool-card[style*="--card-index: 16"] .category-tag {
    background: rgba(38, 208, 206, 0.1);
    color: #26D0CE;
}

.tool-card[style*="--card-index: 16"]::before {
    background: linear-gradient(90deg, #26D0CE, #00B8A9);
}

/* 特色卡片指示器 */
.featured-indicator {
    position: absolute;
    top: -1px;
    left: 20px;
    background: linear-gradient(135deg, #FF6B6B, #FFE66D);
    color: white;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3;
}

.tool-card:hover .featured-indicator {
    transform: translateY(0);
    opacity: 1;
}

.featured-indicator i {
    color: white !important;
    font-size: 11px !important;
    margin-right: 4px;
}

/* 工具分类区域 */
.categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 auto 30px;
    max-width: 900px;
    padding: 0 20px;
}

.category-button {
    background: rgba(74, 108, 247, 0.08);
    color: var(--primary-color);
    border: none;
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    animation: slideUp 0.5s ease forwards;
    opacity: 0;
    animation-delay: calc(var(--btn-index, 0) * 0.05s + 0.5s);
}

.category-button:hover {
    background: rgba(74, 108, 247, 0.15);
    transform: translateY(-2px);
}

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

body.dark-mode .category-button {
    background: rgba(74, 108, 247, 0.12);
    color: var(--primary-light);
}

body.dark-mode .category-button:hover {
    background: rgba(74, 108, 247, 0.2);
}

body.dark-mode .category-button.active {
    background: var(--primary-color);
    color: white;
}

/* 工具卡片下方的提示 */
.card-tooltip {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.tool-card:hover .card-tooltip {
    opacity: 1;
    animation: float 2s ease-in-out infinite;
}

/* 空状态 */
.empty-state {
    width: 100%;
    padding: 50px 20px;
    text-align: center;
    display: none;
}

.empty-state img {
    width: 200px;
    height: auto;
    opacity: 0.7;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-light);
}

.empty-state p {
    color: var(--text-secondary-light);
    max-width: 500px;
    margin: 0 auto;
}

body.dark-mode .empty-state h3 {
    color: var(--text-dark);
}

body.dark-mode .empty-state p {
    color: var(--text-secondary-dark);
}

/* 工具列表上方的统计信息 */
.tools-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    animation: slideUp 0.5s ease 0.3s forwards;
    opacity: 0;
}

.stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    border-radius: 12px;
    background: var(--card-light);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

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

.stats-label {
    font-size: 14px;
    color: var(--text-secondary-light);
}

body.dark-mode .stats-item {
    background: var(--card-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body.dark-mode .stats-count {
    color: var(--primary-light);
}

body.dark-mode .stats-label {
    color: var(--text-secondary-dark);
}

/* 装饰元素 */
.decoration {
    position: absolute;
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

.dec-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 108, 247, 0.1) 0%, transparent 70%);
    top: 10%;
    left: 5%;
    animation: float 8s ease-in-out infinite;
}

.dec-dots {
    width: 180px;
    height: 180px;
    background-image: radial-gradient(rgba(74, 108, 247, 0.2) 1px, transparent 1px);
    background-size: 18px 18px;
    right: 5%;
    top: 20%;
    animation: float 10s ease-in-out infinite;
    animation-delay: 2s;
}

.dec-lines {
    width: 120px;
    height: 120px;
    background: 
        linear-gradient(90deg, transparent, transparent 49%, rgba(74, 108, 247, 0.1) 50%, transparent 51%, transparent),
        linear-gradient(0deg, transparent, transparent 49%, rgba(74, 108, 247, 0.1) 50%, transparent 51%, transparent);
    background-size: 20px 20px;
    bottom: 10%;
    left: 10%;
    animation: float 12s ease-in-out infinite;
    animation-delay: 1s;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .page-header p {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .notice {
        font-size: 13px;
        width: 95%;
        padding: 12px 10px;
    }
    
    .notice p::before {
        font-size: 18px;
        margin-right: 8px;
    }
    
    #tool-list {
        gap: 15px;
        padding: 10px;
    }
    
    .tool-card {
        width: 150px;
        height: 150px;
        padding: 15px;
        gap: 8px;
    }
    
    .tool-card .icon-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .tool-card .icon-bg {
        width: 45px;
        height: 45px;
    }
    
    .tool-card i {
        font-size: 24px;
    }
    
    .tool-card h3 {
        font-size: 15px;
    }
    
    .tool-card .card-description {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .category-button {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .tools-stats {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .stats-item {
        padding: 12px 15px;
    }
    
    .stats-count {
        font-size: 22px;
    }
    
    .stats-label {
        font-size: 12px;
    }
    
    .decoration {
        opacity: 0.3;
        transform: scale(0.7);
    }
}
