@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;600&family=Inter:wght@300;400;500;600&family=Great+Vibes&display=swap');

#curtain-overlay { position: absolute; inset: 0; z-index: 4000; display: flex; justify-content: center; align-items: center; background: transparent; font-family: 'Inter', -apple-system, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
#curtain-phone { width: 100%; height: 100%; background: #f2ebed; display: flex; flex-direction: column; overflow: hidden; position: relative; transition: background 0.4s ease; }
#curtain-phone.is-group { background: #f4eff1; }

#curtain-phone {
    --cy-bg-glass: #f2ebed; --cy-bg-phone: #f4eff1;
    --cy-note-ai: #ffffff; --cy-note-user: #fcf8f9; --cy-note-sys: #f0ecee;
    --cy-tape-ai: rgba(255,255,255,0.65); --cy-tape-user: rgba(240, 225, 230, 0.65);
    --cy-modal-bg: #ffffff;
    --cy-name-char: #6b4e58; --cy-name-user: #7a5c67; --cy-name-sys: #8a9ba8; --cy-color-stop: #b87878;
    --cy-text-main: #4a3b40; --cy-text-sub: #9a8b90; --cy-text-light: #c0b0b6;
    --cy-border-inner: rgba(107, 78, 88, 0.15); --cy-line-color: #e8dce0;
    --cy-shadow-note: 0 12px 24px rgba(107, 78, 88, 0.06), 0 2px 4px rgba(107, 78, 88, 0.04);
    --cy-font-serif: 'Noto Serif SC', 'Songti SC', serif;
    --cy-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --cy-font-script: 'Great Vibes', cursive;
}

#curtain-phone[data-theme="dark"] {
    --cy-bg-glass: #241d20; --cy-bg-phone: #241d20;
    --cy-note-ai: #2d2629; --cy-note-user: #36292d; --cy-note-sys: #282a2e;
    --cy-tape-ai: rgba(60, 50, 55, 0.65); --cy-tape-user: rgba(70, 50, 58, 0.65);
    --cy-modal-bg: #2d2428;
    --cy-name-char: #d4b4c0; --cy-name-user: #e0c4ce; --cy-name-sys: #a8b8c8;
    --cy-text-main: #e8e0e3; --cy-text-sub: #a09297; --cy-text-light: #7a6c72;
    --cy-border-inner: rgba(255, 255, 255, 0.1); --cy-line-color: #3d3135;
    --cy-shadow-note: 0 12px 24px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
    --cy-font-serif: 'Noto Serif SC', 'Songti SC', serif;
    --cy-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --cy-font-script: 'Great Vibes', cursive;
}

/* 顶栏 */
.cy-top-bar { padding: 32px 24px 12px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; border-bottom: 1px solid var(--cy-line-color); }
.cy-top-left, .cy-top-right { display: flex; align-items: center; gap: 8px; min-width: 80px; }
.cy-top-right { justify-content: flex-end; }
.cy-back-btn, .cy-icon-btn { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--cy-border-inner); color: var(--cy-name-char); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; transition: background 0.2s; }
.cy-back-btn:hover, .cy-icon-btn:hover { background: rgba(107, 78, 88, 0.2); }
.cy-top-center { flex: 1; text-align: center; }
.cy-top-title { font-family: var(--cy-font-script); font-size: 32px; color: var(--cy-name-char); line-height: 1; text-align: center; }
.cy-top-subtitle { font-size: 10px; color: var(--cy-text-sub); margin-top: 1px; font-weight: 500; }
.cy-token-badge { font-size: 9px; color: var(--cy-text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;}

/* 头像条 (群聊) */
.cy-avatar-strip { display: flex; gap: 12px; overflow-x: auto; padding: 8px 24px 12px; scrollbar-width: none; border-bottom: 1px solid var(--cy-line-color); }
.cy-avatar-strip::-webkit-scrollbar { display: none; }
.cy-avatar-item { display: flex; flex-direction: column; align-items: center; gap: 5px; flex-shrink: 0; cursor: pointer; opacity: 0.5; transition: all 0.3s; transform: scale(0.9); }
.cy-avatar-item.active { opacity: 1; transform: scale(1); }
.cy-avatar-ring { width: 44px; height: 44px; border-radius: 50%; padding: 2px; background: transparent; transition: all 0.3s; }
.cy-avatar-ring.active { background: linear-gradient(135deg, #c9a0b0, #a8789a); box-shadow: 0 0 12px rgba(168, 120, 154, 0.4); }
.cy-avatar-ring.has-voice:not(.active) { background: linear-gradient(135deg, rgba(201,160,176,0.3), rgba(168,120,154,0.3)); }
.cy-avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--cy-line-color); display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--cy-text-sub); border: 2px solid var(--cy-bg-phone); }
.cy-avatar-name { font-size: 10px; color: var(--cy-text-sub); max-width: 48px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cy-avatar-item.active .cy-avatar-name { color: var(--cy-name-char); font-weight: 600; }

/* 滚动区 */
.cy-story-flow { flex: 1; overflow-y: auto; padding: 24px 20px 12px; display: flex; flex-direction: column; gap: 28px; scrollbar-width: none; }
.cy-story-flow::-webkit-scrollbar { display: none; }

/* ================== 单聊卡片 (story-block，无 tape) ================== */
.story-block {
    background: rgba(255,255,255,0.98);
    border-radius: 20px; border: 1px solid rgba(255,255,255,0.9);
    box-shadow: 0 16px 32px rgba(0,0,0,0.05);
    flex-shrink: 0; display: flex; flex-direction: column;
    padding: 24px; position: relative;
    animation: cyFadeSlideIn 0.35s ease;
}
@keyframes cyFadeSlideIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes breath { 0%,100%{opacity:0.5;text-shadow:none;} 50%{opacity:1;text-shadow:0 0 8px var(--cy-name-char);} }

/* 单聊头部：左照片 + 右信息 */
.card-header { display: flex; gap: 20px; margin-bottom: 20px; }
.note-user .card-header { flex-direction: row-reverse; text-align: right; }

.framed-photo {
    width: 100px; height: 135px; flex-shrink: 0; margin-top: -24px;
    background: rgba(255,255,255,0.9); border-radius: 6px; padding: 4px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.08); border: 1px solid var(--cy-border-inner);
    overflow: hidden; z-index: 10;
}
[data-theme="dark"] .framed-photo { background: rgba(36,29,32,0.9); box-shadow: 0 12px 24px rgba(0,0,0,0.4); }

