/* ========== 薅羊毛导航 全局样式 ========== */
:root {
    --bg: #f5f5f5;
    --card-bg: #fff;
    --text: #222;
    --text-secondary: #555;
    --text-muted: #888;
    --border: #e0e0e0;
    --link: #1a5fb4;
    --link-hover: #14508f;
    --accent: #d4a017;
    --accent-light: #fdf6e3;
    --featured-border: #c48f16;
    --badge-bg: #f0f0f0;
    --sidebar-bg: #fafafa;
    --pagination-bg: #fff;
    --tag-bg: #eef2f7;
    --tag-text: #3d5a80;
    --medal-bg-gold: #fff3e0;
    --medal-text-gold: #b45f1b;
    --medal-bg-cash: #e8f5e9;
    --medal-text-cash: #2e7d32;
    --medal-bg-hot: #ffe4e2;
    --medal-text-hot: #c7362b;
    --medal-bg-vip: #e3f0ff;
    --medal-text-vip: #1a5fb4;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    max-width: 100%;
    overflow-x: hidden;
}
body {
    font-family: -apple-system, 'Montserrat', BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    color: #1f2d3d;
    line-height: 1.4;
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
}
.header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 6px 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    flex-wrap: wrap;
}
.menu-toggle {
    background: transparent;
    border: none;
    font-size: 26px;
    cursor: pointer;
    padding: 0 6px;
    color: #333;
    line-height: 1;
    border-radius: 8px;
    transition: background 0.2s;
    flex-shrink: 0;
    display: none;
}
.menu-toggle:hover {
    background: #f0f0f0;
}
.brand {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}
.logo {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    letter-spacing: -0.3px;
    white-space: nowrap;
}
.logo .frog {
    color: #d4a017;
    font-size: 24px;
}
.site-url {
    font-size: 13px;
    color: #888;
    font-weight: 400;
    letter-spacing: 0.3px;
    background: #f2f2f2;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: nowrap;
}
.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: #2c3e4e;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    display: inline-block;
}
.nav-link:hover {
    color: #d4a017;
    border-bottom-color: #d4a017;
}
.nav-link.active {
            color: #d4a017;
            border-bottom-color: #d4a017;
            font-weight: 600;
        }
/* 桌面端导航自适应 */
@media (min-width: 769px) {
    .nav-links {
        margin-left: auto;
        flex-wrap: nowrap;
    }
    @media (max-width: 1100px) {
        .nav-links { gap: 20px; }
        .nav-link { font-size: 14px; }
    }
    @media (max-width: 950px) {
        .nav-links { gap: 16px; }
        .nav-link { font-size: 13px; }
    }
}
.main-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
    width: 100%;
}
.sidebar {
    width: 160px;
    min-width: 160px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 12px 0;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
    display: flex;
    flex-direction: column;
}
.sidebar .cat-item {
    display: block;
    padding: 9px 18px;
    cursor: pointer;
    font-size: 16px;
    color: #444;
    text-decoration: none;
    transition: all 0.1s;
    border-left: 3px solid transparent;
    white-space: nowrap;
    user-select: none;
    letter-spacing: 0.3px;
}
.sidebar .cat-item:hover {
    background: #eee;
    color: #222;
}
.sidebar .cat-item.active {
    background: #e8ecf2;
    color: #1a5fb4;
    border-left-color: #1a5fb4;
    font-weight: 600;
}
.sidebar .cat-item .count {
    font-size: 11px;
    color: #999;
    margin-left: 4px;
}
.sidebar .cat-item.active .count {
    color: #6a8fbf;
}
.sidebar-divider {
    border: none;
    border-top: 1px solid #e8e8e8;
    margin: 6px 12px;
}
.sidebar-label {
    font-size: 11px;
    color: #999;
    padding: 4px 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    user-select: none;
}
.content {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    min-width: 0;
    width: 100%;
}
/* 手机端覆盖菜单 */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
    backdrop-filter: blur(2px);
    transition: opacity 0.2s;
}
.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 75%;
    max-width: 280px;
    background: #fff;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    border-radius: 16px 0 0 16px;
    overflow: hidden;
}
.mobile-menu-overlay.open {
    display: block;
}
.mobile-menu-overlay.open .mobile-menu-panel {
    transform: translateX(0);
}
.mobile-menu-header {
    padding: 20px 18px 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}
