@charset "UTF-8";

:root {
    --bg-base: #f3f3f3;
    --bg-mica: rgba(243, 243, 243, 0.85);
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-hover: rgba(0, 0, 0, 0.04);
    --bg-active: rgba(0, 0, 0, 0.08);
    --text-primary: #1a1a1a;
    --text-secondary: #5f5f5f;
    --text-tertiary: #8a8a8a;
    --accent: #5b5fc7;
    --accent-hover: #4a4eb3;
    --border: rgba(0, 0, 0, 0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.04), 0 0 1px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --glow-1: rgba(91, 95, 199, 1.0);
    --glow-2: rgba(118, 75, 162, 1.0);
    --glow-3: rgba(0, 150, 255, 1.0);
    --glow-4: rgba(236, 72, 153, 1.0);
    --glow-5: rgba(34, 197, 94, 1.0);
    --glow-6: rgba(245, 158, 11, 1.0);
}

[data-theme="dark"] {
    --bg-base: #202020;
    --bg-mica: rgba(32, 32, 32, 0.85);
    --bg-card: rgba(40, 40, 40, 0.72);
    --bg-hover: rgba(255, 255, 255, 0.06);
    --bg-active: rgba(255, 255, 255, 0.1);
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-tertiary: #707070;
    --accent: #7a7fd9;
    --accent-hover: #8b90e8;
    --border: rgba(255, 255, 255, 0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.2), 0 0 1px rgba(255,255,255,0.04);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.3), 0 0 1px rgba(255,255,255,0.06);
    --glow-1: rgba(91, 95, 199, 1.0);
    --glow-2: rgba(118, 75, 162, 1.0);
    --glow-3: rgba(0, 150, 255, 1.0);
    --glow-4: rgba(236, 72, 153, 1.0);
    --glow-5: rgba(34, 197, 94, 1.0);
    --glow-6: rgba(245, 158, 11, 1.0);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--bg-base); color: var(--text-primary);
    overflow-x: hidden; min-height: 100vh;
}

/* ===== 背景 ===== */
.bg-layer { position: fixed; inset: 0; z-index: -3; background: var(--bg-base); }
.bg-glow { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35; animation: orbFloat 20s ease-in-out infinite; }
.orb:nth-child(1) { width: 300px; height: 300px; background: var(--glow-1); top: 10%; left: 10%; animation-delay: 0s; }
.orb:nth-child(2) { width: 250px; height: 250px; background: var(--glow-2); top: 60%; left: 70%; animation-delay: 3s; }
.orb:nth-child(3) { width: 200px; height: 200px; background: var(--glow-3); top: 30%; left: 80%; animation-delay: 6s; }
.orb:nth-child(4) { width: 280px; height: 280px; background: var(--glow-4); top: 70%; left: 20%; animation-delay: 9s; }
.orb:nth-child(5) { width: 220px; height: 220px; background: var(--glow-5); top: 20%; left: 50%; animation-delay: 12s; }
.orb:nth-child(6) { width: 260px; height: 260px; background: var(--glow-6); top: 80%; left: 60%; animation-delay: 15s; }
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(40px, 20px) scale(1.05); }
}
.mica-overlay { position: fixed; inset: 0; z-index: -1; backdrop-filter: blur(60px) saturate(1.2); background: var(--bg-mica); pointer-events: none; }

