/* assets/css/style.css - 修复移动端白屏问题 */

/* =========================================
   1. 全局设置 (Global & Reset)
   ========================================= */
:root {
    --bg-deep: #09090b;       /* 页面背景 */
    --bg-card: #18181b;       /* 卡片背景 */
    --bg-hover: #27272a;
    --primary: #6366f1;       /* 主题色 Indigo */
    --accent: #ec4899;        /* 强调色 Pink */
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --radius-xl: 24px;
    --radius-lg: 16px;
    --border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 强制重置 */
html {
    background-color: var(--bg-deep);
    overscroll-behavior-y: none;
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

/* 
   🔴 核心修复：仅在 PC 端 (>768px) 隐藏移动端元素 
   之前这里没有加媒体查询，导致手机端也被 !important 强制隐藏了
*/
@media screen and (min-width: 769px) {
    .bottom-nav, 
    .logo-mobile, 
    .mobile-layout-container, 
    #mobile-create-btn, 
    .mobile-search-wrapper { 
        display: none !important; 
    }
}


/* =========================================
   2. 布局网格 (Layout)
   ========================================= */
.aether-layout {
    display: grid;
    grid-template-columns: 260px minmax(580px, 1fr) 320px;
    gap: 40px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 32px;
    min-height: 100vh;
    align-items: start;
    align-content: start;
}


/* =========================================
   3. 左侧导航 (Left Sidebar)
   ========================================= */
.left-nav-module {
    position: sticky; 
    top: 32px; 
    height: calc(100vh - 64px);
    display: flex; 
    flex-direction: column;
    margin-top: 0;
}

.logo {
    font-size: 24px; 
    font-weight: 800; 
    color: white; 
    display: flex; 
    align-items: center; 
    gap: 10px;
    margin: 0 0 40px 0;
}
.logo span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: shimmer 5s linear infinite;
}

.aether-nav.layui-nav-tree { background: transparent !important; width: 100%; }
.aether-nav .layui-nav-item { margin-bottom: 6px; }

.aether-nav .layui-nav-item a {
    color: var(--text-muted) !important;
    height: 48px !important; 
    line-height: 48px !important;
    display: flex; 
    align-items: center;
    padding: 0 16px; 
    border-radius: 12px;
    font-size: 15px; 
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.aether-nav .layui-nav-item a i {
    font-size: 20px; 
    margin-right: 14px; 
    transition: 0.3s; 
    margin-top: -2px;
}
.aether-nav .layui-nav-item a:hover {
    background: rgba(255,255,255,0.03); 
    color: white !important;
}

/* 激活状态美化 */
.aether-nav .layui-nav-item.layui-this { background: transparent !important; }
.aether-nav .layui-this a {
    background: linear-gradient(90deg, rgba(99,102,241,0.08), transparent) !important;
    color: white !important;
    border-left: 3px solid var(--primary);
}
.aether-nav .layui-this a i {
    color: var(--primary);
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.8);
    transform: scale(1.1);
}


/* =========================================
   4. 头部与搜索 (Header & Search)
   ========================================= */
.main-feed { padding-top: 32px; width: 100%; }

.feed-header { 
    position: sticky; 
    top: 20px; 
    z-index: 50; 
    margin-bottom: 32px; 
    pointer-events: none;
}

.search-bar {
    width: 100%; 
    height: 52px;
    background: rgba(39, 39, 42, 0.9); 
    backdrop-filter: blur(12px);
    border: var(--border); 
    border-radius: 50px;
    display: flex; 
    align-items: center; 
    padding: 0 20px;
    pointer-events: auto; 
    transition: 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.search-bar:focus-within {
    border-color: var(--primary); 
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}
#search-input {
    background: transparent; 
    border: none; 
    color: white; 
    flex-grow: 1; 
    height: 100%; 
    font-size: 15px;
}

/* 热门搜索面板 */
.search-panel {
    position: absolute;
    top: 65px; 
    left: 0; right: 0;
    background: var(--bg-card);
    border: var(--border);
    border-radius: 16px;
    padding: 20px;
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.search-panel.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
#search-input:focus ~ .search-panel, .search-panel:hover { display: block; } 

.search-tag-item {
    background: rgba(255,255,255,0.05); 
    color: var(--text-muted);
    padding: 6px 12px; 
    border-radius: 20px; 
    font-size: 13px;
    margin-right: 8px; 
    margin-bottom: 8px; 
    display: inline-block; 
    cursor: pointer;
    transition: 0.2s;
}
.search-tag-item:hover { 
    color: var(--primary); 
    background: rgba(99,102,241,0.1); 
}


/* =========================================
   5. 帖子卡片 (Post Card)
   ========================================= */
.post-card {
    background: var(--bg-card); 
    border: var(--border);
    border-radius: var(--radius-lg); 
    margin-bottom: 32px; 
    overflow: hidden;
    
    /* 滚动动效初始态 */
    opacity: 0;
    transform: scale(0.92) translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    will-change: opacity, transform;
}
.post-card.is-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.post-card.is-visible:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.1);
}

