/* ================================================================
   蝴蝶机 · 黑白灰主题
   设计原则：黑白灰为主，粉色仅作品牌点缀
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700;800;900&display=swap');

/* ---------- 0. 设计变量 ---------- */
:root {
    --black:       #1a1a1a;
    --dark:        #2c2c2e;
    --gray-800:    #333333;
    --gray-600:    #666666;
    --gray-500:    #8e8e93;
    --gray-400:    #aeaeb2;
    --gray-300:    #d1d1d6;
    --gray-200:    #e5e5ea;
    --gray-100:    #f2f2f7;
    --white:       #ffffff;
    --pink:        #ff6b81;
    --red:         #ff3b30;
    --green:       #34c759;
    --radius-sm:   10px;
    --radius-md:   16px;
    --radius-lg:   22px;
    --shadow-soft: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-card: 0 1px 4px rgba(0,0,0,0.05);
    --transition:  0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ---------- 1. 重置 & 基础 ---------- */
* {
    -webkit-tap-highlight-color: transparent;
    outline: none;
    box-sizing: border-box;
}
body {
    margin: 0; padding: 0;
    background: var(--white);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    -webkit-user-select: none; user-select: none;
    -webkit-font-smoothing: antialiased;
    transition: font-family 0.3s ease;
}
input, textarea, select {
    -webkit-user-select: auto; user-select: auto;
    font-family: inherit;
}

/* ---------- 2. 手机壳 ---------- */
.phone-case {
    position: relative;
    width: 100%; height: 100dvh;
    background: var(--white);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: background 0.3s ease;
}

/* ---------- 3. 状态栏 ---------- */
.status-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 24px 0;
    z-index: 999; position: absolute; top: 0; left: 0; width: 100%;
    pointer-events: none;
}
.status-time-wrapper { display: flex; align-items: center; gap: 5px; }
.status-time { font-size: 17px; font-weight: 600; color: var(--black); letter-spacing: 0.3px; }
.status-butterfly { font-size: 14px; color: var(--gray-500); }
.status-right { display: flex; align-items: center; gap: 7px; }
.battery-icon-new {
    position: relative;
    width: 27px; height: 14px;
    background: var(--black);
    border-radius: 4px;
    display: flex; justify-content: center; align-items: center;
}
.battery-icon-new::after {
    content: '';
    position: absolute; right: -3px; top: 3.5px;
    width: 2.5px; height: 7px;
    background: var(--black);
    border-radius: 0 2px 2px 0;
}
.battery-level-new {
    font-size: 10px; font-weight: 800;
    color: var(--white);
    letter-spacing: -0.5px;
    position: relative; z-index: 1;
}

/* ---------- 4. 桌面时钟 ---------- */
.time-widget {
    text-align: center;
    margin-top: 75px; margin-bottom: 50px;
    color: var(--black);
}
.time-text {
    font-size: 72px; font-weight: 200;
    font-family: 'SF Pro Display', -apple-system, 'Helvetica Neue', sans-serif;
    letter-spacing: 3px; margin-bottom: 6px;
    color: var(--black);
}
#clockTime { font-family: 'Varela Round', 'Nunito', sans-serif !important; }
.date-text { font-size: 14px; color: var(--gray-500); font-weight: 500; letter-spacing: 0.5px; }

/* ---------- 5. 桌面图标 ---------- */
.app-grid { display: flex; padding: 0 28px; gap: 24px; flex-wrap: wrap; }
.app-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 7px; width: 62px; cursor: pointer;
}
.app-icon {
    width: 60px; height: 60px;
    background-size: cover; background-position: center;
    border-radius: var(--radius-md);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex; justify-content: center; align-items: center;
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.6);
}
.app-icon svg {
    width: 27px; height: 27px;
    pointer-events: none;
    stroke: rgba(0,0,0,0.55);
    filter: drop-shadow(0 1px 1px rgba(255,255,255,0.3));
}
.app-item:active .app-icon { transform: scale(0.88); }
.app-name { font-size: 11px; color: var(--gray-600); font-weight: 600; }

/* ---------- 6. Dock 栏 ---------- */
.dock-bar {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    display: flex; justify-content: center; gap: 18px;
    padding: 12px 22px;
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
    border-radius: 26px;
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    z-index: 2;
}
.dock-bar .app-item { width: 55px; }
.dock-icon { width: 55px !important; height: 55px !important; }
.dock-icon svg { width: 25px !important; height: 25px !important; }
.dock-bar .app-name { font-size: 10px; }

/* ---------- 7. 通用滑动页面 ---------- */
.slide-page {
    position: absolute; top: 0; left: 100%;
    width: 100%; height: 100%;
    background: var(--white);
    transition: left 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex; flex-direction: column;
    z-index: 5;
}
.slide-page.active { left: 0; }

#qqAppContainer,
#plannerAppContainer {
    background: var(--white) !important;
    padding: 48px 10px 10px !important;
    gap: 10px;
    display: flex; flex-direction: column;
    height: 100%; overflow: hidden;
}

/* ---------- 8. 页面头部 ---------- */
.page-header {
    height: 80px;
    background: var(--gray-100);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; padding-top: 32px;
    border-bottom: none;
    font-weight: 700; font-size: 16px;
    flex-shrink: 0;
}

#qqAppHeader,
#plannerAppHeader {
    border-radius: 999px;
    background: var(--black);
    margin: 0 auto; width: 78%;
    height: 48px; padding-top: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border-bottom: none;
}
#qqAppHeader .header-title,
#plannerAppHeader .header-title { color: var(--white); font-size: 18px; font-weight: 700; }
#qqAppHeader .icon-btn,
#plannerAppHeader .icon-btn { color: var(--white); width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
#qqAppHeader .icon-btn svg,
#plannerAppHeader .icon-btn svg { width: 24px; height: 24px; min-width: 24px; min-height: 24px; }

.icon-btn {
    display: flex; justify-content: center; align-items: center;
    width: 32px; height: 32px;
    min-width: 32px; min-height: 32px;
    aspect-ratio: 1/1; flex-shrink: 0;
    cursor: pointer; color: var(--gray-800);
    border-radius: 50%;
    transition: background var(--transition);
}
.icon-btn:active { background: rgba(0,0,0,0.06); }
.icon-btn svg {
    width: 21px; height: 21px;
    min-width: 21px; min-height: 21px;
    display: block;
    stroke: currentColor; stroke-width: 2.2;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}
.header-title { flex: 1; text-align: center; color: var(--black); }

/* ---------- 9. Tab 内容 & 底部导航 ---------- */
.tab-content {
    display: none; flex: 1;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.tab-content.active { display: block; }

#qqAppContainer .tab-content,
#plannerAppContainer .tab-content {
    border-radius: var(--radius-lg);
    background: rgba(245,245,247,0.9);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-soft);
    overflow-x: hidden; overflow-y: auto;
    display: none; flex: 1;
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}
#qqAppContainer .tab-content.active,
#plannerAppContainer .tab-content.active { display: block; }

.bottom-nav,
#qqAppContainer .bottom-nav,
#plannerAppContainer .bottom-nav {
    position: absolute;
    left: 16px; right: 16px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    height: 70px;
    max-width: 420px; margin: 0 auto;
    padding: 6px 8px;
    display: flex; justify-content: space-around; align-items: center;
    border-radius: 999px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(255,255,255,0.6);
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.nav-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 50px; gap: 3px;
    padding: 6px 4px; margin: 0 2px;
    font-size: 10px; font-weight: 600;
    color: var(--gray-400);
    cursor: pointer; white-space: nowrap;
    border-radius: 999px;
    transition: color var(--transition), background var(--transition);
}
.nav-item.active {
    color: var(--black);
    background: rgba(26,26,26,0.07);
}
.nav-item svg {
    width: 23px; height: 23px;
    stroke: currentColor; stroke-width: 2;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}
.nav-item div { white-space: nowrap; line-height: 1.2; }

/* ---------- 10. 消息列表 ---------- */
.contact-list-container {
    flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
    overflow-x: hidden; touch-action: pan-y;
}
.msg-item-wrapper {
    position: relative; overflow: hidden;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}
.msg-item-content {
    position: relative; z-index: 2;
    background: var(--white);
    transition: transform 0.2s ease;
    width: 100%; display: flex;
    padding: 14px 16px; align-items: center;
}
.msg-item-content.pinned { background: var(--gray-100); }
.msg-item-content:active { background: #fafafa; }
.msg-item-actions {
    position: absolute; right: 0; top: 0; bottom: 0;
    display: flex; z-index: 1;
}
.msg-action-btn {
    width: 72px; display: flex; justify-content: center; align-items: center;
    color: var(--white); font-size: 13px; font-weight: 700; cursor: pointer;
}
.msg-pin-btn { background: var(--dark); }
.msg-del-btn { background: var(--red); }
.msg-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    object-fit: cover; margin-right: 13px;
    pointer-events: none;
}
.msg-info {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; pointer-events: none;
    min-width: 0;
}
.msg-name {
    font-size: 15px; color: var(--black);
    margin-bottom: 3px; font-weight: 600;
    display: flex; align-items: center;
}
.msg-preview {
    font-size: 13px; color: var(--gray-500);
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 180px;
}

