/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    padding: 20px;
    padding-left: 240px;
}

/* ===== 侧边栏 ===== */
.sidenav {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: #1a1a2e;
    color: #fff;
    padding: 20px 0;
    overflow-y: auto;
    z-index: 100;
}

.sidenav .sidebar-logo {
    text-align: center;
    padding: 0 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}

.sidenav .sidebar-logo img {
    max-width: 60px;
    height: auto;
    display: block;
    margin: 0 auto 8px;
}

.sidenav .sidebar-logo .site-name {
    font-size: 16px;
    font-weight: 700;
    display: block;
    color: #fff;
}

.sidenav-header {
    padding: 0 12px;
}

.sidenav-header .navbar-list {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #aaa;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    font-size: 14px;
}

.sidenav-header .navbar-list:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidenav-header .navbar-list .nav-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
}

.sidenav-header hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 12px 0;
}

/* ===== 主容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== 头部 ===== */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 30px;
    flex-wrap: wrap;
    gap: 12px;
}

.site-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
}

.search-box {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    padding: 4px 4px 4px 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.search-box:focus-within {
    border-color: #667eea;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
    background: transparent;
    min-width: 180px;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.search-btn:hover {
    opacity: 0.9;
}

/* ===== 分类标题 ===== */
.category-section {
    margin-bottom: 40px;
}

.category-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    padding-bottom: 12px;
    border-bottom: 3px solid #667eea;
    margin-bottom: 18px;
}

/* ===== 卡片网格 ===== */
.link-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

/* ===== 卡片样式 ===== */
.web-box {
    cursor: pointer;
}

.web-box-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 56px;
}

.web-box-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.15);
}

.web-icon .icon-emoji {
    font-size: 28px;
    line-height: 1;
    display: block;
}

.web-text {
    flex: 1;
    min-width: 0;
}

.web-text h5 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.web-text p {
    font-size: 12px;
    color: #999;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 后台入口小标签 ===== */
.admin-entry {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #e8e8e8;
}

.admin-entry a {
    color: #bbb;
    font-size: 13px;
    text-decoration: none;
}

.admin-entry a:hover {
    color: #667eea;
}

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
    .link-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
        padding-left: 12px;
    }
    .sidenav {
        display: none;
    }
    .link-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .header-top {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        max-width: 100%;
    }
    .search-input {
        min-width: 100px;
    }
}

@media (max-width: 500px) {
    .link-grid {
        grid-template-columns: 1fr;
    }
    .site-title {
        font-size: 22px;
        text-align: center;
    }
    .web-box-card {
        padding: 10px 14px;
    }
}