:root{
    --base-color: #f5f5f5;
    --base-variant: #ffffff;
    --text-color: #111528;
    --primary-color: #232838;
}

.night-mode{
    --base-color: #222222;
    --base-variant: #272727;
    --text-color: #ffffff;
    --primary-color: #3a435d;
}

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

body {
    font-family: "LXGW WenKai TC", cursive;
    background-color: var(--base-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.lxgw-wenkai-tc-light {
    font-family: "LXGW WenKai TC", cursive;
    font-weight: 300;
    font-style: normal;
}

.lxgw-wenkai-tc-regular {
    font-family: "LXGW WenKai TC", cursive;
    font-weight: 400;
    font-style: normal;
}

.lxgw-wenkai-tc-bold {
    font-family: "LXGW WenKai TC", cursive;
    font-weight: 700;
    font-style: normal;
}

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

/* 导航栏样式 */
.nav {
    background: var(--base-variant);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.6rem 0;
}

.nav-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.nav-title {
    font-size: 1.25rem;
    font-weight: bold;
    white-space: nowrap;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.search-input {
    width: 256px;
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    font-size: 0.875rem;
    background-color: var(--base-variant);
    color: var(--text-color);
}

.search-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

/* 主要内容区样式 */
.main-content {
    flex-grow: 1;
    padding: 2rem 2rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.1rem;
    margin-bottom: 1rem;
    border: 2px dashed #ddd;
    padding: 1rem 1rem 1.3rem 1rem;
    position: relative;
}

.clear-filter {
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.1rem 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, -50%);
}

.clear-filter:hover {
    background-color: #357ab8;
}

.tag {
    background: var(--base-variant);
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    cursor: pointer;
}

.tag:hover {
    background: #4a90e2;
    color: white;
}

.section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.section-description {
    color: #666;
    margin-bottom: 1.5rem;
}

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

.grid-item {
    background: var(--base-variant);
    border-radius: 8px;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.item-icon {
    width: 64px;
    height: 64px;
    object-fit: cover;
    margin-bottom: 0.75rem;
}

.item-name {
    font-weight: 500;
    text-align: center;
    font-size: 0.9rem;
}

/* 页脚样式 */
.footer {
    background: var(--base-variant);
    padding: 1.5rem 0;
    margin-top: auto;
}

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

.footer-text {
    color: var(--text-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.25rem;
}

.social-link:hover {
    color: #4a90e2;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-input {
        width: 110px;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

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

@media (max-width: 420px) {
    .search-input {
        display: none;
    }
    .search-icon {
        display: none;
    }
}

#theme-switch {
    height: 50px;
    width: 50px;
    padding: 0;
    border-radius: 50%;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom: 40px;
    right: 20px;
    border: none;
    cursor: pointer;
    z-index: 1000;
}

#theme-switch svg {
    fill: var(--primary-color);
    height: 24px;
    width: 24px;
}

#theme-switch svg:last-child {
    display: none;
}

.night-mode #theme-switch svg:first-child {
    display: none;
}

.night-mode #theme-switch svg:last-child {
    display: block;
}