/* ==================== 基础重置与变量 ==================== */
:root {
    --bg-page: transparent; 
    --bg-card: transparent; 
    --text-main: #ffffff; 
    --text-secondary: #e0e0e0; 
    --border-color: rgba(255, 255, 255, 0.15); 
    --color-primary: #3370ff;
    --color-primary-hover: #4e83fd;
    --color-danger: #f54a45;
    --color-danger-hover: #f76560;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-modal: 0 24px 64px -16px rgba(0, 0, 0, 0.6), 0 0 1px rgba(0,0,0,0.1);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    background-color: #000;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ==================== 全局背景视频 ==================== */
#bg-video {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    object-fit: cover;
    z-index: -2; 
    filter: brightness(0.7); 
    transform: translateZ(0); 
    will-change: transform;
    pointer-events: none; 
}

/* ==================== 论坛容器入场动画 ==================== */
#forum-wrapper {
    animation: fadeInForum 0.8s ease forwards;
}

@keyframes fadeInForum {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 启动页遮罩 ==================== */
#intro-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: transparent; 
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease; 
}

#intro-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ==================== 极致发光按钮 ==================== */
#enter-btn {
    position: relative;
    z-index: 10;
    padding: 16px 50px;
    font-size: 18px; 
    color: #fff;
    background: rgba(0, 0, 0, 0.4); 
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px; 
    cursor: pointer;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
    letter-spacing: 4px; 
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    transform: translateY(20px) scale(0.9) translateZ(0);
    animation: btnPopIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s forwards;
}

#enter-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.5));
    transform: translateY(-2px) scale(1.02) translateZ(0);
}

#enter-btn:active { transform: translateY(1px) scale(0.98) translateZ(0); }

@keyframes btnPopIn {
    to { opacity: 1; transform: translateY(0) scale(1) translateZ(0); }
}

/* ==================== 顶部导航 ==================== */
header { 
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--border-color); 
    position: sticky; top: 0; z-index: 100; 
}
nav { max-width: 1000px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.2rem; font-weight: 600; color: var(--text-main); text-decoration: none; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-user-info { display: flex; align-items: center; gap: 12px; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,0.3); }
.user-meta { display: flex; flex-direction: column; }
.user-name { font-size: 0.9rem; font-weight: 500; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.upload-label { font-size: 0.75rem; color: var(--color-primary); cursor: pointer; text-shadow: none; }
.upload-label:hover { text-decoration: underline; }

/* ==================== 按钮通用 ==================== */
button {
    cursor: pointer; font-size: 0.9rem; font-weight: 500;
    padding: 8px 18px; border-radius: var(--radius-sm);
    font-family: inherit; transition: all 0.2s ease; 
    border: none;
    display: inline-flex; align-items: center; justify-content: center;
}
button:active { transform: scale(0.96); }

.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 2px 6px rgba(51, 112, 255, 0.3); }
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: 0 4px 12px rgba(51, 112, 255, 0.4); }

.btn-outline { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); color: var(--text-main); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.2); }

