/* 言诺 · 手机端（QQ 风格） */

/* 颜色都取 ui-kit.css 的共用配色（和安卓 2.7 同一套，跟随系统深浅色，PD-CLIENT-014）；
   括号里的兜底值是浅色，ui-kit.css 没加载到时页面照旧是浅色 */
:root {
    --qq: var(--y-primary, #c96c8a);
    --qq-deep: var(--y-primary-deep, #b9587a);
    --bg: var(--y-bg, #faf0ef);
    --bar: var(--y-bar, #fdf4f3);
    --line: var(--y-line, #f1dfdd);
    --txt: var(--y-text, #3b2a2e);
    --sub: var(--y-text2, #8a6c72);
    --red: var(--y-badge, #fa5151);
    --card: var(--y-surface, #fffaf8);
    --soft: var(--y-surface-alt, #f6e9e8);
    --icon: var(--y-icon, #5e454c);
    --press: var(--y-pressed, rgba(122, 64, 84, .08));
    --pink: var(--y-pink, #d6336c);
    --pink-soft: var(--y-pink-soft, rgba(214, 51, 108, .08));
    --holder: var(--y-placeholder, #f2e3e3);
    --radius: 14px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--bg);
    color: var(--txt);
    font: 15px/1.45 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC',
        'Microsoft YaHei', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

[hidden] {
    display: none !important;
}

button {
    font-family: inherit;
    cursor: pointer;
}

.app {
    /* 固定在可视视口上：键盘弹起时 --app-h 被 visualViewport 实测高度覆盖，
       聊天区随之压缩而不是被键盘盖住（iOS Safari 不会缩 dvh）。 */
    position: fixed;
    top: var(--app-top, 0px);
    left: 0;
    right: 0;
    height: 100dvh;
    height: var(--app-h, 100dvh);
    overflow: hidden;
    background: var(--bg);
}

/* ---------------------------- 顶栏 ---------------------------- */

.pane {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.bar {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
    height: calc(48px + var(--safe-top));
    padding: var(--safe-top) 8px 0;
    background: var(--bar);
    border-bottom: 1px solid var(--line);
    z-index: 5;
}

.bar-title {
    position: absolute;
    inset: var(--safe-top) 0 0;
    display: grid;
    place-items: center;
    font-size: 17px;
    font-weight: 600;
    pointer-events: none;
}

.bar-side {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    z-index: 2;
}

.ico {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    border-radius: 50%;
    color: var(--icon);
    transition: background 0.15s;
}

.ico:active {
    background: var(--press);
}

.ico svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ico .dotfill {
    fill: currentColor;
    stroke: none;
}

/* ---------------------------- 列表 ---------------------------- */

.scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.conv {
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--card);
}

.conv li {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--card);
    transition: background 0.12s;
}

.conv li:active {
    background: var(--press);
}

.conv li.on {
    background: var(--y-primary-soft, rgba(201, 108, 138, .12));
}

.conv li + li::before {
    content: '';
    position: absolute;
    left: 66px;
    right: 0;
    top: 0;
    height: 1px;
    background: var(--line);
    transform: scaleY(0.5);
}

.conv .ava {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex: 0 0 auto;
    background: var(--holder);
}

.conv .meta {
    flex: 1;
    min-width: 0;
}

.conv .r1 {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.conv .name {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conv .time {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--sub);
}

.conv .snip {
    margin-top: 3px;
    font-size: 13px;
    color: var(--sub);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conv .badge {
    position: absolute;
    right: 14px;
    bottom: 12px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.sect {
    margin: 10px 0 0;
    padding: 12px 14px 6px;
    font-size: 12px;
    color: var(--sub);
    background: var(--card);
}

.cell {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px;
    border: 0;
    background: var(--card);
    text-align: left;
    font-size: 15.5px;
    color: var(--txt);
}

.cell:active {
    background: var(--press);
}

/* 链接做的行（管理后台、交流群）和按钮行一样，不带下划线 */
a.cell {
    text-decoration: none;
}

.cell .grow {
    flex: 1;
    min-width: 0;
}

.cell .val {
    color: var(--sub);
    font-size: 14px;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell .arrow {
    width: 8px;
    height: 8px;
    border-right: 1.6px solid var(--y-text3, #a3868c);
    border-bottom: 1.6px solid var(--y-text3, #a3868c);
    transform: rotate(-45deg);
    flex: 0 0 auto;
}

.tabbar {
    flex: 0 0 auto;
    display: flex;
    background: var(--bar);
    border-top: 1px solid var(--line);
    padding-bottom: var(--safe-bottom);
}

.tab {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0 5px;
    border: 0;
    background: none;
    color: var(--sub);
    font-size: 10.5px;
}

.tab svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tab.on {
    color: var(--qq);
}

.tab .badge {
    position: absolute;
    top: 3px;
    left: 50%;
    margin-left: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
}

.foot-tip {
    padding: 18px 14px 26px;
    text-align: center;
    font-size: 12px;
    color: var(--y-text3, #a3868c);
    background: var(--card);
}

/* 购买额度包（PD-CLIENT-005）：「我」页账号那一节下面的实心按钮，和电脑网页侧栏一样；颜色只取配色变量 */
.me-credits-wrap {
    padding: 6px 14px 14px;
    background: var(--card);
}

.me-credits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--qq);
    color: var(--y-on-primary, #fff);
    font-size: 15.5px;
    font-weight: 600;
    text-decoration: none;
}

.me-credits:active {
    background: var(--qq-deep);
}

.me-credits svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1.2;
    stroke-linejoin: round;
}

/* 「我」页（用户 2026-11-15 要的 QQ「我」页样式，PD-CLIENT-005）：上面一张圆角资料卡，下面每个入口一行——
   彩色线条图标、名字、右边灰字、箭头；不再分「账号」「设置」小标题，几组之间一条细线。整页一种底色，顶上一层淡玫瑰色 */
#viewMe {
    min-height: 100%;
    background: var(--card);
}

.me-page {
    padding-bottom: 4px;
    background: linear-gradient(180deg, var(--y-primary-soft, rgba(201, 108, 138, .12)) 0, transparent 160px);
}

.me-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: calc(100% - 28px);
    margin: 14px 14px 10px;
    padding: 18px 14px 18px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    color: var(--txt);
    font: inherit;
    text-align: left;
}

button.me-card:active {
    background: var(--press);
}

.me-card .me-ava,
.me-card .me-initial {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--soft);
}

.me-card .me-initial {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #e597ab, #c66a88);
    color: #fff;
    font-size: 22px;
    font-weight: 600;
}

.me-card .me-lines {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.me-card .me-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.me-card .me-lines b {
    min-width: 0;
    overflow: hidden;
    font-size: 19px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.me-card .me-lines small {
    color: var(--sub);
    font-size: 13.5px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.me-card .me-edit {
    flex: none;
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--sub);
    font-size: 13px;
    white-space: nowrap;
}

.me-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 56px;
    padding: 6px 14px 6px 18px;
    border: 0;
    background: none;
    color: var(--txt);
    font: inherit;
    font-size: 16.5px;
    text-align: left;
    text-decoration: none;
}

.me-row:active {
    background: var(--press);
}

.me-row .me-ic {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.me-row .grow {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.me-row.me-language .grow {
    white-space: normal;
    overflow-wrap: anywhere;
}

.me-row .val {
    max-width: 50%;
    overflow: hidden;
    color: var(--sub);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.me-row .chev {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin-left: -6px;
    fill: none;
    stroke: var(--y-text3, #a3868c);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.me-split {
    height: 1px;
    margin: 6px 18px;
    background: var(--line);
}

/* ---------------------------- 聊天 ---------------------------- */

.chatpane {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    z-index: 30;
    transform: translateX(100%);
    transition: transform 0.26s cubic-bezier(0.22, 0.8, 0.24, 1);
    will-change: transform;
}

.chatpane.on {
    transform: translateX(0);
}

/* 内容与顶部控件在屏外准备齐再滑入，用户不会看到半成品聊天页。 */
.chatpane.preparing {
    visibility: hidden;
    transition: none;
}

[data-chat-id][aria-busy="true"] { opacity: 0.65; }

.chat-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
}

.chat-title b {
    font-size: 16.5px;
    font-weight: 600;
    max-width: 60vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-title em {
    font-style: normal;
    font-size: 11px;
    color: var(--sub);
    margin-top: 1px;
}

/* 状态和关系挤在名字下面一行 */
.chat-title .sub {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}

.chat-title .sub em {
    margin-top: 0;
}

.rel-mini {
    border: 0;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 10.5px;
    line-height: 15px;
    color: var(--pink);
    background: var(--pink-soft);
}

/* 标题副行的游戏时间：纯时刻，无前缀，和亲密度同一排 */
.game-mini {
    font-style: normal;
    font-size: 10.5px;
    line-height: 15px;
    color: var(--sub);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.msgs {
    padding: 12px 0 4px;
}

/* 约会回复写完、放回草稿原位时滚不到的部分（见 m.js 的 keepStreamPlace），下次开始回复时收回 */
.msgs.stream-pad::after {
    content: '';
    display: block;
    height: var(--stream-pad, 0px);
}

.divider {
    margin: 12px 0 12px;
    text-align: center;
    font-size: 11.5px;
    color: var(--y-text3, #a3868c);
}

.note {
    margin: 10px 16px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--press);
    color: var(--sub);
    font-size: 12.5px;
    text-align: center;
}

/* 约好了、见面开始结束 */
.note.event {
    background: var(--pink-soft);
    color: var(--pink);
}

.note.event.missed,
.note.event.cancelled {
    background: var(--press);
    color: var(--sub);
}

/* ---------------- 约会横幅 ---------------- */

.meet-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    font-size: 13px;
    color: var(--pink);
    background: var(--pink-soft);
    border-bottom: 1px solid var(--line);
}

.meet-bar.on {
    background: color-mix(in srgb, var(--pink) 16%, transparent);
    font-weight: 600;
}

.meet-bar .meet-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meet-bar .meet-btn {
    flex: none;
    padding: 3px 12px;
    border: 1px solid var(--y-pink-line, rgba(214, 51, 108, .35));
    border-radius: 999px;
    background: transparent;
    color: var(--pink);
    font-size: 12.5px;
}

.row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 0 12px;
    margin-bottom: 12px;
    animation: pop 0.18s ease-out;
}

.row.cont {
    margin-top: -8px;
}

.row.me {
    flex-direction: row-reverse;
}

.row .ava {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    object-fit: cover;
    flex: 0 0 auto;
    background: var(--holder);
}

.row .ava.ghost {
    visibility: hidden;
    width: 0;
    margin: 0;
}

.bubbles {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: calc(100% - 92px);
}

.row.me .bubbles {
    align-items: flex-end;
}

/* 发消息先上屏（2026-11-18）：回执回来之前，自己这条下面一行小字「发送中…」 */
.send-state {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.3;
    color: var(--sub);
}

.bubble {
    position: relative;
    width: fit-content;
    max-width: 100%;
    padding: 9px 12px;
    border-radius: 4px 14px 14px 14px;
    background: var(--y-bubble-peer, #ffffff);
    color: var(--y-bubble-peer-text, #3b2a2e);
    font-size: 15.5px;
    line-height: 1.46;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 1px 1px rgba(122, 64, 84, 0.05);
}

.row.me .bubble {
    border-radius: 14px 4px 14px 14px;
    /* 首页示例聊天的玫瑰渐变（纯欲风，PD-CLIENT-014） */
    background: var(--y-bubble-mine, #12b7f5);
    color: var(--y-bubble-mine-text, #ffffff);
    box-shadow: none;
}

.bubble.pic,
.row.me .bubble.pic {
    padding: 0;
    background: none;
    overflow: hidden;
    box-shadow: none;
}

.bubble.pic img {
    display: block;
    max-width: 184px;
    max-height: 244px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--soft);
}

.bubble.pic.pending::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.32) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 3a9 9 0 1 0 9 9'/%3E%3C/svg%3E")
        center no-repeat;
    animation: fade 1s linear infinite;
}

@keyframes fade {
    50% {
        opacity: 0.55;
    }
}

.bubble .meta-line {
    display: block;
    margin-top: 3px;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.7);
    text-align: right;
}

.bubble.typing {
    display: flex;
    gap: 4px;
    padding: 13px 14px;
}

.bubble.typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--y-text3, #a3868c);
    animation: blink 1.1s infinite;
}

.bubble.typing i:nth-child(2) {
    animation-delay: 0.16s;
}

.bubble.typing i:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes blink {
    0%,
    60%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
}

/* 输入区 */
.composer {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 7px 10px;
    background: var(--bar);
    border-top: 1px solid var(--line);
}

/* QQ 快捷栏：输入框正下方一整排纯图标，无气泡底、无文字 */
.quickbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 46px;
    padding: 1px 4px calc(1px + var(--safe-bottom));
    background: var(--bar);
}

.quickbar button {
    flex: 1 1 0;
    min-width: 0;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--icon);
    transition: background 0.12s;
}

.quickbar button:active {
    background: var(--press);
}

.quickbar button[aria-expanded='true'] {
    color: var(--qq);
}

.quickbar svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.quickbar .dotfill {
    fill: currentColor;
    stroke: none;
}

#btnPlus svg {
    transition: transform 0.18s;
}

#btnPlus[aria-expanded='true'] svg {
    transform: rotate(45deg);
}

/* 宽屏（平板 / 桌面浏览器）下别把图标拉成一排大按钮，保持紧凑居中 */
@media (min-width: 560px) {
    .quickbar {
        justify-content: center;
    }

    .quickbar button {
        flex: 0 0 72px;
    }

    .emojipanel {
        grid-template-columns: repeat(8, 56px);
        justify-content: center;
    }
}

/* 表情面板 */
.emojipanel {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 2px;
    padding: 6px 6px calc(6px + var(--safe-bottom));
    background: var(--bar);
    border-top: 1px solid var(--line);
    max-height: min(180px, 32vh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.emojipanel button {
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: none;
    font-size: 22px;
    line-height: 1;
}

.emojipanel button:active {
    background: var(--press);
}

#input {
    flex: 1;
    min-width: 0;
    min-height: 34px;
    max-height: 112px;
    padding: 7px 12px;
    border: 0;
    border-radius: 17px;
    background: var(--card);
    color: var(--txt);
    font: inherit;
    font-size: 15.5px;
    line-height: 1.4;
    resize: none;
    outline: 0;
}

.sendbtn {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 17px;
    background: var(--y-bubble-mine, #12b7f5);
    color: #fff;
    font-size: 14px;
    transition: opacity 0.15s;
}

.sendbtn:disabled {
    opacity: 0.45;
}

.pluspanel {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 2px;
    padding: 14px 8px calc(14px + var(--safe-bottom));
    background: var(--bar);
    border-top: 1px solid var(--line);
    animation: up 0.18s ease-out;
}

@keyframes up {
    from {
        transform: translateY(100%);
    }
}

.pluspanel button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: 0;
    background: none;
    color: var(--icon);
    font-size: 11.5px;
}

.pluspanel .cellbox {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 1px 3px rgba(122, 64, 84, 0.08);
    transition: transform 0.12s;
}

.pluspanel button:active .cellbox {
    transform: scale(0.94);
}

.pluspanel svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: var(--qq);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------------------------- 弹层 ---------------------------- */

.mask {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: var(--y-overlay, rgba(47, 24, 32, .38));
    opacity: 0;
    transition: opacity 0.2s;
}

.mask.on {
    opacity: 1;
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 61;
    margin: 0 8px calc(8px + var(--safe-bottom));
    border-radius: 16px;
    background: var(--bar);
    overflow: hidden;
    transform: translateY(110%);
    transition: transform 0.24s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.sheet.on {
    transform: none;
}

.sheet-head {
    padding: 14px 16px 10px;
    text-align: center;
    font-size: 12.5px;
    color: var(--sub);
}

.sheet-body {
    max-height: 62vh;
    overflow-y: auto;
    background: var(--card);
    border-radius: 12px;
}

.sheet-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 16px;
    border: 0;
    background: var(--card);
    width: 100%;
    text-align: left;
    font-size: 16px;
    color: var(--txt);
}

.sheet-item + .sheet-item {
    box-shadow: inset 0 1px 0 var(--line);
}

.sheet-item:active {
    background: var(--press);
}

.sheet-item:disabled {
    color: var(--sub);
    cursor: default;
}

.sheet-item .grow {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sheet-item .val {
    font-size: 13.5px;
    color: var(--sub);
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sheet-item .ck {
    color: var(--qq);
    font-size: 15px;
}

.sheet-item.danger {
    color: var(--red);
}

.sheet-cancel {
    margin-top: 8px;
    width: 100%;
    padding: 15px;
    border: 0;
    border-radius: 12px;
    background: var(--card);
    font-size: 16px;
    color: var(--txt);
}

.sheet-cancel:active {
    background: var(--press);
}

.facts {
    padding: 4px 16px 14px;
    background: var(--card);
    font-size: 14px;
    color: var(--icon);
}

.facts li {
    position: relative;
    list-style: none;
    padding: 7px 0 7px 16px;
    line-height: 1.4;
}

.facts li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 14px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--qq);
}

.facts ul {
    margin: 0;
    padding: 0;
}

.facts .none {
    padding: 10px 0 14px;
    color: var(--sub);
    font-size: 13.5px;
}

.facts h4 {
    margin: 12px 0 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sub);
}

.facts h4:first-child {
    margin-top: 6px;
}

.facts li {
    cursor: pointer;
}

.facts li:active {
    background: var(--press);
}

.facts li .tag {
    margin-left: 6px;
    padding: 0 4px;
    font-size: 11px;
    color: var(--sub);
    border: 1px solid var(--line);
    border-radius: 4px;
    vertical-align: 1px;
}

.facts .tip {
    padding-top: 4px;
    font-size: 12.5px;
}

/* ---------------- 关系 ---------------- */

.rel {
    padding: 12px 16px 14px;
    background: var(--card);
    font-size: 14px;
    color: var(--icon);
}

.rel-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.rel-top b {
    font-size: 20px;
    color: var(--txt);
}

.rel-top .rel-score {
    margin-left: auto;
    font-size: 20px;
    font-weight: 700;
    color: var(--pink);
}

.rel-top .rel-max {
    font-size: 12px;
    color: var(--sub);
}

.rel-bar {
    position: relative;
    height: 6px;
    margin: 8px 0 6px;
    border-radius: 3px;
    background: var(--bg);
}

.rel-bar i {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 3px;
    background: linear-gradient(90deg, #f7a1c0, #d6336c);
}

.rel-bar u {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 1px;
    background: var(--sub);
    opacity: 0.45;
}

.rel-meta {
    font-size: 12px;
    line-height: 1.6;
    color: var(--sub);
}

.rel-att {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bar);
    line-height: 1.6;
}

.rel h4 {
    margin: 14px 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sub);
}

.rel ul,
.tl ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rel-events li {
    padding: 3px 0;
}

.rel-log li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    box-shadow: inset 0 -1px 0 var(--line);
}

.rel-log li:active {
    background: var(--press);
}

.rel-log .d {
    flex: none;
    width: 38px;
    font-weight: 650;
    color: var(--sub);
    font-variant-numeric: tabular-nums;
}

.rel-log .d.up {
    color: var(--pink);
}

.rel-log .d.down {
    color: var(--y-down, #3b7dd8);
}

.rel-log .b {
    flex: 1;
    min-width: 0;
    line-height: 1.55;
}

.rel-log q {
    display: block;
    font-size: 12.5px;
    color: var(--sub);
}

.rel-log q::before {
    content: var(--locale-quote-start, '原话：「');
}

.rel-log q::after {
    content: var(--locale-quote-end, '」');
}
/* 英文版（PD-CLIENT-018） */

.rel-log small {
    display: block;
    font-size: 12px;
    color: var(--y-warn-text, #8a5a00);
}

.rel-log li.undone .b,
.rel-log li.undone .d {
    text-decoration: line-through;
    opacity: 0.55;
}

.rel .tag,
.tl .tag {
    flex: none;
    padding: 0 4px;
    font-size: 11px;
    line-height: 16px;
    color: var(--sub);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.rel .none,
.tl .none {
    padding: 8px 0 4px;
    font-size: 13px;
    color: var(--sub);
}

.rel .tip,
.tl .tip {
    font-size: 12px;
}

/* ---------------- 回忆 ---------------- */

.tl {
    padding: 12px 16px 14px;
    background: var(--card);
}

.tl-item {
    position: relative;
    margin-left: 4px;
    padding: 0 0 12px 16px;
    border-left: 2px solid var(--line);
}

.tl-item:active {
    background: var(--press);
}

.tl-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--qq);
}

.tl-item.star::before {
    border-color: var(--pink);
    background: var(--pink);
}

.tl-item.gap::before {
    border-color: var(--line);
}

.tl-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--sub);
}

.tl-item.gap .tl-label {
    font-weight: 400;
    font-style: italic;
}

.tl-label .imp {
    font-size: 8px;
    letter-spacing: 1px;
    font-weight: 400;
    color: var(--qq);
    opacity: 0.75;
}

.tl-label .mstar {
    color: var(--pink);
}

.tl-text {
    margin-top: 3px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--icon);
}

.tl-att {
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--sub);
}

/* 剧情模式的 *动作* */
.bubble .act {
    font-style: italic;
    opacity: 0.72;
}

/* 旁白写法里引号中的对白（PD-CHAT-007） */
.bubble .say {
    color: var(--y-dialogue, #a0620a);
}

/* 对话框、看大图换成电脑版共用的 ui-kit.css / portrait.css（PD-CLIENT-014、PD-CLIENT-015） */

/* 提示条 */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(84px + var(--safe-bottom));
    z-index: 90;
    max-width: 76vw;
    padding: 9px 16px;
    border-radius: 10px;
    background: var(--y-notice-bg, rgba(47, 32, 36, .9));
    color: var(--y-notice-text, #ffffff);
    font-size: 13.5px;
    line-height: 1.4;
    text-align: center;
    transform: translate(-50%, 8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

.toast.on {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------------------------- 登录 ---------------------------- */

/* 服务端在 <html data-gate> 上写明登录状态：没登录时第一帧就是登录页，
   主页骨架连一帧都不画，避免「先进主页再跳登录页」。 */
html[data-gate="login"] #app { display: none !important; }
html[data-gate="login"] #gate { display: flex !important; }

/* 直接进聊天（PD-ACCT-022，用户 2026-11-19 决定）：没登录的人从链接打开她的聊天，第一帧就是聊天窗口（不滑入）；
   发第一句以前没有账号，返回、菜单、在线状态和快捷栏都不出，输入框下面是 18 岁那一行（PD-SITE-008） */
html[data-gate="preview"] #gate { display: none !important; }
html[data-gate="preview"] .chatpane { transform: none; transition: none; }
html[data-gate="preview"] #btnBack,
html[data-gate="preview"] #btnMenu,
html[data-gate="preview"] #peerStatus { visibility: hidden; }
html[data-gate="preview"] #quickBar { display: none; }
.preview-adult {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 12px calc(8px + var(--safe-bottom));
    background: var(--bar);
    color: var(--sub);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}
.preview-adult[hidden] { display: none; }
/* 发出第一句、开了游客后接到真的对话：聊天窗口原地不动，不先收起再滑进来 */
.chatpane.handoff { transform: none !important; transition: none !important; visibility: visible !important; }

.gate {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    /* 顶上留出语言切换那一行：内容放不下、从顶上排起时，图标不压在语言切换上 */
    padding: calc(var(--safe-top) + 52px) 34px calc(var(--safe-bottom) + 40px);
    background:
        radial-gradient(900px 520px at 12% 0%, rgba(248, 211, 197, 0.65), transparent 62%),
        radial-gradient(820px 520px at 100% 100%, rgba(227, 213, 243, 0.7), transparent 60%),
        #fffaf8;
    color: #3b2a2e;
    /* 注册时多了选形象，矮屏放不下：能上下滚。放得下时靠 .gate-brand / .switch 的 auto 外边距照旧居中；
       放不下时从顶上排起（justify-content: center 会把顶上那截挤到滚不到的地方），各项也不许被压扁 */
    overflow-y: auto;
    justify-content: flex-start;
}

.gate > * { flex-shrink: 0; }
.gate > .gate-brand { margin-top: auto; }
.gate > .switch { margin-bottom: auto; }

/* 顶上的 Yanero 字样（用户 2026-11-16 决定，取代「言」字图标和「言诺」标题）：西文衬线，安卓上 Georgia 落到系统衬线体 */
.gate h1 {
    margin: 0 0 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-synthesis: none;
    font-size: 38px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.06em;
    color: #2f2024;
}

.gate p {
    margin: 0;
    font-size: 13px;
    color: #8a6c72;
}

.gate .field {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 16px;
    padding: 0 14px;
    height: 46px;
    border-radius: 12px;
    background: #fff;
    box-shadow: inset 0 0 0 1px #f1dfdd;
}

.gate .field + .field { margin-top: 10px; }

/* 注册时选性别：两个并排的块，选中的亮一档 */
.gate .gender {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.gate .gender[hidden] { display: none; }

.gate .gender label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    border-radius: 12px;
    background: #fff;
    box-shadow: inset 0 0 0 1px #f1dfdd;
    color: #8a6c72;
    font-size: 15px;
    user-select: none;
}

.gate .gender input {
    flex: none; /* 下面的 .gate input 有 flex: 1，不覆盖的话单选框会被拉宽，字被挤到最右边 */
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #b9587a;
}

.gate .gender label:has(input:checked) {
    background: #fff5f7;
    box-shadow: inset 0 0 0 1px #d9809a;
    color: #b9587a;
    font-weight: 600;
}

/* 注册时选形象（PD-IMG-012）：九宫格本身的样式在 profile.css */
.gate .gate-look { width: 100%; margin-top: 8px; text-align: left; }
.gate .gate-look[hidden] { display: none; }
.gate .gate-look .gate-look-title { margin: 0 0 8px; font-size: 13px; line-height: 1.5; color: #8a6c72; }
.gate .look-race { color: #8a6c72; }

/* 注册时必勾的「我已年满 18 岁」（PD-ACCT-001） */
.gate .adult {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    color: #8a6c72;
    font-size: 14px;
    user-select: none;
}

.gate .adult[hidden] { display: none; }

.gate .adult input {
    flex: none;
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #b9587a;
}

/* 推荐码默认收起（PD-ADMIN-015）：注册时先只露一行字，点了才出输入框，不再紧跟在密码框下面 */
.gate .ref-toggle {
    width: 100%;
    margin-top: 2px;
    font-size: 13px;
}

.gate .ref-toggle span {
    color: #a3868c;
    text-decoration: underline;
    cursor: pointer;
    user-select: none;
}

.gate #gateReferralField { margin-top: 4px; }

.gate .switch {
    margin-top: 10px;
    font-size: 13px;
}

.gate .switch span,
.gate .forgot span {
    color: #a3868c;
    text-decoration: underline;
    cursor: pointer;
    user-select: none;
}

/* 忘记密码（PD-ACCT-015）：登录按钮下面一行小字 */
.gate .forgot {
    font-size: 13px;
}

.gate input {
    flex: 1;
    border: 0;
    outline: 0;
    background: none;
    color: #3b2a2e;
    font-size: 15px;
}

.gate input::placeholder {
    color: #b49a9f;
}

.gate .go {
    width: 100%;
    height: 46px;
    margin-top: 12px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #d9809a, #b9587a);
    box-shadow: 0 14px 30px -14px rgba(185, 88, 122, 0.7);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.gate .go:disabled {
    opacity: 0.6;
}

.gate .err {
    min-height: 18px;
    margin-top: 8px;
    font-size: 13px;
    color: #c2415f;
}

/* 断线页 */
.offline {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--bg);
    color: var(--sub);
    font-size: 14px;
}

.offline button {
    padding: 9px 22px;
    border: 1px solid var(--qq);
    border-radius: 18px;
    background: none;
    color: var(--qq);
    font-size: 14px;
}

/* 亲密度变化仅附在这一轮回复的最后一段后。 */
.relation-change { display:inline-block; margin-left:8px; font-size:.9em; font-weight:700; white-space:nowrap; }
.relation-change.increase { color:var(--y-rel-up, #d73545); }
.relation-change.decrease { color:var(--y-rel-down, #16834b); }

/* 多人场景（PD-DIM-012，用户 2026-11-25 决定）：标题栏下面一条「在场」；旁白段不带头像、占满一行，台词段上面写说话人的名字 */
.present-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 5px 12px; font-size: 12.5px; color: var(--sub); background: var(--bar); border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.present-bar::-webkit-scrollbar { display: none; }
.present-bar[hidden] { display: none; }
.present-bar .pb-label { flex: 0 0 auto; }
.present-bar .pb-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px 2px 2px; border-radius: 999px; background: var(--soft); color: var(--txt); }
.present-bar .pb-chip b { font-weight: 600; }
.present-bar .pb-ava { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--holder); }
.present-bar .pb-ava.ava-fallback { font-size: 11px; }
.row.speaker .who { font-size: 12px; line-height: 1.25; color: var(--sub); margin: 0 0 -1px 2px; }
.row.narr .bubbles { max-width: 100%; }
.bubble.narr { border-radius: 14px; }

/* 引用：输入框上方的引用条，和气泡里的引用块 */
.quote-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-top: 1px solid var(--line);
    background: var(--bar);
    color: var(--sub);
    font-size: 12.5px;
}
.quote-bar[hidden] { display: none; }
.quote-bar-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.quote-bar-close {
    flex: 0 0 auto;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--sub);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.bubble .quote {
    margin: -2px 0 6px;
    padding: 5px 8px;
    border-left: 2px solid var(--y-quote-peer-line, #e5c9cf);
    border-radius: 6px;
    background: var(--y-quote-peer, rgba(122, 64, 84, .06));
    color: var(--y-quote-peer-text, #8a6c72);
    font-size: 12.5px;
    line-height: 1.45;
    white-space: pre-wrap;
    max-height: 4.4em;
    overflow: hidden;
}
.bubble .quote .quote-name {
    margin-right: 4px;
    font-weight: 600;
    opacity: 0.85;
}
.row.me .bubble .quote {
    border-left-color: var(--y-quote-mine-line, rgba(255, 255, 255, .65));
    background: var(--y-quote-mine, rgba(255, 255, 255, .2));
    color: var(--y-quote-mine-text, #fff0f4);
}
/* 头像加载失败（离线、隧道抖动、没有立绘）时显示名字的第一个字，不显示破图标 */
.ava-fallback { display: grid; place-items: center; background: var(--holder); color: var(--sub); font-size: 16px; font-weight: 600; user-select: none; }
/* 日文版（PD-CLIENT-018） */
