/* ==========================================================================
   拾光 AI 中枢 —— 页面样式
   PC 与移动端共用。断点 860px 以下切成移动端版式（左侧会话栏变抽屉）。
   ========================================================================== */

/* [hidden] 只是 UA 样式，任何作者样式里的 display 都会把它盖掉 —— 齿轮
   写了 hidden 却仍显示给游客，就是这么来的。全模块统一兜底，后续再加
   display 也不会把「按权限隐藏」的元素漏出去。 */
.aih [hidden],
.aihm [hidden],
.aih[hidden],
.aihm[hidden] { display: none !important; }

.aih {
    --aih-bg: #fbfbfc;
    --aih-panel: #ffffff;
    --aih-line: #ececf0;
    --aih-line-strong: #e0e0e6;
    --aih-ink: #1d1d20;
    --aih-ink-2: #55555f;
    --aih-ink-3: #8e8e99;
    --aih-brand: #6b5cff;
    --aih-brand-soft: #f0eeff;
    --aih-me: #f4f4f7;
    --aih-danger: #e5484d;
    --aih-radius: 14px;

    display: flex;
    height: 100%;
    min-height: 0;
    background: var(--aih-bg);
    color: var(--aih-ink);
    font-size: 14px;
    line-height: 1.62;
    position: relative;
    overflow: hidden;
}

.aih *,
.aih *::before,
.aih *::after { box-sizing: border-box; }

/* 整页模式下让容器吃满可视高度。
   PC 端页头页脚是宿主的，先量出来写到 --aih-chrome 上（module.js 在挂载时算一次），
   量不到就退回 100dvh —— 宁可多留一点白，也不要输入框被裁到视口外面。 */
.aih {
    height: var(--aih-height, calc(100dvh - var(--aih-chrome, 0px)));
    max-height: 100%;
}

/* ============================ 骨架 ============================ */

.aih_sk {
    display: block;
    background: linear-gradient(90deg, #eeeef2 25%, #f6f6f9 37%, #eeeef2 63%);
    background-size: 400% 100%;
    animation: aih-shimmer 1.4s ease infinite;
    border-radius: 6px;
}
@keyframes aih-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
.aih_sk-logo { width: 26px; height: 26px; border-radius: 8px; }
.aih_sk-line { height: 10px; }
.aih_sk-dot { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto; }
.aih_sk-btn { display: block; height: 38px; width: 100%; border-radius: 10px; }
.aih_sk-big { width: 200px; height: 24px; }
.aih_sk-input { height: 52px; border-radius: 12px; }

/* ============================ 左侧会话栏 ============================ */

.aih_side {
    width: 264px;
    flex: 0 0 264px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--aih-line);
    background: var(--aih-panel);
    min-height: 0;
}

.aih_side-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 14px 10px;
}
.aih_brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    flex: 1;
}
.aih_brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(140deg, #7c6bff, #b39dff);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 15px;
    flex: 0 0 auto;
}
.aih_brand-text {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aih_side-gear {
    color: var(--aih-ink-3);
    text-decoration: none;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    flex: 0 0 auto;
}
.aih_side-gear:hover { background: var(--aih-me); color: var(--aih-ink); }

.aih_new {
    margin: 0 10px 8px;
    height: 38px;
    border: 1px solid var(--aih-line-strong);
    background: var(--aih-panel);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--aih-ink);
    cursor: pointer;
    transition: background .16s, border-color .16s;
}
.aih_new:hover { background: var(--aih-me); border-color: #d2d2da; }
.aih_new .remix-icon { font-size: 16px; }

.aih_side-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 8px 8px;
    overscroll-behavior: contain;
}
.aih_side-scroll::-webkit-scrollbar { width: 8px; }
.aih_side-scroll::-webkit-scrollbar-thumb {
    background: #dcdce2;
    border-radius: 4px;
    border: 2px solid var(--aih-panel);
}

.aih_side-label {
    font-size: 11px;
    color: var(--aih-ink-3);
    padding: 8px 8px 6px;
    letter-spacing: .02em;
}

/* ---------------- 搜索 ---------------- */

.aih_side-search {
    margin: 0 10px 8px;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border: 1px solid var(--aih-line-strong);
    border-radius: 9px;
    background: var(--aih-panel);
    transition: border-color .16s;
}
.aih_side-search:focus-within { border-color: var(--aih-brand); }
.aih_side-search .remix-icon {
    font-size: 14px;
    color: var(--aih-ink-3);
    flex: 0 0 auto;
}
.aih_side-search-in {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 12.5px;
    color: var(--aih-ink);
    height: 100%;
    /* 去掉 Safari 给 type=search 的那个圆角和叉 */
    -webkit-appearance: none;
    appearance: none;
}
.aih_side-search-in::-webkit-search-decoration,
.aih_side-search-in::-webkit-search-cancel-button { -webkit-appearance: none; }
.aih_side-search-clr {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    border-radius: 50%;
    background: var(--aih-line);
    color: var(--aih-ink-2);
    cursor: pointer;
    font-size: 12px;
}
.aih_side-search-clr:hover { background: var(--aih-line-strong); }

/* 命中处标红。底色比主色淡一档，不然一整列都在跳 */
.aih_mark {
    background: rgba(107, 92, 255, .16);
    color: inherit;
    border-radius: 3px;
    padding: 0 1px;
}

/* 底部那两个按钮并排：存稿 + 诊断 */
.aih_side-row2 {
    display: flex;
    gap: 6px;
}
.aih_side-row2 .aih_side-diag { flex: 1; min-width: 0; }

.aih_side-badge {
    margin-left: auto;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--aih-brand);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    flex: 0 0 auto;
}
.aih_side-badge[hidden] { display: none !important; }

/* ---------------- 存稿抽屉 ---------------- */

.aih_drafts-box { max-width: 560px; }

.aih_draft {
    border: 1px solid var(--aih-line);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--aih-panel);
}
.aih_draft-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.aih_draft-time { font-size: 11.5px; color: var(--aih-ink-3); }
.aih_draft-len {
    font-size: 11.5px;
    color: var(--aih-ink-3);
    margin-right: auto;
}
.aih_draft-text {
    font-size: 13px;
    color: var(--aih-ink-2);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.aih_side-empty {
    font-size: 12px;
    color: var(--aih-ink-3);
    padding: 10px 8px;
}

/* 骨架期的占位行：与 .aih_side-item 同高、同缩进，数据回来时不会跳一下 */
.aih_side-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 8px;
}
.aih_side-row .aih_sk-line { flex: 0 0 auto; }

.aih_side-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px;
    border-radius: 9px;
    cursor: pointer;
    color: var(--aih-ink-2);
    position: relative;
}
.aih_side-item:hover { background: var(--aih-me); }
.aih_side-item.is-active {
    background: var(--aih-brand-soft);
    color: var(--aih-brand);
    font-weight: 500;
}
.aih_side-item .remix-icon { font-size: 15px; flex: 0 0 auto; opacity: .8; }
.aih_side-item-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aih_side-del,
.aih_side-ren {
    border: 0;
    background: transparent;
    color: var(--aih-ink-3);
    cursor: pointer;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: none;
    place-items: center;
    flex: 0 0 auto;
    font-size: 14px;
    padding: 0;
}
.aih_side-item:hover .aih_side-del,
.aih_side-item:hover .aih_side-ren { display: grid; }
/* 手机上没有 hover，两个按钮常显，否则根本改不了名 */
@media (hover: none) {
    .aih_side-del,
    .aih_side-ren { display: grid; }
}
.aih_side-del:hover { background: #ffe9e9; color: var(--aih-danger); }
.aih_side-ren:hover { background: var(--aih-line); color: var(--aih-ink); }

.aih_side-foot {
    border-top: 1px solid var(--aih-line);
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.aih_pick { display: flex; align-items: center; gap: 8px; }
.aih_pick-label { font-size: 12px; color: var(--aih-ink-3); flex: 0 0 auto; }
.aih_pick-sel {
    flex: 1;
    min-width: 0;
    height: 30px;
    border: 1px solid var(--aih-line-strong);
    border-radius: 8px;
    background: var(--aih-panel);
    font-size: 12px;
    color: var(--aih-ink);
    padding: 0 6px;
    outline: none;
}
.aih_pick-sel:focus { border-color: var(--aih-brand); }
.aih_usage {
    font-size: 11px;
    color: var(--aih-ink-3);
    display: flex;
    gap: 6px;
    align-items: center;
}
.aih_dot { opacity: .5; }

/* ============================ 主区 ============================ */

.aih_main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--aih-bg);
}

