/* 强制页面从顶部开始显示 */
html,body{scroll-behavior:auto!important;-ms-scroll-behavior:auto!important;}
@charset "UTF-8";

/* 弹窗样式 */
.modal-overlay {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.modal-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

.modal-overlay input,
.modal-overlay select,
.modal-overlay textarea {
    font-size: 16px !important;
}

.modal-overlay input:focus,
.modal-overlay select:focus,
.modal-overlay textarea:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Hero热搜 */
.hero-hotsearch {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: nowrap;
    overflow: hidden;
    justify-content: center;
    white-space: nowrap;
}
.hot-label {
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.hot-item {
    color: rgba(255,255,255,0.9);
    font-size: 11px;
    text-decoration: none;
    padding: 4px 10px;
    background: rgba(255,255,255,0.12);
    border-radius: 16px;
    transition: all 0.2s;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
    flex-shrink: 0;
}
.hot-item:hover {
    background: rgba(255,255,255,0.25);
    color: white;
    border-color: rgba(255,255,255,0.2);
}

/* 分类计数 */
.section-count {
    font-size: 12px;
    color: #999;
    font-weight: 400;
    margin-left: 3px;
}

/* 分类操作区 */
.section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 分类头部的热搜标签行 */
.hot-tags-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 3px 0 5px;
    font-size: 12px;
}
.hot-tags-label {
    color: #999;
    font-size: 11px;
    flex-shrink: 0;
}
.hot-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(42, 92, 170, 0.1);
    color: var(--primary-color);
    border-radius: 16px;
    font-size: 11px;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid rgba(42, 92, 170, 0.2);
    cursor: pointer;
    font-weight: 500;
}
.hot-tag:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
body.dark-mode .hot-tag {
    background: rgba(42, 92, 170, 0.2);
    color: #6b9bd8;
    border-color: rgba(42, 92, 170, 0.3);
}
body.dark-mode .hot-tag:hover {
    background: var(--primary-color);
    color: #fff;
}

/* 分类展开/折叠按钮（标题内 +/−） */
.section-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(42, 92, 170, 0.25);
    border-radius: 50%;
    background: rgba(42, 92, 170, 0.06);
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 2px;
}
.section-toggle-btn:hover {
    background: rgba(42, 92, 170, 0.15);
}
.section-toggle-btn.expanded {
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-color: var(--border-color);
}
.expand-count {
    font-weight: 600;
}

/* 悬浮按钮组 */
.floating-buttons {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}
.float-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.float-btn:active {
    transform: scale(0.95);
}
.float-sidebar.sidebar-active {
    background: #2A5CAA;
    color: white;
}
.float-icon {
    font-size: 18px;
}