/* ===== 加载动画 ===== */
.loader-overlay { position: fixed; inset: 0; z-index: 1000; background: var(--bg-base); display: flex; align-items: center; justify-content: center; transition: opacity 0.5s, visibility 0.5s; }
.loader-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.origin-loader { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 登录页 ===== */
.login-overlay { position: fixed; inset: 0; z-index: 200; background: var(--bg-base); display: flex; align-items: center; justify-content: center; }
.login-box { width: 90%; max-width: 400px; background: var(--bg-card); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.login-title { font-size: 24px; font-weight: 600; margin-bottom: 24px; text-align: center; color: var(--text-primary); }
.login-input { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-base); color: var(--text-primary); font-size: 16px; margin-bottom: 16px; font-family: inherit; outline: none; transition: var(--transition); }
.login-input:focus { border-color: var(--accent); }
.login-btn { width: 100%; padding: 12px; background: var(--accent); color: white; border: none; border-radius: var(--radius-md); font-size: 16px; cursor: pointer; font-family: inherit; font-weight: 500; transition: var(--transition); }
.login-btn:hover { background: var(--accent-hover); }
.login-error { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; min-height: 18px; }
.saved-users { margin-bottom: 16px; }
.saved-users-label { color: var(--text-tertiary); font-size: 13px; margin-bottom: 8px; }
.saved-user-chip { display: inline-block; padding: 6px 14px; background: var(--bg-hover); border-radius: var(--radius-full); margin-right: 8px; margin-bottom: 8px; cursor: pointer; color: var(--text-primary); font-size: 14px; transition: var(--transition); }
.saved-user-chip:hover { background: var(--accent); color: white; }

/* ===== 顶部栏 ===== */
.app-bar { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(20px); background: var(--bg-mica); border-bottom: 1px solid var(--border); }
.app-bar-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.greeting-brand { font-size: 18px; font-weight: 600; color: var(--text-primary); transition: color 0.3s; }
.greeting-brand.evil { color: #ef4444; }
.nav-center { display: flex; gap: 8px; background: var(--bg-hover); padding: 4px; border-radius: var(--radius-full); }
.nav-tab { padding: 8px 20px; border-radius: var(--radius-full); border: none; background: transparent; color: var(--text-secondary); font-size: 14px; font-weight: 500; cursor: pointer; transition: var(--transition); font-family: inherit; }
.nav-tab:hover { color: var(--text-primary); }
.nav-tab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.bilibili-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-full); background: var(--bg-hover); transition: var(--transition); }
.bilibili-btn:hover { background: var(--bg-active); transform: scale(1.1); }
.bilibili-btn svg { width: 20px; height: 20px; fill: var(--text-secondary); }
.theme-toggle { width: 36px; height: 36px; border-radius: var(--radius-full); border: none; background: var(--bg-hover); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.theme-toggle:hover { background: var(--bg-active); transform: scale(1.1); }
.theme-toggle svg { width: 18px; height: 18px; stroke: var(--text-secondary); stroke-width: 2; fill: none; }

/* ===== 页面容器 ===== */
.pages-container { overflow: hidden; width: 100%; }
.pages-track { display: flex; width: 200%; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.page { width: 50%; min-height: calc(100vh - 56px - 60px); flex-shrink: 0; }
.page-inner { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* ===== 底部 ===== */
.footer { padding: 20px; text-align: center; border-top: 1px solid var(--border); }
.footer-row { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; gap: 8px; }
.footer-left { font-size: 13px; color: var(--text-tertiary); }
.footer-right { font-size: 13px; color: var(--text-tertiary); }

/* ===== 滚动按钮 ===== */
.scroll-float-btn { position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--bg-card); color: var(--text-primary); font-size: 18px; cursor: pointer; box-shadow: var(--shadow-hover); z-index: 40; opacity: 0; transform: scale(0.8); transition: all 0.3s; display: flex; align-items: center; justify-content: center; }
.scroll-float-btn.show { opacity: 1; transform: scale(1); }

/* ===== 彩蛋通知 ===== */
.easter-egg-toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px); background: var(--bg-card); color: var(--text-primary); padding: 12px 24px; border-radius: var(--radius-md); box-shadow: var(--shadow-hover); z-index: 300; transition: transform 0.4s cubic-bezier(0.4,0,0.2,1); font-size: 14px; font-weight: 500; }
.easter-egg-toast.show { transform: translateX(-50%) translateY(0); }

/* ===== 当前用户下载板 ===== */
.user-bar { display: flex; align-items: center; padding: 16px 20px; background: var(--bg-card); border-radius: var(--radius-md); margin-bottom: 20px; box-shadow: var(--shadow); transition: var(--transition); }
.user-bar:hover { box-shadow: var(--shadow-hover); }
.user-bar-label { font-size: 15px; color: var(--text-secondary); margin-right: 8px; }
.user-bar-name { font-size: 16px; font-weight: 600; color: var(--text-primary); }

/* ===== 作品大标题 ===== */
.works-title { font-size: 22px; font-weight: 600; color: var(--text-primary); margin-bottom: 16px; margin-top: 8px; }

/* ===== 内容网格（响应式） ===== */
.posts-grid { display: grid; gap: 16px; padding: 8px 0; }
@media (max-width: 599px) { .posts-grid { grid-template-columns: 1fr; } }
@media (min-width: 600px) and (max-width: 1023px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .posts-grid { grid-template-columns: repeat(3, 1fr); } }

