/* 搜索高亮 & 结果计数 */
.search-highlight {
    background: #fef08a;
    color: #1e293b;
    border-radius: 2px;
    padding: 0 2px;
}

.search-result-count {
    grid-column: 1 / -1;
    padding: 8px 0 4px;
    font-size: 14px;
    color: #64748b;
}

.search-no-result {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== 头部导航 ========== */
.site-header {
    background-color: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.nav-bar {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: #3b82f6;
}

.edit-btn {
    background-color: #10b981;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    margin-right: 8px;
}

.edit-btn:hover {
    background-color: #059669;
}

.edit-btn.active {
    background-color: #f59e0b;
}

.logout-btn {
    color: #f87171 !important;
}

.login-link {
    background-color: #3b82f6;
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 6px;
}

.login-link:hover {
    background-color: #2563eb;
    color: #fff !important;
}

.user-name {
    font-size: 14px;
    color: #e2e8f0;
    margin-right: 8px;
}

/* ========== 主内容区 ========== */
.main-content {
    padding: 32px 20px;
    min-height: calc(100vh - 140px);
}

.page-head {
    margin-bottom: 28px;
    text-align: center;
}

.page-head h1 {
    font-size: 32px;
    color: #1e293b;
    margin-bottom: 8px;
}

.page-head p {
    font-size: 16px;
    color: #64748b;
}

/* ========== 筛选栏 ========== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.search-input {
    flex: 1;
    min-width: 240px;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    background-color: #fff;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.version-select, .res-select {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    background-color: #fff;
    min-width: 120px;
}

.sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.sort-label {
    font-size: 14px;
    color: #64748b;
}

.sort-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    color: #475569;
    background: #fff;
    transition: all 0.2s;
}

.sort-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.sort-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* ========== 分类页双栏布局（主内容 + 右侧子分类侧边栏） ========== */
.category-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.category-main {
    flex: 1;
    min-width: 0;
}

/* 右侧子分类侧边栏 */
.category-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px 16px;
    position: sticky;
    top: 84px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.sub-cat-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sub-cat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: #475569;
    background: #f8fafc;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.sub-cat-item:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.sub-cat-item.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.sub-cat-icon {
    font-size: 18px;
    line-height: 1;
}

.sub-cat-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.sub-cat-arrow {
    font-size: 16px;
    color: #94a3b8;
    transition: transform 0.2s;
}

.sub-cat-item:hover .sub-cat-arrow {
    transform: translateX(3px);
}

.sub-cat-item.active .sub-cat-arrow {
    color: rgba(255,255,255,0.8);
}

.sidebar-tip {
    font-size: 12px;
    color: #94a3b8;
    margin: 16px 0 0 0;
    text-align: center;
    line-height: 1.5;
}

/* ========== 资源列表 - 5列网格卡片 ========== */
.resource-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 32px;
    margin-top: 20px;
}

.resource-item {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    height: 290px;
}

.resource-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.delete-resource-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.delete-resource-btn:hover {
    background: #dc2626;
}

.edit-active .delete-resource-btn {
    display: flex;
}

/* 置顶按钮 - 管理员可见 */
.pin-resource-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.85);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

.pin-resource-btn:hover {
    background: #f59e0b;
    transform: scale(1.1);
}

.pin-resource-btn.active {
    background: #f59e0b;
    display: flex;
}

.edit-active .pin-resource-btn {
    display: flex;
}

/* 置顶角标 */
.pin-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px 0 10px 0;
    z-index: 15;
    letter-spacing: 1px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

/* 置顶卡片高亮 */
.resource-item.pinned {
    border: 2px solid #f59e0b;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.25);
}

.resource-item.pinned:hover {
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}

.resource-preview {
    position: relative;
    width: 100%;
    height: 160px;
    min-height: 160px;
    overflow: visible;
    border-radius: 10px 10px 0 0;
    background-color: #f1f5f9;
}

.item-link {
    display: block;
    width: 100%;
    height: 160px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.resource-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    transition: transform 0.3s;
}

.resource-item:hover .resource-thumb {
    transform: scale(1.05);
}

/* 左下角小图标 - 完全浮在白色区域上方 */
.resource-icon {
    position: absolute;
    left: 10px;
    bottom: -15px;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #fff;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 10;
    background-color: #fff;
}

