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

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-primary: #374151;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --background: #ffffff;
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    --border-radius: 0.75rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: #f8fafc;
    min-height: 100vh;
    padding-top: 70px;
}

/* 前台导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e5e5;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #5b8ce8;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-left: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #5b8ce8;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #c5d9f1;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

.hamburger.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

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

/* Header */
header {
    text-align: center;
    padding: 60px 0 30px;
    position: relative;
}

header h1 {
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* 管理后台容器 */
.admin-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 管理后台头部样式 */
.admin-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* 管理后台主内容区 */
.admin-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.admin-section {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}






/* Category Navigation */
.category-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 35px; /* 减少底部间距 */
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 20px;
    border: 2px solid #c5d9f1;
    border-radius: 25px;
    background: var(--card-background);
    color: #5b8ce8;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover,
.category-btn.active {
    border-color: #5b8ce8;
    background: #5b8ce8;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 140, 232, 0.3);
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.resource-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.resource-card:hover::before {
    opacity: 1;
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.resource-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.resource-category {
    padding: 6px 14px;
    background: #5b8ce8;
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(122, 156, 214, 0.3);
}

.resource-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.resource-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.resource-type {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.type-icon {
    font-size: 1.1rem;
}

.resource-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.tag {
    padding: 4px 8px;
    background: #f0f0f0;
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.8rem;
}

.resource-actions {
    display: flex;
    justify-content: center;
}

.download-btn {
    width: 100%;
    max-width: 280px;
    padding: 10px 24px;
    border: 2px solid #5b8ce8;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: #5b8ce8;
}

.download-btn:hover {
    background: #5b8ce8;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 140, 232, 0.3);
}

.download-btn svg {
    flex-shrink: 0;
}

/* 移除提取码样式，已不再需要 */

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Admin Panel */
.admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-panel.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.admin-content {
    background: var(--card-background);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.admin-panel.show .admin-content {
    transform: translateY(0);
}



.admin-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-primary);
}

.admin-body {
    padding: 0;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
}

.tab-btn {
    padding: 15px 20px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover,
.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    padding: 30px;
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
}

.form-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-actions button[type="submit"] {
    background: var(--primary-color);
    color: white;
}

.form-actions button[type="submit"]:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Resource Management List */
.resource-list {
    max-height: 400px;
    overflow-y: auto;
}

.admin-resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.admin-resource-info h4 {
    color: var(--text-primary);
    margin-bottom: 4px;
}

.admin-resource-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-resource-actions {
    display: flex;
    gap: 8px;
}

.admin-resource-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn {
    background: #e3f2fd;
    color: #1976d2;
}

.edit-btn:hover {
    background: #bbdefb;
}

.delete-btn {
    background: #ffebee;
    color: #d32f2f;
}

.delete-btn:hover {
    background: #ffcdd2;
}

/* Config Section */
.config-section h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.config-section p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

#jsonConfig {
    width: 100%;
    min-height: 300px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    resize: vertical;
}

.config-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.config-actions button {
    padding: 10px 16px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    background: transparent;
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.config-actions button:hover {
    background: var(--primary-color);
    color: white;
}

/* 资源统计样式 */
.resource-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
    padding: 20px 30px;
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f8ff 100%);
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 管理资源项样式优化 */
.admin-resource-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
}

.admin-resource-info {
    flex: 1;
    margin-right: 20px;
}

.admin-resource-info h4 {
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.admin-resource-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 4px 0;
}

.resource-link {
    color: var(--primary-color) !important;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem !important;
}

.admin-resource-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.admin-resource-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.edit-btn {
    background: #e3f2fd;
    color: #1976d2;
}

.edit-btn:hover {
    background: #bbdefb;
    transform: translateY(-1px);
}

.delete-btn {
    background: #ffebee;
    color: #d32f2f;
}

.delete-btn:hover {
    background: #ffcdd2;
    transform: translateY(-1px);
}

/* 配置帮助样式 */
.config-help {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.config-help h4 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 1rem;
}

.config-help ul {
    margin: 0;
    padding-left: 20px;
}

.config-help li {
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.5;
}

.config-actions button.primary {
    background: var(--primary-color);
    color: white;
}

.config-actions button.primary:hover {
    background: var(--primary-hover);
}
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    /* 移动端导航菜单 */
    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 20px 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 10px 0;
        margin-left: 0;
    }

    header {
        padding: 60px 0 25px;
    }

    header h1 {
        font-size: 2rem;
    }

    .resources-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .resource-card {
        padding: 20px;
    }
    
    .category-nav {
        gap: 6px;
    }
    
    .category-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .admin-content {
        width: 95%;
        margin: 10px;
    }
    
    .admin-header,
    .tab-content {
        padding: 20px;
    }
    
    .admin-tabs {
        padding: 0 20px;
    }
    
    .config-actions {
        flex-direction: column;
    }
    
    .config-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .resource-actions {
        flex-direction: column;
    }
    
    .admin-resource-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .admin-resource-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
/* 管理后台
按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-outline {
    background: transparent;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-main {
        padding: 1rem;
    }

    .header-content {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .header-actions {
        justify-content: center;
    }
}