/* ===== 视频模板卡片（带标题） ===== */
.post-card { background: var(--bg-card); border-radius: var(--radius-md); overflow: hidden; cursor: pointer; transition: var(--transition); box-shadow: var(--shadow); }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.post-thumb-wrap { position: relative; width: 100%; padding-top: 62.5%; overflow: hidden; background: var(--bg-hover); }
.post-thumb { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.post-card:hover .post-thumb { transform: scale(1.05); }
.post-info { padding: 12px; }
.post-title { font-size: 15px; font-weight: 500; color: var(--text-primary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== 详情页overlay ===== */
.detail-overlay { position: fixed; inset: 0; z-index: 150; background: var(--bg-base); overflow-y: auto; display: none; opacity: 0; transition: opacity 0.3s; }
.detail-overlay.active { display: block; opacity: 1; }
.detail-close { position: fixed; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.5); color: white; border: none; font-size: 20px; cursor: pointer; z-index: 160; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.detail-close:hover { background: rgba(0,0,0,0.7); transform: scale(1.1); }
.detail-hero { width: 100%; background: #000; display: flex; align-items: center; justify-content: center; min-height: 40vh; max-height: 60vh; overflow: hidden; }
.detail-hero-img { max-width: 100%; max-height: 60vh; object-fit: contain; }
.detail-body { max-width: 800px; margin: 0 auto; padding: 24px 20px; }
.detail-title { font-size: 22px; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; line-height: 1.3; }
.detail-content { font-size: 16px; color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; }
.detail-meta { font-size: 13px; color: var(--text-tertiary); margin-top: 16px; }

/* ===== 发布页overlay ===== */
.publish-overlay { position: fixed; inset: 0; z-index: 150; background: var(--bg-base); overflow-y: auto; display: none; opacity: 0; transition: opacity 0.3s; }
.publish-overlay.active { display: block; opacity: 1; }
.publish-inner { max-width: 600px; margin: 0 auto; padding: 20px; }
.publish-header { font-size: 24px; font-weight: 600; color: var(--text-primary); margin-bottom: 20px; }
.publish-input { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text-primary); font-size: 16px; margin-bottom: 16px; font-family: inherit; outline: none; transition: var(--transition); }
.publish-input:focus { border-color: var(--accent); }
.publish-textarea { width: 100%; min-height: 200px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text-primary); font-size: 15px; resize: vertical; margin-bottom: 16px; font-family: inherit; outline: none; transition: var(--transition); line-height: 1.6; }
.publish-textarea:focus { border-color: var(--accent); }
.publish-dropzone { width: 100%; height: 180px; border: 2px dashed var(--border); border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-tertiary); margin-bottom: 16px; cursor: pointer; transition: var(--transition); }
.publish-dropzone:hover, .publish-dropzone.dragover { border-color: var(--accent); background: var(--bg-hover); }
.publish-dropzone svg { width: 40px; height: 40px; stroke: var(--text-tertiary); stroke-width: 1.5; fill: none; margin-bottom: 8px; }
.publish-preview { max-width: 100%; max-height: 200px; border-radius: var(--radius-md); margin-bottom: 16px; display: block; }
.publish-btn { width: 100%; padding: 14px; background: var(--accent); color: white; border: none; border-radius: var(--radius-md); font-size: 16px; cursor: pointer; font-family: inherit; font-weight: 500; transition: var(--transition); }
.publish-btn:hover { background: var(--accent-hover); }
.publish-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 内容管理页overlay ===== */
.manage-overlay { position: fixed; inset: 0; z-index: 150; background: var(--bg-base); overflow-y: auto; display: none; opacity: 0; transition: opacity 0.3s; }
.manage-overlay.active { display: block; opacity: 1; }
.manage-inner { max-width: 800px; margin: 0 auto; padding: 20px; }
.manage-header { font-size: 22px; font-weight: 600; color: var(--text-primary); margin-bottom: 20px; }
.manage-empty { text-align: center; color: var(--text-tertiary); padding: 60px 20px; font-size: 15px; }
.manage-item { display: flex; gap: 12px; padding: 12px; background: var(--bg-card); border-radius: var(--radius-md); margin-bottom: 12px; box-shadow: var(--shadow); transition: var(--transition); }
.manage-item:hover { box-shadow: var(--shadow-hover); }
.manage-thumb { width: 120px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; background: var(--bg-hover); }
.manage-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.manage-title { font-size: 15px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.manage-date { font-size: 12px; color: var(--text-tertiary); }
.manage-delete { padding: 8px 16px; background: #ef4444; color: white; border: none; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: 13px; transition: var(--transition); flex-shrink: 0; }
.manage-delete:hover { background: #dc2626; }

/* ===== 确认弹窗 ===== */
.confirm-overlay { position: fixed; inset: 0; z-index: 250; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; }
.confirm-overlay.active { display: flex; opacity: 1; }
.confirm-box { background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px; width: 90%; max-width: 360px; text-align: center; box-shadow: var(--shadow-hover); }
.confirm-text { font-size: 16px; color: var(--text-primary); margin-bottom: 20px; line-height: 1.5; }
.confirm-btns { display: flex; gap: 12px; justify-content: center; }
.confirm-btn { padding: 10px 24px; border-radius: var(--radius-md); border: none; font-size: 14px; cursor: pointer; font-family: inherit; font-weight: 500; transition: var(--transition); }
.confirm-yes { background: var(--accent); color: white; }
.confirm-yes:hover { background: var(--accent-hover); }
.confirm-no { background: var(--bg-hover); color: var(--text-primary); }
.confirm-no:hover { background: var(--bg-active); }