/* ---------- 11. 会话列表 ---------- */
#sessionListPage { z-index: 12; background: var(--gray-100); }
.session-list-area { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px; }
.session-list-item {
    display: flex; align-items: stretch; gap: 10px;
    background: var(--white);
    border-radius: var(--radius-md);
    margin-bottom: 10px; padding: 14px;
    box-shadow: var(--shadow-card);
    min-width: 0;
}
.session-list-item.pinned { border-left: 3px solid var(--black); }
.session-list-main { flex: 1; min-width: 0; cursor: pointer; }
.session-list-name {
    color: var(--black); font-size: 15px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-list-preview {
    color: var(--gray-500); font-size: 13px; margin-top: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-list-meta { color: var(--gray-400); font-size: 11px; margin-top: 6px; }
.session-list-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.session-action-btn {
    width: 48px; min-width: 48px; height: 34px;
    padding: 0 3px; border: 0;
    border-radius: var(--radius-sm);
    background: var(--gray-100); color: var(--gray-600);
    font-size: 11px; font-weight: 600; cursor: pointer;
}
.session-delete-btn { background: #fff0f0; color: var(--red); }
.session-empty { padding-top: 100px; color: var(--gray-400); text-align: center; font-size: 14px; }
.session-name-box { width: 85%; max-width: 320px; padding: 24px 20px; }
.session-name-input {
    width: 100%; height: 44px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0 14px; font-size: 15px; outline: none;
    margin: 4px 0 18px;
    transition: border-color var(--transition);
}
.session-name-input:focus { border-color: var(--black); }
.session-modal-actions { display: flex; gap: 12px; }

/* ---------- 12. 主页 Profile ---------- */
#tabProfile { background: var(--gray-100); }
.profile-bg {
    height: 220px; background: var(--dark);
    background-size: cover; background-position: center;
    position: relative;
}
.profile-top-bar {
    display: flex; justify-content: space-between;
    padding: 40px 20px 0; color: var(--white);
}
.profile-card {
    background: var(--white);
    border-radius: 26px 26px 0 0;
    margin-top: -40px; position: relative;
    padding: 22px; min-height: calc(100% - 180px);
}
.profile-avatar {
    width: 86px; height: 86px; border-radius: 50%;
    border: 4px solid var(--white);
    position: absolute; top: -43px; left: 22px;
    object-fit: cover; background: var(--gray-200);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.profile-name-row {
    margin-left: 104px; margin-top: 6px;
    display: flex; justify-content: space-between;
}
.profile-name { font-size: 20px; font-weight: 700; color: var(--black); }
.profile-id { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.profile-likes { text-align: center; color: var(--gray-500); margin-top: -8px; }
.profile-list-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 0; border-bottom: 1px solid var(--gray-200);
    font-size: 14px; color: var(--gray-800);
}
.profile-list-item.no-border { border-bottom: none; }
.profile-btn-group { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; margin-bottom: 20px; }
.p-btn {
    flex: 1; padding: 13px 0;
    border-radius: var(--radius-sm);
    border: none; font-weight: 700; font-size: 14px;
    cursor: pointer; transition: opacity var(--transition);
}
.p-btn-light { background: var(--gray-100); color: var(--gray-800); }
.p-btn-dark { background: var(--black); color: var(--white); }
.p-btn:active { opacity: 0.75; }
.profile-photos {
    display: flex; gap: 10px; overflow-x: auto;
    padding-bottom: 10px; margin-top: 10px;
    -webkit-overflow-scrolling: touch;
}
.profile-photo-item {
    width: 80px; height: 80px; border-radius: var(--radius-sm);
    object-fit: cover; flex-shrink: 0;
    box-shadow: var(--shadow-card); cursor: pointer;
}

/* ---------- 13. 照片全屏 ---------- */
#photoFullscreenOverlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.95); z-index: 9999999;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
#photoFullscreenOverlay.show { opacity: 1; pointer-events: auto; }
#fullscreenPhotoImg {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
    transform: scale(0.85);
}
#photoFullscreenOverlay.show #fullscreenPhotoImg { transform: scale(1); }

/* ---------- 14. 聊天室 ---------- */
#chatRoom { z-index: 10; background: var(--gray-100); }
.chat-content {
    flex: 1; padding: 20px 16px;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}

/* ---------- 15. 聊天气泡 ---------- */
.chat-row {
    display: flex; margin-bottom: 18px; align-items: flex-start;
    animation: bubbleIn 0.25s ease-out;
}
@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
}
.msg-left { flex-direction: row; }
.msg-right { flex-direction: row-reverse; }
.chat-row .avatar { display: none !important; }
.msg-left .chat-bubble { margin-left: 14px; }
.msg-right .chat-bubble { margin-right: 14px; }

/* 对方气泡：白底 + 微阴影 */
.chat-bubble {
    position: relative;
    max-width: 75%;
    padding: 10px 14px;
    font-size: 15px; line-height: 1.6;
    word-wrap: break-word;
    transition: opacity var(--transition);
}
.chat-bubble:active { opacity: 0.7; }
.chat-bubble::after { content: ""; display: table; clear: both; }
.chat-bubble::before { display: none; }

.msg-left .chat-bubble {
    background: var(--white);
    color: var(--black);
    border-radius: 18px 18px 18px 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.msg-right .chat-bubble {
    background: var(--black);
    color: var(--white);
    border-radius: 18px 18px 5px 18px;
}

/* 时间戳 */
.msg-meta {
    float: right; font-size: 11px;
    display: flex; align-items: flex-end;
    line-height: 1; margin-top: 8px; margin-left: 12px;
}
.msg-left .msg-meta { color: var(--gray-400); margin-top: 12px; margin-left: 20px; }
.msg-right .msg-meta { color: rgba(255,255,255,0.5); }

/* 打字动画 */
.typing-indicator {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 2px; height: 20px;
}
.typing-indicator span {
    width: 6px; height: 6px;
    background: var(--gray-400);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ---------- 16. 心声气泡 ---------- */
.thought-row { display: flex; margin-bottom: 12px; align-items: flex-start; }
.thought-bubble {
    position: relative;
    background: var(--gray-200);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 13px; color: var(--gray-500);
    margin-left: 14px; font-style: italic;
    max-width: 70%; display: flex; align-items: center;
    line-height: 1.5;
}
.thought-bubble::before {
    content: ''; position: absolute;
    bottom: -6px; left: 18px;
    width: 8px; height: 8px;
    background: var(--gray-200); border-radius: 50%;
}
.thought-bubble::after {
    content: ''; position: absolute;
    bottom: -12px; left: 12px;
    width: 4px; height: 4px;
    background: var(--gray-200); border-radius: 50%;
}

/* ---------- 17. 撤回 ---------- */
.recalled-msg {
    text-align: center; font-size: 12px;
    color: var(--gray-400); margin: 10px 0; width: 100%;
}
.peek-btn { color: var(--gray-600); cursor: pointer; margin-left: 5px; font-weight: 600; }

/* ---------- 18. 引用框 ---------- */
.quote-box {
    background: rgba(0,0,0,0.04);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px; color: var(--gray-500);
    margin-bottom: 8px;
    border-left: 3px solid var(--gray-300);
}
.msg-right .quote-box {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.6);
    border-left-color: rgba(255,255,255,0.3);
}
.quote-header {
    display: flex; justify-content: space-between;
    margin-bottom: 4px; font-size: 11px;
    opacity: 0.7; font-weight: 700;
}
.quote-content {
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    text-overflow: ellipsis; word-break: break-all;
}

/* ---------- 19. 转账气泡（黑灰） ---------- */
.bubble-transfer {
    background: var(--dark) !important;
    color: var(--white) !important;
    padding: 0 !important; overflow: hidden;
    width: 210px;
    border-radius: var(--radius-md) !important;
}
.msg-left .bubble-transfer::after { display: none; }
.msg-right .bubble-transfer::after { display: none; }
.transfer-top { display: flex; align-items: center; padding: 12px 14px; gap: 10px; }
.transfer-icon {
    width: 34px; height: 34px;
    display: flex; justify-content: center; align-items: center;
    flex-shrink: 0;
}
.transfer-icon svg { width: 34px; height: 34px; stroke: var(--white); stroke-width: 1.5; fill: none; }
.transfer-bottom {
    padding: 4px 14px 5px;
    font-size: 11px;
    background: rgba(255,255,255,0.06);
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---------- 20. 图片消息 ---------- */
.chat-image-bubble {
    padding: 0 !important; overflow: visible;
    background: transparent !important;
    box-shadow: none !important;
}
.chat-image-bubble::after { display: none !important; }
.chat-image-container {
    position: relative;
    width: min(220px, 62vw);
    min-height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gray-200);
    cursor: zoom-in;
    touch-action: manipulation;
}
.chat-image {
    width: 100%; height: auto; max-height: 360px;
    display: block; object-fit: cover;
    -webkit-touch-callout: default;
    -webkit-user-select: auto; user-select: auto;
}
.image-load-failed {
    min-width: 150px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-200); color: var(--gray-400);
}
.image-load-failed .chat-image { display: none; }
.image-load-failed-text { display: none; padding: 12px 16px; font-size: 13px; color: var(--gray-400); }
.image-load-failed .image-load-failed-text { display: block; }

/* 图片全屏预览 */
.chat-image-fullscreen-overlay {
    position: fixed; inset: 0; z-index: 10000000;
    display: flex; align-items: center; justify-content: center;
    padding: max(16px, env(safe-area-inset-top,0px)) 12px max(16px, env(safe-area-inset-bottom,0px));
    background: rgba(0,0,0,0.96);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.chat-image-fullscreen-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }
.chat-image-viewer {
    position: relative; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.chat-image-fullscreen-img {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 120px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));
    object-fit: contain;
    -webkit-touch-callout: default;
    -webkit-user-select: auto; user-select: auto;
}
.chat-image-viewer-close {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    width: 44px; height: 44px;
    border: 0; border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: var(--white); font-size: 26px; line-height: 1;
    cursor: pointer;
}
.chat-image-action-bar {
    position: absolute; left: 50%; bottom: 6px;
    transform: translateX(-50%);
    display: flex; gap: 10px; align-items: center;
}
.chat-image-save-btn {
    min-width: 110px; min-height: 44px;
    border: 0; border-radius: var(--radius-sm);
    padding: 0 18px;
    background: rgba(255,255,255,0.14);
    color: var(--white); font-size: 14px; font-weight: 700;
    cursor: pointer;
}
.chat-image-save-btn:active { background: rgba(255,255,255,0.25); }
.chat-image-delete-btn {
    min-width: 110px; min-height: 44px;
    border: 0; border-radius: var(--radius-sm);
    padding: 0 18px;
    background: rgba(255,59,48,0.6);
    color: var(--white); font-size: 14px; font-weight: 700;
    cursor: pointer;
}
.chat-image-delete-btn:active { background: rgba(255,59,48,0.85); }
body.chat-image-viewing { overflow: hidden; }

/* ---------- 21. 聊天输入区 ---------- */
.chat-bottom-wrapper {
    position: relative; display: flex; flex-direction: column;
    flex-shrink: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    transition: padding-bottom 0.3s;
}
.quote-preview-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 16px;
    background: var(--gray-100);
    font-size: 12px; color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}
