/* ==============================================================
   歆爱 AI - 平台动态 (二次元风格重构版) - news.css
   包含：全局变量、框架排版、富文本兼容、移动端适配
   ============================================================== */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* 手机点击不要出现蓝色闪块 */
}

:root {
    /* --- 二次元主题色卡 (活力粉 + 科技蓝 + 纯白面板) --- */
    --theme-primary: #ff6b81;      /* 樱花粉 / 主强调色 */
    --theme-secondary: #70a1ff;    /* 天空蓝 / 次强调色 */
    --bg-color: #fceef3;           /* 网页最底层的淡淡粉色 */
    --panel-bg: rgba(255, 255, 255, 0.95); /* 任务面板的背景色(带点透明) */
    --text-main: #2f3542;          /* 主文本颜色 (深灰，比纯黑护眼) */
    --text-muted: #747d8c;         /* 次要文本颜色 */
    --nav-bg: rgba(255, 255, 255, 0.85); /* 导航栏毛玻璃底色 */
    
    /* 圆角规范 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* 字体规范 */
    --font-main: -apple-system, "Noto Sans SC", "Helvetica Neue", sans-serif;
    --bg-overlay: rgba(255, 255, 255, 0.4);
}


html, body {
    width: 100%;
    overflow-x: hidden; 
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    
    background-color: var(--bg-color); 
    background-image: 
        linear-gradient(var(--bg-overlay), var(--bg-overlay)), 
        url('../assets/images/global-bg.png');
        
    background-repeat: repeat; 
    background-size: 300px; 
    background-attachment: fixed; 

    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease, background-image 0.3s ease;
}



/* =========================================
   1. 全局背景层 & 看板娘装饰
   ========================================= */

/* 看板娘/悬浮装饰物 */
.anime-mascot {
    position: absolute;
    top: 70px; 
    right: 15px; /* 放在任务面板的右上角 */
    width: 90px; 
    height: auto;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    animation: float 3.5s ease-in-out infinite; /* 悬浮呼吸动画 */
    pointer-events: none; /* 防止遮挡下面的文字点击 */
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(3deg); } /* 轻微上下浮动并摇摆 */
}


/* =========================================
   2. 顶部导航栏 (游戏UI风)
   ========================================= */
.news-navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 2px 20px rgba(255, 107, 129, 0.15); /* 粉色微发光底边 */
    z-index: 100;
}

/* 导航栏两边的立体小按钮 (返回、汉堡菜单) */
.nav-btn {
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    background: white;
    border: 2px solid #ffe4e8;
    color: var(--theme-primary);
    font-size: 18px;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 0 #ffe4e8; /* 游戏手柄按钮的立体按压感 */
    transition: all 0.1s ease;
}
.nav-btn:active {
    transform: translateY(4px); /* 按下时下沉 */
    box-shadow: 0 0 0 #ffe4e8;  /* 按下时阴影消失 */
}

/* 渐变标题字 */
.nav-title-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1px;
    font-family: inherit; 
}

/* 【新增】顶部小头像样式 */
.title-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%; /* 变成圆形 */
    object-fit: cover;
    border: 2px solid var(--theme-primary); /* 外圈加个粉色描边更可爱 */
    background: #fff;
}
.title-icon {
    font-size: 18px;
    color: var(--theme-primary);
    -webkit-text-fill-color: var(--theme-primary); /* 取消渐变继承 */
}


/* =========================================
   3. 二次元侧边栏菜单
   ========================================= */
.side-menu {
    position: fixed;
    top: 0; right: -280px; 
    width: 260px;
    height: 100vh;
    background: #fffafa; /* 稍微偏一点极淡的粉白色作为底色 */
    z-index: 9999;
    transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 25px rgba(255, 107, 129, 0.2); /* 阴影改成粉色光晕 */
    display: flex; 
    flex-direction: column;
    overflow: hidden; /* 防止里面的表情包或者元素逸出边界 */
}

/* 激活状态 */
.side-menu.active { right: 0; }

.menu-overlay {
    position: fixed; inset: 0; 
    background: rgba(0,0,0,0.4); 
    backdrop-filter: blur(2px);
    z-index: 9998; 
    opacity: 0; visibility: hidden; transition: 0.3s;
}
.menu-overlay.active { opacity: 1; visibility: visible; }

/* 🌟 加入了蕾丝素材的头部 */
.menu-header { 
    padding: 50px 20px 30px; /* 顶部留白，以防手机刘海挡住字 */
    font-weight: 900; 
    color: var(--theme-primary); 
    font-size: 20px;
    
    /* 设置蕾丝或花纹的背景，如果你没有底色只有线条，可以用 rgba(255,240,242,1) 当底色 */
    background-color: #fff0f2;
    background-image: url('../assets/images/lace-bg.png'); 
    background-size: cover; 
    background-position: bottom center; /* 让蕾丝花边贴紧元素的底部边缘 */
    background-repeat: no-repeat;
    
    border-bottom: 2px solid #ffe4e8;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03); /* 轻微立体感 */
}

