/* 内置CSS区域 */

/* ================================================================ */
/* 注意：rili平台内置CSS区域不兼容以下选择器：                      */
/* - `html {}` 和 `body {}`：请注意，这些样式可能不会在平台上生效，  */
/*   平台的UI结构可能会覆盖或替换页面的根元素。通常，你需要针对        */
/*   `.container` 或其他自定义的顶层元素来应用全局样式。              */
/* - `:root {}`：CSS变量（var(--...)）在内置CSS中通常不被支持。        */
/*   为了确保样式生效，以下代码已将所有CSS变量替换为具体颜色值。      */
/* ================================================================ */

/*
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #1a1a2e;
    color: #e0e0e0;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
*/

/* 详细介绍的容器样式 */
.container {
    max-width: 800px; /* 最大宽度 */
    margin: 30px auto; /* 居中显示，上下留白 */
    background-color: #16213e; /* 稍浅的蓝紫背景 */
    border-radius: 12px; /* 圆角 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); /* 阴影增强立体感，更深 */
    padding: 30px;
    border: 1px solid #0f3460; /* 边框颜色 */
    text-align: center; /* 内部文字居中 */
    position: relative; /* 为背景光效提供定位基准 */
    overflow: hidden; /* 隐藏溢出的背景光效 */
}

/* ======== 新增：容器背景光效（球球特效） ======== */
.container::before,
.container::after {
    content: '';
    position: absolute;
    width: 200px; /* 光团大小 */
    height: 200px; /* 光团大小 */
    opacity: 0.15; /* 半透明效果，比文字发光略低 */
    filter: blur(60px); /* 模糊处理，制造光晕感 */
    z-index: 0; /* 确保在背景层 */
    animation: container-pulse-glow 6s infinite alternate ease-in-out; /* 呼吸动画 */
}

.container::before {
    background: radial-gradient(circle, #e94560 0%, transparent 70%); /* 亮红色光团 */
    top: -80px;
    left: -80px;
    animation-delay: 0s; /* 动画立即开始 */
}

.container::after {
    background: radial-gradient(circle, #533483 0%, transparent 70%); /* 深紫色光团 */
    bottom: -80px;
    right: -80px;
    animation-delay: 3s; /* 动画延迟3秒开始，形成交替呼吸 */
}

@keyframes container-pulse-glow {
    0% { transform: scale(1); opacity: 0.15; }
    50% { transform: scale(1.15); opacity: 0.25; }
    100% { transform: scale(1); opacity: 0.15; }
}
/* ==================================================== */

/* 标题样式 */
h1 {
    color: #e94560; /* 亮红色主色调 */
    font-size: 3em; /* 大标题，略微调大 */
    margin-bottom: 15px;
    text-shadow: 0 0 15px rgba(233, 69, 96, 0.9), 0 0 25px rgba(233, 69, 96, 0.6); /* 标题发光效果加强 */
    letter-spacing: 2px; /* 增加字间距 */
    position: relative; /* 为可能的伪元素定位 */
}

h2 {
    color: #533483; /* 深紫色次要标题 */
    font-size: 2em; /* 略微调大 */
    margin-top: 30px;
    border-bottom: 2px solid #e94560; /* 底部亮红线 */
    padding-bottom: 10px;
    display: inline-block; /* 让边框线只在文字下方 */
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(83, 52, 131, 0.7); /* 新增：H2标题发光效果 */
    position: relative;
}

/* 段落和高亮文字 */
p {
    margin-bottom: 15px;
    color: #c0c0c0;
}

.highlight {
    color: #e94560;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.6), 0 0 20px rgba(233, 69, 96, 0.3); /* 高亮文字的微光加强 */
}

/* 各个功能区（如设定输入区）的样式 */
.section {
    background-color: #0f3460; /* 更深的蓝紫背景 */
    padding: 20px;
    border-radius: 8px;
    margin-top: 25px;
    text-align: left; /* 内部文字左对齐 */
    border: 1px solid #533483;
    transition: all 0.3s ease; /* 增加过渡效果 */
    position: relative; /* 为左侧装饰条提供定位基准 */
    overflow: hidden;
}

.section:hover {
    box-shadow: 0 0 15px rgba(83, 52, 131, 0.6); /* 悬停发光 */
}

.section ul {
    list-style-type: none; /* 移除默认列表点 */
    padding: 0;
}

.section li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.section li:before {
    content: '⚡'; /* 自定义列表图标，更符合“系统”风格 */
    position: absolute;
    left: 0;
    color: #e94560;
    font-size: 1.1em;
}

/* 按钮样式 */
.button {
    display: inline-block;
    background-color: #e94560;
    color: white;
    padding: 12px 28px; /* 略微增加宽度 */
    border-radius: 30px;
    text-decoration: none;
    margin-top: 30px;
    font-size: 1.2em; /* 略微调大 */
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease; /* 过渡效果更完整 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: none; /* 移除默认边框 */
    cursor: pointer;
    position: relative; /* 为闪光伪元素提供定位基准 */
    overflow: hidden; /* 隐藏闪光溢出部分 */
    z-index: 1; /* 确保内容在闪光之上 */
}

.button:hover {
    background-color: #ff6a80; /* 悬停变色 */
    transform: translateY(-3px) scale(1.02); /* 悬停上浮并略微放大 */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), 0 0 20px rgba(233, 69, 96, 0.7); /* 悬停阴影更明显，并增加红色辉光 */
}

/* 按钮点击效果：模拟按压 */
.button:active {
    transform: translateY(0); /* 回到原位 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); /* 较小的阴影，模拟按压深度 */
    background-color: #d13a50; /* 点击时颜色稍深 */
    transition: background-color 0.1s ease, transform 0.1s ease; /* 快速反馈 */
}

/* ======== 新增：按钮闪光效果 ======== */
.button::before { /* 使用 ::before 实现划过闪光 */
    content: '';
    position: absolute;
    top: 0;
    left: -120%; /* 初始位置在按钮左侧外 */
    width: 60%; /* 闪光条的宽度 */
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent); /* 渐变白色闪光 */
    transform: skewX(-20deg); /* 斜切效果 */
    transition: left 0.7s ease; /* 闪光划过动画 */
    z-index: 2; /* 确保闪光在按钮内容和原有的 after 伪元素之上 */
}