.btn-danger { background: var(--color-danger); color: #fff; box-shadow: 0 2px 6px rgba(245, 74, 69, 0.2); }
.btn-danger:hover { background: var(--color-danger-hover); }

/* ==================== 分类标签栏 ==================== */
.category-bar-container { 
    background: rgba(0, 0, 0, 0.4); 
    border-bottom: 1px solid var(--border-color); 
}
.category-bar { max-width: 1000px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.category-tag { 
    display: flex; align-items: center; padding: 6px 14px; border-radius: 20px; 
    background: rgba(255, 255, 255, 0.1); 
    transition: all 0.2s ease; 
    position: relative; 
}
.category-tag:hover { background: rgba(255,255,255,0.2); }
.category-tag .cat-text { font-size: 0.95rem; color: #fff; font-weight: 500; user-select: none; cursor: pointer; }
.category-tag.active { background: var(--color-primary); box-shadow: 0 2px 10px rgba(51, 112, 255, 0.4); }
.category-tag.active .cat-text { color: #ffffff; font-weight: 600; }

.delete-cat-btn { background: none; border: none; color: rgba(255,255,255,0.5); font-size: 1.1rem; font-weight: bold; margin-left: 8px; padding: 0; line-height: 1; box-shadow: none;}
.delete-cat-btn:hover { color: var(--color-danger); background: transparent;}
.category-tag.active .delete-cat-btn { color: rgba(255,255,255,0.9); }

.add-cat-tag { background: transparent; border: 1px dashed rgba(255,255,255,0.4); color: rgba(255,255,255,0.7); border-radius: 20px; padding: 6px 14px; font-size: 1rem; font-weight: bold; box-shadow: none;}
.add-cat-tag:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, 0.1); }

/* 拖拽排序 */
.category-tag[draggable="true"] { cursor: grab; }
.category-tag.dragging { opacity: 0.9; background-color: var(--color-primary) !important; box-shadow: 0 10px 20px rgba(51, 112, 255, 0.4); transform: scale(1.05) translateZ(0); z-index: 100; transition: none !important; }
.category-tag.dragging .cat-text { color: #ffffff !important; font-weight: 600; }
.category-tag.dragging .delete-cat-btn { color: rgba(255, 255, 255, 0.7) !important; }
.category-tag.drag-left::before { content: ""; position: absolute; left: -6px; top: 15%; height: 70%; width: 3px; background-color: var(--color-primary); border-radius: 3px; }
.category-tag.drag-right::after { content: ""; position: absolute; right: -6px; top: 15%; height: 70%; width: 3px; background-color: var(--color-primary); border-radius: 3px; }

/* ==================== 主内容卡片 ==================== */
main { max-width: 1000px; margin: 24px auto; padding: 0 20px; position: relative; z-index: 10;}

.category-content-area { 
    background: rgba(0, 0, 0, 0.4); 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-sm); 
    padding: 32px; 
    min-height: 500px; 
    border: 1px solid var(--border-color); 
}

.panel-header { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--border-color); }
.author-info { display: flex; align-items: center; gap: 14px; }
.author-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-color); }
.author-meta { display: flex; flex-direction: column; }
.author-name { font-size: 1rem; font-weight: 600; color: var(--text-main); display: flex; align-items: center; gap: 6px; }
.publish-time { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; font-family: monospace;}
.badge { background: rgba(244, 63, 94, 0.2); color: #ff8a9f; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; font-weight: 500; }

/* ==================== 文本内容区 ==================== */
.chat-text-content { font-size: 1.05rem; line-height: 1.8; color: var(--text-main); white-space: pre-wrap; word-wrap: break-word; min-height: 100px; }
.chat-text-content[contenteditable="true"] { cursor: text; background-color: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius-md); padding: 16px; margin: -16px; outline: none; box-shadow: 0 0 0 2px var(--color-primary); transition: box-shadow 0.2s; }

/* ==================== 标签切换平滑过渡动画 ==================== */
.chat-text-content {
    will-change: opacity, transform;
}
.chat-text-content.fade-in-content {
    animation: fadeInText 0.25s ease forwards;
}
@keyframes fadeInText {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 弹窗基础架构 ==================== */
.modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; z-index: 10000; }
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); animation: overlayFade 0.3s ease-out; }
.modal-content { position: relative; background: #ffffff; width: 90%; border-radius: var(--radius-lg); padding: 28px; z-index: 10001; box-shadow: var(--shadow-modal); animation: modalSpring 0.3s ease-out; color: #333; }

@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSpring { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-header h2 { font-size: 1.25rem; color: #1f2329; margin: 0; font-weight: 600; }
.close-btn { background: none; border: none; font-size: 1.5rem; color: #8f959e; cursor: pointer; padding: 0; line-height: 1; transition: color 0.2s; }
.close-btn:hover { color: #1f2329; }

.form-group { margin-bottom: 20px; display: flex; flex-direction: column; }
.form-group label { margin-bottom: 8px; font-size: 0.9rem; font-weight: 500; color: #1f2329; }
.form-group input { padding: 12px 16px; border: 1px solid #e8eaed; border-radius: var(--radius-md); font-family: inherit; font-size: 1rem; transition: all 0.2s; background: #f9f9f9; color: #333; }
.form-group input:focus { outline: none; border-color: var(--color-primary); background: #fff; box-shadow: 0 0 0 3px rgba(51, 112, 255, 0.15); }

.modal-footer { margin-top: 28px; display: flex; gap: 12px; justify-content: flex-end; }
.error-msg { color: var(--color-danger); font-size: 0.85rem; margin-top: 8px; }

/* 密码小眼睛 */
.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper input { width: 100%; padding-right: 44px; }
.eye-icon { position: absolute; right: 14px; cursor: pointer; color: #8f959e; display: flex; transition: color 0.2s; }
.eye-icon svg { width: 20px; height: 20px; }
.eye-icon:hover { color: #1f2329; }

/* ==================== 顶部 Toast 提示 ==================== */
.toast {
    position: fixed; top: -60px; left: 50%; 
    transform: translateX(-50%) translateY(-20px);
    background-color: #333; 
    color: #fff;
    padding: 10px 20px; border-radius: 30px; 
    font-size: 0.9rem; font-weight: 500;
    z-index: 20000; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
    opacity: 0;
    transition: all 0.3s ease; 
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast::before {
    content: "✓"; display: flex; justify-content: center; align-items: center;
    width: 18px; height: 18px; background-color: #00c853; color: #fff; border-radius: 50%; font-size: 12px; font-weight: bold;
}
.toast.show { top: 30px; opacity: 1; transform: translateX(-50%) translateY(0); }