.aih_top {
    height: 52px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border-bottom: 1px solid var(--aih-line);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(8px);
}
.aih_top-menu { display: none; }
.aih_top-title {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aih_top-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.aih_icon-btn {
    border: 0;
    background: transparent;
    color: var(--aih-ink-2);
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 17px;
    padding: 0;
}
.aih_icon-btn:hover { background: var(--aih-me); color: var(--aih-ink); }
/* 小号：存稿卡片右上角那种地方，32px 会把行高顶起来 */
.aih_icon-btn--xs {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 13px;
    flex: 0 0 auto;
}

.aih_persona-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--aih-ink-2);
    background: var(--aih-me);
    border-radius: 20px;
    padding: 4px 10px 4px 4px;
}
.aih_persona-pick {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.aih_persona-pick select {
    appearance: none;
    border: 1px solid var(--aih-line-strong);
    background: var(--aih-panel);
    border-radius: 20px;
    height: 30px;
    padding: 0 26px 0 10px;
    font-size: 12px;
    color: var(--aih-ink);
    cursor: pointer;
    outline: none;
    max-width: 140px;
}
.aih_persona-pick select:focus { border-color: var(--aih-brand); }
.aih_persona-pick .remix-icon {
    position: absolute;
    right: 6px;
    pointer-events: none;
    font-size: 15px;
    color: var(--aih-ink-3);
}
.aih_persona-ava {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}
.aih_persona-ava--txt {
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, #7c6bff, #b39dff);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

/* ============================ 正文 ============================ */

.aih_body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 0 8px;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}
.aih_body::-webkit-scrollbar { width: 10px; }
.aih_body::-webkit-scrollbar-thumb {
    background: #dcdce2;
    border-radius: 5px;
    border: 3px solid var(--aih-bg);
}

.aih_msgs {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.aih_msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.aih_msg--me { flex-direction: row-reverse; }

.aih_msg-ava {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-size: 15px;
    margin-top: 2px;
}
.aih_msg-ava--ai {
    background: linear-gradient(140deg, #7c6bff, #b39dff);
    color: #fff;
}
.aih_msg-ava--me { background: var(--aih-me); color: var(--aih-ink-2); }

.aih_msg-col { min-width: 0; max-width: calc(100% - 40px); }
.aih_msg--me .aih_msg-col { display: flex; flex-direction: column; align-items: flex-end; }

.aih_msg-body {
    font-size: 14px;
    color: var(--aih-ink);
    word-break: break-word;
    overflow-wrap: anywhere;
}
.aih_msg--me .aih_msg-body {
    background: var(--aih-me);
    border-radius: 14px 14px 4px 14px;
    padding: 9px 14px;
    max-width: 100%;
}

/* markdown */
.aih_msg-body > *:first-child { margin-top: 0; }
.aih_msg-body > *:last-child { margin-bottom: 0; }
.aih_msg-body p { margin: 0 0 10px; }
.aih_msg-body h2,
.aih_msg-body h3,
.aih_msg-body h4,
.aih_msg-body h5,
.aih_msg-body h6 {
    margin: 18px 0 8px;
    font-weight: 600;
    line-height: 1.4;
}
.aih_msg-body h2 { font-size: 17px; }
.aih_msg-body h3 { font-size: 15.5px; }
.aih_msg-body h4,
.aih_msg-body h5,
.aih_msg-body h6 { font-size: 14px; }
.aih_msg-body ul,
.aih_msg-body ol { margin: 0 0 10px; padding-left: 22px; }
.aih_msg-body li { margin: 3px 0; }
.aih_msg-body blockquote {
    margin: 10px 0;
    padding: 2px 0 2px 12px;
    border-left: 3px solid var(--aih-line-strong);
    color: var(--aih-ink-2);
}
.aih_msg-body hr {
    border: 0;
    border-top: 1px solid var(--aih-line);
    margin: 16px 0;
}
.aih_msg-body a { color: var(--aih-brand); text-decoration: none; }
.aih_msg-body a:hover { text-decoration: underline; }
.aih_msg-body strong { font-weight: 600; }

.aih_inline {
    background: var(--aih-me);
    border-radius: 5px;
    padding: 1px 5px;
    font-size: 12.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #b5385c;
}
.aih_code {
    background: #1e1e24;
    color: #e6e6ec;
    border-radius: 10px;
    padding: 12px 14px;
    overflow-x: auto;
    margin: 10px 0;
    font-size: 12.5px;
    line-height: 1.6;
}
.aih_code code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre;
}

.aih_msg-tools {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity .16s;
}
.aih_msg:hover .aih_msg-tools { opacity: 1; }
.aih_msg-tool {
    border: 0;
    background: transparent;
    color: var(--aih-ink-3);
    font-size: 11.5px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.aih_msg-tool:hover { background: var(--aih-me); color: var(--aih-ink-2); }
.aih_msg-tool .remix-icon { font-size: 13px; }

.aih_msg-err {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    color: var(--aih-danger);
    background: #fff4f4;
    border: 1px solid #ffdcdc;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
}
.aih_msg-err .remix-icon { margin-top: 2px; flex: 0 0 auto; }

.aih_caret {
    display: inline-block;
    width: 7px;
    height: 15px;
    background: var(--aih-brand);
    border-radius: 1px;
    margin-left: 2px;
    vertical-align: -2px;
    animation: aih-blink 1s steps(2) infinite;
}
@keyframes aih-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ============================ 空态 ============================ */

.aih_body--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px 40px;
}
.aih_hello {
    text-align: center;
    max-width: 560px;
    width: 100%;
}
.aih_hello-mark {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    margin: 0 auto 18px;
    background: linear-gradient(140deg, #7c6bff, #b39dff);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 26px;
    box-shadow: 0 8px 22px -8px rgba(124, 107, 255, .55);
}
.aih_hello h2 {
    font-size: 21px;
    font-weight: 600;
    margin: 0 0 6px;
    letter-spacing: -.01em;
}
.aih_hello-note {
    font-size: 13px;
    color: var(--aih-ink-3);
    margin: 0 0 20px;
}
.aih_hello-note--warn { color: #c2410c; }

.aih_hello-tips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 6px;
}
.aih_tip {
    border: 1px solid var(--aih-line-strong);
    background: var(--aih-panel);
    border-radius: 11px;
    padding: 11px 13px;
    font-size: 13px;
    color: var(--aih-ink-2);
    text-align: left;
    cursor: pointer;
    transition: border-color .16s, background .16s, transform .16s;
    line-height: 1.5;
}
.aih_tip:hover {
    border-color: #c8c2ff;
    background: #faf9ff;
    color: var(--aih-ink);
    transform: translateY(-1px);
}

/* ============================ 输入区 ============================ */

.aih_composer {
    flex: 0 0 auto;
    padding: 8px 20px 14px;
    background: var(--aih-bg);
}
.aih_composer-inner {
    max-width: 760px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--aih-panel);
    border: 1px solid var(--aih-line-strong);
    border-radius: var(--aih-radius);
    padding: 8px 8px 8px 14px;
    transition: border-color .16s, box-shadow .16s;
}
.aih_composer-inner:focus-within {
    border-color: #c8c2ff;
    box-shadow: 0 0 0 3px rgba(107, 92, 255, .1);
}
.aih_input {
    flex: 1;
    border: 0;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    color: var(--aih-ink);
    background: transparent;
    max-height: 200px;
    padding: 5px 0;
    min-height: 26px;
}
.aih_input::placeholder { color: var(--aih-ink-3); }
.aih_input:disabled { cursor: not-allowed; }

.aih_send {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 0;
    background: var(--aih-brand);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 17px;
    transition: background .16s, opacity .16s;
    padding: 0;
}
.aih_send:hover { background: #5a4bea; }
.aih_send:disabled {
    background: var(--aih-line-strong);
    cursor: not-allowed;
}
.aih_send.is-busy { background: var(--aih-ink-2); }
.aih_send.is-busy:hover { background: var(--aih-ink); }

.aih_composer-tip {
    max-width: 760px;
    margin: 6px auto 0;
    font-size: 11.5px;
    color: var(--aih-ink-3);
    min-height: 16px;
    text-align: center;
    opacity: 0;
    transition: opacity .2s;
}
.aih_composer-tip.is-on { opacity: 1; }

/*
 * 剩余次数。只在站长设了「每人每天上限」时出现 ——
 * 不限量时后端给 left = -1，这里直接 hidden，不占位置。
 */
.aih_composer-quota {
    max-width: 760px;
    margin: 2px auto 0;
    font-size: 11.5px;
    color: var(--aih-ink-3);
    text-align: center;
}
.aih_composer-quota.is-out {
    color: #d9534f;
}
.aih_composer-quota[hidden] { display: none !important; }

/*
 * 每轮的账：模型 / 入出 token / 耗时。
 * 刻意做得比正文淡 —— 它是给人核对的，不该抢注意力。
 */
.aih_msg-stat {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--aih-ink-3);
    font-variant-numeric: tabular-nums;
    letter-spacing: .1px;
}

/* ============================ 错误页 ============================ */

.aih--error {
    display: flex;
    align-items: center;
    justify-content: center;
}
.aih_errbox {
    text-align: center;
    max-width: 400px;
    padding: 24px;
}
.aih_errbox .remix-icon {
    font-size: 36px;
    color: var(--aih-ink-3);
    display: block;
    margin-bottom: 12px;
}
.aih_errbox h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.aih_errbox p { margin: 0 0 18px; font-size: 13px; color: var(--aih-ink-2); }
.aih_btn {
    border: 1px solid var(--aih-line-strong);
    background: var(--aih-panel);
    border-radius: 9px;
    height: 34px;
    padding: 0 16px;
    font-size: 13px;
    cursor: pointer;
    color: var(--aih-ink);
}
.aih_btn:hover { background: var(--aih-me); }
/* 表格里的按钮：撑不满一格，别把行高顶起来 */
.aih_btn--xs {
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 7px;
}
.aih_btn--xs[disabled] { opacity: .6; cursor: default; }
.aih_btn--ghost { background: transparent; }

/* ==========================================================================
   移动端：会话栏变抽屉
   ========================================================================== */

@media (max-width: 860px) {
    .aih_top-menu { display: grid; }

    .aih_side {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 30;
        width: 84%;
        max-width: 300px;
        transform: translateX(-102%);
        transition: transform .26s cubic-bezier(.32, .72, 0, 1);
        box-shadow: 0 0 0 1px rgba(0, 0, 0, .04);
    }
    .aih.is-side-open .aih_side { transform: translateX(0); }
    .aih.is-side-open::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, .28);
        z-index: 25;
        animation: aih-fade .2s ease;
    }
    @keyframes aih-fade { from { opacity: 0; } to { opacity: 1; } }

    .aih_top { padding: 0 10px; gap: 6px; }
    .aih_msgs { padding: 0 14px; gap: 18px; }
    .aih_body { padding-top: 14px; }
    .aih_composer { padding: 6px 12px 10px; }
    .aih_hello-tips { grid-template-columns: 1fr; }
    .aih_hello h2 { font-size: 19px; }
    .aih_persona-pick select { max-width: 100px; }
    .aih_msg-col { max-width: calc(100% - 36px); }
    .aih_msg-tools { opacity: 1; }
}

@media (max-width: 420px) {
    .aih { font-size: 13.5px; }
    .aih_top-title { font-size: 13.5px; }
    .aih_hello-mark { width: 46px; height: 46px; font-size: 22px; border-radius: 14px; }
}

