/* ============================================
   🌸 樱花粉主题 · 全站统一美化 v1.0
   作用域：回复正文 + 输入框 + 评论 + 模组
   ============================================ */

/* ---------- 颜色变量（通过具体选择器注入，避开 *、html、body 限制） ---------- */
sakura-reply,
sakura-reply * {
    --sakura-deep: #d6708f;
    --sakura-main: #f4a6c0;
    --sakura-light: #fde4ec;
    --sakura-bg: #fff5f8;
    --sakura-text: #5c3a48;
    --sakura-border: #f9c8d8;
}

/* ============================================
   一、回复正文容器美化
   ============================================ */
sakura-reply {
    display: block;
    background: linear-gradient(135deg, #fff5f8 0%, #ffeaf2 100%);
    border: 1px solid #f9c8d8;
    border-radius: 16px;
    padding: 16px 18px;
    margin: 14px 0;
    box-shadow: 0 4px 18px rgba(214, 112, 143, 0.12);
    color: #5c3a48;
    font-size: 14px;
    line-height: 1.75;
    position: relative;
    overflow: hidden;
}

sakura-reply::before {
    content: "🌸";
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 18px;
    opacity: 0.4;
}

/* ---------- details 折叠块 ---------- */
sakura-reply details {
    background: #ffffffcc;
    border: 1px solid #f9c8d8;
    border-radius: 12px;
    margin: 10px 0;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

sakura-reply details[open] {
    box-shadow: 0 2px 12px rgba(244, 166, 192, 0.25);
}

sakura-reply summary {
    cursor: pointer;
    padding: 10px 14px;
    background: linear-gradient(90deg, #f4a6c0 0%, #f9c8d8 100%);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    list-style: none;
    user-select: none;
    transition: background 0.3s;
}

sakura-reply summary::-webkit-details-marker {
    display: none;
}

sakura-reply summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.3s;
    margin-right: 4px;
}

sakura-reply details[open] summary::before {
    transform: rotate(90deg);
}

sakura-reply summary:hover {
    background: linear-gradient(90deg, #d6708f 0%, #f4a6c0 100%);
}

/* ---------- 表格美化 ---------- */
sakura-reply .sakura-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 10px 0;
    background: #fffafd;
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
}

sakura-reply .sakura-table th {
    background: #f4a6c0;
    color: #fff;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border: none;
}

sakura-reply .sakura-table td {
    padding: 8px 12px;
    border-bottom: 1px dashed #f9c8d8;
    color: #5c3a48;
    vertical-align: top;
}

sakura-reply .sakura-table tr:last-child td {
    border-bottom: none;
}

sakura-reply .sakura-table tr:nth-child(even) td {
    background: #fff5f8;
}

sakura-reply .sakura-table tr:hover td {
    background: #ffeaf2;
    transition: background 0.2s;
}

sakura-reply .sakura-table td:first-child {
    font-weight: 600;
    color: #d6708f;
    white-space: nowrap;
    width: 90px;
}

/* ---------- 不同区块的色调微调 ---------- */
sakura-reply status-user details { border-left: 4px solid #b491c8; }
sakura-reply status-su details { border-left: 4px solid #d6708f; }
sakura-reply status-body details { border-left: 4px solid #e85a85; }
sakura-reply status-memory details { border-left: 4px solid #c8a2b8; }
sakura-reply status-option details { border-left: 4px solid #ff8fab; }

/* ---------- 记忆区子标题 ---------- */
sakura-reply .memory-title {
    margin: 12px 14px 6px;
    padding: 4px 10px;
    background: #fde4ec;
    color: #d6708f;
    font-weight: 600;
    border-radius: 6px;
    display: inline-block;
    font-size: 13px;
}

/* ---------- 推荐选项 ---------- */
sakura-reply .sakura-option {
    list-style: none;
    padding: 12px 16px;
    margin: 0;
    counter-reset: opt;
}

sakura-reply .sakura-option li {
    counter-increment: opt;
    background: #fff5f8;
    margin: 8px 0;
    padding: 10px 14px 10px 40px;
    border-radius: 10px;
    border: 1px solid #f9c8d8;
    position: relative;
    transition: all 0.25s;
    cursor: pointer;
}

sakura-reply .sakura-option li::before {
    content: counter(opt);
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background: linear-gradient(135deg, #f4a6c0, #d6708f);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
}

sakura-reply .sakura-option li:hover {
    background: #ffeaf2;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(214, 112, 143, 0.2);
}

/* ---------- 正文段落 ---------- */
sakura-reply p {
    margin: 8px 0;
    text-indent: 2em;
}

/* ============================================
   二、平台输入框 / 评论 / 模组美化
   （命中平台原生 class，不动 placeholder 文字）
   ============================================ */

/* ---------- 底部输入栏整体容器 ---------- */
.chat-input,
.input-bar,
.message-input-container,
[class*="inputBar"],
[class*="InputBar"],
[class*="chatInput"] {
    background: linear-gradient(180deg, #fff5f8 0%, #ffeaf2 100%) !important;
    border-top: 1px solid #f9c8d8 !important;
    box-shadow: 0 -2px 12px rgba(244, 166, 192, 0.15) !important;
}

/* ---------- 输入框本体（不动 placeholder 文字本身） ---------- */
textarea,
input[type="text"],
.chat-input textarea,
[class*="inputBox"] textarea,
[class*="InputBox"] textarea {
    background: #fffafd !important;
    border: 1.5px solid #f9c8d8 !important;
    border-radius: 14px !important;
    color: #5c3a48 !important;
    transition: all 0.25s ease !important;
}

textarea:focus,
input[type="text"]:focus {
    border-color: #d6708f !important;
    box-shadow: 0 0 0 3px rgba(244, 166, 192, 0.25) !important;
    outline: none !important;
}

/* ---------- 发送按钮 / 功能按钮 ---------- */
.send-btn,
.send-button,
[class*="sendBtn"],
[class*="SendBtn"],
[class*="sendButton"] {
    background: linear-gradient(135deg, #f4a6c0 0%, #d6708f 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    transition: all 0.25s !important;
    box-shadow: 0 2px 8px rgba(214, 112, 143, 0.3) !important;
}

.send-btn:hover,
.send-button:hover,
[class*="sendBtn"]:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 14px rgba(214, 112, 143, 0.45) !important;
}

/* ---------- 评论区 ---------- */
.comment,
.comment-item,
.comment-list,
[class*="comment"],
[class*="Comment"] {
    background: #fffafd !important;
    border-color: #f9c8d8 !important;
    color: #5c3a48 !important;
}

[class*="comment"] [class*="avatar"],
[class*="Comment"] [class*="avatar"] {
    border: 2px solid #f4a6c0 !important;
    box-shadow: 0 2px 6px rgba(244, 166, 192, 0.3) !important;
}

[class*="comment"] [class*="like"],
[class*="comment"] [class*="reply"] {
    color: #d6708f !important;
}

/* ---------- 模组区 ---------- */
.mod-item,
.mod-card,
[class*="mod-"],
[class*="Mod-"],
[class*="modCard"],
[class*="ModCard"] {
    background: linear-gradient(135deg, #fff5f8 0%, #ffeaf2 100%) !important;
    border: 1px solid #f9c8d8 !important;
    border-radius: 12px !important;
    transition: all 0.3s !important;
}

[class*="mod-"]:hover,
[class*="modCard"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(214, 112, 143, 0.25) !important;
    border-color: #f4a6c0 !important;
}

/* ---------- 聊天气泡（全覆盖） ---------- */
.message-bubble,
.chat-bubble,
[class*="bubble"],
[class*="Bubble"],
[class*="messageItem"],
[class*="MessageItem"] {
    background: #fffafd !important;
    border: 1px solid #f9c8d8 !important;
    color: #5c3a48 !important;
}

/* AI 消息气泡 */
[class*="aiMessage"],
[class*="AiMessage"],
[class*="assistant"] [class*="bubble"] {
    background: linear-gradient(135deg, #fff5f8 0%, #ffeaf2 100%) !important;
    border-color: #f9c8d8 !important;
}

/* 用户消息气泡 */
[class*="userMessage"],
[class*="UserMessage"],
[class*="user"] [class*="bubble"] {
    background: linear-gradient(135deg, #f4a6c0 0%, #f9c8d8 100%) !important;
    color: #fff !important;
    border: none !important;
}

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

::-webkit-scrollbar-track {
    background: #fff5f8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f4a6c0, #d6708f);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d6708f;
}

/* ---------- 通用按钮 ---------- */
button:not([class*="send"]):not([disabled]) {
    transition: all 0.25s ease !important;
}

/* ---------- 顶部日期/时段行 ---------- */
sakura-reply ~ p:first-of-type,
sakura-reply + p {
    color: #d6708f;
    font-weight: 600;
}