/* 🌟 圆润可爱的按钮区 */
.menu-content {
    flex: 1;
    padding: 10px;
}

.side-menu a {
    padding: 18px 20px; 
    text-decoration: none; 
    color: var(--text-main); 
    font-weight: 700; /* 加粗，更有游戏 UI 感 */
    display: flex; align-items: center; gap: 15px; 
    background: white;
    border-radius: 12px; /* 变成胶囊小方块 */
    margin-bottom: 10px;
    border: 1px solid #f5f5f5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 点按/悬浮互动的果冻效果 */
.side-menu a:hover, 
.side-menu a:active { 
    background: #fff0f2; 
    color: var(--theme-primary); 
    border-color: #ffe4e8;
    transform: scale(1.02) translateX(4px); /* 按下时向右稍微滑动并变大 */
}

.side-menu a i { 
    color: var(--theme-primary); /* 图标统一用粉色更搭配 */
    font-size: 20px; 
    width: 24px; 
    text-align: center;
}

/* 🌟 右下角绝对定位的表情包 */
.menu-emote {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 100px; /* 大小可以根据你的图微调，比如 120px */
    height: auto;
    opacity: 0.95; /* 避免喧宾夺主，带一点点透明度 */
    pointer-events: none; /* 【重点】防止表情包把鼠标点按挡住 */
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

/* =========================================
   4. 核心：情报/任务面板容器
   ========================================= */
.news-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 110px 15px 60px 15px; /* 顶部大留白给导航和看板娘 */
    position: relative;
    min-height: 100vh;
}

.quest-panel {
    /* 这里非常关键！我们在你的二次元底图之上，盖了一层 85% 不透明度的白色渐变层
       这样既能透出背景图，又不会让黑色文字跟背景图融在一起看不清！*/
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.90)), 
        url('../assets/images/panel-bg.png');
        
    /* 同样使用自动平铺无限复制魔法 */
    background-repeat: repeat;
    background-size: 300px; /* 根据你找的素材纹理大小调整 */

    border: 4px solid white;
    border-radius: var(--radius-lg);
    padding: 40px 25px 30px 25px;
    position: relative;
    box-shadow: 
        0 15px 35px rgba(255, 107, 129, 0.15), 
        inset 0 0 0 3px rgba(255, 107, 129, 0.2); /* 内线框描点带点点粉色更搭 */
    /* 由于现在有背景图了，我们暂时关掉毛玻璃以保证性能 */
}

/* 面板顶部的小标牌 (变成了年月日) */
.panel-ribbon {
    position: absolute;
    top: -20px;
    left: 20px;
    background: var(--theme-primary);
    color: white;
    padding: 6px 18px; /* 左右稍微缩短点，适应长日期 */
    border-radius: 24px;
    font-weight: 800; /* 日期字稍微细一点点 */
    font-family: inherit;
    font-size: 13px; /* 字稍微改小一点防止太长 */
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(255, 107, 129, 0.4);
    border: 3px solid white;
    z-index: 5;
    transform: rotate(-1deg);
}


/* 加载动画适配 */
.loading-scan { display: flex; align-items: center; justify-content: center; padding-top: 50px; }
.spinner {
    width: 25px; height: 25px;
    border: 3px solid #ffe4e8;
    border-top-color: var(--theme-primary) !important;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* =========================================
   5. 正文内容排版 (Content Body)
   ========================================= */
.content-body {
    word-wrap: break-word;
    word-break: break-word; 
    overflow-wrap: break-word;
}

.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 20px 0;
    display: block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); /* 图片柔和阴影 */
    border: 1px solid #f0f0f0;
}

.content-body p {
    font-size: 16px;
    margin-bottom: 20px;
    text-align: justify;
    line-height: 1.8; /* 字间距拉开，护眼 */
}

/* 二次元风格的标题排版 */
.content-body h1 { 
    font-size: 1.8em; 
    margin: 30px 0 15px 0; 
    font-weight: 800;
    color: var(--theme-primary);
    text-align: center;
}

.content-body h2 {
    font-size: 1.3em;
    margin: 35px 0 15px 0;
    padding: 10px 16px;
    background: #fff0f2; /* 浅粉底色 */
    border-radius: var(--radius-sm);
    color: var(--theme-primary);
    display: inline-block;
    border-left: 6px solid var(--theme-primary);
    font-weight: 700;
}

.content-body h3 {
    font-size: 1.15em;
    margin-top: 25px;
    font-weight: 700;
    color: var(--text-main);
}