/* 深色模式跟随系统 —— 站点若自己上了 .dark 也认 */
@media (prefers-color-scheme: dark) {
    .aih:not(.aih--light) {
        --aih-bg: #16161a;
        --aih-panel: #1c1c21;
        --aih-line: #2a2a31;
        --aih-line-strong: #35353d;
        --aih-ink: #e9e9ee;
        --aih-ink-2: #a9a9b4;
        --aih-ink-3: #71717e;
        --aih-brand-soft: #262338;
        --aih-me: #26262c;
    }
    .aih:not(.aih--light) .aih_sk {
        background: linear-gradient(90deg, #26262c 25%, #2e2e36 37%, #26262c 63%);
        background-size: 400% 100%;
    }
    .aih:not(.aih--light) .aih_top { background: rgba(28, 28, 33, .85); }
    .aih:not(.aih--light) .aih_msg-err {
        background: #2a1a1c;
        border-color: #43252a;
    }
    .aih:not(.aih--light) .aih_tip:hover { background: #232030; }
    .aih:not(.aih--light) .aih_inline { color: #ff9ab5; }
    .aih:not(.aih--light) .aih_hello-note--warn { color: #fb923c; }
}

/* ==========================================================================
   AI 写作按钮（module.js 全站注入）
   这一段会出现在**全站每一页**（首页快速发布、发帖页、编辑页），
   所以类名一律 aih_gp / aih_gadget 前缀，绝不碰宿主的选择器。

   按钮本体借用站点的 .ls-action-btn（尺寸、hover、间距都由站点决定），
   这里只补一个「这是 AI」的颜色标识 —— 与站内那排灰色图标区分开。
   ========================================================================== */

.aih_gadget-btn {
    color: #6b5cff !important;
    position: relative;
}
.aih_gadget-btn:hover {
    color: #5646e6 !important;
    background: #f2eeff !important;
}
.aih_gadget-btn .remix-icon { font-size: 17px; }

/* 站点若没有 .ls-action-btn（某些主题），退回到自带样式，保证按钮还看得见 */
.aih_gadget-btn:not(.ls-action-btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    color: #6b5cff;
}

/* ---------------- 面板 ---------------- */

.aih_gp-mask {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: rgba(20, 20, 26, .18);
    animation: aih-gp-fade .14s ease;
}
@keyframes aih-gp-fade { from { opacity: 0; } to { opacity: 1; } }

.aih_gp {
    position: fixed;
    width: 360px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 48px -12px rgba(20, 20, 40, .28), 0 0 0 1px rgba(20, 20, 40, .06);
    padding: 14px;
    font-size: 13px;
    color: #1d1d20;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    box-sizing: border-box;
    animation: aih-gp-pop .16s cubic-bezier(.34, 1.3, .64, 1);
}
/*
 * 入场只动 transform / opacity，绝不动 top。
 *
 * 面板的位置是 place() 用内联 top 算出来的。如果入场动画里也带位移，
 * 两者叠在一起的那几十毫秒里，视觉位置和布局位置对不上 —— 表现为
 * 「插到正文」明明画在屏幕里，命中测试却判它不在视口内，点不着。
 * 动画一结束就删干净（到 to 帧回到 none），不留常驻的 will-change，
 * 否则整块面板一直挂在一个合成层上，里面滚动会发虚。
 */
@keyframes aih-gp-pop {
    from { opacity: 0; transform: translateY(-6px) scale(.98); }
    to { opacity: 1; transform: none; }
}
.aih_gp *, .aih_gp *::before, .aih_gp *::after { box-sizing: border-box; }

.aih_gp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    /* 面板被限高后会内部滚动（配图那屏选中一张就可能高过视口）。
     * 头部得粘住，否则一滚页签和关闭按钮一起走掉 —— 用户滚到结果墙那里
     * 就再也切不回「AI 写作」，也关不掉面板。
     * 背景取面板底色，不然文字会透出下面滚过的内容。 */
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    padding-top: 2px;
    /* 背景往外撑满内边距：面板左右各有 14px padding，头部背景若只覆盖自身宽度，
     * 滚动时两侧会各露出一条透明缝，下面的内容从缝里飘上来。用负 margin + 等量
     * padding 把底色补齐，视觉上没有接缝。 */
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
}
.aih_gp-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}
.aih_gp-title .remix-icon {
    color: #6b5cff;
    font-size: 16px;
}
/* 页签：写作 / 配图。
 * 用「底部一条实心短横」而不是整块高亮 —— 面板里已经有很多带边框的方块
 * （动作格、胶囊、输入框），再放两个实心方块会糊成一片。 */
.aih_gp-tabs {
    display: flex;
    align-items: center;
    gap: 14px;
}
.aih_gp-tab {
    border: 0;
    background: transparent;
    padding: 0 0 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #9a9aa6;
    cursor: pointer;
    position: relative;
    transition: color .14s;
}
.aih_gp-tab:hover { color: #6b6b75; }
.aih_gp-tab.is-on { color: #1d1d20; }
.aih_gp-tab.is-on::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 1px;
    background: #6b5cff;
}

.aih_gp-x {
    border: 0;
    background: transparent;
    color: #8e8e99;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 15px;
    padding: 0;
}
.aih_gp-x:hover { background: #f4f4f7; color: #1d1d20; }

.aih_gp-hint {
    font-size: 12px;
    color: #6b6b75;
    background: #f7f7fa;
    border-radius: 8px;
    padding: 7px 10px;
    margin-bottom: 10px;
}
.aih_gp-hint b { color: #6b5cff; }

.aih_gp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}
.aih_gp-act {
    border: 1px solid #ececf0;
    background: #fff;
    border-radius: 9px;
    padding: 8px 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-family: inherit;
    transition: border-color .14s, background .14s;
}
.aih_gp-act b {
    font-size: 12.5px;
    font-weight: 600;
    color: #1d1d20;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* 「剩 N」标签：只出现在站长给这个动作单独配了额度的按钮上 */
.aih_gp-left {
    font-style: normal;
    font-size: 9.5px;
    font-weight: 500;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 5px;
    background: #f0edff;
    color: #6b5cff;
    transform: scale(.94);
    white-space: nowrap;
}
.aih_gp-left.is-out {
    background: #f3f3f5;
    color: #9b9ba6;
}
.aih_gp-act span {
    font-size: 10.5px;
    color: #8e8e99;
    transform: scale(.94);
}
.aih_gp-act:hover {
    border-color: #cec5ff;
    background: #faf8ff;
}
.aih_gp-act:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.aih_gp-act:disabled:hover { border-color: #ececf0; background: #fff; }

/* 目标字数：只在「生成」时出现的一行 */
.aih_gp-words {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.aih_gp-words-lab {
    font-size: 12px;
    color: #7c7c88;
    flex: 0 0 auto;
}
.aih_gp-words-chips {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.aih_gp-chip {
    height: 26px;
    padding: 0 10px;
    border: 1px solid #ececf0;
    border-radius: 13px;
    background: #fff;
    font-size: 12px;
    font-family: inherit;
    color: #4a4a55;
    cursor: pointer;
    transition: all .12s ease;
}
.aih_gp-chip:hover {
    border-color: #d6cfff;
    color: #5646e6;
}
.aih_gp-chip.is-on {
    background: #6b5cff;
    border-color: #6b5cff;
    color: #fff;
    font-weight: 500;
}
.aih_gp-words-in {
    width: 88px;
    height: 26px;
    border: 1px solid #ececf0;
    border-radius: 13px;
    padding: 0 10px;
    font-size: 12px;
    font-family: inherit;
    color: #1d1d20;
    background: #fafafb;
    outline: none;
}
.aih_gp-words-in:focus {
    border-color: #cec5ff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(107, 92, 255, .1);
}
/* 数字框的上下箭头在这么窄的框里挤，去掉 */
.aih_gp-words-in::-webkit-outer-spin-button,
.aih_gp-words-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.aih_gp-words-in[type=number] { -moz-appearance: textfield; }

.aih_gp-extra { margin-bottom: 10px; }
.aih_gp-input {
    width: 100%;
    height: 34px;
    border: 1px solid #ececf0;
    border-radius: 9px;
    padding: 0 10px;
    font-size: 12.5px;
    font-family: inherit;
    color: #1d1d20;
    outline: none;
    background: #fcfcfd;
}
.aih_gp-input:focus {
    border-color: #cec5ff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(107, 92, 255, .1);
}
.aih_gp-input::placeholder { color: #a8a8b2; }

.aih_gp-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #6b6b75;
    padding: 14px 0;
    justify-content: center;
}
.aih_gp-spin {
    width: 14px;
    height: 14px;
    border: 2px solid #e6e2ff;
    border-top-color: #6b5cff;
    border-radius: 50%;
    animation: aih-gp-rot .7s linear infinite;
}
@keyframes aih-gp-rot { to { transform: rotate(360deg); } }

.aih_gp-result {
    max-height: 220px;
    overflow-y: auto;
    background: #fafafc;
    border: 1px solid #f0f0f4;
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 12.5px;
    line-height: 1.72;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 8px;
}
.aih_gp-result::-webkit-scrollbar { width: 6px; }
.aih_gp-result::-webkit-scrollbar-thumb {
    background: #dcdce2;
    border-radius: 3px;
}

.aih_gp-err {
    color: #e5484d;
    font-size: 12.5px;
    padding: 6px 0;
}

.aih_gp-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.aih_gp-btn {
    height: 30px;
    padding: 0 12px;
    border: 1px solid #ececf0;
    background: #fff;
    border-radius: 8px;
    font-size: 12.5px;
    color: #1d1d20;
    cursor: pointer;
    font-family: inherit;
    transition: background .14s, border-color .14s;
}
.aih_gp-btn:hover { background: #f6f6f9; border-color: #e0e0e6; }
.aih_gp-btn--main {
    background: #6b5cff;
    border-color: #6b5cff;
    color: #fff;
    font-weight: 500;
    flex: 1;
}
.aih_gp-btn--main:hover { background: #5a4bea; border-color: #5a4bea; }
.aih_gp-btn--ghost { color: #6b6b75; }

.aih_gp-foot {
    margin-top: 10px;
    font-size: 11px;
    color: #a8a8b2;
    text-align: center;
}

/* 额度提示（v1.9.5）：写作/生图各剩几次，画在脚注上方一行 */
.aih_gp-quota {
    margin-top: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(107, 91, 255, .07);
    color: #6b5bff;
    font-size: 11.5px;
    line-height: 1.5;
    text-align: center;
    letter-spacing: .2px;
}
.aih_gp-quota.is-out {
    background: rgba(245, 158, 11, .1);
    color: #b45309;
}

/* ================================ 配图页签 ================================ */

.aih_md-sec { margin-bottom: 12px; }
.aih_md-lab {
    font-size: 11.5px;
    font-weight: 600;
    color: #8e8e99;
    letter-spacing: .3px;
    margin-bottom: 6px;
}
.aih_md-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
/* 输入框复用的是写作那边的 .aih_gp-input，这里只补「和按钮并排时」的宽度 */
.aih_md-row .aih_gp-input { flex: 1; min-width: 0; }
.aih_md-go {
    flex: 0 0 auto;
    height: auto;
    min-width: 48px;
}
.aih_md-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 7px;
}
.aih_md-chips-lab {
    font-size: 11.5px;
    color: #a0a0ab;
    flex: 0 0 24px;
}
.aih_md-chips .aih_gp-words-chips { flex: 1; flex-wrap: wrap; }

.aih_md-off {
    font-size: 12px;
    color: #8a6d1f;
    background: #fffbeb;
    border: 1px solid #fdf0c8;
    border-radius: 8px;
    padding: 8px 10px;
    line-height: 1.65;
}

/* 结果墙：三列，正方形裁切。
 * 用 object-fit:cover 而不是 contain —— 搜来的图长宽比五花八门，contain
 * 会在格子里留出大片白，一墙看下去全是「补丁」。cover 统一裁成方块，
 * 用户点进去看的是原图，不会因为这一眼裁掉了边角而误判。 */
.aih_md-wall {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-top: 8px;
    /*
     * 高度按「整行」算，不拍一个数。
     *
     * 原来写死 216px：三列各 123px、格间 5px，一行 128px —— 216 只装得下
     * 1.7 行，第二行被切掉大半截，看上去像「明明搜到 12 张却只有 3 张」。
     *
     * 行高不写死，让 .aih_md-cell 的 aspect-ratio 自己撑。上限给「整行」：
     * 桌面档一格 123px + 缝 5px ≈ 128px 一行，所以取 384px（3 行 379 + 余量）。
     *
     * 为什么不是 2 行（256）：选中一张之后下面要露出预览大图 + 插到正文那一排，
     * 面板整块会超视口。但那张预览大图其实没什么信息量 —— 点中的格子上早就有
     * 描边、用户知道自己选了哪张。所以宁可把预览压矮（见 .aih_md-preview），
     * 也要把位置让给结果墙：搜一次 12 张，能一眼看全就别让人滚。
     *
     * 手机上三列只剩 2 列、格更宽，由下面的手机档单独覆盖这个值。
     */
    max-height: 384px;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* 内容不足两行时别把格子拉高：grid 默认 stretch 会让 1 张图铺满整墙 */
    align-content: start;
}
.aih_md-wall::-webkit-scrollbar { width: 6px; }
.aih_md-wall::-webkit-scrollbar-thumb { background: #dcdce2; border-radius: 3px; }
.aih_md-cell {
    position: relative;
    border: 0;
    padding: 0;
    background: #f2f2f6;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    line-height: 0;
}
.aih_md-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* 缩略图挂掉的格子：淡淡一道斜纹，尺寸跟正常格子一样，网格不塌 */
.aih_md-cell--dead {
    cursor: default;
    background:
        repeating-linear-gradient(45deg, #ececf1 0 6px, #f5f5f8 6px 12px);
}
.aih_md-cell--dead::before {
    content: "图看不了";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #b3b3bd;
}
/* 选中用内描边，不用外发光：格子之间只隔 5px，外扩的阴影会糊到邻居身上 */
.aih_md-cell.is-on::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid #6b5cff;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9);
}
.aih_md-tag {
    position: absolute;
    left: 4px;
    bottom: 4px;
    font-size: 10px;
    font-style: normal;
    line-height: 1;
    padding: 3px 4px;
    border-radius: 4px;
    background: rgba(20, 20, 30, .62);
    color: #fff;
}
.aih_md-empty {
    font-size: 12px;
    color: #8e8e99;
    padding: 14px 6px;
    text-align: center;
    line-height: 1.7;
}

.aih_md-pick {
    border-top: 1px solid #f0f0f4;
    padding-top: 10px;
    margin-top: 4px;
}
.aih_md-preview {
    background: #f7f7fa;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    /* 92px 是「看得出构图」的下限：再矮就只剩一条色带，等于没预览。
     * 这里让位给上面的结果墙 —— 12 张缩略图看全，比一张大图更能帮人做决定 */
    max-height: 92px;
    display: grid;
    place-items: center;
}
.aih_md-preview img {
    max-width: 100%;
    max-height: 92px;
    display: block;
    object-fit: contain;
}
.aih_md-pickbar { display: flex; gap: 6px; }
.aih_md-pickbar .aih_gp-btn--main { flex: 1; }

.aih_md-loading {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: #6b5cff;
    background: #f5f3ff;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 10px;
}

/* 隐藏态必须显式盖掉，否则 .aih_md-loading 的 display:flex 会赢。
 *
 * 两个坑叠在一起：
 *   一、浏览器内置的 hidden 属性样式优先级低于类选择器，光写 hidden 不管用；
 *   二、写成 .aih_md-loading[hidden] 也要**排在本规则后面** —— 同优先级下后来者胜。
 *
 * 第一版两条都没绕开：规则写对了但位置在前，于是隐藏时仍占着 16px 的 padding，
 * 屏幕上是一条空的紫粉色横杠。这里加 !important 断掉「谁在后谁赢」这个脆弱前提。
 *
 * 注意：这段注释里绝对不能出现「星号+斜杠」连写 —— 注释会当场结束，
 * 后面整块样式连同文件剩余部分一起变成垃圾字符，浏览器静默丢弃。踩过一次。
 */
.aih_md-loading[hidden] { display: none !important; }

/* 「已切到 xxx」：用琥珀色，比正文轻、比灰字重，一眼能看到但不抢戏。
   虚线下划提示可以悬停看原因（为什么切了）。 */
.aih_gp-foot .aih_fb {
    color: #c98a16;
    border-bottom: 1px dashed currentColor;
    cursor: help;
}

@media (max-width: 520px) {
    .aih_gp {
        left: 12px !important;
        right: 12px;
        width: auto;
        max-width: none;
        /* 手机上必须限高：标题 + 7 个动作 + 字数条 + 输入框 + 结果 + 按钮全摊开
         * 会超出屏幕底部，操作按钮被挤出视口 —— 用户生成完发现点不到「替换正文」。
         * 限高之后整体滚动，按钮始终在触手可及的范围内。 */
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .aih_gp-grid { grid-template-columns: repeat(3, 1fr); }
    /* 窄屏上结果区别再占 220px，留 160 给按钮 */
    .aih_gp-result { max-height: 160px; }
    /* 配图：手机上结果墙给 2 列。
     * 3 列在 390px 宽的屏上每格只有 110px，图看不太清，点起来也容易点偏。
     *
     * 高度只给**一行半**：2 列时每格约 180px，两整行就是 365px，加上上面
     * 生图区、下面预览和按钮，整块必然超屏。留一行半既让人看出「还有更多、
     * 可以滚」，又不把按钮挤出屏幕。 */
    .aih_md-wall { grid-template-columns: repeat(2, 1fr); max-height: 268px; }
    .aih_md-preview, .aih_md-preview img { max-height: 84px; }
}

/* 手机端那颗按钮：跟在左格那排图标末尾，借用站点自己的 .ls-pw-tool-btn / .ls-ma-tool-btn。
 * 图标大小跟着站点走，只把颜色换成紫色，让它一眼认出是 AI 而不是又一个插入按钮。 */
.aih_gadget-btn--mb {
    color: #7c5cf0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.aih_gadget-btn--mb i {
    font-size: 20px;
    line-height: 1;
}
.aih_gadget-btn--mb:active { opacity: .6; }

/* ==========================================================================
 * 手机壳（mbshell.js）
 *
 * 与电脑壳同前缀不同命名空间：电脑壳是 .aih_*，手机壳是 .aihm*。
 * 两套 CSS 同在一个文件里，宿主只加载一份，省一次请求。
 * ========================================================================== */

/* ==========================================================================
   拾光 AI 中枢 —— 手机端
   类名一律 aihm 前缀，绝不碰宿主的样式。
   整页三段式：固定页头 / 可滚动消息区 / 底部输入条（吸底，避开安全区）。
   ========================================================================== */

.aihm {
    --aihm-bg: #f7f7fa;
    --aihm-card: #fff;
    --aihm-line: #ececf2;
    --aihm-text: #1b1c22;
    --aihm-sub: #8b8d99;
    --aihm-brand: #6b5cff;
    --aihm-brand-soft: #f0edff;
    --aihm-h: 100%;

    position: relative;
    display: flex;
    flex-direction: column;
    height: var(--aihm-h);
    min-height: 0;
    background: var(--aihm-bg);
    color: var(--aihm-text);
    font-size: 15px;
    -webkit-tap-highlight-color: transparent;
}

@media (prefers-color-scheme: dark) {
    .aihm {
        --aihm-bg: #131418;
        --aihm-card: #1c1d23;
        --aihm-line: #2a2c34;
        --aihm-text: #e8e9ee;
        --aihm-sub: #8b8d99;
        --aihm-brand-soft: #241f45;
    }
}

/* ---------------------------------------------------------------- 页头 */

.aihm-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 8px;
    background: var(--aihm-card);
    border-bottom: 1px solid var(--aihm-line);
    position: relative;
    z-index: 3;
}

.aihm-head-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--aihm-text);
    font-size: 19px;
    border-radius: 10px;
    cursor: pointer;
}
.aihm-head-btn:active { background: var(--aihm-brand-soft); }

.aihm-head-mid {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.25;
}
.aihm-head-title {
    font-size: 15px;
    font-weight: 600;
}
.aihm-head-sub {
    font-size: 11px;
    color: var(--aihm-sub);
}

/* ---------------------------------------------------------------- 消息区 */

.aihm-msgs {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 12px 18px;
    scroll-behavior: smooth;
}

.aihm-msg {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    align-items: flex-start;
}

.aihm-msg.is-user {
    justify-content: flex-end;
}

.aihm-bubble {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 16px;
    line-height: 1.6;
    word-break: break-word;
    white-space: normal;
}

.aihm-msg.is-user .aihm-bubble {
    background: var(--aihm-brand);
    color: #fff;
    border-bottom-right-radius: 5px;
}

.aihm-msg.is-ai .aihm-bubble {
    background: var(--aihm-card);
    border: 1px solid var(--aihm-line);
    border-bottom-left-radius: 5px;
}

.aihm-avatar {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7b6cff, #a78bfa);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

/* 气泡里的富文本 */
.aihm-bubble p { margin: 0 0 8px; }
.aihm-bubble p:last-child { margin-bottom: 0; }
.aihm-bubble h3, .aihm-bubble h4 {
    margin: 10px 0 6px;
    font-size: 15px;
    font-weight: 600;
}
.aihm-bubble ul { margin: 6px 0; padding-left: 20px; }
.aihm-bubble li { margin: 3px 0; }
.aihm-bubble blockquote {
    margin: 8px 0;
    padding: 6px 10px;
    border-left: 3px solid var(--aihm-brand);
    background: var(--aihm-brand-soft);
    border-radius: 0 8px 8px 0;
    color: var(--aihm-sub);
}
.aihm-inline {
    background: rgba(107, 92, 255, .1);
    padding: 1px 5px;
    border-radius: 5px;
    font-size: .92em;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.aihm-code {
    margin: 8px 0;
    padding: 10px 12px;
    background: #1e1f26;
    color: #e6e6ef;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.55;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* 打字光标 */
.aihm-caret {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--aihm-brand);
    vertical-align: -2px;
    margin-left: 2px;
    animation: aihm-blink .9s steps(2) infinite;
}
@keyframes aihm-blink { 50% { opacity: 0; } }

.aihm-msg-err {
    margin-top: 8px;
    padding: 8px 10px;
    background: #fff2f2;
    border: 1px solid #ffd4d4;
    border-radius: 9px;
    color: #c0392b;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.aihm-msg-err button {
    flex: 0 0 auto;
    border: 0;
    background: #c0392b;
    color: #fff;
    border-radius: 7px;
    padding: 5px 11px;
    font-size: 12.5px;
}

/* ---------------------------------------------------------------- 空态 */

.aihm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 44px 20px 20px;
    text-align: center;
}
.aihm-empty-ico {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7b6cff, #a78bfa);
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.aihm-empty h2 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 20px;
    line-height: 1.5;
}
.aihm-sugs {
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: 100%;
    max-width: 340px;
}
.aihm-sug {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    background: var(--aihm-card);
    border: 1px solid var(--aihm-line);
    border-radius: 12px;
    color: var(--aihm-text);
    font-size: 14px;
    line-height: 1.4;
}
.aihm-sug:active { background: var(--aihm-brand-soft); }

/* ---------------------------------------------------------------- 输入条 */

.aihm-composer {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 10px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--aihm-card);
    border-top: 1px solid var(--aihm-line);
    /* 剩余次数要能当这一行的第一行，所以允许换行 */
    flex-wrap: wrap;
}

/*
 * 剩余次数。手机屏幕上一行值钱，所以只在不限量时才藏、有数字时才出现。
 * 用 order 把它顶到输入框上方，而不用绝对定位 —— 绝对定位会盖住输入框。
 */
.aihm-quota {
    order: -1;
    flex: 1 0 100%;
    text-align: center;
    font-size: 11.5px;
    color: var(--aihm-sub);
    line-height: 1.5;
    padding-bottom: 2px;
}
.aihm-quota.is-out { color: #c0392b; }
.aihm-quota[hidden] { display: none !important; }

/* ---------------- 人设 / 模型切换 ---------------- */

.aihm-picks {
    order: -2;
    flex: 1 0 100%;
    display: flex;
    gap: 6px;
    padding-bottom: 4px;
}
.aihm-picks[hidden] { display: none !important; }

.aihm-pick {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 6px 0 7px;
    border: 1px solid var(--aihm-line);
    border-radius: 8px;
    background: var(--aihm-bg);
    color: var(--aihm-sub);
    font-size: 12px;
    overflow: hidden;
}
.aihm-pick .remix-icon,
.aihm-pick i[class^="ri-"] { font-size: 13px; flex: 0 0 auto; opacity: .75; }
.aihm-pick select {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 12px;
    color: var(--aihm-text);
    /* 原生下拉箭头太宽，手机上会把文字挤没 */
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2px;
}

/* ---------------- 抽屉搜索 / 工具行 ---------------- */

.aihm-search {
    flex: 0 0 auto;
    margin: 0 12px 8px;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border: 1px solid var(--aihm-line);
    border-radius: 9px;
    background: var(--aihm-card);
}
.aihm-search i[class^="ri-"] { font-size: 14px; color: var(--aihm-sub); flex: 0 0 auto; }
.aihm-search-in {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--aihm-text);
    -webkit-appearance: none;
    appearance: none;
}
.aihm-search-in::-webkit-search-decoration,
.aihm-search-in::-webkit-search-cancel-button { -webkit-appearance: none; }
.aihm-search-clr {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    border-radius: 50%;
    background: var(--aihm-line);
    color: var(--aihm-sub);
    font-size: 12px;
}
.aihm-search-clr[hidden] { display: none !important; }

.aihm-mark {
    background: rgba(107, 92, 255, .18);
    color: inherit;
    border-radius: 3px;
    padding: 0 1px;
}

.aihm-drawer-tools {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    border-top: 1px solid var(--aihm-line);
    flex-wrap: wrap;
}
.aihm-tool {
    flex: 1 1 0;
    min-width: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 32px;
    padding: 0 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--aihm-sub);
    font-size: 12.5px;
    text-decoration: none;
}
.aihm-tool:active { background: var(--aihm-brand-soft); color: var(--aihm-brand); }
.aihm-tool i[class^="ri-"] { font-size: 14px; }
.aihm-tool-n {
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--aihm-brand);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    line-height: 15px;
    text-align: center;
}
.aihm-tool-n[hidden] { display: none !important; }

/* ---------------- 底部弹层（存稿 / 诊断） ---------------- */

.aihm-sheet { position: fixed; inset: 0; z-index: 90; }
.aihm-sheet[hidden] { display: none !important; }
.aihm-sheet-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .42);
    animation: aihm-fade .18s ease;
}
@keyframes aihm-fade { from { opacity: 0; } to { opacity: 1; } }

.aihm-sheet-box {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    background: var(--aihm-card);
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: aihm-up .24s cubic-bezier(.32, .72, 0, 1);
}
@keyframes aihm-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.aihm-sheet-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--aihm-line);
}
.aihm-sheet-head b { font-size: 15px; color: var(--aihm-text); margin-right: auto; }
.aihm-sheet-x {
    border: 0;
    background: transparent;
    color: var(--aihm-sub);
    font-size: 12.5px;
    padding: 4px 8px;
    border-radius: 7px;
}
.aihm-sheet-x:active { background: var(--aihm-line); }

.aihm-drafts-body,
.aihm-diag-tabs + .aihm-drafts-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
}

.aihm-drafts-empty {
    padding: 22px 4px;
    text-align: center;
    color: var(--aihm-sub);
    font-size: 12.5px;
    line-height: 1.7;
}

.aihm-draft {
    border: 1px solid var(--aihm-line);
    border-radius: 11px;
    padding: 9px 11px;
    margin-bottom: 8px;
}
.aihm-draft-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}
.aihm-draft-top span { flex: 1; font-size: 11.5px; color: var(--aihm-sub); }
.aihm-draft-top button {
    border: 0;
    background: var(--aihm-brand-soft);
    color: var(--aihm-brand);
    font-size: 12px;
    padding: 4px 9px;
    border-radius: 7px;
}
.aihm-draft-del {
    background: transparent !important;
    color: var(--aihm-sub) !important;
    width: 24px;
    height: 24px;
    padding: 0 !important;
    display: grid;
    place-items: center;
}
.aihm-draft-text {
    font-size: 13px;
    color: var(--aihm-text);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    opacity: .86;
}

/* ---------------- 诊断页签与条目 ---------------- */

.aihm-diag-tabs {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
    padding: 8px 14px 0;
}
.aihm-diag-tab {
    flex: 1 1 0;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--aihm-sub);
    font-size: 12.5px;
}
.aihm-diag-tab.is-on { background: var(--aihm-brand-soft); color: var(--aihm-brand); }