.quote-preview-text {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; margin-right: 10px;
    border-left: 3px solid var(--gray-400); padding-left: 8px;
}
.quote-preview-close { cursor: pointer; font-size: 18px; font-weight: 700; color: var(--gray-400); line-height: 1; }

.chat-input-area { display: flex; align-items: center; padding: 10px 14px 14px; }
.ai-reply-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--black); color: var(--white);
    border: none; display: flex; justify-content: center; align-items: center;
    cursor: pointer; margin-right: 10px; flex-shrink: 0;
    transition: transform 0.1s ease, opacity var(--transition);
}
.ai-reply-btn:active { transform: scale(0.85); }
.ai-reply-btn.disabled, .ai-reply-btn:disabled {
    background: var(--gray-300); cursor: not-allowed; pointer-events: none;
}
.chat-input {
    flex: 1;
    min-height: 38px;
    max-height: 120px;
    height: auto;
    border: 1.5px solid var(--gray-200);
    border-radius: 19px;
    padding: 9px 16px;
    font-size: 14px;
    outline: none;
    background: var(--gray-100);
    resize: none;
    overflow-y: auto;
    line-height: 1.4;
    font-family: inherit;
    transition: border-color var(--transition), background var(--transition);
}
.chat-input:focus { border-color: var(--gray-400); background: var(--white); }
.send-btn {
    margin-left: 8px;
    background: var(--black); color: var(--white);
    border: none; border-radius: 19px;
    padding: 9px 16px; font-size: 14px;
    cursor: pointer; font-weight: 700; flex-shrink: 0;
    transition: opacity var(--transition);
}
.send-btn:active { opacity: 0.7; }

.plus-btn {
    width: 32px; height: 32px; border-radius: 50%;
    border: 2px solid var(--gray-300);
    background: transparent; color: var(--gray-500);
    font-size: 22px;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; flex-shrink: 0; margin-left: 8px;
    transition: transform 0.3s ease, border-color var(--transition), color var(--transition);
    line-height: 0; padding-bottom: 2px;
}
.plus-btn.active { transform: rotate(45deg); border-color: var(--black); color: var(--black); }

/* 加号面板 */
.plus-panel {
    display: none;
    padding: 12px 16px 28px;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px 10px;
}
.plus-panel.show { display: grid; }
.panel-icon-box { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; }
.panel-icon {
    width: 52px; height: 52px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    display: flex; justify-content: center; align-items: center;
    transition: background var(--transition);
}
.panel-icon:active { background: var(--gray-200); }
.panel-icon svg {
    width: 24px; height: 24px;
    stroke: var(--gray-600); fill: none;
    stroke-linecap: round; stroke-linejoin: round;
}
.panel-text { font-size: 11px; color: var(--gray-500); font-weight: 500; }

/* ---------- 22. 长按菜单 ---------- */
.context-menu {
    position: fixed;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    display: none; flex-direction: row;
    padding: 0; z-index: 10000;
    transform: scale(0.9); opacity: 0;
    transition: all 0.2s ease;
    overflow: hidden;
    max-width: 90vw;
}
.context-menu.show { display: flex; transform: scale(1); opacity: 1; }
.context-item {
    padding: 12px 16px; font-size: 13px;
    color: var(--gray-800); cursor: pointer;
    border-right: 1px solid var(--gray-200);
    font-weight: 600; text-align: center; line-height: 1.3;
}
.context-item:last-child { border-right: none; }
.context-item:active { background: var(--gray-100); }

/* ---------- 23. 动态 (QQ空间) ---------- */
#tabMoments { background: var(--gray-100); }
.qzone-header {
    display: flex; align-items: center;
    padding: 32px 20px 16px;
    background: var(--gray-200);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: 0; position: relative;
    background-size: cover; background-position: center;
    min-height: 100px;
}
.qzone-bg-btn {
    position: absolute; top: 12px; right: 12px;
    width: 30px; height: 30px;
    background: rgba(0,0,0,0.25); border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; z-index: 5;
}
.qzone-bg-btn svg { width: 14px; height: 14px; color: var(--white); }
.qzone-header.has-bg .qzone-name,
.qzone-header.has-bg .qzone-visitor,
.qzone-header.has-bg .qzone-signature { color: var(--white); text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.qzone-header.has-bg .qzone-avatar { border: 2px solid var(--white); }
.qzone-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    border: 2px solid var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    object-fit: cover; margin-right: 14px;
}
.qzone-name { font-size: 19px; font-weight: 700; color: var(--black); margin-bottom: 3px; }
.qzone-visitor { font-size: 12px; color: var(--gray-500); }
.qzone-signature {
    font-size: 12px; color: var(--gray-500);
    margin-top: 6px; font-style: italic; cursor: pointer;
    max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qzone-input-box {
    margin: 16px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    padding: 13px 16px;
    display: flex; justify-content: space-between; align-items: center;
    color: var(--gray-400); font-size: 14px;
    background: var(--white); cursor: pointer;
}

.moment-card {
    padding: 16px; border-bottom: 1px solid var(--gray-200);
    background: var(--white); margin-bottom: 8px; position: relative;
}
.moment-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.moment-header-info { display: flex; align-items: center; }
.moment-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; margin-right: 10px; }
.moment-name { font-size: 15px; font-weight: 700; color: var(--black); }
.moment-time { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.moment-more-icon { color: var(--gray-400); padding: 5px; cursor: pointer; display: flex; align-items: center; }
.moment-more-icon svg { width: 20px; height: 20px; fill: currentColor; }
.moment-text { font-size: 14px; color: var(--gray-800); line-height: 1.6; margin-bottom: 10px; word-break: break-all; }
.moment-img { max-width: 80%; border-radius: var(--radius-sm); margin-bottom: 10px; display: block; }
.moment-footer { display: flex; gap: 22px; color: var(--gray-500); }
.moment-action { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; font-weight: 500; }
.moment-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.moment-action.liked { color: var(--pink); }
.moment-action.liked svg { fill: var(--pink); stroke: var(--pink); }

/* 发布动态 */
.moment-img-upload {
    width: 100px; height: 100px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    color: var(--gray-400); font-size: 12px;
    cursor: pointer; margin-top: 10px; overflow: hidden;
}
.moment-tags { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.m-tag {
    padding: 7px 14px; background: var(--gray-100);
    border-radius: 999px; font-size: 12px; color: var(--gray-600);
    display: flex; align-items: center; gap: 5px; cursor: pointer;
    font-weight: 500;
}
.m-tag svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* 评论输入 */
#commentInputBar {
    display: none; position: absolute; bottom: 0; left: 0; width: 100%;
    background: var(--white);
    padding: 10px 16px 20px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
    z-index: 100; align-items: center; gap: 12px;
    border-top: 1px solid var(--gray-200);
}
#commentInputText {
    flex: 1; height: 42px;
    background: var(--gray-100);
    border: none; border-radius: var(--radius-sm);
    padding: 0 16px; font-size: 14px; outline: none;
}
#commentInputBtn {
    background: var(--black); color: var(--white);
    border: none; border-radius: var(--radius-sm);
    height: 42px; padding: 0 20px;
    font-size: 14px; font-weight: 700; cursor: pointer;
}