.post-card-header { padding: 20px; display: flex; justify-content: space-between; }
.author-info { display: flex; align-items: center; }
.placeholder-avatar {
    width: 42px; height: 42px; border-radius: 50%; margin-right: 12px;
    background: #333; border: 2px solid rgba(255,255,255,0.05); flex-shrink: 0;
}
.name { color: white; font-weight: 600; display: block; }
.handle { color: var(--text-muted); font-size: 13px; }
.handle span { display: inline-block; }

.prompt-details { padding: 0 20px 20px; }
.prompt-title { color: white; font-size: 17px; margin-bottom: 10px; font-weight: 700;}

.prompt-box {
    background: #09090b; 
    border-radius: 8px; 
    border-left: 3px solid var(--primary); 
    padding: 12px 14px; 
    overflow: hidden; 
    margin-bottom: 12px;
}
.prompt-text {
    color: #cbd5e1; 
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    line-height: 24px; 
    max-height: 48px; 
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; 
    overflow: hidden;
    border: none !important; 
    margin: 0 !important;
    padding: 0 !important;
    transition: max-height 0.4s ease-in-out;
}
.prompt-text.expanded {
    -webkit-line-clamp: unset; 
    max-height: 800px; 
}
.toggle-prompt {
    display: inline-block; margin-top: 8px; font-size: 12px;
    color: var(--text-muted); cursor: pointer; font-weight: 600;
}
.toggle-prompt:hover { color: var(--primary); }

.placeholder-wrapper {
    width: 100%; background: #050505; position: relative;
    display: flex; justify-content: center; align-items: center;
    overflow: hidden; min-height: 240px; max-height: 550px;
}
.placeholder-content {
    width: 100%; height: 100%; position: absolute; top: 0; left: 0;
    opacity: 0.8; transition: transform 0.5s ease;
}
.placeholder-wrapper:hover .placeholder-content { transform: scale(1.02); opacity: 0.6; }

.expand-overlay {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 64px; height: 64px; border-radius: 50%;
    background: rgba(0, 0, 0, 0.65); 
    backdrop-filter: blur(4px);
    border: none; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex; justify-content: center; align-items: center;
    color: white; cursor: pointer; z-index: 20; pointer-events: auto;
    opacity: 0; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.expand-overlay i {
    font-size: 32px; 
    line-height: 1; margin: 0;
    padding-left: 0px; 
}
.placeholder-wrapper:hover .expand-overlay {
    opacity: 1; transform: translate(-50%, -50%) scale(1);
    background: rgba(0, 0, 0, 0.75);
}
.expand-overlay:active {
    transform: translate(-50%, -50%) scale(0.9) !important;
    background: rgba(99, 102, 241, 0.9);
}

.aspect-ratio-badge {
    position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.7);
    color: white; padding: 2px 6px; border-radius: 4px; font-size: 11px; z-index: 2;
}

.post-actions-wrapper { padding: 12px 20px; background: rgba(255,255,255,0.02); }
.post-actions { display: flex; gap: 24px; color: var(--text-muted); align-items: center; }
.post-actions span { 
    display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px;
    cursor: pointer; transition: 0.2s; 
}
.post-actions span:hover { background-color: rgba(255,255,255,0.05); color: white; }
.post-actions span:active { transform: scale(0.95); }

.post-actions span.like-btn.is-active { color: #ec4899; }
.post-actions span.like-btn.is-active i { animation: bounceIn 0.4s; font-weight: bold; }
.post-actions span.comment-btn:hover { color: var(--primary); }

.remix-btn {
    margin-left: auto; 
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white; padding: 6px 16px; border-radius: 20px; font-size: 13px; cursor: pointer;
    transition: all 0.3s ease; background-size: 200% auto;
}
.remix-btn:hover { background-position: right center; box-shadow: 0 0 15px rgba(99, 102, 241, 0.6); transform: translateY(-2px); }
.remix-btn:active { transform: translateY(0) scale(0.95); }


/* =========================================
   6. 右侧边栏 (Right Sidebar)
   ========================================= */
.right-sidebar {
    position: sticky; top: 32px; height: fit-content; overflow: visible;
}
.module {
    background: var(--bg-card); border: var(--border);
    border-radius: var(--radius-lg); margin-bottom: 24px;
    transition: transform 0.3s, box-shadow 0.3s;
}
.module:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); border-color: rgba(99, 102, 241, 0.3); }