.photo-inner {
    width: 100%; height: 100%; border-radius: 3px; border: 1px solid var(--cy-border-inner);
    background: linear-gradient(135deg, #dcd4d7, #ebe4e6);
    background-size: cover; background-position: center;
}
[data-theme="dark"] .photo-inner {
    background: linear-gradient(135deg, #4a3b40, #36292d);
    border-color: rgba(255,255,255,0.1);
}

.info-box { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 4px; }
.floor-num { font-size: 9px; color: var(--cy-text-sub); letter-spacing: 1px; margin-bottom: 10px; text-transform: uppercase; }
.char-name { font-family: var(--cy-font-serif); font-size: 26px; font-weight: 400; color: var(--cy-name-char); line-height: 1.1; letter-spacing: 2px; }
.note-user .char-name { color: var(--cy-name-user); }
.char-en { font-size: 9px; color: var(--cy-text-sub); text-transform: uppercase; letter-spacing: 2px; margin-top: 6px; }

/* 单聊 AI 卡片右上角 Regen 按钮 */
.story-block.note-ai .card-header { position: relative; }
.regen-corner {
    position: absolute; top: 0; right: 0;
    font-size: 18px; color: var(--cy-text-light);
    background: transparent; border: none; cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    padding: 4px;
}
.regen-corner:hover { color: var(--cy-name-char); transform: rotate(-30deg); }

/* 单聊状态栏 — 用.note-ai（非.sticky-note）隔离 */
.story-block.note-ai .status-wrap { margin-bottom: 20px; display: flex; flex-direction: column; align-items: center; }
.story-block.note-ai .status-trigger {
    display: inline-flex; align-items: center; cursor: pointer; user-select: none;
    padding: 4px 12px; opacity: 0.85; transition: opacity 0.3s;
}
.story-block.note-ai .status-trigger:hover { opacity: 1; }
.story-block.note-ai .trigger-text {
    font-family: var(--cy-font-script);
    font-size: 20px;
    color: var(--cy-name-char); line-height: 1; letter-spacing: 0.5px;
}
.story-block.note-ai .status-content {
    display: none; width: 100%; flex-direction: column;
    background: rgba(0,0,0,0.03); border: 1px solid var(--cy-line-color); border-radius: 8px;
    padding: 16px; margin-top: 8px; animation: fadeIn 0.3s ease;
}
.story-block.note-ai .status-wrap.open .status-content { display: flex; }
.story-block.note-ai .s-row { display: flex; align-items: baseline; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--cy-line-color); }
.story-block.note-ai .s-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.story-block.note-ai .s-col { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--cy-line-color); }
.story-block.note-ai .s-col:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.story-block.note-ai .s-label { font-size: 8px; font-weight: 500; color: var(--cy-text-sub); text-transform: uppercase; letter-spacing: 1px; width: 45px; flex-shrink: 0; }
.story-block.note-ai .s-value { font-family: var(--cy-font-serif); font-size: 12px; font-weight: 400; color: var(--cy-text-main); line-height: 1.6; }
.story-block.note-ai .s-col .s-value { line-height: 1.9; text-align: justify; }

/* 单聊用户装饰语 */
.user-deco-script { font-family: var(--cy-font-script); font-size: 20px; color: var(--cy-name-user); line-height: 1; opacity: 0.7; text-align: right; margin-bottom: 20px; padding-right: 12px; }

/* 正文区 */
.card-body { position: relative; display: flex; flex-direction: column; gap: 16px; transform: translateZ(0); }
.static-content { display: flex; flex-direction: column; gap: 16px; white-space: normal; word-break: break-word; }

