/* ========================================
   ❄️ 冰蓝科幻风格 - SillyTavern 内置CSS
   设计理念：冷冽冰蓝 + 全息光效 + 科技感
   ======================================== */

/* ---------- 全局基础 ---------- */
:root {
    --ice-primary: #00d4ff;
    --ice-secondary: #0099cc;
    --ice-glow: rgba(0, 212, 255, 0.6);
    --ice-bg-start: #0a0e1a;
    --ice-bg-end: #141c2b;
    --ice-text: #e0f2fe;
    --ice-bubble-user: rgba(0, 180, 216, 0.15);
    --ice-bubble-assistant: rgba(0, 212, 255, 0.05);
    --ice-border: rgba(0, 212, 255, 0.25);
    --ice-shadow: 0 0 30px rgba(0, 212, 255, 0.08);
}

/* ---------- 背景 ---------- */
body,
#app,
.chat {
    background: linear-gradient(145deg, var(--ice-bg-start), var(--ice-bg-end)) !important;
    background-attachment: fixed !important;
}

/* ---------- 聊天容器 ---------- */
.chat {
    backdrop-filter: blur(1px);
}

/* ---------- 消息气泡通用 ---------- */
.mes,
.message {
    border-radius: 12px !important;
    border: 1px solid var(--ice-border) !important;
    box-shadow: var(--ice-shadow), inset 0 0 60px rgba(0, 212, 255, 0.02) !important;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.mes:hover,
.message:hover {
    border-color: rgba(0, 212, 255, 0.5) !important;
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.12), inset 0 0 80px rgba(0, 212, 255, 0.04) !important;
}

/* ---------- 用户消息 ---------- */
.mes[data-role="user"],
.message.user {
    background: var(--ice-bubble-user) !important;
    border-left: 3px solid var(--ice-primary) !important;
    color: #c8e6f5 !important;
}

/* ---------- 助手消息 ---------- */
.mes[data-role="assistant"],
.message.assistant {
    background: var(--ice-bubble-assistant) !important;
    border-right: 3px solid var(--ice-secondary) !important;
    color: var(--ice-text) !important;
}

/* ---------- 文字发光 ---------- */
.mes .text,
.message .text,
.mes .content,
.message .content {
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.08), 0 0 30px rgba(0, 212, 255, 0.03) !important;
    color: inherit !important;
}

/* ---------- 名字标签 ---------- */
.mes .name,
.message .name {
    color: var(--ice-primary) !important;
    font-weight: 600 !important;
    letter-spacing: 1.5px !important;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.3) !important;
    font-size: 0.85em !important;
    text-transform: uppercase !important;
}

/* ---------- 时间戳 ---------- */
.mes .time,
.message .time {
    color: rgba(0, 212, 255, 0.4) !important;
    font-size: 0.7em !important;
    font-family: 'Courier New', monospace !important;
    letter-spacing: 0.5px;
}

/* ---------- 输入框 ---------- */
#send_textarea,
.textarea_compact,
.chat_input textarea,
.st-textarea textarea {
    background: rgba(10, 14, 26, 0.7) !important;
    border: 1px solid rgba(0, 212, 255, 0.2) !important;
    border-radius: 12px !important;
    color: var(--ice-text) !important;
    box-shadow: inset 0 0 30px rgba(0, 212, 255, 0.03), 0 0 20px rgba(0, 212, 255, 0.05) !important;
    backdrop-filter: blur(8px);
    transition: all 0.4s ease;
}

#send_textarea:focus,
.textarea_compact:focus,
.chat_input textarea:focus,
.st-textarea textarea:focus {
    border-color: var(--ice-primary) !important;
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.1), inset 0 0 30px rgba(0, 212, 255, 0.05) !important;
    outline: none !important;
}

/* ---------- 发送按钮 ---------- */
#send_but,
.send_button,
.st-button-primary {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 153, 204, 0.1)) !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
    color: var(--ice-primary) !important;
    border-radius: 10px !important;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.08) !important;
    transition: all 0.3s ease;
    font-weight: 500 !important;
    letter-spacing: 0.5px;
}