/* 悬停时触发闪光动画 */
.button:hover::before {
    left: 120%; /* 最终位置在按钮右侧外 */
}
/* ==================================================== */

/* 输入框组样式 */
.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #e94560;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 0 0 3px rgba(233, 69, 96, 0.3); /* 标签微光 */
}

.input-group textarea {
    width: calc(100% - 24px); /* 宽度适配，padding 24px */
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #533483;
    background-color: #0f3460;
    color: #e0e0e0;
    font-size: 1em;
    resize: vertical; /* 允许垂直拖动大小 */
    min-height: 100px; /* 最小高度略微增加 */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3); /* 内部阴影 */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group textarea:focus {
    border-color: #e94560; /* 聚焦时边框变色 */
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.6), 0 0 20px rgba(233, 69, 96, 0.3); /* 聚焦发光加强 */
    outline: none; /* 移除默认焦点轮廓 */
}

/* 底部信息样式 */
.footer {
    margin-top: 50px;
    font-size: 0.9em;
    color: #a0a0a0;
    border-top: 1px dashed #533483; /* 虚线分隔 */
    padding-top: 20px;
}

/* =========== 回复格式中的元素美化 =========== */

/* 状态栏（details/summary）样式 */
details {
    margin-top: 25px; /* 略微增加间距 */
    border: 1px solid #0f3460; /* 边框 */
    border-radius: 8px;
    background-color: #16213e; /* 背景色 */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); /* 阴影更明显 */
    transition: box-shadow 0.3s ease;
}

details:hover {
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4); /* 悬停阴影 */
}

summary {
    background-color: #533483; /* 摘要背景色 */
    color: white;
    padding: 12px 18px; /* 略微调整内边距 */
    border-radius: 8px 8px 0 0; /* 上部圆角 */
    cursor: pointer;
    font-weight: bold;
    font-size: 1.15em; /* 略微调大 */
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease; /* 增加box-shadow过渡 */
    display: flex; /* 使用flex布局 */
    align-items: center; /* 垂直居中 */
    justify-content: space-between; /* 内容两端对齐 */
    position: relative; /* 为闪光伪元素提供定位基准 */
    overflow: hidden; /* 隐藏闪光溢出部分 */
    z-index: 1; /* 确保内容在闪光之上 */
}

summary:hover {
    background-color: #6a4a9c; /* 悬停变色 */
    color: #fff; /* 悬停时文字颜色保持或微调 */
    box-shadow: 0 0 15px rgba(83, 52, 131, 0.7); /* 新增：悬停发光 */
}

details[open] summary {
    border-radius: 8px 8px 0 0; /* 展开时底部不圆角 */
    border-bottom: 1px solid #0f3460; /* 展开时加底部边框 */
}