/* AI 角色旁白：加深为深灰梅色 */
.narration { font-family: var(--cy-font-serif); font-size: 13px; font-weight: 400; color: #736368; line-height: 2.1; text-align: justify; font-style: normal; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; white-space: pre-wrap; word-break: break-word; }

/* AI 角色对话：偏暖的深玫瑰棕 */
.dialogue { font-family: var(--cy-font-serif); font-size: 14px; font-weight: 400; color: #4a3b40; line-height: 1.9; padding-left: 14px; border-left: 2px solid var(--cy-name-char); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; white-space: pre-wrap; word-break: break-word; }

/* USER 旁白：偏冷的霜梅灰 */
.note-user .narration { text-align: right; color: #786b72; }

/* USER 对话：偏冷的灰紫棕 */
.note-user .dialogue { padding-left: 0; padding-right: 14px; border-left: none; border-right: 2px solid var(--cy-name-user); text-align: right; color: #52454a; }

/* 夜间模式：保证黑底上清晰但不刺眼 */
[data-theme="dark"] .narration { color: #b5aab0; }
[data-theme="dark"] .note-user .narration { color: #b0a5ab; }
[data-theme="dark"] .dialogue { color: #e8e0e3; }
[data-theme="dark"] .note-user .dialogue { color: #e0d8db; }

/* 编辑模式 */
.edit-content { display: none; }
.edit-textarea { width: 100%; min-height: 120px; background: transparent; border: 1px dashed var(--cy-name-char); border-radius: 8px; padding: 12px; font-family: var(--cy-font-serif); font-size: 13px; color: var(--cy-text-main); line-height: 2; resize: vertical; outline: none; }
.note-user .edit-textarea { border-color: var(--cy-name-user); }
.story-block.is-editing .static-content { display: none; }
.story-block.is-editing .edit-content { display: block; animation: fadeIn 0.3s ease; }

/* 底部操作区 */
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--cy-line-color); }
.note-user .card-footer { flex-direction: row-reverse; }
.token-cost { font-size: 10px; color: var(--cy-text-sub); letter-spacing: 0.5px; }
.ops { display: flex; gap: 16px; align-items: center; }
.ops.ops-edit { display: none; gap: 12px; }
.story-block.is-editing .ops-normal { display: none; }
.story-block.is-editing .ops-edit { display: flex; }
.op-btn { font-family: var(--cy-font-sans); font-size: 9px; font-weight: 500; color: var(--cy-text-sub); text-transform: uppercase; letter-spacing: 1px; cursor: pointer; background: transparent; border: none; transition: 0.2s; }
.op-btn:hover { color: var(--cy-name-char); }
.note-user .op-btn:hover { color: var(--cy-name-user); }
.op-btn.del:hover { color: var(--cy-color-stop); }
.op-btn.save { color: var(--cy-name-char); font-weight: 600; border: 1px solid var(--cy-name-char); padding: 4px 10px; border-radius: 4px; }
.note-user .op-btn.save { color: var(--cy-name-user); border-color: var(--cy-name-user); }

/* 单聊心声按钮 */
.whisper-btn { display: flex; align-items: center; gap: 4px; color: var(--cy-name-char); font-family: var(--cy-font-script); font-size: 16px; text-transform: none; letter-spacing: 0; cursor: pointer; animation: breath 2.5s infinite; border: none; background: transparent; }

/* 单聊导演卡 */
.story-block.note-director { background: rgba(255,255,255,0.6); border: 1.5px dashed var(--cy-name-sys); }
.note-director .char-name { color: var(--cy-name-sys); font-size: 18px; margin-bottom: 12px; }
.note-director .narration { color: var(--cy-name-sys); font-family: var(--cy-font-sans); }
.note-director .card-footer { border-top: none; padding-top: 0; margin-top: 0; }

/* ================== 群聊卡片 (sticky-note / note-card) ================== */
.note-card {
    border-radius: 4px 4px 16px 16px; padding: 28px 20px 20px;
    box-shadow: var(--cy-shadow-note); border: 1px solid rgba(255,255,255,0.1);
    position: relative; animation: cySlideNote 0.3s ease; flex-shrink: 0; display: flex; flex-direction: column;
}
@keyframes cySlideNote { from { opacity: 0; transform: translateY(10px) rotate(-0.5deg); } to { opacity: 1; transform: translateY(0) rotate(0deg); } }
.story-block.note-user { background: #faf2f5; }
.note-card.note-user { background: #faf2f5; }
.note-card.note-user::before {
    content: ''; position: absolute; top: -12px; left: 50%;
    transform: translateX(-50%) rotate(1.5deg); width: 80px; height: 24px;
    background: var(--cy-tape-user); border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04); z-index: 10; opacity: 0.9;
}

.sticky-note {
    border-radius: 4px 4px 16px 16px; padding: 28px 20px 20px;
    box-shadow: var(--cy-shadow-note); border: 1px solid rgba(255,255,255,0.1);
    position: relative; animation: cySlideNote 0.3s ease; flex-shrink: 0; display: flex; flex-direction: column;
}
.sticky-note::before {
    content: ''; position: absolute; top: -12px; left: 50%;
    transform: translateX(-50%) rotate(-2deg); width: 80px; height: 24px;
    border: 1px solid rgba(0,0,0,0.03); box-shadow: 0 2px 6px rgba(0,0,0,0.04); z-index: 10; opacity: 0.9;
}
.sticky-note.note-ai { background: var(--cy-note-ai); }
.sticky-note.note-ai::before { background: var(--cy-tape-ai); }
.sticky-note.note-director { background: var(--cy-note-sys); }
.sticky-note.note-director::before { background: var(--cy-tape-ai); opacity: 0.4; }

/* 群聊头部 */
.card-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--cy-line-color); }
.note-user .card-header { flex-direction: row-reverse; text-align: right; }
.header-left { display: flex; flex-direction: column; gap: 4px; }
.scene-title { font-family: var(--cy-font-script); font-size: 26px; color: var(--cy-name-char); line-height: 1; margin-bottom: 4px; }
.note-user .scene-title { color: var(--cy-name-user); }
.floor-meta { font-family: var(--cy-font-sans); font-size: 9px; color: var(--cy-text-sub); letter-spacing: 1px; text-transform: uppercase; }

/* 群聊状态栏 */
.sticky-note .status-wrap { margin-bottom: 20px; position: relative; }
.sticky-note .status-trigger {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
    padding: 4px 12px; border: 1px solid var(--cy-line-color); border-radius: 0 8px 8px 0;
    background: rgba(107,78,88,0.03); border-left: 3px solid var(--cy-name-char);
    transition: 0.3s; margin-left: -20px; box-shadow: 2px 2px 8px rgba(0,0,0,0.02);
}
.sticky-note .status-trigger:hover { opacity: 0.8; }
.sticky-note .trigger-text { font-family: var(--cy-font-sans); font-size: 9px; font-weight: 500; color: var(--cy-name-char); text-transform: uppercase; letter-spacing: 1.5px; }
.sticky-note .status-content {
    display: none; flex-direction: column; gap: 12px;
    background: rgba(107,78,88,0.02); border-left: 2px solid var(--cy-name-char);
    padding: 16px; margin-top: 8px; animation: fadeIn 0.3s ease;
}
.sticky-note .status-wrap.open .status-content { display: flex; }
.sticky-note .s-row { display: flex; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 1px dashed var(--cy-line-color); }
.sticky-note .s-row:last-child { border-bottom: none; padding-bottom: 0; }
.sticky-note .s-label { font-family: var(--cy-font-sans); font-size: 8px; font-weight: 500; color: var(--cy-text-sub); text-transform: uppercase; letter-spacing: 1px; width: 40px; flex-shrink: 0; }
.sticky-note .s-value { font-family: var(--cy-font-serif); font-size: 12px; font-weight: 400; color: var(--cy-text-main); line-height: 1.6; text-align: justify; }

/* 群聊正文 */
.note-card .card-body { position: relative; display: flex; flex-direction: column; gap: 16px; }
.note-card .static-content { display: flex; flex-direction: column; gap: 16px; white-space: normal; word-break: break-word; }

/* AI 角色旁白：加深为深灰梅色 */
.note-card .narration { font-family: var(--cy-font-serif); font-size: 13px; font-weight: 400; color: #736368; line-height: 2.1; text-align: justify; font-style: normal; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* AI 角色对话：偏暖的深玫瑰棕 */
.note-card .dialogue { font-family: var(--cy-font-serif); font-size: 14px; font-weight: 400; color: #4a3b40; line-height: 1.9; padding-left: 14px; border-left: 2px solid var(--cy-name-char); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* USER 旁白：偏冷的霜梅灰 */
.note-card.note-user .narration { text-align: right; color: #786b72; }

/* USER 对话：偏冷的灰紫棕 */
.note-card.note-user .dialogue { padding-left: 0; padding-right: 14px; border-left: none; border-right: 2px solid var(--cy-name-user); text-align: right; color: #52454a; }

/* 🌙 夜间模式：保证黑底上清晰但不刺眼 */
[data-theme="dark"] .note-card .narration { color: #b5aab0; }
[data-theme="dark"] .note-card.note-user .narration { color: #b0a5ab; }
[data-theme="dark"] .note-card .dialogue { color: #e8e0e3; }
[data-theme="dark"] .note-card.note-user .dialogue { color: #e0d8db; }

/* 群聊编辑模式 */
.note-card .edit-content { display: none; }
.note-card.is-editing .static-content { display: none; }
.note-card.is-editing .edit-content { display: block; animation: fadeIn 0.3s ease; }
.note-card.is-editing .ops-normal { display: none; }
.note-card.is-editing .ops-edit { display: flex; }

/* 群聊底部 */
.note-card .card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--cy-line-color); }
.note-card.note-user .card-footer { flex-direction: row-reverse; }
.note-card .token-cost { font-family: var(--cy-font-sans); font-size: 9px; color: var(--cy-text-sub); letter-spacing: 1px; text-transform: uppercase; }
.note-card .ops { display: flex; gap: 16px; }
.note-card .ops.ops-edit { display: none; }

/* 群聊心声区 */
.inner-voice-zone { margin-top: 24px; padding: 16px; background: rgba(107,78,88,0.03); border: 1px solid var(--cy-line-color); border-radius: 4px; position: relative; z-index: 1; }
.inner-voice-zone::before { content: 'Thoughts'; position: absolute; top: -10px; left: 16px; background: var(--cy-note-ai); padding: 0 8px; font-family: var(--cy-font-script); font-size: 16px; color: var(--cy-name-char); line-height: 1; }
.iv-name { font-family: var(--cy-font-sans); font-size: 9px; color: var(--cy-text-sub); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.iv-content { font-family: var(--cy-font-serif); font-size: 12px; color: var(--cy-text-main); line-height: 1.8; margin-bottom: 8px; font-style: normal; }
.iv-deep { font-family: var(--cy-font-serif); font-size: 12px; color: var(--cy-name-char); line-height: 1.8; padding-left: 10px; border-left: 1px dashed var(--cy-name-char); font-style: normal; }

/* 群聊导演卡水印 */
.sticky-note.note-director .bg-watermark { position: absolute; top: -10px; right: 20px; font-family: var(--cy-font-serif); font-size: 100px; color: rgba(138,155,168,0.05); line-height: 1; z-index: 0; pointer-events: none; }
.sticky-note.note-director .scene-title { color: var(--cy-name-sys); }

/* 暗色模式 */
[data-theme="dark"] .story-block.note-user { background: #261e22; }
[data-theme="dark"] .note-card.note-user { background: #261e22; }
[data-theme="dark"] .note-card.note-user::before { background: rgba(70,50,58,0.85); }
[data-theme="dark"] .sticky-note.note-ai::before { background: rgba(60,50,55,0.85); }
[data-theme="dark"] .sticky-note.note-director::before { background: rgba(60,50,55,0.5); }
[data-theme="dark"] .inner-voice-zone { background: rgba(0,0,0,0.15); }

/* 向后兼容 .cy-* 类 */
.cy-floor-card { border-radius: 18px; animation: cyFadeSlideIn 0.35s ease; position: relative; }
.cy-floor-ai { background: rgba(255,255,255,0.85); border-radius: 20px; border: 1px solid rgba(255,255,255,0.9); box-shadow: 0 16px 32px rgba(0,0,0,0.05); margin-top: 10px; }
.cy-framed-photo { width: 100px; height: 135px; flex-shrink: 0; margin-top: -44px; background: rgba(255,255,255,0.9); border-radius: 6px; padding: 4px; box-shadow: 0 12px 24px rgba(0,0,0,0.08); border: 1px solid var(--cy-border-inner); overflow: hidden; z-index: 10; }
[data-theme="dark"] .cy-framed-photo { background: rgba(36,29,32,0.85); box-shadow: 0 12px 24px rgba(0,0,0,0.3); }
.cy-photo-inner { width: 100%; height: 100%; border-radius: 3px; border: 1px solid var(--cy-border-inner); background: linear-gradient(135deg, #dcd4d7, #ebe4e6); background-size: cover; background-position: center; }
[data-theme="dark"] .cy-photo-inner { background: linear-gradient(135deg, #4a3b40, #36292d); }
.cy-card-header { display: flex; gap: 20px; padding: 16px 16px 0 80px; min-height: 48px; align-items: flex-end; }
.cy-info-box { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 4px; }
.cy-floor-num { font-size: 9px; color: var(--cy-text-sub); letter-spacing: 1px; margin-bottom: 8px; text-transform: uppercase; }
.cy-char-name { font-family: var(--cy-font-serif); font-size: 22px; font-weight: 400; color: var(--cy-name-char); line-height: 1.1; letter-spacing: 2px; }
.cy-char-en { font-size: 9px; color: var(--cy-text-sub); text-transform: uppercase; letter-spacing: 2px; margin-top: 4px; }

/* ================== 输入区 ================== */
.cy-input-area { flex-shrink: 0; padding: 16px 20px 32px; background: rgba(242, 235, 237, 0.85); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-top: 1px solid #ffffff; z-index: 10; display: flex; flex-direction: column; gap: 12px; }
.cy-mode-bar { display: flex; gap: 24px; padding-left: 4px; justify-content: flex-start; }
.cy-mode-btn { flex: 0 0 auto; padding: 0 0 6px 0 !important; border: none !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--cy-text-light); font-size: 13px; font-family: var(--cy-font-serif); font-weight: 400; letter-spacing: 2px; cursor: pointer; transition: color 0.3s; position: relative; }
.cy-mode-btn:hover { background: transparent !important; color: var(--cy-text-sub); }
.cy-mode-btn.active { background: transparent !important; color: var(--cy-name-char); border-color: transparent !important; font-weight: 600; }
.cy-mode-btn.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--cy-name-char); }
.cy-input-header { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; margin-bottom: -4px; gap: 12px; }
.cy-mode-hint { flex: 1; min-width: 0; font-family: var(--cy-font-serif); font-style: italic; font-size: 12px; color: var(--cy-text-sub); letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.narration-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; transition: opacity 0.3s; flex-shrink: 0; }
.n-checkbox { position: absolute; opacity: 0; pointer-events: none; }
.n-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.n-icon { width: 12px; height: 12px; border: 1px solid var(--cy-text-light); border-radius: 2px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.n-icon::after { content: '\2713'; font-family: var(--cy-font-sans); font-size: 9px; color: #ffffff; opacity: 0; transform: scale(0.5); transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.n-checkbox:checked + .n-label .n-icon { background: var(--cy-name-char); border-color: var(--cy-name-char); }
.n-checkbox:checked + .n-label .n-icon::after { opacity: 1; transform: scale(1); }
.n-text { font-family: var(--cy-font-serif); font-size: 11px; color: var(--cy-text-sub); letter-spacing: 1px; transition: color 0.2s, font-weight 0.2s; }
.n-checkbox:checked + .n-label .n-text { color: var(--cy-name-char); font-weight: 600; }
.cy-input-row { display: flex; gap: 10px; align-items: center; }
.cy-regen-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--cy-line-color); background: var(--cy-note-ai); color: var(--cy-text-sub); font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: transform 0.2s; }
.cy-regen-btn:hover { transform: rotate(-30deg); color: var(--cy-name-char); }
.cy-input-box { flex: 1; background: rgba(107,78,88,0.05); border: 1.5px solid transparent; border-radius: 20px; padding: 0 16px; height: 42px; display: flex; align-items: center; transition: border-color 0.2s; }
.cy-input-box:focus-within { border-color: #a8789a; background: var(--cy-note-ai); }
.cy-input-box input { width: 100%; border: none; background: transparent; font-size: 13px; color: var(--cy-text-main); outline: none; font-family: var(--cy-font-serif); }
.cy-input-box input::placeholder { color: var(--cy-text-light); font-style: normal; }
.cy-send-btn { width: 42px; height: 42px; border-radius: 50%; border: none; background: linear-gradient(135deg, #c9a0b0, #a8789a); color: white; font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; box-shadow: 0 4px 12px rgba(168, 120, 154, 0.3); transition: transform 0.1s; }
.cy-send-btn:active { transform: scale(0.95); }
.cy-send-btn.is-generating { background: var(--cy-color-stop); box-shadow: 0 4px 12px rgba(184, 120, 120, 0.3); }

/* ================== 弹窗体系 ================== */
.cy-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 5000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.cy-modal-overlay.active { opacity: 1; pointer-events: all; }
.cy-modal-box { width: 100%; max-width: 340px; background: var(--cy-modal-bg); border-radius: 20px; border: 1px solid var(--border-light); padding: 24px 20px 32px; max-height: 85%; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.3); transform: scale(0.95); transition: transform 0.3s ease; }
.cy-modal-overlay.active .cy-modal-box { transform: scale(1); }
.cy-modal-handle { width: 40px; height: 4px; background: var(--cy-line-color); border-radius: 2px; margin: 0 auto 16px; }
.cy-modal-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--cy-line-color); margin-bottom: 16px; }
.cy-modal-title { font-size: 17px; font-weight: 600; color: var(--cy-text-main); }
.cy-close-btn { width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(107,78,88,0.06); color: var(--cy-text-sub); font-size: 20px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cy-modal-body { flex: 1; overflow-y: auto; padding-right: 4px; scrollbar-width: none; }
.cy-modal-body::-webkit-scrollbar { display: none; }
.cy-setting-section { margin-bottom: 24px; }
.cy-setting-title { font-size: 11px; font-weight: 600; color: var(--cy-text-light); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.cy-setting-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(107, 78, 88, 0.04); border-radius: 14px; margin-bottom: 8px; }
.cy-setting-label { font-size: 14px; color: var(--cy-text-main); font-weight: 500; }
.cy-setting-select { background: var(--cy-modal-bg); border: 1px solid var(--cy-border-inner); border-radius: 10px; padding: 6px 10px; font-size: 13px; color: var(--cy-text-main); outline: none; }
.cy-setting-textarea { width: 100%; background: rgba(107, 78, 88, 0.04); border: 1px solid transparent; border-radius: 14px; padding: 12px 16px; font-size: 13.5px; color: var(--cy-text-main); resize: none; margin-bottom: 8px; outline: none; font-family: var(--cy-font-sans); line-height: 1.6; transition: border-color 0.2s; }
.cy-setting-textarea:focus { border-color: rgba(168,120,154,0.4); background: var(--cy-note-ai); }
.cy-toggle { width: 46px; height: 26px; background: var(--cy-line-color); border-radius: 13px; position: relative; cursor: pointer; transition: background 0.3s; flex-shrink: 0; }
.cy-toggle.on { background: linear-gradient(135deg, #c9a0b0, #a8789a); }
.cy-toggle::after { content: ''; position: absolute; width: 20px; height: 20px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: transform 0.3s, box-shadow 0.3s; box-shadow: 0 2px 5px rgba(0,0,0,0.15); }
.cy-toggle.on::after { transform: translateX(20px); box-shadow: 0 2px 5px rgba(168,120,154,0.4); }

/* 按钮 */
.cy-action-btn { width: 100%; padding: 14px; border: none; border-radius: 14px; background: rgba(107, 78, 88, 0.05); color: var(--cy-text-main); font-size: 14px; font-weight: 500; cursor: pointer; margin-bottom: 8px; text-align: center; transition: background 0.2s; }
.cy-action-btn:hover { background: rgba(107, 78, 88, 0.08); }
.cy-action-btn.danger { color: var(--cy-color-stop); background: rgba(184,120,120,0.08); }
.cy-save-btn { width: 100%; padding: 16px; border: none; border-radius: 18px; background: linear-gradient(135deg, #c9a0b0, #a8789a); color: white; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 10px; box-shadow: 0 6px 16px rgba(168, 120, 154, 0.3); }

/* 楼层操作按钮组 */
.cy-floor-actions { display: flex; align-items: center; gap: 4px; }
.cy-mini-btn { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--cy-line-color); background: transparent; color: var(--cy-text-sub); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; transition: all 0.2s; flex-shrink: 0; }
.cy-mini-btn:hover { background: rgba(107,78,88,0.08); color: var(--cy-name-char); }

/* 编辑与静态切换 */
.cy-static { display: block; }
.cy-edit { display: none; }
.is-editing .cy-static { display: none; }
.is-editing .cy-edit { display: block; }

/* 辅助与加载 */
.cy-sys-note { text-align: center; font-size: 11.5px; color: var(--cy-text-light); padding: 10px 20px; }
.cy-loading { display: flex; gap: 6px; padding: 20px; justify-content: center; }
.cy-loading span { width: 8px; height: 8px; border-radius: 50%; background: #a8789a; opacity: 0.4; animation: cyPulse 1.2s infinite; }
.cy-loading span:nth-child(2) { animation-delay: 0.2s; } .cy-loading span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cyPulse { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

/* 兼容 */
.cy-edit-textarea { width: 100%; background: rgba(107,78,88,0.03); border: 1px solid var(--cy-line-color); border-radius: 10px; padding: 12px; font-family: var(--cy-font-serif); font-size: 14px; line-height: 1.8; color: var(--cy-text-main); resize: vertical; outline: none; margin-bottom: 8px; }
.cy-iv-row { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cy-iv-mini-card { background: var(--cy-bg-phone); border-radius: 8px; padding: 8px 12px; border: 1px solid rgba(107,78,88,0.04); }
.cy-iv-mini-title { font-size: 9px; font-weight: 600; color: var(--cy-text-light); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.cy-iv-mini-content { font-size: 12px; line-height: 1.6; color: var(--cy-text-sub); }

/* =========================================================
   照影 Curtain - 涟漪交互组件全局样式库
   ========================================================= */

/* 1. 基础容器与文本排版 */
.curtain-card-base {
    width: 100%; max-width: 340px; margin: 12px auto 24px;
    background: var(--card-bg); border: 1px solid var(--line-color);
    border-radius: 16px; padding: 24px 20px;
    box-shadow: 0 16px 32px rgba(0,0,0,0.05);
    position: relative; overflow: hidden; transition: all 0.5s ease;
}
[data-theme="dark"] .curtain-card-base { box-shadow: 0 16px 32px rgba(0,0,0,0.4); }
.curtain-card-base.danger-mode {
    border-color: var(--color-danger);
    background: color-mix(in srgb, var(--color-danger) 4%, var(--card-bg));
    box-shadow: 0 0 40px color-mix(in srgb, var(--color-danger) 15%, transparent);
}
.c-title { font-family: 'Noto Serif SC', serif; font-size: 18px; color: var(--name-char); text-align: center; margin-bottom: 8px; line-height: 1; letter-spacing: 4px; }
.c-desc { font-family: 'Noto Serif SC', serif; font-size: 13px; color: var(--text-sub); text-align: center; margin-bottom: 20px; line-height: 1.6; }
.c-result { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-color); font-family: 'Noto Serif SC', serif; font-size: 14px; color: var(--text-main); line-height: 1.8; animation: fadeIn 0.5s ease; }
.danger-mode .c-result { border-top-color: var(--color-danger); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* 吃瓜评论区 */
.c-whispers { display: none; flex-direction: column; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--color-danger) 20%, transparent); }
.danger-mode .c-whispers { display: flex; }
.cw-item { background: color-mix(in srgb, var(--text-main) 5%, transparent); border-radius: 6px; padding: 8px 12px; font-family: 'Inter', sans-serif; font-size: 11px; color: var(--text-sub); opacity: 0; animation: floatUp 0.5s forwards; }
.cw-name { font-weight: 600; margin-right: 6px; color: var(--color-danger); }
@keyframes floatUp { to { opacity: 1; transform: translateY(0); } }

/* ================== 【单聊专属组件】 ================== */

/* 1. 解扣子 (Unbutton) */
.c-btn-unbutton { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line-color); margin: 0 auto; cursor: pointer; transition: all 0.3s; display: flex; justify-content: center; align-items: center; }
.c-btn-unbutton::after { content: '⋯'; color: var(--text-sub); font-size: 16px; }
.c-btn-unbutton.popped { transform: scale(1.3) translateY(15px); opacity: 0; pointer-events: none; }

/* 2. 融冰 (Ice Melt) */
.c-btn-ice { width: 48px; height: 48px; background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.5); backdrop-filter: blur(4px); border-radius: 8px; margin: 0 auto; cursor: pointer; transition: all 0.8s ease; }
.c-btn-ice.melted { transform: scale(1.5) translateY(20px); opacity: 0; filter: blur(10px); pointer-events: none; }

/* 3. 擦雾气 (Fog Glass) */
.c-fog-glass { height: 140px; background: #1f181a; border-radius: 8px; position: relative; overflow: hidden; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.c-fog-layer { position: absolute; inset: 0; background: rgba(255,255,255,0.1); backdrop-filter: blur(15px); transition: opacity 1.5s ease; z-index: 2; display: flex; justify-content: center; align-items: center; color: rgba(255,255,255,0.6); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }
.c-fog-glass.cleared .c-fog-layer { opacity: 0; pointer-events: none; }

/* 4. 掐灭火焰 (Ignite) */
.c-flame { width: 30px; height: 30px; background: #e25822; border-radius: 50% 50% 20% 20%; margin: 0 auto; cursor: pointer; box-shadow: 0 0 20px #e25822; animation: flicker 0.5s infinite alternate; transition: all 0.3s; }
@keyframes flicker { 0% { transform: scale(1) rotate(-2deg); } 100% { transform: scale(1.1) rotate(2deg); } }
.c-flame.extinguished { background: #333; box-shadow: none; animation: none; transform: scale(0.5) translateY(20px); opacity: 0; }

/* 5. 心率监测 (Heart Monitor) */
.c-ecg { height: 60px; background: rgba(0,0,0,0.2); border-radius: 8px; display: flex; justify-content: center; align-items: center; font-family: 'Inter', sans-serif; font-size: 28px; font-weight: 700; color: var(--name-char); margin-bottom: 16px; cursor: pointer; transition: color 0.3s; }
.c-ecg.err { color: var(--color-danger); animation: shake 0.3s infinite; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

/* 6. 理智防线 (Sanity Bar) */
.c-sanity-track { width: 100%; height: 6px; background: var(--line-color); border-radius: 3px; overflow: hidden; margin: 20px 0; cursor: pointer; }
.c-sanity-fill { width: 100%; height: 100%; background: var(--name-char); transition: width 1s cubic-bezier(0.1, 0.7, 0.1, 1); }
.c-sanity-track.empty .c-sanity-fill { width: 0%; background: var(--color-danger); }

/* 7. 封蜡信件 (Wax Letter) */
.c-wax-seal { width: 60px; height: 60px; background: radial-gradient(circle, var(--color-danger), #8a4545); border-radius: 50%; margin: 0 auto; display: flex; justify-content: center; align-items: center; color: #fff; font-family: 'Great Vibes', cursive; font-size: 24px; cursor: pointer; transition: all 0.5s; position: relative; z-index: 10; }
.c-wax-seal.melted { transform: scale(1.5); opacity: 0; pointer-events: none; }
.c-letter-content { display: none; margin-top: -30px; padding: 20px; background: color-mix(in srgb, var(--name-char) 3%, transparent); border: 1px dashed var(--name-char); border-radius: 8px; animation: fadeIn 0.6s ease forwards; }

/* 8. 拍立得 (Polaroid) */
.c-polaroid { background: #f0f0f0; padding: 10px 10px 30px 10px; border-radius: 4px; transform: rotate(-3deg); cursor: pointer; transition: all 0.6s; width: 200px; margin: 0 auto; box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.c-polaroid.revealed { transform: rotate(2deg) scale(1.05); pointer-events: none; }
.cp-img { width: 100%; height: 180px; object-fit: cover; filter: grayscale(100%) blur(4px); transition: all 1s; }
.c-polaroid.revealed .cp-img { filter: grayscale(20%) blur(0); }

/* ================== 【群聊专属组件】 ================== */

/* 9. 修罗场分屏 (Tension Split) */
.c-split-view { display: flex; border: 1px solid var(--line-color); border-radius: 12px; overflow: hidden; }
.c-split-side { flex: 1; padding: 16px; text-align: center; cursor: pointer; transition: all 0.4s; }
.c-split-side.left { border-right: 1px dashed var(--line-color); }
.c-split-side:hover { background: color-mix(in srgb, var(--name-char) 5%, transparent); }
.c-split-side.selected { background: color-mix(in srgb, var(--name-char) 10%, transparent); pointer-events: none; }
.c-split-side.dimmed { opacity: 0.2; filter: grayscale(100%); pointer-events: none; }

/* 10. 天平倾斜 (Balance Scale) */
.c-scale-box { width: 100%; height: 4px; background: var(--line-color); position: relative; margin: 40px 0; transition: transform 0.5s ease; }
.c-scale-box.tilt-left { transform: rotate(-8deg); }
.c-scale-box.tilt-right { transform: rotate(8deg); }
.c-scale-node { position: absolute; top: -14px; width: 32px; height: 32px; background: var(--card-bg); border: 2px solid var(--name-char); border-radius: 50%; cursor: pointer; }
.c-scale-node.left { left: 10%; }
.c-scale-node.right { right: 10%; }

/* 11. 视线焦点 (Focus Shift) */
.c-focus-btn { padding: 8px 16px; border: 1px solid var(--line-color); border-radius: 20px; background: transparent; color: var(--text-main); cursor: pointer; margin: 0 4px; transition: 0.3s; }
.c-focus-btn.active { border-color: var(--name-char); background: var(--name-char); color: var(--card-bg); }

/* 12. 圆桌表决 (Roundtable) */
.c-vote-item { padding: 12px; border: 1px solid var(--line-color); border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: 0.3s; display: flex; justify-content: space-between; }
.c-vote-item.voted { border-color: var(--name-char); background: color-mix(in srgb, var(--name-char) 5%, transparent); }

/* 13. 桌下暗流 (Secret Pass) */
.c-secret-stamp { border: 2px solid var(--color-danger); color: var(--color-danger); padding: 8px; font-family: 'Inter', sans-serif; font-weight: 700; letter-spacing: 4px; transform: rotate(-10deg); width: fit-content; margin: 0 auto; cursor: pointer; transition: 0.3s; }
.c-secret-stamp.broken { opacity: 0; transform: scale(1.5) rotate(-20deg); pointer-events: none; }

/* 14. 眼神截获 (Eye Contact) */
.c-crowd-bg { height: 120px; background: #111; border-radius: 8px; display: flex; justify-content: center; align-items: center; cursor: pointer; overflow: hidden; position: relative; }
.c-crowd-bg::before { content: '👥 👥 👥'; font-size: 32px; filter: blur(4px); opacity: 0.3; transition: 1s; }
.c-crowd-bg.focused::before { filter: blur(10px); opacity: 0.1; }
.c-eye { position: absolute; font-size: 40px; opacity: 0; transition: 1s; transform: scale(0.5); }
.c-crowd-bg.focused .c-eye { opacity: 1; transform: scale(1); }

/* ================== 【通用兜底组件】 ================== */

/* 15. 事件鉴定卡 (Event Archive) */
.c-event-cover { height: 160px; background: #111; border-radius: 8px; overflow: hidden; position: relative; margin-bottom: 16px; }
.ce-img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8); transition: 1s; }
.danger-mode .ce-img { filter: brightness(0.5) sepia(0.5) hue-rotate(-20deg); transform: scale(1.1); }
.c-event-btn { width: 100%; padding: 12px; background: transparent; border: 1px solid var(--name-char); color: var(--name-char); border-radius: 8px; cursor: pointer; transition: 0.3s; }
.c-event-btn.revealed { display: none; }
