/* ==========================================================================
   STYLE.CSS - 2026 HIGH CONCEPT DESIGN (Final Visual Remaster)
   包含：磨砂玻璃菜单、悬浮胶囊用户栏、布局修复、幻灯片
   ========================================================================== */

:root {
    --bg-body: #f2f4f8;
    --bg-surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.25);
    --danger: #ef4444;
    --radius-xl: 24px;
    --radius-md: 12px;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }
body {
    margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body); color: var(--text-primary);
    line-height: 1.6; height: 100vh; display: flex; flex-direction: column; overflow: hidden;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* =========================================
   1. 顶部导航 (Navbar) - 美化版
   ========================================= */
.navbar {
    height: 72px; padding: 0 40px; display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-surface); z-index: 100; flex-shrink: 0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}
.logo { 
    font-size: 20px; font-weight: 800; 
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
}

/* 用户信息悬浮胶囊 */
.user-badge {
    display: flex; align-items: center; gap: 12px;
    padding: 5px 5px 5px 16px; /* 左宽右窄，包住头像 */
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 100px;
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    transition: all 0.3s var(--ease-elastic);
    cursor: default;
}
.user-badge:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
    transform: translateY(-1px);
}
.user-badge i { font-size: 12px; opacity: 0.8; color: var(--accent); }

.user-avatar {
    width: 38px; height: 38px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700;
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.3);
}

/* =========================================
   2. 布局与侧边栏
   ========================================= */
.main-container { flex: 1; display: grid; grid-template-columns: 260px 1fr; height: calc(100vh - 72px); overflow: hidden; }

.sidebar { padding: 30px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }

.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius-md);
    color: var(--text-secondary); font-weight: 600; font-size: 14px; transition: 0.3s var(--ease-elastic); cursor: pointer;
}
.nav-item:hover { background: #fff; color: var(--text-primary); transform: translateX(4px); }
.nav-item.active { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -4px var(--accent-glow); }
.nav-item i { width: 20px; text-align: center; }

/* 侧边栏底部弹簧与特殊链接 */
.nav-separator { flex: 1; min-height: 20px; } /* 撑开空间 */
.nav-return-link { 
    background: #e2e8f0; color: var(--text-primary) !important; font-weight: 700; margin-bottom: 8px; 
}
.nav-return-link:hover { background: #cbd5e1; }

.content-area { padding: 0 40px 40px 40px; overflow-y: auto; scroll-behavior: smooth; position: relative; }

/* =========================================
   3. 工具栏
   ========================================= */
.toolbar {
    position: sticky; top: 0; 
    padding: 30px 0 10px 0; /* 底部减少留白 */
    background: var(--bg-body); 
    z-index: 50; 
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    margin-bottom: 10px;
}
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; margin: 0; }

.search-box {
    display: flex; align-items: center; gap: 10px; background: var(--bg-surface); padding: 0 20px;
    height: 48px; width: 300px; border-radius: 100px; box-shadow: var(--shadow-soft); transition: 0.3s;
}
.search-box:focus-within { box-shadow: 0 0 0 3px var(--accent-glow); transform: scale(1.02); }
.search-box input { border: none; font-size: 14px; width: 100%; height: 100%; }

.btn {
    height: 48px; padding: 0 24px; border-radius: 100px; font-weight: 700; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: none;
    transition: all 0.3s var(--ease-elastic);
}
.btn:active { transform: scale(0.92); }
.btn.primary { background: var(--text-primary); color: #fff; box-shadow: 0 10px 20px -5px rgba(15, 23, 42, 0.3); }
.btn.primary:hover { background: var(--accent); box-shadow: 0 10px 25px -5px var(--accent-glow); }
.btn.ghost { background: transparent; color: var(--text-secondary); }
.btn.ghost:hover { background: rgba(0,0,0,0.05); color: var(--text-primary); }

/* =========================================
   4. 资源卡片
   ========================================= */
.resource-grid { 
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 24px; padding-top: 10px; padding-bottom: 60px; 
    position: relative; z-index: 1;
}
.card {
    background: var(--bg-surface); border-radius: var(--radius-xl); padding: 24px;
    height: 200px; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; transition: all 0.4s var(--ease-elastic);
    border: 1px solid rgba(255,255,255,0.5); cursor: pointer;
    z-index: 1; transform-origin: center center;
}
.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    z-index: 999; border-color: transparent;
}
.card-header { 
    display: flex; justify-content: space-between; align-items: flex-start; 
    margin-bottom: 16px; width: 100%;
}
.card-icon-box { width: 56px; height: 56px; border-radius: 16px; background: #f8fafc; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.card-icon-img { width: 100%; height: 100%; object-fit: cover; }
.card-icon-fa { font-size: 28px; color: var(--accent); }
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 4px 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-ver-tag { font-size: 11px; font-weight: 600; font-family: monospace; background: #f1f5f9; padding: 4px 8px; border-radius: 6px; color: var(--text-secondary); }
.card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #cbd5e1; font-weight: 500; margin-top: auto; }

/* =========================================
   5. 右键菜单 (磨砂玻璃风格)
   ========================================= */
#ctx-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.9); /* 高透 */
    backdrop-filter: blur(12px);            /* 磨砂 */
    padding: 6px;
    border-radius: 16px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.5), 0 15px 40px -10px rgba(0,0,0,0.15);
    width: 140px;
    z-index: 9999;
    display: none;
    transform-origin: top left;
    animation: menuPop 0.2s var(--ease-elastic);
}
.ctx-item {
    padding: 10px 12px;
    font-size: 13px; font-weight: 500; color: var(--text-primary);
    border-radius: 10px; cursor: pointer; transition: 0.1s;
    display: flex; align-items: center; gap: 10px;
}
.ctx-item i { width: 16px; text-align: center; color: var(--text-secondary); }
.ctx-item:hover { background: var(--accent); color: #fff; }
.ctx-item:hover i { color: #fff; }
.ctx-item.danger:hover { background: var(--danger); }

@keyframes menuPop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* =========================================
   6. 详情页 (View)
   ========================================= */
.view-container { max-width: 1000px; margin: 0 auto; padding: 40px; animation: slideUp 0.5s var(--ease-elastic); }
.view-header { display: flex; gap: 32px; margin-bottom: 40px; align-items: flex-start; }
.view-icon { width: 120px; height: 120px; border-radius: 32px; background: #fff; box-shadow: var(--shadow-soft); display: flex; align-items: center; justify-content: center; font-size: 60px; color: var(--accent); object-fit: cover; flex-shrink: 0; }
.view-meta h1 { font-size: 40px; font-weight: 800; margin: 0 0 16px 0; line-height: 1.2; }
.view-desc { font-size: 16px; color: var(--text-secondary); line-height: 1.8; max-width: 600px; }
.view-tags { display: flex; gap: 12px; margin-top: 24px; }
.tag { padding: 6px 12px; background: #e2e8f0; border-radius: 8px; font-size: 12px; font-weight: 600; color: #475569; }

/* 图片幻灯片 */
.carousel-section { margin-bottom: 40px; }
.carousel-container { display: flex; gap: 20px; overflow-x: auto; padding: 10px 5px 20px 5px; scroll-snap-type: x mandatory; scroll-behavior: smooth; }
.carousel-container::-webkit-scrollbar { height: 8px; }
.carousel-container::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
.carousel-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.carousel-item { min-width: 600px; height: 340px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-soft); overflow: hidden; scroll-snap-align: center; position: relative; border: 1px solid #e2e8f0; }
.carousel-img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.carousel-item:hover .carousel-img { transform: scale(1.02); }

/* 版本列表 */
.version-card { background: #fff; border-radius: 20px; padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-soft); display: flex; justify-content: space-between; align-items: center; transition: 0.2s; }
.version-card:hover { transform: translateX(5px); }
.ver-info { display: flex; flex-direction: column; gap: 4px; }
.ver-num { font-size: 20px; font-weight: 800; font-family: monospace; color: var(--text-primary); }
.ver-date { font-size: 13px; color: #94a3b8; }
.ver-actions { display: flex; gap: 12px; }
.btn-source { display: inline-block; padding: 6px 12px; margin-right: 8px; margin-top: 8px; background: #fff; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--accent); box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: 0.2s; }
.btn-source:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }

/* =========================================
   7. 编辑/发布页
   ========================================= */
.editor-layout { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 300px 1fr; gap: 60px; padding: 40px; animation: slideUp 0.4s ease-out; }
.visual-col { position: sticky; top: 40px; height: fit-content; }
.icon-uploader { width: 100%; aspect-ratio: 1/1; background: #fff; border-radius: 40px; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed #e2e8f0; transition: 0.3s; cursor: pointer; overflow: hidden; position: relative; }
.icon-uploader:hover { border-color: var(--accent); transform: rotate(-2deg); }
.icon-uploader img { width: 100%; height: 100%; object-fit: cover; }
.icon-uploader i { font-size: 80px; color: var(--accent); }

.naked-input { width: 100%; background: transparent; border: none; font-size: 40px; font-weight: 800; color: var(--text-primary); margin-bottom: 20px; }
.naked-input::placeholder { color: #e2e8f0; }
.styled-textarea { width: 100%; background: #fff; border: 2px solid transparent; border-radius: 20px; padding: 20px; font-size: 16px; line-height: 1.6; color: var(--text-primary); min-height: 120px; resize: vertical; box-shadow: var(--shadow-soft); transition: 0.3s; font-family: inherit; }
.styled-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }

.sub-block { background: #fff; padding: 24px; border-radius: 24px; box-shadow: var(--shadow-soft); margin-top: 30px; }
.sub-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-weight: 700; }

.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; margin-top: 10px; }
.img-edit-item { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0; group: hover; }
.img-edit-item img { width: 100%; height: 100%; object-fit: cover; }
.img-del-btn { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,0.9); color: var(--danger); border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

.ver-editor-item { background: #f8fafc; border-radius: 16px; padding: 20px; margin-bottom: 16px; border: 1px solid #e2e8f0; }
.ver-editor-header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.ver-input { background: #fff; border: 1px solid #cbd5e1; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-family: monospace; width: 120px; }
.link-row { display: flex; gap: 8px; margin-top: 8px; }
.link-input { flex: 1; background: #fff; border: 1px solid #e2e8f0; padding: 8px; border-radius: 8px; font-size: 13px; }

.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 10px 20px; background: #fff; border-radius: 100px; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: 0.2s; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.chip.active { background: var(--text-primary); color: #fff; transform: scale(1.05); }

@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { 100% { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* =========================================
   8. 登录页 (Auth)
   ========================================= */
.auth-body { display: flex; align-items: center; justify-content: center; height: 100vh; background: #f2f4f8; background-image: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%); }
.auth-card { width: 400px; padding: 40px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(20px); border-radius: 32px; box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.1); text-align: center; border: 1px solid rgba(255, 255, 255, 0.5); animation: slideUp 0.5s var(--ease-elastic); }
.auth-logo { font-size: 28px; font-weight: 800; margin-bottom: 8px; background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; }
.auth-input-group { margin-bottom: 20px; text-align: left; }
.auth-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; margin-left: 4px; }
.auth-input { width: 100%; height: 50px; padding: 0 20px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; font-size: 15px; color: var(--text-primary); transition: 0.3s; }
.auth-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); background: #fff; }
.auth-btn { width: 100%; height: 50px; margin-top: 10px; font-size: 16px; }
.auth-footer { margin-top: 24px; font-size: 13px; color: var(--text-secondary); }
.auth-footer a { color: var(--accent); font-weight: 600; }

/* 移动端通用 */
@media (max-width: 768px) {
    .main-container { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .view-header { flex-direction: column; align-items: center; text-align: center; }
    .editor-layout { grid-template-columns: 1fr; padding: 20px; }
    .visual-col { position: static; margin-bottom: 40px; }
    .carousel-item { min-width: 90%; height: 200px; }
}