/* ---------- 24. 设置页面 ---------- */
.settings-page { z-index: 15; background: var(--gray-100); }
.settings-scroll-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 40px; }
.settings-group { margin: 16px; }
.settings-item {
    padding: 18px; background: var(--white);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-card);
}
.settings-item:last-child { margin-bottom: 0; }
.settings-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.settings-label { font-size: 15px; color: var(--black); font-weight: 700; margin-bottom: 10px; }
.settings-label.inline { margin-bottom: 0; }
.fetch-btn {
    background: var(--black); color: var(--white);
    border: none; border-radius: var(--radius-sm);
    padding: 9px 18px; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: transform 0.1s, opacity var(--transition);
}
.fetch-btn:active { transform: scale(0.95); opacity: 0.8; }
.fetch-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.settings-input {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 12px 14px; font-size: 15px;
    outline: none; width: 100%;
    transition: border-color var(--transition);
    background: var(--white);
}
.settings-textarea {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 12px 14px; font-size: 15px;
    outline: none; width: 100%; height: 90px;
    resize: none; font-family: inherit;
    transition: border-color var(--transition);
    background: var(--white);
}
.settings-input:focus, .settings-textarea:focus { border-color: var(--gray-400); }
input[type="number"].settings-input { font-weight: 700; font-size: 16px; color: var(--black); }
.settings-input[multiple] {
    min-height: 88px;
    padding: 6px 8px;
}
.settings-input[multiple] option {
    padding: 6px 8px;
}
.settings-input[multiple] option:checked {
    background: var(--black) linear-gradient(0deg, var(--black) 0%, var(--black) 100%);
    color: var(--white);
}
.settings-tips { font-size: 13px; color: var(--gray-500); margin: 0 16px 20px; line-height: 1.8; }
.save-btn-wrapper { padding: 10px 16px 20px; }
.save-btn {
    width: 100%;
    background: var(--black); color: var(--white);
    border: none; border-radius: var(--radius-md);
    padding: 15px; font-size: 16px; font-weight: 700;
    cursor: pointer; transition: transform 0.1s, opacity var(--transition);
}
.save-btn:active { transform: scale(0.98); opacity: 0.8; }
.section-title { margin: 22px 16px 6px; font-size: 13px; color: var(--gray-400); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

.avatar-uploader {
    display: flex; align-items: center; gap: 14px;
    cursor: pointer; padding: 12px;
    border: 1.5px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    transition: border-color var(--transition);
}
.avatar-uploader:active { border-color: var(--gray-500); }
.avatar-preview {
    width: 52px; height: 52px; border-radius: 50%;
    object-fit: cover; border: 1px solid var(--gray-200);
}
.upload-text { font-size: 14px; color: var(--black); font-weight: 700; }
.upload-desc { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

.plan-reminder-inactive-hint { display: none; font-size: 11px; color: #c4a35a; margin-top: 6px; }
.plan-reminder-inactive-hint.show { display: block; }

/* 开关 */
.toggle-switch {
    position: relative; width: 46px; height: 26px;
    background: var(--gray-300); border-radius: 13px;
    cursor: pointer; transition: background 0.3s ease;
}
.toggle-switch::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 22px; height: 22px;
    background: var(--white); border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
}
.toggle-switch.active { background: var(--black); }
.toggle-switch.active::after { transform: translateX(20px); }

.css-preview-box {
    background: var(--gray-100); padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 10px; border: 1px solid var(--gray-200);
}
.css-editor {
    height: 130px;
    background: var(--gray-100); color: var(--gray-600);
    border: 1.5px dashed var(--gray-300);
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 12px; line-height: 1.6;
}
.css-editor:focus { background: var(--white); border-color: var(--gray-400); }

/* ---------- 25. 世界书 ---------- */
.wb-swipe-container {
    position: relative; overflow: hidden;
    margin: 14px 16px; border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    background: var(--white); border: 1px solid var(--gray-200);
}
.wb-swipe-content {
    position: relative; z-index: 2;
    background: var(--white);
    transition: transform 0.2s ease;
    width: 100%; display: flex;
    justify-content: space-between; align-items: center;
    padding: 16px; cursor: pointer;
}
.wb-swipe-content:active { background: #fafafa; }
.wb-card-title { font-size: 16px; font-weight: 700; color: var(--black); pointer-events: none; }
.wb-card-count { font-size: 12px; color: var(--gray-400); margin-top: 4px; pointer-events: none; }
.swipe-actions { position: absolute; right: 0; top: 0; bottom: 0; display: flex; z-index: 1; }
.action-btn {
    width: 72px; display: flex; justify-content: center; align-items: center;
    color: var(--white); font-size: 13px; font-weight: 700; cursor: pointer;
}
.pin-btn { background: var(--dark); }
.del-btn { background: var(--red); }

.wb-entry-preview-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 14px 40px 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-card);
    cursor: pointer; position: relative;
    border: 1px solid var(--gray-200);
    transition: background var(--transition);
}
.wb-entry-preview-card:active { background: #fafafa; }
.wb-entry-preview-keyword-row {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px; padding-right: 12px;
}
.wb-entry-preview-keyword {
    font-size: 15px; font-weight: 700; color: var(--black);
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wb-entry-preview-mode {
    flex-shrink: 0; font-size: 11px; font-weight: 700;
    line-height: 1; padding: 4px 10px;
    border-radius: 999px;
    background: var(--gray-100); color: var(--gray-500);
}
.wb-entry-preview-mode.always { background: var(--gray-200); color: var(--black); }
.wb-read-mode-row { display: flex; gap: 8px; margin-top: 8px; }
.wb-read-mode-btn {
    flex: 1; min-height: 38px;
    border: 1.5px solid var(--gray-200);
    background: var(--white); color: var(--gray-600);
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 700; cursor: pointer;
    padding: 8px 0;
    transition: all var(--transition);
}
.wb-read-mode-btn.active {
    background: var(--black); border-color: var(--black); color: var(--white);
}
.wb-entry-preview-content {
    font-size: 13px; color: var(--gray-500); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- 26. 主题页 ---------- */
.theme-icon-grid { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; }
.theme-icon-box {
    width: 45%; display: flex; flex-direction: column;
    align-items: center; gap: 8px; cursor: pointer;
    padding: 12px; background: var(--gray-100);
    border-radius: var(--radius-md);
    border: 1.5px dashed var(--gray-300);
    transition: border-color var(--transition);
}
.theme-icon-box:active { border-color: var(--gray-500); background: var(--gray-200); }
.theme-icon-preview {
    width: 52px; height: 52px; border-radius: var(--radius-md);
    object-fit: cover; box-shadow: var(--shadow-card);
}
.theme-icon-name { font-size: 12px; color: var(--gray-600); font-weight: 700; }
.app-icon-preview {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: rgba(200,200,200,0.15);
    border: 1px solid rgba(200,200,200,0.3);
    display: flex; justify-content: center; align-items: center;
    flex-shrink: 0; margin: 0 auto 5px;
}
.app-icon-preview svg { width: 20px; height: 20px; }

/* ---------- 27. Toast & 确认框（粉色品牌色） ---------- */
.toast-overlay {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    display: flex; justify-content: center; align-items: center;
    pointer-events: none; z-index: 999999;
    opacity: 0; transition: opacity 0.3s ease;
}
.toast-overlay.show { opacity: 1; pointer-events: auto; }
.toast-box {
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 22px 28px;
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 48px rgba(0,0,0,0.12);
    text-align: center; max-width: 78%;
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
    font-family: ui-rounded, "SF Pro Rounded", "Nunito", sans-serif;
}
.toast-overlay.show .toast-box { transform: scale(1); }
.toast-title { font-size: 18px; font-weight: 800; color: var(--pink); margin-bottom: 10px; }
.toast-msg { font-size: 15px; color: var(--gray-800); line-height: 1.6; font-weight: 600; }

.confirm-btn {
    flex: 1; padding: 13px;
    font-size: 15px; font-weight: 700;
    border-radius: var(--radius-sm);
    border: none; cursor: pointer;
    transition: opacity var(--transition);
}
.btn-cancel { background: var(--gray-100); color: var(--gray-600); }
.btn-confirm { background: var(--black); color: var(--white); }
.btn-cancel:active, .btn-confirm:active { opacity: 0.7; }

/* ---------- 28. iOS 通知 ---------- */
.ios-notification {
    position: fixed; top: -100px; left: 50%; transform: translateX(-50%);
    width: 94%; background: rgba(255,255,255,0.9);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    display: flex; align-items: center;
    padding: 13px 16px; z-index: 9999999;
    transition: top 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
    pointer-events: none;
}
.ios-notification.show { top: 20px; }
.ios-notif-avatar { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; margin-right: 12px; flex-shrink: 0; }
.ios-notif-info { flex: 1; overflow: hidden; }
.ios-notif-title { font-size: 14px; font-weight: 700; color: var(--black); margin-bottom: 2px; }
.ios-notif-desc { font-size: 13px; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 29. 电话界面 ---------- */
.call-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 99999; background: var(--black); color: var(--white);
    display: none; flex-direction: column; overflow: hidden;
}
.call-screen.show { display: flex; }
.call-bg {
    position: absolute; top: -10%; left: -10%;
    width: 120%; height: 120%;
    background-size: cover; background-position: center;
    filter: blur(28px) brightness(0.25); z-index: 1;
}
.call-content { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; width: 100%; }
.call-header { padding-top: 70px; text-align: center; }
.call-name { font-size: 34px; font-weight: 300; margin-bottom: 8px; letter-spacing: 1px; }
.call-status { font-size: 15px; color: rgba(255,255,255,0.6); font-weight: 500; }
.call-center {
    flex: 1; display: flex; justify-content: center; align-items: center;
    padding: 30px; overflow: hidden; min-height: 0;
}
.call-subtitle {
    font-size: 20px; text-align: center; line-height: 1.7;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    font-weight: 600; opacity: 0.9; transition: opacity 0.3s;
    width: 100%; max-height: 100%; overflow-y: auto;
    -webkit-overflow-scrolling: touch; padding: 10px 0;
}
.call-bottom {
    padding-bottom: 60px;
    display: flex; justify-content: space-around; align-items: center;
    width: 100%; padding-left: 40px; padding-right: 40px; flex-shrink: 0;
}
.call-btn {
    width: 72px; height: 72px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; color: var(--white);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: transform 0.1s;
}
.call-btn:active { transform: scale(0.88); }
.call-btn.red { background: var(--red); }
.call-btn.green { background: var(--green); }
.call-btn.gray { background: rgba(255,255,255,0.2); backdrop-filter: blur(10px); }
.call-btn svg { width: 34px; height: 34px; fill: var(--white); }
.call-input-bar {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: var(--white);
    padding: 12px 16px 26px;
    display: none; align-items: center; gap: 10px; z-index: 10;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
}
.call-input-bar.show { display: flex; transform: translateY(0); }
.call-input-bar input {
    flex: 1; height: 44px;
    border-radius: 22px; border: 1.5px solid var(--gray-200);
    padding: 0 16px; font-size: 15px; outline: none;
    color: var(--black); background: var(--gray-100);
}
.call-input-bar button {
    background: var(--black); color: var(--white);
    border: none; border-radius: 22px;
    padding: 0 20px; height: 44px;
    font-weight: 700; font-size: 15px; cursor: pointer;
}

/* ---------- 30. 灵动岛 ---------- */
.dynamic-island {
    position: fixed; top: -80px; left: 50%; transform: translateX(-50%);
    width: 86%; max-width: 360px;
    background: var(--black);
    border-radius: 28px; padding: 14px 16px;
    display: flex; align-items: center; gap: 10px;
    z-index: 9999999;
    transition: top 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.dynamic-island.show { top: 16px; }
.di-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.di-info { flex: 1; overflow: hidden; }
.di-name { font-size: 14px; font-weight: 700; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.di-status { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.di-actions { display: flex; gap: 8px; flex-shrink: 0; }
.di-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; transition: transform 0.1s;
}
.di-btn:active { transform: scale(0.85); }
.di-btn svg { width: 18px; height: 18px; }
.di-btn-red { background: var(--red); }
.di-btn-green { background: var(--green); }

/* ---------- 31. 视频通话 ---------- */
.video-call-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 99998; background: var(--black); color: var(--white);
    display: none; flex-direction: column; overflow: hidden;
}
.video-call-screen.show { display: flex; }
.video-call-bg {
    position: absolute; top: -10%; left: -10%;
    width: 120%; height: 120%;
    background-size: cover; background-position: center;
    filter: blur(32px) brightness(0.2) saturate(1.1); z-index: 1;
}
.video-call-content { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; width: 100%; }
.video-call-top { padding: 50px 20px 10px; display: flex; align-items: center; justify-content: space-between; }
.video-call-char-pip {
    width: 88px; height: 118px; border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.15);
}
.video-call-char-pip img { width: 100%; height: 100%; object-fit: cover; }
.video-call-timer { font-size: 15px; color: rgba(255,255,255,0.6); font-weight: 500; }
.video-call-center {
    position: relative; flex: 1;
    display: flex; justify-content: center; align-items: center;
    padding: 30px; overflow: hidden; min-height: 0;
}
.video-call-subtitle {
    font-size: 19px; text-align: center; line-height: 1.7;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    font-weight: 600; opacity: 0.9; transition: opacity 0.3s;
    width: 100%; max-height: 100%; overflow-y: auto;
    -webkit-overflow-scrolling: touch; padding: 10px 0;
}
.video-call-subtitle.history-open { visibility: hidden; }
.video-call-bottom {
    padding: 0 24px max(28px, calc(20px + env(safe-area-inset-bottom,0px)));
    display: flex; justify-content: center; align-items: center;
    gap: clamp(22px, 8vw, 42px); flex-shrink: 0;
}
.video-call-tool-btn {
    width: 72px; height: 72px; min-width: 72px; min-height: 72px;
    padding: 0; border: 0; border-radius: 50%;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: var(--white);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transition: transform 0.1s, background var(--transition);
    flex-shrink: 0;
}
.video-call-tool-btn:active { transform: scale(0.88); }
.video-call-tool-btn svg {
    width: 30px; height: 30px;
    fill: none; stroke: currentColor;
    stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
    pointer-events: none; display: block; overflow: visible;
}
.video-call-history-btn svg circle { fill: rgba(22,22,24,0.92); }
.video-call-history-btn.active { background: rgba(255,255,255,0.35); }
.video-call-bottom .call-btn.red { flex-shrink: 0; }
@media (max-width: 360px) {
    .video-call-bottom { gap: 16px; padding-left: 14px; padding-right: 14px; }
    .video-call-tool-btn { width: 62px; height: 62px; min-width: 62px; min-height: 62px; }
    .video-call-tool-btn svg { width: 26px; height: 26px; }
}

/* 视频通话聊天记录面板 */
.video-call-history {
    position: absolute; inset: 12px 12px 8px; z-index: 3;
    display: none; flex-direction: column;
    min-height: 0; overflow: hidden;
    border-radius: var(--radius-md);
    background: rgba(16,16,18,0.82);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}
.video-call-history.show { display: flex; }
.video-call-history-header {
    min-height: 56px; padding: 12px 14px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1); flex-shrink: 0;
}
.video-call-history-title { color: var(--white); font-size: 15px; font-weight: 700; }
.video-call-history-count { margin-top: 2px; color: rgba(255,255,255,0.5); font-size: 11px; }
.video-call-history-close {
    width: 36px; height: 36px; border: 0; border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: var(--white); font-size: 22px; line-height: 1; cursor: pointer;
}
.video-call-history-list {
    flex: 1; min-height: 0;
    overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
}
.video-call-history-row { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 12px; }
.video-call-history-row.is-user { align-items: flex-end; }
.video-call-history-sender { margin: 0 4px 4px; color: rgba(255,255,255,0.45); font-size: 10px; }
.video-call-history-bubble {
    max-width: 82%; padding: 9px 13px;
    border-radius: 4px 14px 14px 14px;
    background: rgba(255,255,255,0.12);
    color: var(--white); font-size: 14px; line-height: 1.5;
    text-align: left; white-space: pre-wrap; overflow-wrap: anywhere;
}
.video-call-history-row.is-user .video-call-history-bubble {
    border-radius: 14px 4px 14px 14px;
    background: rgba(255,255,255,0.25);
}
.video-call-history-empty { padding: 48px 16px; color: rgba(255,255,255,0.5); font-size: 13px; text-align: center; }
.video-call-input-bar {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: var(--white);
    padding: 12px 16px max(26px, calc(12px + env(safe-area-inset-bottom,0px)));
    display: none; align-items: center; gap: 10px; z-index: 10;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
}
.video-call-input-bar.show { display: flex; transform: translateY(0); }
.video-call-input-bar input {
    flex: 1; height: 44px; border-radius: 22px;
    border: 1.5px solid var(--gray-200);
    padding: 0 16px; font-size: 15px; outline: none;
    color: var(--black); background: var(--gray-100);
}
.video-call-input-bar button {
    background: var(--black); color: var(--white);
    border: none; border-radius: 22px;
    padding: 0 20px; height: 44px;
    font-weight: 700; font-size: 15px; cursor: pointer;
}

/* ---------- 32. 线下模式 ---------- */
.offline-action-bar {
    position: absolute; bottom: 100%; left: 10px; margin-bottom: 6px;
    display: flex; align-items: center; gap: 5px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 6px 8px 6px 12px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 14px rgba(0,0,0,0.1);
    z-index: 10;
}
.offline-action-input {
    width: 130px; height: 36px;
    border: 1.5px solid var(--gray-200);
    border-radius: 18px; padding: 0 12px;
    font-size: 11px; outline: none;
    background: var(--gray-100); color: var(--gray-800);
}
.offline-action-input::placeholder { color: var(--gray-400); font-size: 10px; }
.offline-action-input:focus { border-color: var(--gray-400); background: var(--white); }
.offline-send-btn {
    background: var(--black); color: var(--white);
    border: none; border-radius: 14px;
    padding: 7px 13px; font-size: 11px; font-weight: 700;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.offline-exit-btn {
    background: none; color: var(--gray-400);
    border: none; font-size: 16px; font-weight: 700;
    cursor: pointer; padding: 0 3px; line-height: 1; flex-shrink: 0;
}
.offline-exit-btn:active { color: var(--red); }
.offline-action-msg {
    font-size: 13px; color: var(--gray-600);
    margin: 8px auto;
    background: var(--gray-200);
    border: 1px dashed var(--gray-300);
    padding: 7px 18px; border-radius: var(--radius-md);
    max-width: 85%; text-align: center;
    line-height: 1.5; font-style: italic;
}

/* ---------- 33. 计划表 ---------- */
.planner-list { padding: 12px 10px 0; }
.planner-empty { text-align: center; padding: 48px 20px 20px; color: var(--gray-400); }
.planner-empty-title { font-size: 15px; font-weight: 700; color: var(--gray-600); margin-bottom: 6px; }
.planner-empty-desc { font-size: 12px; margin-bottom: 16px; }
.plan-card {
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 13px; margin-bottom: 10px;
    box-shadow: var(--shadow-card);
}
.plan-card.completed { opacity: 0.45; }
.plan-card.completed .plan-title { text-decoration: line-through; color: var(--gray-400); }
.plan-check {
    width: 22px; height: 22px; min-width: 22px;
    border-radius: 50%; border: 1.5px solid var(--gray-300);
    background: transparent; margin-top: 2px;
    cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.plan-check svg { width: 13px; height: 13px; stroke: var(--white); stroke-width: 3; fill: none; display: none; }
.plan-card.completed .plan-check { background: var(--black); border-color: var(--black); }
.plan-card.completed .plan-check svg { display: block; }
.plan-main { flex: 1; min-width: 0; }
.plan-title { font-size: 15px; font-weight: 700; color: var(--black); line-height: 1.4; word-break: break-word; }
.plan-meta { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.plan-note-preview {
    font-size: 12px; color: var(--gray-400); margin-top: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-actions { display: flex; gap: 4px; flex-shrink: 0; }
.plan-icon-btn {
    width: 32px; height: 32px; border: none;
    background: var(--gray-100); border-radius: var(--radius-sm);
    color: var(--gray-500); cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.plan-icon-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.plan-icon-btn:active { background: var(--gray-200); }
.plan-icon-btn.danger { color: var(--red); }
.plan-repeat-tag {
    display: inline-block; margin-left: 6px;
    font-size: 10px; color: var(--gray-600);
    background: var(--gray-200); border-radius: 8px;
    padding: 1px 7px; vertical-align: middle;
}
.planner-select-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin: 10px 10px 0; padding: 10px;
    background: var(--white); border-radius: var(--radius-md);
    font-size: 12px; color: var(--gray-600);
    box-shadow: var(--shadow-card);
}
.planner-select-bar .fetch-btn { padding: 6px 12px; font-size: 12px; }
.planner-select-delete { background: var(--red) !important; color: var(--white) !important; }
.plan-select-box { width: 18px; height: 18px; min-width: 18px; margin-top: 4px; accent-color: var(--black); }
.plan-card.selected-plan { box-shadow: 0 0 0 1.5px var(--black); }
.planner-menu-btn {
    width: 100%; margin-top: 10px; border: none;
    background: var(--gray-100); color: var(--gray-800);
    border-radius: var(--radius-sm);
    padding: 13px 14px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.planner-menu-btn:active { background: var(--gray-200); }

/* 日历 */
.planner-calendar-wrap { padding: 10px 10px 0; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.calendar-nav-btn {
    width: 36px; height: 36px; min-width: 36px;
    border: none; border-radius: 50%;
    background: var(--white); color: var(--black);
    font-size: 22px; line-height: 1; cursor: pointer;
    box-shadow: var(--shadow-card);
}
.calendar-month-label {
    flex: 1; min-width: 0; border: none; background: transparent;
    font-size: 16px; font-weight: 800; color: var(--black);
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.calendar-today-btn {
    display: block; margin: 8px auto 10px;
    border: none; background: var(--gray-200);
    color: var(--gray-600); font-size: 12px; font-weight: 700;
    border-radius: 999px; padding: 6px 16px; cursor: pointer;
}
.calendar-picker { gap: 8px; align-items: center; margin-bottom: 10px; }
.calendar-picker .settings-input { padding: 8px 10px; font-size: 14px; }
.calendar-picker .fetch-btn { padding: 8px 12px; flex-shrink: 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); width: 100%; gap: 2px; }
.calendar-weekday { text-align: center; font-size: 12px; color: var(--gray-400); font-weight: 700; padding: 6px 0; }
.calendar-day {
    min-width: 0; height: 58px; border: none;
    background: transparent; border-radius: var(--radius-sm);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px; padding: 4px 0; cursor: pointer; position: relative;
}
.calendar-day.outside { opacity: 0.3; }
.calendar-day.today { box-shadow: inset 0 0 0 1.5px var(--black); }
.calendar-day.selected { background: var(--black); color: var(--white); }
.calendar-day .solar-day { font-size: 15px; font-weight: 700; line-height: 1.1; }
.calendar-day .lunar-day {
    font-size: 10px; color: var(--gray-400); line-height: 1.1;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.calendar-day.selected .lunar-day { color: rgba(255,255,255,0.7); }
.calendar-day .plan-marker {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--black); margin-top: 2px;
}
.calendar-day .plan-marker.has-count {
    width: auto; min-width: 14px; height: 12px;
    padding: 0 3px; border-radius: 8px;
    color: var(--white); font-size: 9px; line-height: 12px; font-weight: 700;
}
.calendar-day.selected .plan-marker { background: var(--white); color: var(--black); }
.calendar-day-section { margin-top: 12px; }
.calendar-day-title { font-size: 13px; font-weight: 800; color: var(--gray-600); margin: 0 4px 8px; }

.plan-editor-box {
    width: 88%; max-width: 360px;
    max-height: 82vh; overflow-y: auto;
    text-align: left; padding: 22px 18px;
}
.plan-editor-box .toast-title { color: var(--black); text-align: center; }
.plan-editor-fields .settings-label { margin-top: 10px; margin-bottom: 6px; }
.plan-editor-fields .settings-textarea { height: 72px; }
#plannerAppHeader .planner-header-actions { display: flex; align-items: center; flex-shrink: 0; gap: 0; }

.weekday-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.weekday-chip {
    flex: 1 1 calc(14.28% - 6px);
    min-width: 36px; min-height: 36px;
    border: 1.5px solid var(--gray-200);
    background: var(--white); color: var(--gray-600);
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 700; cursor: pointer; padding: 8px 0;
}
.weekday-chip.active { background: var(--black); border-color: var(--black); color: var(--white); }
.batch-plan-preview {
    margin-top: 12px; padding: 10px 14px;
    background: var(--gray-100); border-radius: var(--radius-sm);
    font-size: 12px; color: var(--gray-500);
    line-height: 1.6; word-break: break-word;
}

/* ---------- 34. 放大编辑器 ---------- */
.expand-editor-btn {
    width: 36px; height: 36px; min-width: 36px; min-height: 36px;
    padding: 0; margin: 0; border: none;
    border-radius: var(--radius-sm);
    background: transparent; color: var(--gray-400);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}
.expand-editor-btn svg {
    width: 18px; height: 18px;
    fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
    pointer-events: none;
}
.expand-editor-btn:active { background: var(--gray-100); color: var(--black); }
.expand-editor-btn-wrap { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

#charPersona, #editCharPersona,
#charRel, #editCharRel {
    height: 140px; min-height: 140px; max-width: 100%;
    resize: vertical; overflow-x: hidden; overflow-y: auto;
    white-space: pre-wrap; word-break: break-word;
    overflow-wrap: anywhere; line-height: 1.55;
}
#editCharMemory {
    min-height: 140px; height: 140px; width: 100%; max-width: 100%;
    resize: vertical; overflow-x: hidden; overflow-y: auto;
    box-sizing: border-box; line-height: 1.6;
    white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
}
#charImagePrompt, #editCharImagePrompt {
    height: 180px; min-height: 180px; max-width: 100%;
    resize: vertical; overflow-x: hidden; overflow-y: auto;
    white-space: pre-wrap; word-break: break-word;
    overflow-wrap: anywhere; line-height: 1.55;
}

.expanded-editor-overlay {
    position: absolute; inset: 0; z-index: 80;
    display: flex; align-items: stretch; justify-content: center;
    padding: max(10px, env(safe-area-inset-top,0px)) 10px max(10px, env(safe-area-inset-bottom,0px));
    background: rgba(0,0,0,0.4);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.expanded-editor-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }
.expanded-editor-panel {
    width: 100%; max-width: 100%; min-height: 0;
    display: flex; flex-direction: column;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15);
}
.expanded-editor-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; flex-shrink: 0;
    padding: 12px 10px 10px 16px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-100);
}
.expanded-editor-title {
    font-size: 16px; font-weight: 800; color: var(--black);
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.expanded-editor-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.expanded-editor-count { font-size: 12px; color: var(--gray-400); font-weight: 600; margin-right: 4px; white-space: nowrap; }
.expanded-editor-icon-btn {
    width: 36px; height: 36px; min-width: 36px; min-height: 36px;
    padding: 0; border: none; border-radius: var(--radius-sm);
    background: transparent; color: var(--gray-600);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.expanded-editor-icon-btn svg {
    width: 18px; height: 18px;
    fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
    pointer-events: none;
}
.expanded-editor-icon-btn:active { background: var(--gray-200); color: var(--black); }
.expanded-editor-textarea {
    flex: 1; min-height: 12em; width: 100%; max-width: 100%;
    border: none; outline: none; resize: none;
    padding: 16px; font-size: 16px; line-height: 1.65;
    color: var(--black); background: var(--white);
    overflow-x: hidden; overflow-y: auto;
    white-space: pre-wrap; word-break: break-word;
    overflow-wrap: anywhere;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* ---------- 35. 响应式微调 ---------- */
@media (max-width: 400px) {
    .bottom-nav,
    #qqAppContainer .bottom-nav,
    #plannerAppContainer .bottom-nav {
        left: 12px; right: 12px; height: 64px;
    }
    .calendar-day { height: 52px; }
    .calendar-day .solar-day { font-size: 14px; }
    .weekday-chip { min-width: 32px; font-size: 12px; }
}

/* ---------- 36. 小剧场 ---------- */
.theater-page {
    z-index: 16;
    overflow: hidden;
    background:
        linear-gradient(rgba(245,245,247,0.92), rgba(245,245,247,0.92)),
        var(--white);
}

.theater-page .page-header {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.theater-scroll-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px 50px;
}

.theater-control-section {
    margin-bottom: 14px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255,255,255,0.58);
    border: 1px solid rgba(255,255,255,0.78);
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.theater-section-title {
    margin-bottom: 9px;
    color: var(--gray-800);
    font-size: 13px;
    font-weight: 800;
}

.theater-selection-summary {
    min-height: 18px;
    margin-top: 8px;
    color: var(--gray-500);
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.theater-persona-actions,
.theater-action-section,
.theater-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
}

.theater-persona-actions {
    margin-top: 10px;
}

.theater-action-section {
    margin: 4px 0 18px;
}

.theater-prompt-input {
    width: 100%;
    min-height: 125px;
    resize: vertical;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 18px;
    padding: 14px;
    background: rgba(255,255,255,0.72);
    color: var(--black);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.65;
    outline: none;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.theater-prompt-input:focus {
    border-color: rgba(26,26,26,0.35);
    background: rgba(255,255,255,0.9);
}

.theater-main-btn,
.theater-pill-btn {
    border: 1px solid rgba(255,255,255,0.68);
    border-radius: 999px;
    min-height: 42px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    transition: transform 0.15s ease, opacity 0.2s ease, background 0.2s ease;
}

.theater-main-btn {
    min-width: 128px;
    background: rgba(26,26,26,0.88);
    color: var(--white);
}

.theater-pill-btn {
    background: rgba(255,255,255,0.62);
    color: var(--gray-800);
}

.theater-pill-btn.secondary {
    background: rgba(255,255,255,0.48);
    color: var(--gray-600);
}

.theater-main-btn:active,
.theater-pill-btn:active {
    transform: scale(0.96);
    opacity: 0.78;
}

.theater-main-btn:disabled,
.theater-pill-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
}

.theater-story-article {
    margin-top: 10px;
    margin-bottom: 14px;
    padding: 24px 20px 38px;
    border-radius: 24px;
    background: rgba(255,255,255,0.68);
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 10px 28px rgba(0,0,0,0.06);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.theater-story-meta {
    margin-bottom: 18px;
    color: var(--gray-500);
    font-size: 12px;
    line-height: 1.5;
}

.theater-story-meta:empty {
    display: none;
}

.theater-story-content {
    color: #252525;
    font-family: Georgia, "Songti SC", "STSong", serif;
    font-size: 16px;
    line-height: 2;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.theater-story-content.is-empty,
.theater-story-thread.is-empty {
    color: var(--gray-400);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.7;
}

.theater-story-thread {
    min-width: 0;
}

.theater-user-turn {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin: 18px 0 12px;
    padding: 0 2px;
    box-sizing: border-box;
}

.theater-user-bubble {
    width: fit-content;
    max-width: min(76%, 460px);
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 18px 18px 5px 18px;
    background: rgba(235, 235, 235, 0.72);
    color: rgba(45, 45, 45, 0.84);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.045);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.theater-ai-segment {
    min-width: 0;
    margin: 0;
    padding: 0 2px 16px;
}

.theater-ai-content {
    color: #303030;
    font-family: Georgia, "Songti SC", "STSong", serif;
    font-size: 16px;
    line-height: 2;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.theater-segment-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    min-height: 32px;
    margin-top: 12px;
}

.theater-segment-count {
    color: rgba(95, 95, 95, 0.62);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 12px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.theater-segment-stale-note {
    margin: 4px 2px 8px;
    color: #8a6a32;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 12px;
    line-height: 1.5;
}

.theater-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theater-history-empty {
    color: var(--gray-400);
    font-size: 12px;
    line-height: 1.6;
}

.theater-history-item {
    width: 100%;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid rgba(255,255,255,0.68);
    border-radius: 999px;
    background: rgba(255,255,255,0.48);
    color: var(--gray-800);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.theater-history-item.is-current {
    background: rgba(26,26,26,0.88);
    color: var(--white);
}

.theater-persona-modal-box {
    width: 88%;
    max-width: 360px;
    text-align: left;
}

.theater-persona-modal-box .toast-title {
    text-align: center;
}

.theater-persona-modal-box .settings-input,
.theater-persona-modal-box .settings-textarea {
    margin-bottom: 12px;
}

.theater-persona-modal-box .settings-textarea {
    height: 160px;
    resize: vertical;
}

@media (max-width: 380px) {
    .theater-main-btn,
    .theater-pill-btn {
        padding-left: 14px;
        padding-right: 14px;
        font-size: 12px;
    }

    .theater-story-content,
    .theater-ai-content {
        font-size: 15px;
    }
}

@media (max-width: 600px) {
    #theaterDetailView .theater-detail-scroll {
        padding: 12px 10px 22px;
    }

    #theaterDetailView .theater-story-thread > .theater-ai-segment {
        padding: 14px 13px 12px;
        border-radius: 16px;
    }

    #theaterDetailView .theater-ai-content,
    .theater-ai-content {
        font-size: 15px;
    }

    #theaterDetailView .theater-user-bubble,
    .theater-user-bubble {
        max-width: 84%;
        font-size: 13px;
        padding: 8px 12px;
    }

    #theaterDetailView .theater-user-turn {
        margin: 16px 0;
    }

    #theaterDetailView .theater-story-footer {
        left: 10px;
        right: 10px;
    }

    .theater-stream-setting {
        padding: 10px 12px;
    }

    .theater-toggle {
        width: 42px;
        height: 26px;
    }

    .theater-toggle::after {
        width: 20px;
        height: 20px;
    }

    .theater-toggle.active::after {
        transform: translateX(16px);
    }
}

.theater-stream-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.46);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.theater-stream-setting-info {
    min-width: 0;
}

.theater-stream-setting-title {
    color: #2c2c2e;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.theater-stream-setting-desc {
    margin-top: 2px;
    color: #8e8e93;
    font-size: 12px;
    line-height: 1.4;
}

.theater-toggle {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #d8d8de;
    cursor: pointer;
    transition: background 0.2s ease;
}

.theater-toggle::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s ease;
}

.theater-toggle.active {
    background: #34c759;
}

.theater-toggle.active::after {
    transform: translateX(18px);
}

.theater-toggle:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.theater-streaming-cursor::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 2px;
    vertical-align: text-bottom;
    background: rgba(48, 48, 48, 0.72);
    animation: theaterStreamCursor 1s steps(1) infinite;
}

@keyframes theaterStreamCursor {
    50% { opacity: 0; }
}

.theater-page {
    background: #f7f7f8;
}

.theater-view {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

.theater-view.active {
    display: flex;
}

.theater-home-scroll,
.theater-create-scroll,
.theater-detail-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px 28px;
}

.theater-list-heading {
    margin: 4px 6px 12px;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 700;
}

.theater-empty-state {
    margin-top: 80px;
    padding: 0 24px;
    text-align: center;
}

.theater-empty-title {
    color: #333;
    font-size: 18px;
    font-weight: 700;
}

.theater-empty-desc {
    margin-top: 8px;
    color: #8e8e93;
    font-size: 13px;
    line-height: 1.6;
}

.theater-story-card {
    position: relative;
    margin: 12px 14px;
    padding: 18px 18px 16px;
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 22px;
    background: rgba(255,255,255,0.62);
    box-shadow: 0 10px 28px rgba(0,0,0,0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    cursor: pointer;
}

.theater-home-scroll .theater-story-card {
    margin-left: 0;
    margin-right: 0;
}

.theater-story-card-title {
    margin-right: 28px;
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.theater-story-card-summary {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    color: #666;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.theater-story-card-meta {
    margin-top: 10px;
    color: #8e8e93;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.theater-story-card-arrow {
    position: absolute;
    top: 18px;
    right: 16px;
    color: #b0b0b0;
    font-size: 22px;
    line-height: 1;
}

.theater-card-delete {
    margin-top: 12px;
    min-height: 34px;
    padding: 0 14px;
    font-size: 12px;
}

.theater-story-title {
    margin: 0 0 16px;
    color: #1a1a1a;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.theater-detail-scroll .theater-story-article {
    margin-top: 0;
    padding: 8px 2px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#theaterDetailView {
    position: relative;
}

#theaterDetailView .theater-detail-scroll {
    background: #f2f3f5;
    padding: 16px 14px calc(var(--theater-compose-space, 108px) + env(safe-area-inset-bottom));
}

#theaterDetailView .theater-story-thread {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#theaterDetailView .theater-story-article {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#theaterDetailView .theater-story-thread > .theater-ai-segment {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 18px 17px 15px;
    border: 1px solid #dedfe3;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 5px 18px rgba(25, 28, 35, 0.075);
    box-sizing: border-box;
}

#theaterDetailView .theater-segment-heading {
    margin: 0 0 10px;
    color: rgba(70, 74, 82, 0.72);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

#theaterDetailView .theater-ai-content {
    color: #303030;
    font-family: Georgia, "Songti SC", "STSong", serif;
    font-size: 16px;
    line-height: 2;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#theaterDetailView .theater-segment-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    min-height: 38px;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #ececf0;
}

#theaterDetailView .theater-user-turn {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    max-width: 100%;
    margin: 22px 0;
    padding: 0 3px;
    box-sizing: border-box;
}

#theaterDetailView .theater-user-bubble {
    width: fit-content;
    max-width: min(78%, 460px);
    padding: 10px 15px;
    border: 1px solid #d6d9df;
    border-radius: 17px 17px 5px 17px;
    background: #e3e5e9;
    color: #343840;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-shadow: 0 3px 10px rgba(25, 28, 35, 0.045);
}