details > div, details > p, details > table, details > ul, details > ol { /* 针对details内的内容调整样式，增加 ul, ol */
    padding: 15px;
    color: #c0c0c0;
    text-align: left; /* 内部文字左对齐 */
}

/* ======== 新增：Summary闪光效果 (同按钮) ======== */
summary::before { /* 使用 ::before 实现划过闪光 */
    content: '';
    position: absolute;
    top: 0;
    left: -120%; /* 初始位置在 summary 左侧外 */
    width: 60%; /* 闪光条的宽度 */
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent); /* 渐变白色闪光 */
    transform: skewX(-20deg); /* 斜切效果 */
    transition: left 0.7s ease; /* 闪光划过动画 */
    z-index: 2; /* 确保闪光在内容之上 */
}

/* 悬停时触发闪光动画 */
summary:hover::before {
    left: 120%; /* 最终位置在 summary 右侧外 */
}
/* ==================================================== */

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.95em; /* 略微缩小字体 */
}

table th, table td {
    border: 1px solid #0f3460;
    padding: 10px; /* 略微增加内边距 */
    text-align: left;
    color: #e0e0e0;
}

table th {
    background-color: #533483;
    color: white;
    font-weight: bold;
    text-transform: uppercase; /* 大写 */
    letter-spacing: 0.5px;
}

table tr:nth-child(even) {
    background-color: #1a1a2e; /* 隔行变色 */
}

table tr:hover {
    background-color: #2b1f3c; /* 悬停效果 */
}

/* 隐藏短期记忆 (STM) 的语义化标签 */
hidden-stm {
    display: none !important; /* 强制隐藏，确保AI能看到但用户看不到 */
}

/* 隐藏思维区 (Think Area) 的语义化标签 */
think {
    display: none !important; /* 新增：强制隐藏思维区 */
}

/* 主要文本区域 */
text {
    display: block; /* 确保它独占一行 */
    padding: 20px 25px; /* 略微增加左右内边距 */
    background-color: #16213e;
    border-radius: 10px; /* 圆角略大 */
    margin-top: 30px; /* 增加顶部间距 */
    box-shadow: 0 4px 15px rgba(0,0,0,0.4); /* 阴影更明显 */
    text-align: left;
    white-space: pre-wrap; /* 保留换行和空格 */
    word-break: break-word; /* 防止长单词溢出 */
    border: 1px solid #0f3460;
    /* 模型输出特效 */
    animation: text-glow 2s infinite alternate; /* 呼吸灯效果 */
}

/* 文本区域的呼吸灯动画 */
@keyframes text-glow {
    from {
        box-shadow: 0 0 10px rgba(233, 69, 96, 0.4), 0 4px 15px rgba(0,0,0,0.4);
    }
    to {
        box-shadow: 0 0 20px rgba(233, 69, 96, 0.8), 0 4px 20px rgba(0,0,0,0.6);
    }
}

text p {
    margin-bottom: 1em; /* 段落间距 */
    text-indent: 2em; /* 首行缩进 */
}

/* 引导文字 */
guide {
    display: block;
    color: #e94560;
    font-style: italic;
    margin-top: 10px;
    text-align: right;
    font-size: 0.95em; /* 略微调大 */
    opacity: 0.8; /* 稍微透明 */
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        margin: 15px;
        padding: 20px;
    }
    h1 {
        font-size: 2.2em;
        letter-spacing: 1px;
    }
    h2 {
        font-size: 1.6em;
    }
    .button {
        padding: 10px 20px;
        font-size: 1.1em;
    }
    .input-group textarea {
        min-height: 80px;
    }
    summary {
        font-size: 1em;
        padding: 10px 15px;
    }
    table th, table td {
        padding: 8px;
    }
    text {
        padding: 15px 20px;
        margin-top: 20px;
    }
}


/* ================================================================ */
/* 新增美化与功能增强（已整合并适应平台限制）                       */
/* ================================================================ */

/* 1. 选中文字样式 */
::selection {
    background-color: rgba(233, 69, 96, 0.5);
    color: #fff;
}

