:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --shadow-default: 0 3px 6px rgba(0, 0, 0, 0.16);
    --transition-default: all 0.3s cubic-bezier(.25, .8, .25, 1);
}

/* 站长信息板样式 */
.author-panel {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-default);
    margin-bottom: 2rem;
}

.author-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--secondary-color);
    object-fit: cover;
    margin: 0 auto 1rem;
    display: block;
}

.author-bio {
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.author-contact {
    text-align: center;
    color: var(--accent-color);
    font-weight: bold;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-areas:
        "header header"
        "sidebar main"
        "footer footer";
    min-height: 100vh;
}

.header {
    grid-area: header;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
}

/* 当 header 通过容器动态注入时，容器需要参与 Grid 布局 */
#header-container {
    grid-area: header;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar {
    grid-area: sidebar;
    background-color: #f5f5f5;
    padding: 2rem 1rem 1rem 1rem;
    margin-top: 1rem;
}

.main-content {
    grid-area: main;
    padding: 2rem 1.5rem 1rem 1.5rem;
    margin-top: 1rem;
}

.footer {
    grid-area: footer;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2.5rem 1rem;
    font-size: 0.95rem;
}

.footer p {
    margin-bottom: 0.75rem;
}


.tools-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.tool-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.tool-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.tool-card h3 {
    margin: 0.5rem 0;
    color: var(--primary-color);
}

.tool-card p {
    color: #666;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.tool-btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--secondary-color);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "sidebar"
            "footer";
    }

    .tools-container {
        grid-template-columns: 1fr;
    }
}

.category-tags {
    margin: 1rem 0;
    text-align: left;
}

.category-btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.4rem 1.2rem;
    border: none;
    border-radius: 20px;
    background: #f0f2f5;
    color: #333;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-size: 1rem;
}

.category-btn.active,
.category-btn:hover {
    background: #3498db;
    color: #fff;
}

.popular-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.popular-list li {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.popular-list li:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.popular-list .rank {
    width: 24px;
    height: 24px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-size: 0.8rem;
}

.popular-list i {
    margin-right: 0.5rem;
    color: #3498db;
}

.popular-list .tool-name {
    flex: 1;
}

.popular-list .visits {
    font-size: 0.8rem;
    color: #666;
}
.popular-tool-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.popular-tool-link:hover {
    background-color: #f0f0f0;
}