.aihm-diag-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--aihm-line);
}
.aihm-diag-row.is-bad { background: rgba(229, 72, 77, .04); }
.aihm-diag-t { font-size: 11px; color: var(--aihm-sub); }
.aihm-diag-m { font-size: 12.5px; color: var(--aihm-text); margin-top: 2px; word-break: break-word; }
.aihm-diag-sep { margin: 0 5px; color: var(--aihm-sub); }
.aihm-diag-e {
    margin-top: 4px;
    font-size: 11.5px;
    color: #c0392b;
    line-height: 1.55;
    word-break: break-word;
}

.aihm-mtest {
    border: 1px solid var(--aihm-line);
    border-radius: 11px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.aihm-mtest-top { display: flex; align-items: center; gap: 8px; }
.aihm-mtest-top b { flex: 1; font-size: 13.5px; color: var(--aihm-text); }
.aihm-ok { font-size: 11.5px; color: #1a7f37; }
.aihm-bad { font-size: 11.5px; color: #c0392b; }
.aihm-mtest-mono {
    font-size: 11.5px;
    color: var(--aihm-sub);
    font-family: ui-monospace, Menlo, Consolas, monospace;
    margin-top: 2px;
    word-break: break-all;
}
.aihm-mtest-res {
    margin-top: 6px;
    font-size: 12px;
    color: var(--aihm-sub);
    line-height: 1.55;
    word-break: break-word;
}
.aihm-mtest-res.is-ok { color: #1a7f37; }
.aihm-mtest-res.is-bad { color: #c0392b; }
.aihm-mtest-btn {
    margin-top: 8px;
    width: 100%;
    height: 32px;
    border: 1px solid var(--aihm-line);
    border-radius: 9px;
    background: transparent;
    color: var(--aihm-text);
    font-size: 12.5px;
}
.aihm-mtest-btn:active { background: var(--aihm-line); }
.aihm-mtest-btn[disabled] { opacity: .6; }


/* 每轮的账。手机上比电脑更小一号，别抢走正文的行数。 */
.aihm-msg-stat {
    margin-top: 5px;
    font-size: 10.5px;
    line-height: 1.4;
    color: var(--aihm-sub);
    font-variant-numeric: tabular-nums;
}

.aihm-input {
    flex: 1 1 auto;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 14px;
    border: 1px solid var(--aihm-line);
    border-radius: 20px;
    background: var(--aihm-bg);
    color: var(--aihm-text);
    font-size: 15px;
    line-height: 1.45;
    resize: none;
    outline: none;
    font-family: inherit;
}
.aihm-input:focus {
    border-color: var(--aihm-brand);
    background: var(--aihm-card);
}

.aihm-send {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--aihm-brand);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
}
.aihm-send:disabled { opacity: .35; }
.aihm-send:active:not(:disabled) { transform: scale(.94); }
.aihm-stop {
    background: #e05b5b;
    font-size: 13px;
}

/* ---------------------------------------------------------------- 登录拦截 */

/*
 * hidden 属性必须能压住 display:flex —— 否则「已经登录」也会一直显示登录引导。
 * 这是 HTML 层面的通用坑：display 是作者样式，优先级高于 UA 给 hidden 的那条
 * 隐藏规则（浏览器内置，选择器权重最低）。
 */
.aihm [hidden],
.aihm-gate[hidden],
.aihm-send[hidden] {
    display: none !important;
}

.aihm-gate {
    position: absolute;
    inset: 52px 0 0 0;
    background: var(--aihm-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
}
.aihm-gate-box { text-align: center; padding: 0 28px; }
.aihm-gate-ico { font-size: 40px; margin-bottom: 12px; }
.aihm-gate-box h3 { font-size: 17px; margin: 0 0 8px; }
.aihm-gate-box p { color: var(--aihm-sub); font-size: 14px; margin: 0 0 20px; }

.aihm-btn {
    display: inline-block;
    padding: 11px 26px;
    border: 0;
    border-radius: 22px;
    background: var(--aihm-brand);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}

/* ---------------------------------------------------------------- 抽屉 */

.aihm-drawer {
    position: absolute;
    inset: 0;
    z-index: 9;
    pointer-events: none;
    visibility: hidden;
}
.aihm.is-drawer .aihm-drawer {
    pointer-events: auto;
    visibility: visible;
}

.aihm-drawer-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .38);
    opacity: 0;
    transition: opacity .22s;
}
.aihm.is-drawer .aihm-drawer-mask { opacity: 1; }

.aihm-drawer-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 78%;
    max-width: 300px;
    background: var(--aihm-card);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .24s cubic-bezier(.22, .8, .3, 1);
    box-shadow: 2px 0 16px rgba(0, 0, 0, .1);
}
.aihm.is-drawer .aihm-drawer-panel { transform: translateX(0); }

.aihm-drawer-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 10px;
    font-size: 15px;
    font-weight: 600;
}
.aihm-drawer-head button {
    border: 0;
    background: transparent;
    font-size: 22px;
    color: var(--aihm-sub);
    line-height: 1;
    padding: 0 4px;
}

.aihm-new {
    flex: 0 0 auto;
    margin: 4px 12px 10px;
    padding: 11px;
    border: 1px dashed var(--aihm-brand);
    border-radius: 11px;
    background: var(--aihm-brand-soft);
    color: var(--aihm-brand);
    font-size: 14px;
    font-weight: 500;
}

.aihm-sess {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 10px;
    -webkit-overflow-scrolling: touch;
}
.aihm-sess-empty {
    padding: 26px 0;
    text-align: center;
    color: var(--aihm-sub);
    font-size: 13px;
}
.aihm-sess-item {
    /* 一行四个孩子：图标、标题（吃掉剩余宽度）、改名、删除。
       早先这里是 block，四个孩子各占一行 —— 抽屉里一条会话高 150px，
       一屏只看得见四条，翻起来像在翻通讯录。 */
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    padding: 11px 8px 11px 12px;
    margin-bottom: 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--aihm-text);
    font-size: 14px;
    line-height: 1.4;
}