/* 列表样式 */
.content-body ul, .content-body ol {
    padding-left: 28px;
    margin-bottom: 20px;
    background: #fafafc; 
    padding: 15px 15px 15px 40px;
    border-radius: var(--radius-sm);
}
.content-body li { margin-bottom: 8px; }
.content-body li::marker { color: var(--theme-primary); font-weight: bold; }


/* =========================================
   6. 海报积木块 (Hero Block 结构适配)
   ========================================= */
.news-hero-block {
    position: relative; /* 确保子元素 absolute 是相对于我不乱跑 */
    width: 100%;       
    margin: 30px 0;    
    border-radius: var(--radius-md);
    overflow: hidden;  
    box-shadow: 0 8px 25px rgba(0,0,0,0.12); 
    background: #000; 
    line-height: 0;    /* 防止容器内部产生行高留白 */
}

/* 保持图片原比例 */
.news-hero-block img {
    width: 100%;
    height: auto;      
    display: block;
    object-fit: contain;
    margin: 0 !important; 
    padding: 0 !important;
    border-radius: 0 !important; 
    box-shadow: none !important;
    position: relative;
    z-index: 1; 
}

/* 渐变遮罩层 */
.hero-text-overlay {
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.85) 100%);
    display: flex;
    align-items: flex-end; /* 文字沉底 */
    justify-content: center;
    padding: 20px;
    box-sizing: border-box; 
    z-index: 10;            
    pointer-events: none;  /* 让用户可以长按穿透遮罩层保存图片 */
}

/* 海报上的大标题字 */
.content-body .hero-text {
    color: white;
    font-size: 26px;
    line-height: 1.4;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9); /* 黑阴影保证在亮色图片上也看得清 */
    
    /* 彻底清除从外部继承来的多余样式 */
    border: none;         
    border-left: none;    
    background: transparent;
    padding: 0;           
    margin: 0;            
}


/* =========================================
   7. Quill 富文本编辑器兼容补丁
   ========================================= */
/* 对齐方式 */
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