/* 关灯模式 */
body.dark-mode {
    background: #1a1a2e;
    color: #ddd;
}
body.dark-mode .main-content,
body.dark-mode .category-section,
body.dark-mode .cards-grid {
    background: #1a1a2e;
}
body.dark-mode .hero {
    background: linear-gradient(to bottom, #1a1a2e, #16213e) !important;
}
body.dark-mode .site-card {
    background: #252542;
    border-color: #333355;
    color: #ddd;
}
body.dark-mode .site-card:hover {
    background: #2d2d4a;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
body.dark-mode .site-desc {
    color: #aaa;
}
body.dark-mode .site-tag {
    background: rgba(180, 140, 60, 0.15);
    color: #c9a84c;
}
body.dark-mode .visit-btn {
    background: rgba(230,126,34,0.15);
    color: #E67E22;
}
body.dark-mode .sub-tag {
    background: #2A5CAA;
    color: #fff;
    border-color: transparent;
}
body.dark-mode .sub-tag:hover,
body.dark-mode .sub-tag.active {
    background: #3a7ad4;
    color: white;
    border-color: #3a7ad4;
}
body.dark-mode .section-toggle-btn {
    background: rgba(42, 92, 170, 0.15);
    color: #6b9bd8;
    border-color: rgba(42, 92, 170, 0.3);
}
body.dark-mode .expand-btn.expanded {
    color: #aaa;
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}
body.dark-mode .footer {
    background: #12122a;
    border-color: #222244;
}
body.dark-mode .footer-content {
    color: #aaa;
}
body.dark-mode .footer-section h4 {
    color: #ddd;
}
body.dark-mode .footer a {
    color: #aaa;
}
body.dark-mode .search-box input {
    background: rgba(255,255,255,0.1);
    color: white;
    border-color: rgba(255,255,255,0.2);
}
body.dark-mode .search-box input::placeholder {
    color: rgba(255,255,255,0.4);
}

/* 搜索历史面板暗黑模式 */
body.dark-mode #_searchHistoryPanel {
    background: #1e1e38;
    border-color: #333355;
}

body.dark-mode .header {
    background: rgba(26,26,46,0.95);
    border-color: #222244;
}
body.dark-mode .mobile-menu-panel {
    background: #1a1a2e;
    border-color: #333355;
}
body.dark-mode .mobile-menu-title {
    color: #ddd;
}
body.dark-mode .mobile-menu-link {
    color: #aaa;
}
body.dark-mode .float-btn {
    background: #252542;
    color: white;
}

/* 申请方案卡片 */
.apply-plan:hover {
    border-color: var(--primary-color) !important;
    background: rgba(42, 92, 170, 0.05);
}

/* ========== 左侧边缘悬停触发区 ========== */
.sidebar-edge-trigger {
    position: fixed;
    left: 0;
    top: 0;
    width: 8px;
    height: 100vh;
    z-index: 9998;
    cursor: pointer;
}

/* ========== 左侧窄侧栏布局 ========== */
.left-sidebar {
    position: fixed;
    left: -60px;
    top: 0;
    width: 60px;
    height: 100vh;
    z-index: 1000;
    background: linear-gradient(to bottom, #2C3E50, #34495E);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    overflow: hidden;
    transition: left 0.25s ease, width 0.25s ease;
}

/* 侧边栏打开状态 */
.left-sidebar.sidebar-open {
    left: 0;
}

/* 侧边栏悬停展开 */
.left-sidebar.sidebar-open:hover,
.left-sidebar.sidebar-expanded {
    width: 160px;
}

.left-sidebar.sidebar-open:hover .sidebar-logo-text,
.left-sidebar.sidebar-open:hover .sidebar-label {
    opacity: 1;
}

/* Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    margin-bottom: 12px;
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}
.sidebar-logo img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 6px;
}
.sidebar-logo-text {
    font-size: 12px;
    font-weight: 700;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
}

/* 导航项 */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    padding: 0 6px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}
.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
    min-height: 44px;
}
.sidebar-item:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}
.sidebar-item.active {
    background: rgba(230,126,34,0.3);
    color: #E67E22;
}
.sidebar-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}
.sidebar-label {
    opacity: 0;
    transition: opacity 0.2s;
    font-weight: 500;
}