/* 标题是唯一允许压缩的那一栏，其余按内容固定 */
.aihm-sess-t {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aihm-sess-item > i {
    flex: 0 0 auto;
    color: var(--aihm-sub);
    font-size: 15px;
}

.aihm-sess-item .aihm-sess-del {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--aihm-sub);
    font-size: 15px;
    /* 手机上删除按钮就在手指边上，给个明显一点的反馈区 */
    cursor: pointer;
}

.aihm-sess-item .aihm-sess-del:active {
    background: rgba(0, 0, 0, .07);
}

.aihm-sess-item.is-on {
    background: var(--aihm-brand-soft);
    color: var(--aihm-brand);
    font-weight: 500;
}

.aihm-drawer-foot {
    flex: 0 0 auto;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--aihm-line);
    font-size: 13px;
    color: var(--aihm-sub);
}
.aihm-me { font-weight: 500; color: var(--aihm-text); }

/* ---------------------------------------------------------------- 载入 / 错误 */

.aihm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    gap: 14px;
    color: #8b8d99;
    font-size: 14px;
}
.aihm-spin {
    width: 26px;
    height: 26px;
    border: 2.5px solid #e6e2ff;
    border-top-color: #6b5cff;
    border-radius: 50%;
    animation: aihm-rot .8s linear infinite;
}
@keyframes aihm-rot { to { transform: rotate(360deg); } }

