/* 基础重置与排版 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* 顶部导航 */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 2rem 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
header h1 { 
    font-size: 2.2rem; 
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
header p { 
    font-size: 1rem; 
    color: #666;
}

/* 搜索框 */
.search-container {
    max-width: 600px;
    margin: 1.5rem auto 0;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input::placeholder {
    color: #a0aec0;
}

/* 主体内容 */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* 历史记录区块 */
.history-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    animation: fadeInUp 0.6s ease-out;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.history-title {
    font-size: 1.3rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-history-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.clear-history-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.history-item {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
}

.history-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.history-icon {
    font-size: 1.8rem;
}

.history-info {
    flex: 1;
}

.history-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.2rem;
}

.history-time {
    font-size: 0.75rem;
    color: #a0aec0;
}

.remove-history {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    background: rgba(245, 101, 101, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    color: #e53e3e;
    font-size: 1rem;
}

.history-item:hover .remove-history {
    opacity: 1;
}

.remove-history:hover {
    background: rgba(245, 101, 101, 0.2);
    transform: scale(1.1);
}

.empty-history {
    text-align: center;
    padding: 2rem;
    color: #a0aec0;
    font-size: 0.95rem;
}

/* 分类区块 */
.category-section {
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.6s ease-out;
}

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

.category-title {
    color: white;
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.category-icon {
    font-size: 1.8rem;
}

/* 工具卡片网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}

/* 工具按钮卡片 */
.tool-card {
    background: white;
    border-radius: 16px;
    padding: 1.8rem;
    text-decoration: none;
    color: #333;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

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

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 0.3rem;
}

.tool-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
}

.tool-desc {
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.5;
}

.tool-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: auto;
    align-self: flex-start;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .category-title {
        font-size: 1.3rem;
    }

    main {
        padding: 0 1rem;
    }
}

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

/* 页脚 */
footer {
    text-align: center;
    padding: 2rem 1rem;
    background-color: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-top: 3rem;
}

footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}