#theaterDetailView .theater-segment-stale-note {
    margin: 8px 4px 0;
}

.theater-story-footer {
    margin-top: 18px;
    padding: 0 2px calc(22px + env(safe-area-inset-bottom));
}

#theaterDetailView .theater-story-footer {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

#theaterDetailView .theater-story-footer .theater-writing-status,
#theaterDetailView .theater-story-footer .theater-compose-bar {
    pointer-events: auto;
}

#theaterDetailView .theater-story-footer .theater-writing-status {
    margin: 0;
    padding: 0 8px;
    text-align: center;
}

#theaterDetailView .theater-compose-bar {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 28px rgba(25, 28, 35, 0.12);
}

.theater-rewrite-row {
    display: flex;
    justify-content: flex-start;
    margin: 16px 0 10px;
}

.theater-rewrite-mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.46);
    color: rgba(50, 50, 50, 0.72);
    font-family: inherit;
    font-size: 12px;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
}

.theater-rewrite-mini-btn:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.72);
}

.theater-rewrite-mini-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.theater-compose-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 100%;
    padding: 7px 8px 7px 13px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.56);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-sizing: border-box;
}

.theater-command-input {
    flex: 1;
    min-width: 0;
    width: auto;
    min-height: 28px;
    max-height: 120px;
    resize: none;
    padding: 5px 0;
    border: 0;
    border-radius: 0;
    outline: none;
    background: transparent;
    color: #252525;
    font: inherit;
    line-height: 1.5;
    overflow-y: auto;
    box-shadow: none;
}