.aihm-err {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 70vh;
    padding: 0 30px;
    text-align: center;
}
.aihm-err-ico {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff2f2;
    color: #c0392b;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.aihm-err h3 { font-size: 16px; margin: 0 0 8px; }
.aihm-err p { color: #8b8d99; font-size: 13.5px; margin: 0 0 20px; }

/* ---------------------------------------------------- 手机壳在真实页面里的定位 */

/*
 * 手机壳挂在站点内容区里，视口高度得自己撑：宿主给了 fixed 页头和底部导航，
 * 用 100dvh 减去它们不现实（站点头部高度会变），改成用 JS 写死 --aihm-h。
 * 这里只兜底：没有 JS 值时按视口八成算，至少不会塌成一条线。
 */
body.aih-mb-on .aihm {
    --aihm-h: var(--aih-mb-h, calc(100dvh - 120px));
}

/* 手机壳自己滚，外层别跟着滚 —— 否则底部输入条会被浏览器地址栏遮住 */
body.aih-mb-on {
    overflow: hidden;
}

body.aih-mb-on .ls-page-body,
html.aih-mb-html body {
    padding-bottom: 0 !important;
}

/* 小屏上电脑壳的骨架（如果先画出来了）不该占位 */
body.aih-mb-on .aih {
    display: none !important;
}

/* 会话项里的删除按钮：平时淡，按下去才明显 */
.aihm-sess-del {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--aihm-sub);
    border-radius: 8px;
    cursor: pointer;
    opacity: .55;
}

.aihm-sess-del:active {
    opacity: 1;
    background: rgba(255, 92, 92, .12);
    color: #e5484d;

}

/* 重命名按钮和删除长得一样，只是按下去不变红 —— 它不是破坏性操作 */
.aihm-sess-del[data-ren-session]:active {
    background: rgba(0, 0, 0, .06);
    color: var(--aihm-text);
}

/* 手机壳自己的错误页（后端挂了 / 取数失败） */
.aihm-err {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    text-align: center;
    color: #1b1c22;
}

.aihm-err h3 {
    margin: 0;
    font-size: 17px;
}

.aihm-err p {
    margin: 0;
    color: #8b8d99;
    font-size: 14px;
    line-height: 1.6;
}

.aihm-empty-tip {
    margin: 6px 0 0;
    color: #8b8d99;
    font-size: 14px;
}

/* -------------------------------------------------------------------------
 * 手机壳铺满视口
 *
 * 不能靠 flex / 100% 撑：手机壳挂在 body 下，body 里还有站点自己的 fixed 页头、
 * 底部 tab、广告浮钮、迷你音乐条，那些东西一起参与布局会把高度算歪（实测只剩 269px）。
 * 也不适合直接写 top/bottom:0 全屏 —— 那样会盖住站点的底部 tab，用户回不去别的页。
 *
 * 所以取中间态：固定定位，从视口顶到底部 tab 之上；高度由 JS 每 180ms 校正一次。
 * 断点与模块里的视口判定保持一致（这里只管样式，判定在 JS）。
 * ---------------------------------------------------------------------- */

body.aih-mb-on .aihm {
    position: fixed;
    top: var(--aihm-top, 0px);
    left: 0;
    right: 0;
    bottom: var(--aihm-bottom, 0px);
    z-index: 30;
    height: auto;
    min-height: 0;
    /* 让底部输入条避开刘海屏与浏览器工具栏 */
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* 站点自己的悬浮件压到手机壳下面：广告浮钮、迷你音乐条、回到顶部之类 */
body.aih-mb-on .ads-fab,
body.aih-mb-on .ls-mini-music,
body.aih-mb-on [class*="back-top"],
body.aih-mb-on [class*="go-top"] {
    z-index: 20;
}

/* 输入条永远在最上层，别被任何悬浮件挡操作 */
body.aih-mb-on .aihm-composer {
    position: relative;
    z-index: 32;
}

/* 手机壳里不再需要站点给 body 留的顶部空隙 */
body.aih-mb-on {
    padding-top: 0 !important;
}

/* ============================ 诊断抽屉（管理员） ============================ */

.aih_side-diag {
    display: flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: var(--aih-ink-3);
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
}
.aih_side-diag:hover { background: var(--aih-me); color: var(--aih-ink); }
.aih_side-diag[hidden] { display: none !important; }
/* 存稿按钮不需要管理员，所以它不带 hidden，但 `[hidden]` 那条规则要能盖住它 */
.aih_side-row2 .aih_side-diag { width: auto; justify-content: center; }

.aih_diag[hidden] { display: none !important; }
.aih_diag {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.aih_diag-mask {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 24, .34);
}
.aih_diag-box {
    position: relative;
    width: min(920px, 100%);
    max-height: min(78vh, 720px);
    background: var(--aih-panel);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.aih_diag-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 12px 18px;
    border-bottom: 1px solid var(--aih-line);
}
.aih_diag-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.aih_diag-act { display: flex; align-items: center; gap: 6px; }
.aih_diag-body {
    overflow: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}
.aih_diag-empty {
    padding: 36px 20px;
    text-align: center;
    color: var(--aih-ink-3);
    font-size: 13px;
    line-height: 1.7;
}
.aih_diag-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.aih_diag-tbl th {
    position: sticky;
    top: 0;
    background: var(--aih-panel);
    text-align: left;
    font-weight: 500;
    color: var(--aih-ink-3);
    font-size: 11.5px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--aih-line);
    white-space: nowrap;
}
.aih_diag-tbl td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--aih-line);
    vertical-align: top;
    color: var(--aih-ink-2);
}
.aih_diag-tbl tbody tr:hover { background: #fafafd; }
.aih_diag-tbl .num { text-align: right; white-space: nowrap; }
.aih_diag-tbl .mono {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--aih-ink-3);
}
.aih_diag-tbl .q {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aih_diag-tbl .res { white-space: nowrap; }
.aih_diag-ok { color: #2f9e44; }
.aih_diag-bad { color: var(--aih-danger); }
.aih_diag-wait { color: var(--aih-ink-3); }
.aih_diag-tbl .act { text-align: right; white-space: nowrap; }
/* 模型那张表的「结果」列要能放下一句中文，别被 nowrap 挤成一条 */
.aih_diag-tbl--model .res { white-space: normal; max-width: 240px; }
.aih_diag-hint {
    padding: 10px 12px 2px;
    font-size: 12px;
    color: var(--aih-ink-3);
}
.aih_diag-tbl tr.is-errrow td {
    padding-top: 0;
    background: #fdf4f4;
}
.aih_diag-tbl tr.is-errrow code {
    display: block;
    font-size: 11.5px;
    line-height: 1.6;
    color: #a33;
    white-space: pre-wrap;
    word-break: break-all;
    user-select: text;
}

@media (max-width: 720px) {
    .aih_diag { padding: 0; align-items: flex-end; }
    .aih_diag-box {
        width: 100%;
        max-height: 86vh;
        border-radius: 16px 16px 0 0;
    }
    .aih_diag-tbl .q { max-width: 130px; }
}

/* ================================================================
   手机壳：页签 + 写作面板
   ================================================================ */

.aihm-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    background: var(--aihm-bg, #fff);
}

.aihm-tab {
    flex: 0 0 auto;
    padding: 8px 16px 10px;
    border: 0;
    background: none;
    font-size: 14px;
    color: #8a8a95;
    cursor: pointer;
    position: relative;
}

.aihm-tab.is-on {
    color: #3d3d46;
    font-weight: 600;
}

/* 选中态那条短横线：只贴着字的宽度，不要拉满，拉满像导航栏 */
.aihm-tab.is-on::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 20px;
    height: 3px;
    margin-left: -10px;
    border-radius: 3px 3px 0 0;
    background: #6d5bd0;
}

.aihm-write {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
}

.aihm-w-src {
    position: relative;
    background: #f6f6f8;
    border-radius: 12px;
    padding: 10px 12px 26px;
}

.aihm-w-text {
    width: 100%;
    min-height: 120px;
    max-height: 42vh;
    border: 0;
    outline: none;
    resize: none;
    background: transparent;
    font-size: 15px;
    line-height: 1.7;
    color: #2f2f36;
    font-family: inherit;
}

.aihm-w-count {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 11px;
    color: #a0a0ac;
}

.aihm-w-count.is-over { color: #d9534f; }

.aihm-w-extra {
    width: 100%;
    margin-top: 10px;
    padding: 11px 12px;
    border: 1px solid #e6e6ec;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.aihm-w-extra:focus { border-color: #b9aef0; }

.aihm-w-acts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.aihm-w-act {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 12px;
    border: 1px solid #ececf1;
    border-radius: 12px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.aihm-w-act b {
    font-size: 14px;
    font-weight: 600;
    color: #3d3d46;
}

.aihm-w-act span {
    font-size: 11.5px;
    color: #9a9aa6;
    line-height: 1.45;
}

.aihm-w-act:disabled { opacity: .45; cursor: not-allowed; }

.aihm-w-act:not(:disabled):active {
    background: #f4f2ff;
    border-color: #cfc6f5;
}

.aihm-w-tip {
    grid-column: 1 / -1;
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: #9a9aa6;
}

.aihm-w-out { margin-top: 14px; }

.aihm-w-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    font-size: 13px;
    color: #8a8a95;
}

.aihm-w-result {
    padding: 13px 14px;
    border-radius: 12px;
    background: #f7f6ff;
    border: 1px solid #e7e3fb;
    font-size: 15px;
    line-height: 1.75;
    color: #2f2f36;
    white-space: pre-wrap;
    word-break: break-word;
    /* 复制失败时用户要能手选，所以别禁选 */
    user-select: text;
}

.aihm-w-bar {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.aihm-w-btn {
    flex: 1 1 auto;
    padding: 10px 12px;
    border: 1px solid #e6e6ec;
    border-radius: 10px;
    background: #fff;
    font-size: 13.5px;
    color: #4a4a54;
    cursor: pointer;
    font-family: inherit;
}

.aihm-w-btn--main {
    flex: 1.4 1 auto;
    background: #6d5bd0;
    border-color: #6d5bd0;
    color: #fff;
    font-weight: 600;
}

.aihm-w-btn--ghost { flex: 0 0 auto; color: #8a8a95; }

.aihm-w-foot {
    margin-top: 8px;
    font-size: 11px;
    color: #a8a8b2;
    text-align: center;
}

/* 极轻的浮动提示：不挡内容、不打断操作 */
.aihm-toast {
    position: fixed;
    left: 50%;
    bottom: calc(84px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    max-width: 78vw;
    padding: 9px 15px;
    border-radius: 20px;
    background: rgba(38, 38, 44, .9);
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    z-index: 100200;
    animation: aihm-toast-in .18s ease-out;
}

@keyframes aihm-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* `hidden` 属性会被上面的 display 规则盖掉（CSS 优先级高于属性），
   写作面板和消息区都靠它切换，所以显式压一条。别删。 */
.aihm-write[hidden],
.aihm-msgs[hidden],
.aihm-composer[hidden] {
    display: none !important;
}

/* 诊断面板的「对话 / 写作」切换 */
.aih_diag-tabs {
    display: flex;
    gap: 6px;
    padding: 0 18px 12px;
    border-bottom: 1px solid #eeeef3;
}

.aih_diag-tab {
    padding: 6px 14px;
    border: 1px solid #e6e6ec;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    color: #6b6b76;
    cursor: pointer;
}

.aih_diag-tab.is-on {
    background: #f1eefd;
    border-color: #cfc6f5;
    color: #5b48c8;
    font-weight: 600;
}

/* ================================================================
 * 手机壳的配图页（mbshell.js 的 aihm-media 面板）。
 *
 * 类名独立成 aihm-md-*，不跟电脑端的 aihm_md / aih_md 混 —— 两边布局
 * 思路不同：手机是单列上下排，电脑是悬浮面板里的紧凑网格。共享样式
 * 以后一旦挪动，另一端跟着塌，宁可各写各的。
 * ================================================================ */
.aihm-media {
    padding: 12px 14px 90px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.aihm-md-sec {
    margin-bottom: 14px;
}
.aihm-md-lab {
    font-size: 12px;
    color: #8a8a96;
    margin-bottom: 6px;
}
.aihm-md-row {
    display: flex;
    gap: 8px;
}
.aihm-md-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #ddd8f0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
    background: #fff;
}
.aihm-md-input:focus {
    outline: none;
    border-color: #a08cf0;
}
.aihm-md-btn {
    border: 1px solid #ddd8f0;
    background: #fff;
    color: #444;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 15px;
    white-space: nowrap;
}
.aihm-md-btn:disabled {
    opacity: .5;
}
.aihm-md-btn--main {
    background: linear-gradient(135deg, #7f5cf0, #b06cf0);
    border-color: transparent;
    color: #fff;
}
/* 结果墙：两列。手机宽度撑不下电脑端那种三列 —— 每格太窄，判不出图好坏 */
.aihm-md-wall {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 10px;
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
    align-content: start;
}
.aihm-md-cell {
    position: relative;
    border: 0;
    padding: 0;
    background: #f2f2f6;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.aihm-md-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.aihm-md-cell.is-on {
    outline: 3px solid #8f6cf0;
    outline-offset: -3px;
}
/* 缩略图挂掉的格子：斜纹占位，尺寸不变，网格不塌 */
.aihm-md-cell--dead {
    background: repeating-linear-gradient(45deg, #ececf1 0 6px, #f5f5f8 6px 12px);
}
.aihm-md-cell--dead::before {
    content: "图看不了";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #b3b3bd;
}
.aihm-md-tag {
    position: absolute;
    left: 5px;
    top: 5px;
    font-style: normal;
    font-size: 10px;
    background: rgba(127, 92, 240, .9);
    color: #fff;
    border-radius: 4px;
    padding: 1px 5px;
}
.aihm-md-empty {
    grid-column: 1 / -1;
    padding: 18px 8px;
    font-size: 13px;
    color: #9a9aa6;
    text-align: center;
}
/* 选中预览：大图铺满宽，压到 200px 高，按钮贴在下面 */
.aihm-md-pick {
    margin-top: 12px;
}
.aihm-md-pimg {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    display: block;
    border-radius: 10px;
    background: #f2f2f6;
}
.aihm-md-bar {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.aihm-md-bar .aihm-md-btn {
    flex: 1;
}
.aihm-md-busy {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: #7f5cf0;
}
.aihm-md-foot {
    margin-top: 12px;
    font-size: 12px;
    color: #a5a5b0;
    text-align: center;
}

/* ---- 1.8.0 管理员健康横幅 ---- */
.aih_health {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 16px 0;
  padding: 10px 12px;
  border: 1px solid #f5d08a;
  background: #fff8ea;
  color: #8a5a00;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.aih_health i { font-size: 16px; flex: none; }
.aih_health span { flex: 1; min-width: 0; }
.aih_health-x {
  flex: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.aih_health-x:hover { background: rgba(138, 90, 0, 0.12); }
.aih_stats-zero { opacity: 0.3; }

/* ---------------- 1.9.0：标签推荐 / 封面图 / 评论回复 ---------------- */

.aih_gp-extra-acts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 0;
}
.aih_gp-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 20px;
    color: var(--aih-text-2, #555);
    background: var(--aih-fill, #f5f5f7);
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.aih_gp-mini:hover {
    color: var(--aih-main, #6c5ce7);
    background: var(--aih-main-soft, rgba(108, 92, 231, .1));
}
.aih_gp-sub {
    padding: 8px 12px 0;
    font-size: 12px;
    color: var(--aih-text-2, #555);
}
.aih_tag-lab {
    margin-bottom: 6px;
    color: var(--aih-text-3, #888);
    font-size: 11px;
}
.aih_tag-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.aih_tag {
    padding: 3px 10px;
    font-size: 12px;
    color: var(--aih-text, #222);
    background: #fff;
    border: 1px solid var(--aih-line, #e2e2ea);
    border-radius: 999px;
    cursor: pointer;
}
.aih_tag:hover {
    border-color: var(--aih-main, #6c5ce7);
    color: var(--aih-main, #6c5ce7);
}
.aih_tag.is-on {
    background: var(--aih-main-soft, rgba(108, 92, 231, .1));
    border-color: var(--aih-main, #6c5ce7);
    color: var(--aih-main, #6c5ce7);
}
.aih_cover {
    border: 1px solid var(--aih-line, #e2e2ea);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.aih_cover img {
    display: block;
    width: 100%;
    height: auto;
}
.aih_cover-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
}
.aih_cover-tag {
    font-size: 11px;
    color: #fff;
    background: var(--aih-main, #6c5ce7);
    border-radius: 4px;
    padding: 1px 6px;
}
.aih_cover-prompt {
    padding: 0 10px 8px;
    font-size: 11px;
    color: var(--aih-text-3, #888);
    line-height: 1.5;
}
.aih_cover-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.aih_cover-grid a {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background: var(--aih-fill, #f5f5f7);
}
.aih_cover-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.aih_reply-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 18px;
    color: var(--aih-main, #6c5ce7);
    background: #fff;
    border: 1px solid var(--aih-main-soft, rgba(108, 92, 231, .3));
    border-radius: 999px;
    cursor: pointer;
    opacity: .9;
    transition: opacity .15s;
}
.aih_reply-btn:hover {
    opacity: 1;
    background: var(--aih-main-soft, rgba(108, 92, 231, .1));
}
.aih-spin {
    animation: aih-spin 1s linear infinite;
}
@keyframes aih-spin {
    to { transform: rotate(360deg); }
}

/* ---------------- 索引页签 ---------------- */
.aih_rag {
    padding: 4px 2px;
}
.aih_rag-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--aih-line, #eee);
    font-size: 12px;
}
.aih_rag-row b {
    color: var(--aih-text-3, #888);
    font-weight: 500;
}
.aih_rag-tip {
    margin: 10px 0;
    font-size: 11px;
    line-height: 1.6;
    color: var(--aih-text-3, #888);
}
.aih_rag-btn {
    width: 100%;
    padding: 8px;
    font-size: 13px;
    color: #fff;
    background: var(--aih-main, #6c5ce7);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}
.aih_rag-btn:disabled {
    opacity: .6;
    cursor: default;
}

/* ================================================================
   v2.3.0 新增：签到 / 自建人设 / 今日看板 / 模板行 / 我的作品 / 预检
   ================================================================ */

/* 侧栏签到按钮 */
.aih_bonus {
    border: 1px solid rgba(120, 110, 255, .35);
    background: rgba(120, 110, 255, .08);
    color: #6a5cff;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    padding: 4px 10px;
    cursor: pointer;
}
.aih_bonus:hover { background: rgba(120, 110, 255, .16); }
.aih_bonus.is-done {
    border-color: rgba(120, 130, 140, .3);
    background: transparent;
    color: #98a0b3;
    cursor: default;
}

/* 顶栏「自建角色」小按钮 */
.aih_persona-add {
    border: 1px dashed rgba(130, 140, 160, .5);
    background: transparent;
    color: #7a8296;
    border-radius: 999px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    vertical-align: middle;
}
.aih_persona-add:hover { color: #6a5cff; border-color: #6a5cff; }

/* 诊断抽屉 · 今日看板 */
.aih_today {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.aih_today-card {
    border: 1px solid rgba(130, 140, 160, .22);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.aih_today-card b { font-size: 17px; line-height: 1.2; }
.aih_today-card span { font-size: 11px; color: #8a92a6; }
.aih_today-card.is-bad b { color: #d05a5a; }
.aih_today-card.is-zero { opacity: .45; }

/* 浮层 · 模板行 */
.aih_gp-tpl { margin-top: 10px; }
.aih_tpl-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.aih_tpl {
    border: 1px solid rgba(130, 140, 160, .35);
    background: transparent;
    color: #5a6276;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    padding: 5px 10px;
    cursor: pointer;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aih_tpl:hover { color: #6a5cff; border-color: #6a5cff; }
.aih_tpl--save { color: #98a0b3; border-style: dashed; }

/* 浮层 · 我的作品 */
.aih_md-cellwrap { position: relative; }
.aih_md-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: rgba(20, 22, 30, .55);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}
.aih_md-cellwrap:hover .aih_md-del { display: inline-flex; }
.aih_md-more { text-align: center; padding: 6px 0 2px; }

/* 浮层 · 预检结果 */
.aih_gp-ok {
    color: #2f9e63;
    background: rgba(47, 158, 99, .1);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

/* 手机壳 · v2.3.0 */
.aihm-bonus {
    border: 1px solid rgba(120, 110, 255, .4);
    background: rgba(120, 110, 255, .1);
    color: #6a5cff;
    border-radius: 999px;
    font-size: 12px;
    padding: 2px 9px;
    cursor: pointer;
}
.aihm-bonus.is-done {
    border-color: rgba(130, 140, 160, .35);
    background: transparent;
    color: #98a0b3;
}
.aihm-tpl { margin: 6px 0 2px; }
.aihm-tpl-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.aihm-tpl-chip {
    border: 1px solid rgba(130, 140, 160, .4);
    background: transparent;
    color: #5a6276;
    border-radius: 999px;
    font-size: 12px;
    padding: 5px 10px;
    max-width: 108px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aihm-md-cellwrap { position: relative; display: inline-block; }
.aihm-md-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: rgba(20, 22, 30, .6);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.aihm-md-more { text-align: center; padding: 8px 0 2px; }

/* 作品集：临时地址提示（转存失败时才有） */
.aih_md-tip {
    font-size: 12px;
    line-height: 1.5;
    color: #a9703c;
    background: rgba(201, 130, 60, .1);
    border-radius: 8px;
    padding: 6px 9px;
    margin: 0 0 8px;
}
.aihm-md-tip {
    font-size: 12px;
    line-height: 1.5;
    color: #a9703c;
    background: rgba(201, 130, 60, .1);
    border-radius: 8px;
    padding: 6px 9px;
    margin: 0 0 8px;
}

/* 会话行：置顶按钮点亮态 */
.aih_side-ren.is-on { color: #6a5cff; }

/* 手机端：AI 气泡下的「重新生成」 */
.aihm-msg-acts {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.aihm-msg-acts button {
    border: 0;
    background: transparent;
    color: #8a92a6;
    font-size: 12px;
    padding: 2px 4px;
    cursor: pointer;
}
.aihm-msg-acts button:hover { color: #6a5cff; }

/* ==========================================================================
   宽屏：三条杠 = 收起/展开会话栏（v2.4.0）
   以前 .aih_top-menu{display:none} 被后面的 .aih_icon-btn{display:grid} 覆盖，
   桌面端按钮看得见、点了却只切一个没有对应样式的 is-side-open —— 纯摆设。
   现在明确在宽屏显示，并给它一套真的折叠样式；窄屏仍走上面的抽屉规则。
   ========================================================================== */
@media (min-width: 861px) {
    .aih_top-menu { display: grid; }
    .aih_side {
        transition: width .24s cubic-bezier(.32, .72, 0, 1),
                    flex-basis .24s cubic-bezier(.32, .72, 0, 1);
    }
    .aih.is-side-collapsed .aih_side {
        width: 0;
        flex-basis: 0;
        border-right: 0;
        overflow: hidden;
    }
    .aih_top-menu[aria-pressed="true"] {
        background: var(--aih-me);
        color: #6a5cff;
    }
}

/* ==========================================================================
   阶段 2 · 反馈按钮（PC 与手机壳共用）
   放在气泡里、独立于 .aih_msg-tools 的 hover 显隐，保证用户随时点得到。
   ========================================================================== */
.aih_fb-row, .aihm-fb {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    margin: 8px 0 2px; color: #8a90a0; font-size: 12px;
}
.aih_fb-row > span, .aihm-fb > span { margin-right: 2px; }
.aih_fb, .aihm-fb button {
    border: 1px solid #e6e9f2; background: transparent; color: #7a8194;
    border-radius: 999px; padding: 2px 10px; cursor: pointer;
    font-size: 12px; line-height: 20px; transition: all .15s;
}
.aih_fb:hover, .aihm-fb button:hover { border-color: #6a5cff; color: #6a5cff; }
.aih_fb.is-on, .aihm-fb button.is-on {
    background: #f0edff; border-color: #6a5cff; color: #6a5cff;
}
.aih_fb-thx, .aihm-fb-thx { font-style: normal; color: #28a06a; font-size: 11px; }
.aihm-fb { margin: 6px 0 0; font-size: 11px; }
.aihm-fb button { font-size: 11px; padding: 1px 9px; }