.mobile-menu-header span {
    font-weight: 700;
    font-size: 18px;
    color: #222;
    letter-spacing: -0.3px;
}
.mobile-menu-close {
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 20px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.1s;
}
.mobile-menu-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0 20px;
}
.mobile-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: background 0.1s;
    border-left: 3px solid transparent;
}
.mobile-cat-item.active {
    background: #eef2fa;
    border-left-color: #1a5fb4;
    color: #1a5fb4;
    font-weight: 500;
}
.mobile-cat-name {
    flex: 1;
}
.mobile-cat-count {
    font-size: 12px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 20px;
}
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
}
.content-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}
.search-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 28px;
    padding: 4px 12px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.search-wrapper:focus-within {
    border-color: #d4a017;
    box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.1);
}
.search-icon {
    font-size: 14px;
    color: #aaa;
}
#searchInput {
    border: none;
    outline: none;
    font-size: 13px;
    padding: 6px 0;
    width: 160px;
    background: transparent;
    font-family: inherit;
}
#clearSearchBtn {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.1s;
}
#clearSearchBtn:hover {
    color: #555;
}
.grid-cols-toggle {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 28px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}
.grid-cols-toggle:active {
    transform: scale(0.96);
}
.grid-cols-toggle span {
    font-size: 14px;
}
.per-page-selector {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 28px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    transition: all 0.2s;
}
.per-page-selector select {
    border: none;
    background: transparent;
    font-weight: 500;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    color: #1a5fb4;
}
/* 桌面端两列/三列切换按钮默认隐藏，移动端显示（见媒体查询） */
@media (min-width: 769px) {
    .grid-cols-toggle {
        display: none;
    }
}
@media (max-width: 768px) {
    .grid-cols-toggle {
        display: inline-flex;
    }
}
/* 桌面固定列数 */
@media (min-width: 1200px) {
    .sites-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
@media (min-width: 992px) and (max-width: 1199px) {
    .sites-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
@media (min-width: 769px) and (max-width: 991px) {
    .sites-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
/* 移动端默认不使用固定列，由js内联样式控制2/3列，但基础grid布局保留 */
.sites-grid {
    display: grid;
    gap: 8px;
    width: 100%;
}
.site-card {
    background: var(--card-bg);
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.12s;
    min-height: 52px;
    position: relative;
    overflow: visible;
}
.site-card:hover {
    border-color: #c0c0c0;
    background: #fafbfc;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}
.site-card.featured {
    background: linear-gradient(145deg, #fffef7, #fff7e8);
}
.site-card .favicon-wrap {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: #888;
}
.site-card .favicon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.site-card .site-info {
    flex: 1;
    min-width: 0;
}
.site-card .info-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    row-gap: 4px;
}
.site-card .site-name {
    font-size: 16px;
    font-weight: 500;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    max-width: 100%;
}
.wool-badge {
    display: inline-flex;
    align-items: center;
    background: #f0f0f0;
    border-radius: 12px;
    padding: 2px 5px;
    font-size: 12px;
    font-weight: 500;
    gap: 3px;
    color: #3f3f46;
    white-space: nowrap;
    transition: all 0.1s;
    line-height: 1.2;
}
.wool-badge.badge-hot {
    background: #fff3e0;
    color: #b45f1b;
}
.wool-badge.badge-cash {
    background: #e8f5e9;
    color: #2e7d32;
}
.wool-badge.badge-gold {
    background: #ffe4e2;
    color: #c7362b;
}
.wool-badge.badge-vip {
    background: #e3f0ff;
    color: #1a5fb4;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.pagination button {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    transition: all 0.1s;
    font-family: inherit;
}
.pagination button.active {
    background: #1a5fb4;
    color: #fff;
    border-color: #1a5fb4;
    font-weight: 600;
}
.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
}
/* 移动端适配 */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .menu-toggle {
        display: block;
        margin-left: auto;
        transform: translateY(2px);
    }
    .header {
        padding: 8px 16px;
        gap: 12px;
    }
    .brand {
        gap: 4px;
        flex-shrink: 1;
        margin-right: 0;
    }
    .logo {
        font-size: 18px;
        white-space: nowrap;
    }
    .site-url {
        font-size: 10px;
        padding: 2px 6px;
        white-space: nowrap;
    }
    .nav-links {
        width: 100%;
        justify-content: flex-start;
        padding-top: 6px;
        border-top: 1px solid #f0f0f0;
        margin-top: 6px;
        gap: 14px;
        flex-wrap: wrap;
        margin-left: 0 !important;
    }
    .nav-link {
        font-size: 13px;
        white-space: nowrap;
        padding: 4px 0;
    }
    .content {
        padding: 12px;
    }
    .sites-grid {
        gap: 6px;
    }
    .site-card {
        padding: 5px 5px 5px 10px;
    }
    .site-card .site-name {
        font-size: 13px;
    }
    .wool-badge {
        font-size: 10px;
        padding: 1px 5px;
    }
    .content-header {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .search-wrapper {
        width: auto;
        flex: 1 1 auto;
        min-width: 120px;
    }
    #searchInput {
        width: 100px;
        font-size: 12px;
    }
    .per-page-selector {
        font-size: 12px;
        padding: 3px 8px;
    }
    .per-page-selector select {
        font-size: 12px;
    }
}
@media (max-width: 480px) {
    .nav-links {
        gap: 12px;
    }
    .nav-link {
        font-size: 12px;
    }
    .logo {
        font-size: 18px;
    }
    .site-url {
        font-size: 9px;
    }
    .search-wrapper {
        min-width: 110px;
    }
    #searchInput {
        width: 70px;
    }
}
.menu-toggle {
    -webkit-tap-highlight-color: transparent;
}
.pagination .page-info {
    margin-left: 6px;
    font-size: 13px;
    color: #666;
}