/* 引用块 (改得可爱一点) */
.content-body blockquote {
    border-left: 5px solid var(--theme-secondary);
    background: #f0f5ff; /* 浅蓝底色 */
    margin: 20px 0;
    padding: 15px;
    color: var(--text-muted);
    font-style: auto; /* 去掉以前瞎斜体的配置 */
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 编辑器里加的视频适配 */
.content-body iframe.ql-video {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    margin: 15px 0;
}

/* 字体补丁类 */
.font-default { font-family: var(--font-main); font-weight: 700; }
.font-serif { font-family: "Noto Serif SC", serif; font-weight: 600; } 
.font-cursive { font-family: "ZCOOL KuaiLe", cursive; letter-spacing: 2px; } 
.font-mono { font-family: "Orbitron", monospace; letter-spacing: 1px; }

/* =========================================
   日历选择器 (透明覆盖魔法)
   ========================================= */
.date-ribbon-container {
    position: absolute;
    top: -20px;
    left: 20px;
    z-index: 15;
    cursor: pointer; /* ✨ 鼠标放上去变成小手 */
}

/* 现在外婆是容器，这是里面的彩带 */
.panel-ribbon {
    position: relative; /* 取消原本的绝对定位，交由容器包办 */
    top: 0; left: 0;
    /* 后面保持你之前设置的背景粉色等属性... */
    background: var(--theme-primary);
    color: white; padding: 6px 18px; border-radius: 24px;
    font-weight: 800; font-size: 13px; letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(255, 107, 129, 0.4);
    border: 3px solid white; transform: rotate(-1deg);
    display: flex; align-items: center; justify-content: center;
}

.invisible-date-picker {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; 
    cursor: pointer;
    z-index: 10; /* ✨ 【解决痛点】把它拉到最上层，盖住粉色贴纸！ */
}

/* 没数据时的缺省页 */
.empty-state {
    text-align: center;
    padding: 60px 10px 40px 10px;
}
.empty-state img { width: 130px; filter: grayscale(80%); opacity: 0.8; margin-bottom: 20px;}
.empty-state h3 { color: var(--text-muted); font-size: 18px; margin: 0; }
.empty-state p { color: #aaa; font-size: 14px; margin-top: 10px; line-height: 1.5; }

/* =========================================
   9. 日报评论区 (最新追加)
   ========================================= */
.news-comments-section {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 2px dashed rgba(255, 107, 129, 0.3); /* 粉色虚线分割线 */
}

.comments-header h3 {
    color: var(--theme-primary);
    font-size: 1.1em;
    margin: 0 0 20px 0;
    font-weight: 800;
}

.comments-list {
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

/* 自定义滚动条 */
.comments-list::-webkit-scrollbar { width: 4px; }
.comments-list::-webkit-scrollbar-thumb { background-color: #ffe4e8; border-radius: 4px; }

/* 单条评论气泡 */
.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background: #f0f0f0;
}

.comment-body {
    flex: 1;
    background: #fafafc;
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    padding: 12px 15px;
    position: relative;
    border: 1px solid #f0f0f0;
}

/* 气泡小倒刺 */
.comment-body::before {
    content: '';
    position: absolute;
    top: 0; left: -10px;
    border-width: 0 10px 12px 0;
    border-style: solid;
    border-color: transparent #fafafc transparent transparent;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

.comment-username {
    font-size: 0.9em;
    font-weight: 700;
    color: var(--theme-secondary);
}

.comment-time {
    font-size: 0.75em;
    color: var(--text-muted);
}

.comment-text {
    font-size: 0.95em;
    color: var(--text-main);
    line-height: 1.5;
    word-break: break-all;
}

/* 底部输入框区域 */
.comment-input-box {
    display: flex;
    gap: 10px;
    background: #fff;
    border-radius: 30px;
    padding: 6px;
    box-shadow: 0 4px 15px rgba(255, 107, 129, 0.1);
    border: 1px solid #ffe4e8;
}

.comment-input-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 0 15px;
    font-size: 0.95em;
    color: var(--text-main);
}

.send-comment-btn {
    width: 40px; height: 40px;
    background: var(--theme-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
    font-size: 16px;
}

.send-comment-btn:hover { background: #fc5c74; transform: scale(1.05); }
.send-comment-btn:active { transform: scale(0.95); }

/* 没评论时的占位文本 */
.no-comments-yet {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9em;
    padding: 20px 0;
}
/* =========================================
   10. 全局 Toast 提示框魔法
   ========================================= */
.xb-toast {
    position: fixed;
    /* 距离底部 80px，刚好避开你的评论输入框，不会挡住视线 */
    bottom: 80px; 
    left: 50%;
    /* 初始状态：透明，且稍微往下沉一点点 (20px) */
    transform: translate(-50%, 20px); 
    background-color: rgba(35, 35, 35, 0.85); /* 半透明的高级黑底色 */
    backdrop-filter: blur(4px); /* 给黑色背景加一点点毛玻璃效果 */
    color: #fff;
    padding: 10px 24px;
    border-radius: 30px; /* 胶囊圆角 */
    font-size: 13px;
    font-weight: 500;
    z-index: 10000; /* 图层设到老高，保证谁也挡不住它 */
    opacity: 0;
    /* 贝塞尔曲线，可以让弹窗弹出来的时候有一点点“果冻”的Q弹感 */
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55); 
    pointer-events: none; /* 透明穿透：防止挡住用户本来想点底部的东西 */
    white-space: nowrap; /* 强制在一行显示，不换行 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); 
}

/* 当加了这个 show 类名时，Toast 就会浮现 */
.xb-toast.show {
    opacity: 1;
    transform: translate(-50%, 0); 
}
/* 修改我们让 comment-meta 排版更高级，支持两端对齐 */
.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center; /* 居中对齐 */
    margin-bottom: 5px;
}

/* 管理员专属删除按钮：平时淡灰，鼠标悬浮变鲜红 */
.admin-del-btn {
    background: transparent;
    border: none;
    color: #ced6e0;
    cursor: pointer;
    font-size: 0.9em;
    padding: 0 4px;
    transition: all 0.2s;
    outline: none;
}
.admin-del-btn:hover, .admin-del-btn:active {
    color: #ff4757; /* 警告红 */
    transform: scale(1.15) rotate(10deg); /* 悬浮时带一点活泼的摇晃感 */
}

/* =========================================
   8. 移动端专门适配 (手机上的微调)
   ========================================= */
@media (max-width: 768px) {
    /* 缩小顶部避让空间 */
    .news-container {
        padding: 90px 10px 40px 10px;
    }
    
    /* 面板外框在手机上不要留太厚的白边 */
    .quest-panel {
        padding: 35px 15px 20px 15px;
        border-width: 2px; /* 边框改细 */
    }
    
    /* 缩小看板娘防止挡字 */
    .anime-mascot {
        width: 65px;
        top: 65px;
        right: 5px;
    }
    
    /* 解决旧的海报黑边问题 */
    .news-hero-block { 
        height: auto !important; 
        min-height: auto !important;
        margin: 20px 0;
        border-radius: var(--radius-sm);
    }
    
    .hero-text { 
        font-size: 20px; 
        padding-bottom: 10px; 
    }
    
    .content-body h2 {
        font-size: 1.1em;
        margin: 25px 0 10px 0;
    }
    
    .nav-title { font-size: 16px; }
}