.layui-card-header {
    background: transparent; border-bottom: 1px solid rgba(255,255,255,0.05);
    color: white; font-weight: 600; padding: 0 20px;
}
.layui-card-body { padding: 20px; }

.follow-list li {
    display: flex; align-items: center; padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.follow-list li:last-child { border: none; }
.follow-list .info { width: 100%; padding-right: 10px; }

.follow-btn {
    display: flex; justify-content: center; align-items: center;
    min-width: 64px; height: 28px; line-height: 1;
    background: transparent; border: 1px solid #444; color: white;
    border-radius: 14px; font-size: 12px; cursor: pointer; transition: 0.2s;
}
.follow-btn:hover { border-color: var(--primary); color: var(--primary); }
.follow-btn.followed { background: #333; border-color: transparent; color: #aaa; }


/* =========================================
   7. 浮动按钮与弹窗 (FAB & Modals)
   ========================================= */
.creator-fab {
    position: fixed; bottom: 50px; right: 50px;
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    z-index: 1000; cursor: pointer; border: 2px solid rgba(255,255,255,0.2);
    display: flex; justify-content: center; align-items: center;
    transition: transform 0.3s;
}
.creator-fab:hover { transform: scale(1.1); }
.creator-fab i { font-size: 28px; color: white; }

/* 进度动效 */
.progress-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: none; justify-content: center; align-items: center;
}
.creator-fab.is-generating .icon-main { display: none; }
.creator-fab.is-generating .progress-container { display: flex; }
.progress-ring { transform: rotate(-90deg); }
.progress-ring-circle { transition: stroke-dashoffset 0.1s linear; }
.progress-text { position: absolute; font-size: 14px; font-weight: 700; color: white; font-family: monospace; }

/* 模态框 */
.creator-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
    z-index: 2000; display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: 0.3s;
}
.creator-modal-overlay.is-visible { opacity: 1; visibility: visible; }
.creator-modal-content {
    background: #18181b; width: 550px; padding: 30px 15px; border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 25px 60px rgba(0,0,0,0.8);
    position: relative; transform: scale(0.95); transition: 0.3s; color: white;
    overflow: visible !important; /* 允许下拉菜单溢出 */
}
.creator-modal-overlay.is-visible .creator-modal-content { transform: scale(1); }

.modal-close-btn {
    position: absolute; top: 20px; right: 20px;
    background: rgba(255,255,255,0.05); border: none; color: #a1a1aa;
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.modal-close-btn:hover { background: rgba(255,255,255,0.1); color: white; }

#prompt-input {
    width: 100%; background: #09090b; border: 1px solid #333; color: white;
    padding: 16px; border-radius: 12px; margin-bottom: 20px; resize: none;
    height: 200px; font-size: 15px;
}
#prompt-input:focus { border-color: var(--primary); }

.creator-actions {
    display: flex; justify-content: space-between; align-items: center; 
    gap: 12px; margin-top: 20px;
}