.resource-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-content {
    padding: 14px 10px 8px;
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
    box-sizing: border-box;
}

.resource-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.resource-title a {
    color: #1e293b;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-title a:hover {
    color: #3b82f6;
}

.resource-author {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.author-name {
    color: #3b82f6;
    font-weight: 500;
}

.resource-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.resource-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.tag {
    font-size: 12px;
    padding: 2px 8px;
    background-color: #f1f5f9;
    color: #475569;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.resource-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #64748b;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item svg {
    opacity: 0.7;
}

.update-time {
    font-size: 11px;
    color: #94a3b8;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 添加资源卡片 */
.add-resource-card {
    display: none;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    min-height: 290px;
    transition: all 0.2s;
}

.edit-active .add-resource-card {
    display: flex;
}

.add-resource-card:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.add-resource-card .add-icon {
    text-align: center;
    color: #64748b;
}

.add-resource-card:hover .add-icon {
    color: #3b82f6;
}

.add-resource-card svg {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.add-resource-card span {
    display: block;
    font-size: 14px;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background-color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    text-decoration: none;
    color: #333;
    min-width: 32px;
    text-align: center;
}

.page-btn:hover:not(.disabled):not(.active) {
    border-color: #3b82f6;
    color: #3b82f6;
}

.page-btn.active {
    background-color: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.page-btn.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    pointer-events: none;
}

.page-dots {
    color: #94a3b8;
    padding: 0 4px;
}

/* ========== 页脚 ========== */
.site-footer {
    background-color: #1e293b;
    color: #94a3b8;
    padding: 24px 0;
    text-align: center;
    font-size: 14px;
}

/* ========== 登录注册页 ========== */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background-color: #fff;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.error-msg {
    padding: 10px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

.form-item {
    margin-bottom: 20px;
}

.form-item label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 8px;
}

.form-item input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-item input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.captcha-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-input {
    flex: 1;
}

.captcha-img {
    width: 120px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}

.captcha-img:hover {
    opacity: 0.8;
}

.login-submit {
    width: 100%;
    padding: 12px;
    background-color: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-submit:hover {
    background-color: #2563eb;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.back-home {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
}

.back-home:hover {
    color: #3b82f6;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========== 详情页样式 ========== */
.detail-page {
    padding: 24px 0;
}

.detail-banner {
    width: 100%;
    height: 280px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
    position: relative;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    position: relative;
}

.detail-icon {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    flex-shrink: 0;
    margin-top: -60px;
    position: relative;
    z-index: 2;
}

.detail-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info {
    flex: 1;
}

.detail-title {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
}

.detail-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.detail-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.download-btn {
    background: #3b82f6;
    color: #fff;
}

.download-btn:hover {
    background: #2563eb;
}

.like-btn {
    background: #f1f5f9;
    color: #475569;
    transition: all 0.2s ease;
    cursor: pointer;
}

.like-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.like-btn.liked {
    background: #ef4444;
    color: #fff;
}

.like-btn.liked:hover {
    background: #dc2626;
}

.detail-desc {
    margin: 12px 0 0 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
}

/* ========== 详情页选项卡 ========== */
.detail-tabs {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
}

.tab-nav-item {
    padding: 14px 28px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.tab-nav-item:hover {
    color: #3b82f6;
}

.tab-nav-item.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-content {
    display: none;
    padding: 32px;
    line-height: 1.8;
    color: #334155;
    font-size: 15px;
}

.tab-content.active {
    display: block;
}

.tab-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

.tab-content iframe {
    max-width: 100%;
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 8px;
    margin: 16px 0;
}

.tab-content ul, .tab-content ol {
    padding-left: 24px;
}

.detail-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

.detail-content iframe {
    max-width: 100%;
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 8px;
    margin: 16px 0;
}

.detail-content ul, .detail-content ol {
    padding-left: 24px;
}

/* ========== 版本列表样式 ========== */
.version-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.version-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 8px;
    position: relative;
    transition: background 0.2s;
}

.version-item:hover {
    background: #f1f5f9;
}

.version-info {
    flex: 1;
    min-width: 0;
}

.version-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.version-changelog {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.version-mc {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.mc-version-tag {
    padding: 4px 10px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.version-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.version-time {
    font-size: 12px;
    color: #94a3b8;
}

.version-download-btn {
    padding: 8px 20px;
    background: #2563eb;
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.version-download-btn:hover {
    background: #1d4ed8;
}

.delete-version-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.edit-active .delete-version-btn {
    display: flex;
}

.add-version-btn {
    margin-top: 16px;
    width: 100%;
    padding: 12px;
    border: 2px dashed #cbd5e1;
    background: #fff;
    border-radius: 8px;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    display: none;
    transition: all 0.2s;
}

.edit-active .add-version-btn {
    display: block;
}

.add-version-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

/* 下载弹窗版本列表 */
.modal-version-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.modal-version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.modal-version-name {
    font-weight: 500;
    color: #1e293b;
}

.modal-download-btn {
    padding: 8px 20px;
    background: #2563eb;
    color: #ffffff !important;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    transition: background 0.2s;
}

.modal-download-btn:hover {
    background: #1d4ed8;
    color: #ffffff !important;
}

/* ========== 弹窗统一样式 ========== */
/* 所有弹窗窗口统一尺寸、对齐方式 */
.edit-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.edit-modal.open {
    display: flex;
}

.modal-box {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* 下载弹窗也统一为 500px，与其他弹窗对齐 */
.download-modal-box {
    max-width: 500px;
}

.modal-box h3 {
    font-size: 20px;
    color: #1e293b;
    margin: 0 0 20px 0;
}

.download-content {
    padding: 16px 0;
    line-height: 1.8;
    color: #334155;
}

.download-content a {
    color: #3b82f6;
    font-weight: 500;
    text-decoration: none;
}

.download-content a:hover {
    text-decoration: underline;
}

/* ========== 编辑弹窗表单 ========== */
.edit-section {
    margin-bottom: 18px;
}

.edit-section label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 8px;
}

.edit-section textarea, .edit-section input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.edit-section textarea {
    resize: vertical;
}

.edit-section textarea:focus, .edit-section input:focus {
    outline: none;
    border-color: #3b82f6;
}

.img-upload {
    width: 100%;
    padding: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background-color: #f8fafc;
}

.tip {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

/* ========== 按钮组 ========== */
.btn-group {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #3b82f6;
    color: #fff;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-default {
    background-color: #f1f5f9;
    color: #334155;
}

.btn-default:hover {
    background-color: #e2e8f0;
}

/* ========== 编辑模式样式 ========== */
.edit-active [data-editkey] {
    cursor: pointer !important;
    position: relative;
    outline: 2px dashed #3b82f6;
    outline-offset: 2px;
}

.edit-active [data-editkey]:hover {
    outline-color: #2563eb;
    background-color: rgba(59, 130, 246, 0.05);
}

/* ========== 访客统计徽章 ========== */
.visitor-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #6366f1;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
    white-space: nowrap;
    border: none;
}

.visitor-badge:hover {
    background-color: #4f46e5;
    transform: translateY(-1px);
}

.visitor-badge:active {
    transform: translateY(0);
}

.visitor-badge svg {
    flex-shrink: 0;
}

.visitor-badge .badge-count {
    font-weight: 700;
    font-size: 14px;
}

/* 在线人数徽章 */
.online-badge {
    background-color: #10b981;
}

.online-badge:hover {
    background-color: #059669;
}

.online-badge .online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #fff;
    flex-shrink: 0;
    animation: onlinePulse 1.6s ease-in-out infinite;
}

@keyframes onlinePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.82); }
}

/* 访客统计弹窗 */
.visitor-stats-content {
    margin: 0;
}

.visitor-stats-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.stats-card {
    flex: 1;
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.stats-card .stats-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.stats-card .stats-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.stats-card.today {
    background: #eef2ff;
}

.stats-card.today .stats-value {
    color: #4f46e5;
}

.stats-card.online {
    background: #ecfdf5;
}

.stats-card.online .stats-value {
    color: #059669;
}

.stats-card.downloads {
    background: #eff6ff;
}

.stats-card.downloads .stats-value {
    color: #2563eb;
}

.stats-card.likes {
    background: #fdf2f8;
}

.stats-card.likes .stats-value {
    color: #db2777;
}

.visitor-history-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.visitor-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    transition: background 0.15s;
}

.visitor-history-item:last-child {
    border-bottom: none;
}

.visitor-history-item:hover {
    background: #f8fafc;
}

.visitor-history-item .history-date {
    color: #475569;
    font-weight: 500;
    min-width: 80px;
}

.visitor-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 2px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
}

.visitor-history-header .history-date {
    min-width: 80px;
}

.history-stats-group {
    display: flex;
    gap: 24px;
    align-items: center;
}

.visitor-history-header .history-stats-group span {
    min-width: 48px;
    text-align: center;
}

.visitor-history-item .history-stats-group {
    display: flex;
    gap: 24px;
    align-items: center;
}

.visitor-history-item .history-count {
    color: #6366f1;
    font-weight: 600;
    font-size: 15px;
    min-width: 48px;
    text-align: center;
}

.visitor-history-item .history-downloads {
    color: #2563eb;
    font-weight: 600;
    font-size: 15px;
    min-width: 48px;
    text-align: center;
}

.visitor-history-item.today {
    background: #eef2ff;
}

.visitor-history-item.today .history-date {
    color: #4f46e5;
}

.visitor-stats-tip {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 12px;
    text-align: center;
}

/* ========== 响应式 - 平板 ========== */
@media (max-width: 1024px) {
    .resource-list {
        grid-template-columns: repeat(4, 1fr);
    }

    /* 侧边栏收窄 */
    .category-sidebar {
        width: 180px;
        padding: 16px 12px;
    }
}

/* ========== 响应式 - 手机 ========== */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }

    body {
        overflow-x: hidden;
    }

    .container {
        padding: 0 12px;
    }

    .resource-item {
        height: 290px;
    }

    /* 头部导航 */
    .site-header {
        position: sticky;
        top: 0;
    }

    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 12px 0;
        gap: 12px;
    }

    .logo {
        font-size: 20px;
    }

    .nav-bar {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .nav-link {
        font-size: 14px;
        padding: 6px 10px;
        min-height: 36px;
        display: flex;
        align-items: center;
    }

    .login-link {
        padding: 6px 14px;
    }

    .edit-btn {
        padding: 6px 12px;
        font-size: 13px;
        min-height: 36px;
    }

    /* 主内容 */
    .main-content {
        padding: 20px 12px;
    }

    .page-head {
        margin-bottom: 20px;
    }

    .page-head h1 {
        font-size: 22px;
    }

    .page-head p {
        font-size: 14px;
    }

    /* 筛选栏 */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    /* 分类页双栏：手机改为上下堆叠，侧边栏变横向标签 */
    .category-layout {
        flex-direction: column;
        gap: 16px;
    }

    .category-sidebar {
        width: 100%;
        position: static;
        padding: 14px;
        order: -1;
    }

    .sidebar-title {
        font-size: 14px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .sub-cat-nav {
        flex-direction: row;
        gap: 8px;
    }

    .sub-cat-item {
        flex: 1;
        justify-content: center;
        padding: 10px 8px;
    }

    .sub-cat-arrow {
        display: none;
    }

    .sidebar-tip {
        display: none;
    }

    .search-input {
        min-width: auto;
        width: 100%;
        padding: 12px 16px;
        font-size: 16px;
    }

    .version-select, .res-select {
        width: 100%;
        padding: 12px 16px;
        font-size: 16px;
    }

    .sort-bar {
        margin-left: 0;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }

    .sort-label {
        display: none;
    }

    .sort-btn {
        padding: 8px 10px;
        font-size: 13px;
        flex: 1;
        text-align: center;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 资源卡片 - 手机2列 */
    .resource-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .resource-preview {
        height: 160px;
        min-height: 160px;
    }

    .resource-icon {
        width: 40px;
        height: 40px;
        bottom: -15px;
        left: 8px;
    }

    .resource-content {
        padding: 20px 10px 8px;
    }

    .resource-title {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .resource-author {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .resource-desc {
        font-size: 11px;
        -webkit-line-clamp: 2;
        margin-bottom: 8px;
    }

    .resource-meta {
        font-size: 11px;
        padding-top: 8px;
    }

    .meta-item {
        gap: 2px;
    }

    /* 详情页 */
    .detail-page {
        padding: 16px 0;
    }

    .detail-banner {
        height: 180px;
        border-radius: 8px;
        margin-bottom: 24px;
    }

    .detail-header {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }

    .detail-icon {
        width: 64px;
        height: 64px;
        margin-top: -40px;
        align-self: center;
    }

    .detail-info {
        text-align: center;
        width: 100%;
    }

    .detail-title {
        font-size: 20px;
    }

    .detail-meta {
        justify-content: center;
        gap: 12px;
        font-size: 13px;
    }

    .detail-tags {
        justify-content: center;
    }

    .detail-desc {
        font-size: 14px;
        text-align: left;
    }

    .detail-actions {
        width: 100%;
        flex-direction: row;
        gap: 10px;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }

    /* 选项卡 */
    .detail-tabs {
        border-radius: 10px;
    }

    .tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-nav-item {
        padding: 14px 20px;
        font-size: 14px;
        white-space: nowrap;
    }

    .tab-content {
        padding: 16px;
        font-size: 14px;
        line-height: 1.7;
    }

    .tab-content iframe {
        height: 200px;
        border-radius: 6px;
    }

    .tab-content img {
        border-radius: 6px;
        margin: 12px 0;
    }

    /* 版本列表 */
    .version-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 14px;
    }

    .version-info {
        width: 100%;
    }

    .version-name {
        font-size: 15px;
    }

    .version-changelog {
        white-space: normal;
    }

    .version-mc {
        flex-wrap: wrap;
        gap: 4px;
    }

    .mc-version-tag {
        font-size: 11px;
        padding: 3px 8px;
    }

    .version-right {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .version-download-btn {
        width: auto;
        flex: 1;
        text-align: center;
        padding: 10px 20px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 弹窗 */
    .modal-box {
        padding: 20px;
        width: 95%;
        margin: 10px;
    }

    .modal-box h3 {
        font-size: 18px;
    }

    .modal-version-item {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        padding: 14px;
    }

    .modal-download-btn {
        text-align: center;
        width: 100%;
        padding: 12px;
        min-height: 44px;
        display: block;
    }

    .btn-group {
        gap: 10px;
    }

    .btn {
        flex: 1;
        padding: 12px 20px;
        min-height: 44px;
    }

    /* 登录页 */
    .login-page {
        padding: 20px;
    }

    .login-container {
        padding: 0;
    }

    .login-box {
        padding: 24px 20px;
        border-radius: 12px;
    }

    .login-header h2 {
        font-size: 22px;
    }

    .form-item input {
        padding: 12px 16px;
        font-size: 16px;
    }

    .login-submit {
        padding: 14px;
        min-height: 48px;
    }

    .captcha-img {
        height: 44px;
        width: 110px;
    }

    /* 分页 */
    .pagination {
        gap: 4px;
        margin-top: 24px;
    }

    .page-btn {
        padding: 8px 10px;
        font-size: 13px;
        min-width: 36px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 页脚 */
    .site-footer {
        padding: 20px 12px;
        font-size: 13px;
    }
}

/* ========== 超小屏手机 1列 ========== */
@media (max-width: 480px) {
    .resource-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .resource-preview {
        height: 160px;
        min-height: 160px;
    }

    .resource-icon {
        width: 40px;
        height: 40px;
        bottom: -15px;
        left: 12px;
    }

    .resource-content {
        padding: 20px 14px 8px;
    }

    .resource-title {
        font-size: 16px;
    }

    .resource-author {
        font-size: 13px;
    }

    .resource-desc {
        font-size: 13px;
    }

    .resource-meta {
        font-size: 12px;
    }

    .nav-bar {
        gap: 6px;
    }

    .nav-link {
        font-size: 13px;
        padding: 6px 8px;
    }

    .detail-banner {
        height: 160px;
    }

    .detail-title {
        font-size: 18px;
    }

    .tab-nav-item {
        padding: 12px 16px;
        font-size: 13px;
    }

    .tab-content {
        padding: 14px;
    }

    .tab-content iframe {
        height: 180px;
    }
}