/* 2. 通用链接样式（原CSS未定义，假设HTML中存在<a>） */
a {
    color: #e94560;
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
a:hover {
    color: #ff8a9a;
    text-shadow: 0 0 8px rgba(233, 69, 96, 0.5);
}
a:focus-visible {
    outline: 2px solid #e94560;
    outline-offset: 2px;
}

/* 3. 图片响应式（假设有图片） */
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* 4. 代码块与行内代码样式 */
pre, code {
    font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    background-color: #0f3460;
    border-radius: 6px;
    padding: 0.2em 0.4em;
    font-size: 0.9em;
    border: 1px solid #533483;
}
pre {
    display: block;
    padding: 16px;
    overflow-x: auto;
    white-space: pre;
    word-break: normal;
    border-left: 4px solid #e94560;
    margin: 1em 0;
}
pre code {
    background: none;
    padding: 0;
    border: none;
}

/* 5. 引用块样式 */
blockquote {
    border-left: 4px solid #e94560;
    margin: 1em 0;
    padding: 0.5em 1em;
    background-color: rgba(233, 69, 96, 0.08);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #c0c0c0;
}
blockquote footer {
    margin-top: 0.5em;
    color: #a0a0a0;
    font-size: 0.85em;
}

/* 6. 水平线样式 */
hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #533483, #e94560, #533483, transparent);
    margin: 2em 0;
}

/* 7. 自定义滚动条（webkit内核浏览器） */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #533483, #e94560);
    border-radius: 10px;
    border: 2px solid #1a1a2e;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #6a4a9c, #ff6a80);
}
::-webkit-scrollbar-corner {
    background: #1a1a2e;
}

/* 8. 按钮增强：底部光晕和点击反馈（原始代码已集成，这里是原有的::after） */
.button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 4px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.5;
    transition: opacity 0.3s ease, width 0.3s ease;
    z-index: 0; /* 确保在闪光::before之下 */
}
.button:hover::after {
    opacity: 0.8;
    width: 100%;
}
/* 注意：:active 的 transform 会与 hover 的 scale 叠加，但仅在点击瞬间，体验自然 */

/* 9. summary 展开/折叠箭头（纯CSS） */
summary::after {
    content: '▶';
    font-size: 0.8em;
    transition: transform 0.3s ease;
    display: inline-block;
    margin-left: auto; /* 靠右对齐（flex已设置justify-content: space-between） */
    color: #e94560; /* 箭头颜色 */
    z-index: 3; /* 确保在闪光之上 */
}
details[open] summary::after {
    transform: rotate(90deg);
}

/* 10. section 左侧装饰条 */
.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #e94560, #533483);
    border-radius: 8px 0 0 8px;
    opacity: 0.7;
    transition: opacity 0.3s ease, width 0.3s ease;
}
.section:hover::before {
    opacity: 1;
    width: 6px;
}

/* 11. highlight 脉冲动画（突出显示） */
.highlight {
    animation: highlight-pulse 2s ease-in-out infinite;
}
@keyframes highlight-pulse {
    0%, 100% { text-shadow: 0 0 10px rgba(233, 69, 96, 0.6), 0 0 20px rgba(233, 69, 96, 0.3); }
    50% { text-shadow: 0 0 20px rgba(233, 69, 96, 0.8), 0 0 40px rgba(233, 69, 96, 0.5); } /* 脉冲加强 */
}

/* 12. text 内部样式补充 */
/* 引用块在 text 内 */
text blockquote {
    border-left-color: #533483;
    background-color: rgba(83, 52, 131, 0.1);
}
/* 代码块在 text 内 */
text pre {
    border-left-color: #533483;
    background-color: #0f3460;
}

/* 13. focus-visible 样式（键盘导航高亮） */
:focus-visible {
    outline: 2px solid #e94560;
    outline-offset: 2px;
}

/* 14. 打印样式优化 */
@media print {
    /* body {} */ /* 已注释，遵循平台规则 */
    .container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    .button, .footer, details, .section, .input-group textarea {
        box-shadow: none;
        border-color: #ccc;
    }
    .button {
        background: #333;
        color: #fff;
    }
    text {
        animation: none;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    ::-webkit-scrollbar {
        display: none;
    }
    @page {
        margin: 2cm;
    }
}

/* 15. 加载动画预置（可用于生成内容时的等待指示器） */
.loading-spinner {
    display: inline-block;
    width: 2em;
    height: 2em;
    border: 3px solid #533483;
    border-top-color: #e94560;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 16. 小屏额外优化：确保按钮和卡片依然舒适 */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    .section {
        padding: 15px;
    }
    .button {
        padding: 10px 18px;
        font-size: 1em;
    }
    .input-group textarea {
        min-height: 70px;
    }
    table {
        font-size: 0.85em;
    }
    table th, table td {
        padding: 6px;
    }
    text {
        padding: 12px 15px;
    }
}

/* 17. 暗色模式下的轻微聚焦效果（不改变原有颜色，仅增加一层滤镜） */
/*
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
*/