/* Global styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --font-mono: 'Consolas', 'Monaco', monospace;
    --header-height: 64px;
    --content-max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-secondary);
}

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

/* Navigation */
.navbar {
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    display: flex;
    align-items: center;
    height: 64px;
    gap: 1rem;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
}

/* 返回按钮样式 */
.back-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-radius: 0.5rem;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    height: 40px;
    line-height: 1;
}

.back-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.back-btn i {
    font-size: 1.25rem;
    color: inherit;
}

.navbar-menu {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.navbar-menu a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
}

.navbar-menu a:hover {
    background-color: var(--bg-secondary);
}

/* Search box */
.search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 0.5rem;
    gap: 0.5rem;
    min-width: 300px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
}

.search-box-large {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    border-radius: 0.75rem;
    padding: 1rem;
    gap: 0.75rem;
    max-width: 600px;
    margin: 2rem auto;
    box-shadow: var(--shadow);
}

.search-box-large input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 1.125rem;
}

/* Hero section */
.hero {
    background-color: var(--bg-color);
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

/* Tool cards */
.tool-section {
    margin: 3rem 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tool-card {
    background-color: var(--bg-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.tool-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tool-icon i {
    font-size: 2rem;
    color: var(--primary-color);
}

.tool-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: #6b7280;
    margin-bottom: 1rem;
}

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

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

.category-header i {
    font-size: 2rem;
    color: var(--primary-color);
}

.category-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.category-header p {
    color: #6b7280;
}

/* Badge */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-new {
    background-color: #22c55e;
    color: white;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
}

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

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

/* No results */
.no-results {
    text-align: center;
    padding: 3rem;
    background-color: var(--bg-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

.no-results i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.no-results p {
    font-size: 1.25rem;
    color: var(--text-color);
}

.no-results .sub {
    font-size: 1rem;
    color: #6b7280;
}

/* Footer */
.footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: #6b7280;
}

.footer-main {
    text-align: center;
    flex: 1;
}

.visitor-stats {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.visitor-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 0.5rem;
    min-width: 120px;
}

.visitor-stats .stat-item i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.visitor-stats .stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.visitor-stats .stat-number {
    font-weight: 600;
    color: var(--primary-color);
    margin-left: auto;
}

/* Responsive design */
@media (max-width: 768px) {
    .navbar-container {
        flex-wrap: wrap;
        height: auto;
        padding: 1rem;
    }

    .back-btn {
        order: 1;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .navbar-brand {
        order: 2;
        font-size: 1.1rem;
    }

    .search-box {
        order: 3;
        width: 100%;
        min-width: auto;
    }

    .navbar-menu {
        order: 2;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .visitor-stats {
        justify-content: center;
        gap: 1rem;
    }

    .visitor-stats .stat-item {
        min-width: 100px;
        font-size: 0.875rem;
    }
}

/* Loading spinner */
.spinner {
    display: none;
    width: 40px;
    height: 40px;
    margin: 2rem auto;
    border: 4px solid var(--bg-secondary);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具下拉菜单 */
.tools-dropdown {
    position: relative;
    margin-right: 1rem;
}

.tools-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tools-dropdown-btn:hover {
    background-color: var(--bg-secondary);
}

.tools-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 320px;
    max-height: 80vh;
    overflow-y: auto;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    z-index: 1000;
    margin-top: 0.5rem;
}

.tools-dropdown.active .tools-dropdown-content {
    display: block;
}

.category-group {
    border-bottom: 1px solid var(--border-color);
}

.category-group:last-child {
    border-bottom: none;
}

.category-group .category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    font-weight: 500;
}

.category-group .category-header i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.category-tools {
    padding: 0.5rem 0;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s;
}

.tool-item:hover {
    background-color: var(--bg-secondary);
}

.tool-item i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-name {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.tool-desc {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 滚动条样式 */
.tools-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.tools-dropdown-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.tools-dropdown-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.tools-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tools-dropdown {
        order: 1;
        width: 100%;
        margin-right: 0;
    }

    .tools-dropdown-content {
        width: 100%;
        max-height: 60vh;
    }

    .tools-dropdown-btn {
        width: 100%;
        justify-content: center;
    }
} 