.theater-command-input::placeholder {
    color: rgba(90, 90, 90, 0.68);
}

.theater-send-btn {
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.68);
    color: #444;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
}

.theater-send-btn:active {
    transform: scale(0.94);
}

.theater-send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.theater-send-btn svg,
.theater-icon-btn svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theater-writing-status {
    width: 100%;
    margin: 0 0 8px;
    color: var(--gray-400);
    font-size: 12px;
    line-height: 1.6;
}

.theater-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-sizing: border-box;
}

.theater-modal[hidden] {
    display: none !important;
}

.theater-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, 0.18);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.theater-rewrite-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    max-height: calc(100% - 8px);
    overflow: auto;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-sizing: border-box;
}

.theater-rewrite-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.theater-rewrite-dialog-header h2 {
    margin: 0;
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
}

.theater-icon-btn {
    display: inline-flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    color: #444;
    cursor: pointer;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.theater-icon-btn:active {
    transform: scale(0.96);
}

.theater-rewrite-hint {
    margin: 10px 0 12px;
    color: #666;
    font-size: 12px;
    line-height: 1.6;
}

.theater-rewrite-input {
    width: 100%;
    min-height: 100px;
    max-height: 220px;
    resize: vertical;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.52);
    color: #252525;
    font: inherit;
    line-height: 1.55;
    outline: none;
}

.theater-rewrite-dialog-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}

.theater-secondary-btn,
.theater-primary-btn {
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
    color: #555;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
}

.theater-primary-btn {
    background: rgba(255, 255, 255, 0.72);
    color: #222;
    font-weight: 700;
}

.theater-secondary-btn:active,
.theater-primary-btn:active {
    transform: scale(0.96);
}

.theater-secondary-btn:disabled,
.theater-primary-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.theater-main-btn {
    background: rgba(26,26,26,0.62);
}

.theater-header .icon-btn svg circle {
    fill: currentColor;
    stroke: none;
}

.theater-story-menu-box {
    width: 84%;
    max-width: 320px;
}

.theater-story-menu-box .toast-title {
    text-align: center;
}

.theater-story-menu-box .theater-modal-actions {
    justify-content: center;
}

@media (max-width: 380px) {
    .theater-rewrite-dialog {
        width: 100%;
    }
}