/* 底部 */
.sidebar-bottom {
    width: 100%;
    padding: 0 6px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
    margin-top: 8px;
    flex-shrink: 0;
}
.sidebar-section {
    width: 100%;
    padding: 0 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.sidebar-apply {
    background: rgba(230,126,34,0.2);
    color: #E67E22;
}

.sidebar-section-title {
    padding: 8px 16px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.sidebar-badge {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 10px;
    padding: 2px 7px;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s;
}
/* 折叠状态下：徽章以小圆点形式显示在图标右上角 */
.sidebar-badge-dot {
    position: absolute;
    top: 6px;
    left: 26px;
    background: rgba(255,255,255,0.3);
    color: white;
    border-radius: 8px;
    padding: 0 5px;
    font-size: 10px;
    line-height: 16px;
    min-width: 16px;
    text-align: center;
    display: none;
}
/* 展开hover时显示右侧badge */
.left-sidebar.sidebar-open:hover .sidebar-badge {
    opacity: 1;
}
.sidebar-apply:hover {
    background: rgba(230,126,34,0.35) !important;
}

/* 侧栏展开效果 - 仅在sidebar-open状态下hover展开 */
.left-sidebar.sidebar-open:hover .sidebar-logo-text,
.left-sidebar.sidebar-open:hover .sidebar-label {
    opacity: 1;
}

/* 主内容区 - 不再偏移，侧边栏overlay */
.main-wrapper {
    margin-left: 0;
    transition: margin-left 0.25s ease;
}

/* 暗色模式侧栏 */
body.dark-mode .left-sidebar {
    background: linear-gradient(to bottom, #1a1a2e, #252545);
}

/* ========== 左侧侧栏——移动端 ========== */
@media (max-width: 900px) {
    .left-sidebar {
        display: flex;
        left: -60px;
        width: 60px;
    }
    .left-sidebar.sidebar-open {
        left: 0;
    }
    .left-sidebar.sidebar-open:hover {
        width: 160px;
    }
    .main-wrapper {
        margin-left: 0;
    }
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* React风格配色 - 建筑蓝 */
    --primary-color: #2A5CAA;
    --primary-light: #4A7EC8;
    --primary-dark: #1e3a5f;
    --secondary-color: #E67E22;
    --accent-color: #27AE60;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-muted: #B2BEC3;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-card: #FFFFFF;
    --border-color: #E9ECEF;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 弹窗样式 v2.8.2 */
.modal-overlay {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.modal-overlay .modal-content {
    margin: auto !important;
    transform: none !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

.modal-overlay .form-group label {
    font-size: 14px;
}

.modal-overlay input:focus,
.modal-overlay select:focus,
.modal-overlay textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 顶部导航栏 */
.header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 10px;
}

.logo-section {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.logo:hover {
    opacity: 0.8;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    object-fit: contain;
    background: white;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #1a5490, #3d7ab8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 导航菜单 */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 4px;
    flex-wrap: nowrap;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 100%;
}
.nav-list::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(255, 107, 53, 0.08);
}

/* 搜索框 */
.search-box {
    position: relative;
    flex: 1 1 0%;
    min-width: 120px;
    max-width: 680px;
    margin: 0 16px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-primary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.6;
    transition: opacity 0.1s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
}

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

/* 用户头像按钮 */
.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #555555;
    flex-shrink: 0;
    margin-left: 10px;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.user-avatar-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* 移动端头像自适应 */
@media (max-width: 768px) {
    .user-avatar-btn {
        width: 32px;
        height: 32px;
        margin-left: 0;
        background: #ffffff;
        color: #555555;
        border: 1px solid #e0e0e0;
    }
}

/* Hero区域 - React风格 */
.hero {
    background: linear-gradient(to bottom, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 45px 0 35px;
    min-height: 200px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg'");
    pointer-events: none;
    z-index: 0;
}

/* 暗黑模式 Hero */
body.dark-mode .hero {
    background: linear-gradient(to bottom, #0f1a2e 0%, #1a2744 100%);
}

body.dark-mode .hero::before {
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg'");
}

body.dark-mode .stat-item {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 12px;
    font-weight: 400;
    position: relative;
    z-index: 1;
    text-align: center;
    line-height: 1.4;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

/* Hero区域 */
/* 统计卡片 */
.stat-item {
    text-align: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: none;
}

.stat-number {
    display: inline;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    opacity: 0.75;
    font-weight: 400;
}

/* 主内容区 */
.main-content {
    padding: 2px 0;
}

/* 热门资源横向滚动区 */
.hot-resources-section {
    display: block;
    width: 100%;
    padding: 10px 0;
}

/* ========== 月榜独立区块 ========== */
.monthly-rank-section {
    background: white;
    margin-top: 5px;
    padding: 5px 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-bottom: 1px solid var(--border-color);
}

.rank-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.rank-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.rank-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.rank-scroll-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
}

.rank-scroll-container::-webkit-scrollbar {
    display: none;
}

.rank-card {
    min-width: 120px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    position: relative;
    flex-shrink: 0;
}

.rank-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(42, 92, 170, 0.12);
    transform: translateY(-2px);
}

.rank-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #B87333);
}

.rank-badge.rank-4,
.rank-badge.rank-5,
.rank-badge.rank-6,
.rank-badge.rank-7,
.rank-badge.rank-8,
.rank-badge.rank-9,
.rank-badge.rank-10 {
    background: linear-gradient(135deg, #6B8DD6, #4A6BB5);
}

.rank-favicon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin-top: 8px;
}

.rank-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.rank-clicks {
    font-size: 11px;
    color: var(--text-muted);
}

.rank-icon {
    font-size: 18px;
}

.rank-count {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.rank-pills {
    display: inline-flex;
    gap: 6px;
    flex-wrap: nowrap;
    margin-left: 8px;
    vertical-align: middle;
    overflow: hidden;
    max-width: calc(100vw - 140px);
}

.rank-pill {
    padding: 3px 10px;
    font-size: 12px;
    background: rgba(42, 92, 170, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.rank-pill:hover {
    background: var(--primary-color);
    color: white;
}

.rank-nav {
    display: flex;
    gap: 8px;
}

.rank-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-nav-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.rank-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.rank-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 20px 0;
}

    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 40px 0;
    border-bottom: 1px solid var(--border-color);
}

.hot-resources-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    margin-bottom: 24px;
}

.hot-resources-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hot-resources-icon {
    font-size: 22px;
}

.hot-resources-count {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}
.hot-resources-pills {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: 8px;
    vertical-align: middle;
}
.hot-resources-pills .section-hot-pill {
    padding: 5px 12px;
    font-size: 12px;
}
.hot-resources-nav {
    display: flex;
    gap: 8px;
}

.hot-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hot-nav-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.hot-resources-scroll {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0 20px;
}

.hot-resources-scroll::-webkit-scrollbar {
    display: none;
}

.hot-resource-card {
    flex: 0 0 var(--monthly-card-width, 160px);
    width: var(--monthly-card-width, 160px);
    scroll-snap-align: start;
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.hot-resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.hot-resource-favicon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0 auto 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hot-resource-favicon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.hot-resource-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-resource-clicks {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* 暗黑模式 - 热门资源 */
body.dark-mode .hot-resources-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .hot-resource-card {
    background: #252542;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .hot-resource-card:hover {
    border-color: var(--primary-color);
}

body.dark-mode .hot-nav-btn {
    background: #252542;
    border-color: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

body.dark-mode .hot-nav-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

body.dark-mode .hot-resources-count {
    color: #6b9bd8;
}

/* 分类区块 */
.

.category-section { scroll-margin-top: 80px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.section-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.section-count {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

/* 分类头部右侧红色热搜标签组 */
.section-hot-pills {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
    max-width: 40%;
}

.section-hot-pill {
    display: inline-block;
    padding: 5px 12px;
    background: #fff0f0;
    color: #e74c3c;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #fdd;
    cursor: pointer;
    white-space: nowrap;
}
.section-hot-pill:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}
body.dark-mode .section-hot-pill {
    background: rgba(231, 76, 60, 0.15);
    color: #f1948a;
    border-color: rgba(231, 76, 60, 0.25);
}
body.dark-mode .section-hot-pill:hover {
    background: #e74c3c;
    color: #fff;
}

/* 子分类标签 */
.sub-tags {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    margin-left: auto;
    max-width: 50%;
    overflow: hidden;
    white-space: nowrap;
}

.sub-tag {
    padding: 5px 12px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: #2A5CAA;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    color: #fff;
    font-weight: 500;
}

.sub-tag:hover,
.sub-tag.active {
    background: #1e4a8a;
    color: white;
    border-color: #1e4a8a;
}

/* 卡片网格 - 5列布局（参考React版） */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

@media (max-width: 1200px) {
    .cards-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
    .cards-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* 网站卡片 - 大图标+名称+描述+底部标签 */
.site-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: all 0.25s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

/* 拖拽手柄（仅管理员可见） */
.drag-handle {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    cursor: grab;
    color: #ccc;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    user-select: none;
    z-index: 10;
}
.drag-handle:hover {
    color: #999;
}
.drag-handle:active {
    cursor: grabbing;
}
.site-card.dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary-color);
}
.site-card.drag-over {
    border: 2px solid var(--primary-color);
    transform: scale(1.02);
}

.site-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    border-color: #d0d8e0;
    transform: translateY(-2px);
}

.site-card:hover .site-name {
    color: var(--primary-color);
}

/* 收藏按钮 - 右上角固定 */
.fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 100;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 4px;
    opacity: 0.4;
    transition: opacity 0.2s, transform 0.2s;
    text-decoration: none;
    display: inline-block;
}
.fav-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}
.fav-btn.is-fav {
    opacity: 1;
    text-shadow: 0 0 8px rgba(255, 165, 0, 0.8);
}

/* 搜索高亮 */
.site-card.search-highlight {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(42, 92, 170, 0.15), var(--shadow-md);
}
.site-card.search-highlight .site-name {
    color: var(--primary-color);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-info .site-desc {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.site-favicon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.site-favicon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.site-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

.site-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 17px;
}

.card-footer {
    display: flex;
    align-items: flex-end;
    gap: 0;
    flex-wrap: nowrap;
    margin-top: auto;
    overflow: visible;
    position: relative;
    min-height: 26px;
}

.site-tags {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    padding-right: 24px;
}

.card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.card-action {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    padding: 4px 6px;
    background: #f5f0eb;
    color: #8b6914;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    user-select: none;
    flex: 1;
    justify-content: center;
    min-width: 0;
    white-space: nowrap;
}

.card-action:hover {
    background: #ede4d8;
}

.card-action.liked {
    background: #fff3e0;
    color: #e65100;
}

.card-action .act-cnt {
    font-style: normal;
    font-size: 11px;
}

.site-tag {
    padding: 2px 8px;
    background: #f5f0eb;
    color: #8b6914;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    flex-shrink: 0;
}
.site-card:hover .site-tag {
    background: #ede4d8;
}

.report-link {
    padding: 2px 8px;
    background: #f5f0eb;
    color: #8b6914;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s;
}
.report-link:hover {
    opacity: 0.7;
}

.visit-btn {
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--primary-color), #ff8555);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.visit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* 页脚 */
.footer {
    background: linear-gradient(135deg, #1a2a4a 0%, #0f1a30 100%);
    color: white;
    padding: 60px 0 30px;
    margin-top: 80px;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: white;
}

.footer-section p,
.footer-section a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    line-height: 1.8;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* 返回顶部 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: #ffffff;
    color: #555555;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .main-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    /* 移动端sidebar隐藏，取消main-wrapper的margin偏移 */
    .main-wrapper {
        margin-left: 0 !important;
    }

    .header .container {
        flex-wrap: nowrap;
        height: 54px;
        padding: 0 10px;
        justify-content: space-between;
    }
    
    .logo-section {
        flex-shrink: 0;
    }
    
    .logo-text {
        font-size: 14px;
    }
    
    .logo-img {
        width: 24px;
        height: 24px;
    }
    
    /* 搜索框撑满中间 */
    .search-box {
        flex: 1;
        min-width: 0;
        max-width: none;
        margin: 0 6px;
        width: auto;
    }
    
    .search-box input {
        padding: 6px 10px 6px 10px;
        font-size: 16px;  /* 必须16px防止iOS自动放大 */
    }
    
    .search-btn {
        font-size: 14px;
        right: 4px;
    }
    
    /* 用户头像按钮 */
    .user-avatar-btn {
        flex-shrink: 0;
        width: 34px;
        height: 34px;
        min-width: 34px;
        margin-left: 0;
        margin-right: 0;
    }
    
    /* 菜单按钮隐藏（侧边栏入口已移除） */
    .mobile-menu-btn {
        display: none !important;
    }
    
    /* Hero移动端更紧凑 */
    .hero {
        padding: 30px 0 25px !important;
        min-height: 150px;
    }
    
    /* hero-box removed */
.hero-title { font-size: 22px !important; margin-bottom: 6px !important; text-align: center !important; }
    
    .hero-subtitle { font-size: 11px !important; margin-bottom: 8px !important; text-align: center !important; }
    
    .hero-hotsearch {
        white-space: nowrap;
        overflow: hidden;
        margin-top: 6px !important;
    }
    
    .hot-label {
        flex-shrink: 0;
    }
    
    .hot-item {
        font-size: 10px !important;
        padding: 3px 7px !important;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .hero-stats {
        gap: 6px !important;
    }
/* 统计卡片 */
.stat-item {
    text-align: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
    .stat-number { font-size: 16px !important; }
    .stat-label { font-size: 10px !important; }
    
    /* 移动端显示热门资源区（月榜分栏） */
    .hot-resources-section {
        display: block;
        padding: 10px 0;
    }
    
    /* 月榜移动端适配 */
    .monthly-rank-section {
        margin-top: 5px;
        padding: 5px 0;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .rank-header {
        margin-bottom: 12px;
        padding: 0 12px;
    }
    
    .rank-title {
        font-size: 15px;
    }
    
    .rank-desc {
        font-size: 11px;
    }
    
    .rank-scroll-container {
        gap: 10px;
        padding: 0 12px 8px;
    }
    
    .rank-card {
        min-width: 100px;
        padding: 12px 10px;
    }
    
    .rank-badge {
        min-width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .rank-favicon {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    
    .rank-name {
        font-size: 11px;
        max-width: 85px;
    }
    
    .rank-clicks {
        font-size: 10px;
    }
    
    .rank-nav {
        display: none;
    }
    
    .rank-nav-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .rank-info {
        gap: 1px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .section-header {
        gap: 4px;
        margin-bottom: 8px !important;
        padding-bottom: 6px !important;
    }
    
    .category-section { scroll-margin-top: 80px;
        margin-bottom: 20px !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    /* 热门资源移动端适配 */
    .hot-resources-section {
        padding: 10px 0;
    }
    
    .hot-resources-header {
        margin-bottom: 20px;
        padding: 0 10px;
    }
    
    .hot-resources-title {
        font-size: 15px;
    }
    
    .hot-resources-count {
        font-size: 11px;
    }
    
    .hot-nav-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .hot-resource-card {
        width: 115px;
        padding: 12px 8px;
    }
    
    .hot-resource-favicon {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
    
    .hot-resource-name {
        font-size: 12px;
    }
    
    .hot-resource-clicks {
        font-size: 10px;
    }
    
    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

/* 搜索高亮 */
.highlight {
    background: rgba(255, 107, 53, 0.2);
    padding: 0 2px;
    border-radius: 2px;
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-results-text {
    font-size: 16px;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 分类折叠功能 */
.category-section { scroll-margin-top: 80px;
    transition: opacity 0.3s ease;
}

.category-section.hidden {
    display: none;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 申请弹窗样式 */
.apply-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    /* iOS Safari 兼容 */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.apply-modal-overlay.show {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
}

.apply-modal {
    background: white;
    border-radius: 16px;
    width: 480px;
    max-width: 95vw;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.apply-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.apply-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.apply-modal-close {
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.apply-modal-close:hover {
    background: #e0e0e0;
}

/* 申请表单 iOS Safari 兼容 — 防止输入框缩放 */
.apply-modal input,
.apply-modal select,
.apply-modal textarea {
    font-size: 16px !important; /* iOS: ≥16px才不会聚焦时自动缩放 */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 8px;
}

.apply-modal input:focus,
.apply-modal select:focus,
.apply-modal textarea:focus {
    outline: none;
    border-color: #E67E22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15);
}

.apply-form-group {
    margin-bottom: 16px;
}

.apply-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.apply-form-group input,
.apply-form-group textarea,
.apply-form-group select {
    width: 100%;
    padding: 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.apply-form-group input:focus,
.apply-form-group textarea:focus,
.apply-form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.apply-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.apply-submit-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(to right, #1a5490, #3d7ab8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.apply-submit-btn:hover {
    opacity: 0.9;
}

.apply-success-msg {
    text-align: center;
    padding: 20px;
    color: #27ae60;
    font-size: 16px;
}

/* 手机菜单按钮 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
    order: 2;
    /* iOS Safari 触控 */
    -webkit-tap-highlight-color: transparent;
}
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: 0.3s;
}

/* 手机菜单遮罩 */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1998;
    background: rgba(0, 0, 0, 0.5);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mobile-menu-overlay.show {
    display: block;
}

/* 手机侧边菜单 */
.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100dvh; /* iOS Safari: 动态视口高度 */
    background: white;
    z-index: 1999;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-panel.show {
    right: 0;
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-menu-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-menu-close {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
}

.mobile-menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.mobile-menu-list {
    list-style: none;
}

.mobile-menu-link {
    display: block;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.mobile-menu-link:hover {
    background: var(--bg-secondary);
}

.mobile-menu-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.mobile-menu-apply {
    display: block;
    text-align: center;
    padding: 12px;
    background: linear-gradient(to right, #1a5490, #3d7ab8);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
}

.mobile-menu-footer {
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu-login {
    flex: 1;
    display: block;
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
}

/* Hero CTA按钮样式 */
.hero-cta-wrapper {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.hero-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #FF6B35, #E55A2B);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.35);
}

.hero-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.45);
    color: white;
}

.hero-cta-btn:active {
    transform: translateY(0);
}

/* 模态框样式 - v2.8.2 修复居中 */
.modal-overlay {
    pointer-events: auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.modal-overlay .modal-content {
    pointer-events: auto !important;
    margin: auto !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
}

.modal-overlay input,
.modal-overlay select,
.modal-overlay textarea,
.modal-overlay button {
    pointer-events: auto !important;
}

/* 表单样式优化 */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color, #FF6B35) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: none !important;
    }
    
    .hero-cta-wrapper {
        margin-top: 8px;
    }
    
    .hero-cta-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    /* 移动端紧凑优化（补充）*/
    
    .hero {
        padding: 30px 0 25px !important;
        min-height: 150px;
    }
    /* hero-box removed */
.hero-title { font-size: 22px !important; margin-bottom: 6px !important; text-align: center !important; }
    .hero-subtitle { font-size: 11px !important; margin-bottom: 8px !important; text-align: center !important; }
    .hero-stats {
        gap: 6px !important;
    }
/* 统计卡片 */
.stat-item {
    text-align: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
    .stat-number { font-size: 16px !important; }
    .stat-label { font-size: 10px !important; }
    
    .hot-resources-section {
        display: block !important;
        padding: 10px 0;
    }
    
    .category-section { scroll-margin-top: 80px;
        margin-bottom: 20px !important;
    }
    .section-header {
        margin-bottom: 8px !important;
        gap: 4px !important;
        padding-bottom: 6px !important;
        flex-wrap: wrap !important;
    }
    .section-title {
        font-size: 14px !important;
    }
    .section-icon {
        font-size: 14px !important;
    }
    
    .site-card {
        padding: 10px !important;
        border-radius: 8px !important;
    }
    .site-favicon {
        width: 38px !important;
        height: 38px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
    }
    .site-name {
        font-size: 13px !important;
    }
    .site-desc {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }
    .site-tag {
        font-size: 10px !important;
        padding: 2px 7px !important;
        border-radius: 4px !important;
    }
    
    .sub-tags {
        gap: 5px !important;
        margin-bottom: 6px !important;
    }
    .sub-tag {
        padding: 4px 9px !important;
        font-size: 11px !important;
    }
    
    /* 移动端热门标签字体统一 */
    .section-hot-pill {
        padding: 3px 9px !important;
        font-size: 11px !important;
        border-radius: 12px !important;
    }
    
    /* 分类标签和标题同行居右 */
    .sub-tags {
        margin-left: auto !important;
        max-width: 50% !important;
    }
    /* 热门标签换行，占满 */
    .section-hot-pills {
        max-width: 100% !important;
        width: 100%;
        flex-wrap: wrap;
        order: 1;
    }
    
    .hot-tags-row {
        margin: 2px 0 4px !important;
        gap: 4px !important;
    }
    .hot-tag {
        padding: 2px 8px !important;
        font-size: 10px !important;
    }
    
    .search-box {
        margin: 0 6px !important;
    }
    .search-box input {
        padding: 6px 32px 6px 10px !important;
    }
}


/* category spacing fix */
.category-section { scroll-margin-top: 80px; margin-bottom: 20px !important; }


/* ========== 移动端Header布局修复 ========== */
@media (max-width: 768px) {
    /* 隐藏PC端导航和汉堡按钮 */
    .header .main-nav {
        display: none !important;
    }
    .header .mobile-menu-btn {
        display: none !important;
    }
    
    /* Header容器：[🌐建筑网站] [====搜索框撑满====] [👤] */
    .header .container {
        flex-wrap: nowrap !important;
        height: 54px !important;
        padding: 0 10px !important;
        justify-content: flex-start !important;
        gap: 0 !important;
    }
    
    /* Logo固定不缩 */
    .header .logo-section {
        flex-shrink: 0 !important;
    }
    
    /* 搜索框撑满中间 */
    .header .search-box {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        max-width: none !important;
        width: auto !important;
        margin: 0 8px !important;
    }
    
    /* 头像靠最右，无额外间距 */
    .header .user-avatar-btn {
        flex-shrink: 0 !important;
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        order: 99 !important;
        background: #ffffff !important;
        color: #555555 !important;
        border: 1px solid #e0e0e0 !important;
    }
    
    /* 主框架左右边距8px */
    .main-content > .container,
    .hero .container,
    .hot-resources-section .container,
    .footer .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    
    /* 月榜卡片：自适应数量，不截断 */
    .hot-resources-scroll {
        gap: 8px !important;
        padding: 0 0 12px !important;
        scroll-snap-type: x mandatory !important;
    }
    .hot-resource-card {
        width: var(--monthly-card-width, 80px) !important;
        min-width: 0 !important;
        flex: 0 0 var(--monthly-card-width, 80px) !important;
        scroll-snap-align: start !important;
        padding: 8px 4px !important;
    }
    .hot-resource-favicon {
        width: 30px !important;
        height: 30px !important;
        font-size: 12px !important;
        margin: 0 auto 5px !important;
    }
    .hot-resource-name {
        font-size: 10px !important;
        margin-bottom: 2px !important;
    }
    .hot-resource-clicks {
        font-size: 9px !important;
    }
    .hot-resources-header {
        margin-bottom: 8px !important;
        padding: 0 !important;
    }
    .hot-resources-section {
        padding: 6px 0 !important;
    }
}


/* ========== 移动端月榜紧凑布局 ========== */
@media (max-width: 768px) {
    /* 月榜区域整体更紧凑 */
    .monthly-rank-section {
        margin-top: 2px !important;
        padding: 2px 0 !important;
    }
    
    /* 月榜标题行 */
    .rank-header {
        margin-bottom: 6px !important;
        padding: 0 10px !important;
    }
    
    /* 横向滚动容器：间距8px */
    .rank-scroll-container {
        gap: 8px !important;
        padding: 0 10px 6px !important;
    }
    
    /* 月榜卡片：缩小以显示4个 */
    .rank-card {
        min-width: calc((100vw - 16px - 18px) / 4) !important;  /* 屏幕宽 - 左右padding(20) - 3个gap(24) = 除以4 */
        max-width: calc((100vw - 20px - 24px) / 4) !important;
        padding: 6px 4px !important;
        border-radius: 8px !important;
    }
    
    /* 月榜favicon缩小 */
    .rank-favicon {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }
    
    /* 月榜名称字号 */
    .rank-name {
        font-size: 11px !important;
        margin-top: 4px !important;
    }
    
    /* 月榜点击数 */
    .rank-clicks {
        font-size: 9px !important;
        margin-top: 2px !important;
    }
    
    /* 月榜排名徽章缩小 */
    .rank-badge {
        min-width: 16px !important;
        height: 16px !important;
        font-size: 9px !important;
        top: -5px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}