#send_but:hover,
.send_button:hover,
.st-button-primary:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(0, 153, 204, 0.2)) !important;
    border-color: var(--ice-primary) !important;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.2) !important;
    transform: scale(1.02);
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 14, 26, 0.5) !important;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--ice-primary), var(--ice-secondary)) !important;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2) !important;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ice-primary) !important;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.4) !important;
}

/* ---------- 侧边栏/面板 ---------- */
.sidebar,
.panel,
.menu {
    background: rgba(10, 14, 26, 0.6) !important;
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(0, 212, 255, 0.08) !important;
}

/* ---------- 标题/头部 ---------- */
.header,
.title {
    color: var(--ice-primary) !important;
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.15) !important;
    letter-spacing: 2px !important;
    font-weight: 300 !important;
}

/* ---------- 分隔线/装饰 ---------- */
hr,
.divider {
    border: none !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent, var(--ice-primary), transparent) !important;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.15) !important;
    margin: 16px 0 !important;
}

/* ---------- 标签/徽章 ---------- */
.tag,
.badge {
    background: rgba(0, 212, 255, 0.1) !important;
    border: 1px solid rgba(0, 212, 255, 0.2) !important;
    color: var(--ice-primary) !important;
    border-radius: 6px !important;
    padding: 2px 12px !important;
    font-size: 0.8em !important;
    letter-spacing: 0.5px;
}

/* ---------- 选中/高亮 ---------- */
::selection {
    background: rgba(0, 212, 255, 0.25) !important;
    color: #ffffff !important;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.3) !important;
}

/* ---------- 代码块 ---------- */
code,
pre {
    background: rgba(0, 10, 20, 0.6) !important;
    border: 1px solid rgba(0, 212, 255, 0.1) !important;
    border-radius: 8px !important;
    color: #90e0ef !important;
    font-family: 'Courier New', monospace !important;
}

/* ---------- 链接 ---------- */
a {
    color: var(--ice-primary) !important;
    text-decoration: none !important;
    border-bottom: 1px dashed rgba(0, 212, 255, 0.2);
    transition: all 0.3s ease;
}

a:hover {
    color: #90e0ef !important;
    border-bottom-color: var(--ice-primary);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

/* ---------- 头像（如果有） ---------- */
.avatar,
.avatar img {
    border: 1px solid rgba(0, 212, 255, 0.15) !important;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.05) !important;
}

/* ---------- 加载动画/状态指示 ---------- */
.typing-indicator span {
    background: var(--ice-primary) !important;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3) !important;
}

/* ---------- 按钮通用 ---------- */
button,
.st-button {
    background: rgba(0, 212, 255, 0.05) !important;
    border: 1px solid rgba(0, 212, 255, 0.15) !important;
    color: var(--ice-text) !important;
    border-radius: 8px !important;
    transition: all 0.3s ease;
}

button:hover,
.st-button:hover {
    background: rgba(0, 212, 255, 0.12) !important;
    border-color: var(--ice-primary) !important;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.08) !important;
}

/* ---------- 下拉菜单/选择器 ---------- */
select,
.st-select {
    background: rgba(10, 14, 26, 0.7) !important;
    border: 1px solid rgba(0, 212, 255, 0.15) !important;
    color: var(--ice-text) !important;
    border-radius: 8px !important;
}

/* ---------- 输入框占位符 ---------- */
::placeholder {
    color: rgba(0, 212, 255, 0.25) !important;
    letter-spacing: 0.5px;
}

/* ---------- 消息内引用/引用块 ---------- */
blockquote {
    border-left: 3px solid var(--ice-primary) !important;
    background: rgba(0, 212, 255, 0.03) !important;
    padding: 8px 16px !important;
    border-radius: 0 8px 8px 0 !important;
    color: #b0dce8 !important;
}

/* ---------- 科幻装饰线 ---------- */
.chat::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ice-primary), transparent);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.15);
    z-index: 9999;
    pointer-events: none;
    opacity: 0.6;
}

/* ---------- 右下角全息水印感 ---------- */
.chat::after {
    content: '✦ 冰蓝协议 v2.0 ✦';
    position: fixed;
    bottom: 20px;
    right: 30px;
    font-size: 10px;
    letter-spacing: 3px;
    color: rgba(0, 212, 255, 0.06);
    font-family: 'Courier New', monospace;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}