/* Layui 下拉框深度美化 */
.creator-actions .layui-form-select { flex: 1; width: auto !important; }
.creator-actions .layui-input {
    background-color: #09090b !important; 
    border: 1px solid rgba(255, 255, 255, 0.15) !important; 
    color: #fff !important; 
    border-radius: 8px !important;
    height: 40px !important; 
    line-height: 40px !important;
    font-size: 14px;
}
.creator-actions .layui-edge { border-top-color: rgba(255, 255, 255, 0.6) !important; }
.creator-actions .layui-form-select dl {
    background-color: #1f1f22 !important; 
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 6px 0;
    top: 45px; 
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6) !important;
    height:200px;
}
.creator-actions .layui-form-select dl dd { color: #a1a1aa !important; font-size: 14px; padding: 8px 15px; }
.creator-actions .layui-form-select dl dd:hover { background-color: rgba(255, 255, 255, 0.05) !important; }
.creator-actions .layui-form-select dl dd.layui-this { background-color: var(--primary) !important; color: #fff !important; }

/* 生成按钮 */
.generate-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white; border: none; 
    padding: 0 24px; 
    height: 40px; line-height: 40px;
    border-radius: 8px;
    font-weight: 600; cursor: pointer; 
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    flex-shrink: 0; 
}

/* 提示框 Toast 美化 */
/* 增加 .layui-layer 类名以提高权重，防止被默认样式覆盖 */
body .layui-layer-msg-dark.layui-layer { 
    background: none !important; 
    background-color: transparent !important; /* 双重保险 */
    border: none !important; 
    box-shadow: none !important; 
}
body .layui-layer-msg-dark .layui-layer-content {
    background-color: rgba(24, 24, 27, 0.9) !important; /* 背景稍微加深 */
    backdrop-filter: blur(12px);
    color: #fff !important; 
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px !important; 
    
    /* 🔴 核心修复：使用 Flex 布局自动排版 */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important; /* 图标和文字之间的间距 */
    padding: 14px 24px !important;
    
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

/* 🔴 修复图标位置：取消绝对定位，让它乖乖排队 */
body .layui-layer-msg-dark .layui-layer-ico {
    position: static !important;
    display: block !important;
    margin: 0 !important;
    /* 保持原有的图标背景图片，但位置交给 Flex 控制 */
}


/* =========================================
   8. 辅助类与动画 (Helpers & Animations)
   ========================================= */
.color-avatar-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.color-avatar-2 { background: linear-gradient(135deg, #ec4899, #f472b6); }
.color-avatar-3 { background: linear-gradient(135deg, #10b981, #34d399); }
.color-avatar-4 { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.color-avatar-5 { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.color-avatar-6 { background: linear-gradient(135deg, #3b82f6, #60a5fa); }

.color-1 { background: linear-gradient(45deg, #312e81, #4338ca); }
.color-2 { background: linear-gradient(45deg, #831843, #be185d); }
.color-3 { background: linear-gradient(45deg, #14532d, #15803d); }
.color-4 { background: linear-gradient(45deg, #7c2d12, #c2410c); }
.color-5 { background: linear-gradient(45deg, #581c87, #7e22ce); }
.color-6 { background: linear-gradient(45deg, #1e3a8a, #2563eb); }

@keyframes shimmer { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
@keyframes bounceIn { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 60% { transform: scale(0.8); } 100% { transform: scale(1); } }

button:active, .search-tag-item:active, .aether-nav a:active, .creator-fab:active {
    transform: scale(0.96) !important;
}


/* =========================================
   9. 响应式适配 (Responsive)
   ========================================= */

/* 阶段一：屏幕 < 1300px (隐藏右侧栏) */
@media screen and (max-width: 1300px) {
    .aether-layout {
        grid-template-columns: 260px 1fr;
        padding: 0 20px;
        gap: 30px;
    }
    .right-sidebar { display: none; }
    .main-feed { max-width: 800px; margin: 0 auto; }
}

/* 阶段二：屏幕 < 960px (窄导航模式) */
@media screen and (max-width: 960px) {
    .aether-layout {
        grid-template-columns: 80px 1fr;
        gap: 20px;
        padding: 0 16px;
    }
    .left-nav-module { align-items: center; }
    .logo { justify-content: center; margin-bottom: 30px; font-size: 0; }
    .logo span { display: none !important; }
    .logo i { font-size: 32px; margin: 0; display: block; }

    .aether-nav .layui-nav-item a span { display: none !important; }
    .aether-nav .layui-nav-item a {
        justify-content: center; padding: 0 !important;
        height: 56px; width: 56px; margin: 0 auto 8px auto;
    }
    .aether-nav .layui-nav-item a i { margin: 0 !important; font-size: 24px; }
    
    .aether-nav .layui-this a {
        border-left: none;
        background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(236,72,153,0.2)) !important;
        border-radius: 16px;
    }
}

/* 阶段三：屏幕 < 768px (移动端模式) */
@media screen and (max-width: 768px) {
    .aether-layout { display: block; padding: 0; margin: 0; }
    .left-nav-module, .right-sidebar { display: none; }
    .main-feed { padding-top: 60px; padding-bottom: 80px; width: 100%; max-width: 100%; }
    .post-card { border-radius: 0; border-left: none; border-right: none; margin-bottom: 10px; }
    .feed-header { position: fixed; top: 0; left: 0; padding: 10px; background: rgba(9, 9, 11, 0.95); margin-bottom: 0; }
    .search-bar { height: 40px; }
}

/* === PC端下拉菜单修复：向上弹出 (Upward Dropdown) === */
@media screen and (min-width: 769px) {
    .creator-actions .layui-form-select dl {
        top: auto !important;
        bottom: 48px !important; 
        transform-origin: bottom center;
        max-height: 220px; 
        overflow-y: auto;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.6) !important;
    }
    .creator-actions .layui-form-selected .layui-edge {
        transform: rotate(180deg); 
        margin-top: -3px !important; 
    }
}