/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --bg: #0a0a0f;
    --bg-card: #16161d;
    --bg-card-hover: #1e1e28;
    --text: #ffffff;
    --text-secondary: #a1a1aa;
    --border: #27272a;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Header */
.header {
    text-align: center;
    padding: 3rem 0 2rem;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.search-box {
    max-width: 500px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

/* Category */
.category {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.category.hidden {
    display: none;
}

/* Tools Grid */
.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

/* Tool Card */
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tool-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.tool-card.hidden {
    display: none;
}

.tool-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.tool-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-grow: 1;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 0 2rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer-note {
    font-size: 0.85rem;
}

/* 工具页面通用样式 */
.tool-page {
    max-width: 800px;
    margin: 0 auto;
}

.tool-header {
    text-align: center;
    padding: 2rem 0;
}

.tool-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tool-header p {
    color: var(--text-secondary);
}

.tool-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
}

textarea, input[type="text"], input[type="number"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

textarea:focus, input:focus {
    border-color: var(--primary);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
}

.result-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: 12px;
    border: 2px solid var(--border);
}

.result-box pre {
    white-space: pre-wrap;
    word-break: break-all;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .tool-cards {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
