/* --- 小剧场功能样式 --- */

#theater-screen,
#theater-create-screen,
#theater-detail-screen,
#theater-html-detail-screen {
    /* 仿 iOS 的柔和浅色渐变背景 */
    background: linear-gradient(180deg, #f7f8fc 0%, #f2f3f7 40%, #eff1f5 100%);
}

#theater-screen .app-header,
#theater-create-screen .app-header,
#theater-detail-screen .app-header,
#theater-html-detail-screen .app-header {
    /* 顶部导航做成 iOS 风格的毛玻璃栏 */
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 0.5px 0 rgba(15, 23, 42, 0.12);
}

.theater-content {
    padding: 16px 18px 20px;
}

/* 主页样式 */
.theater-filter-bar {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.theater-filter-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 999px;
    font-size: 15px;
    color: #333;
    outline: none;
    transition: all 0.3s ease;
}

.theater-filter-select:focus {
    border-color: rgba(255, 128, 171, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 128, 171, 0.1), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.theater-scenarios-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.theater-scenario-card {
    background-color: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    padding: 18px 16px;
    border: 0.5px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.theater-scenario-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
    border-color: rgba(148, 163, 184, 0.4);
    background-color: rgba(255, 255, 255, 0.98);
}

.theater-scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.theater-scenario-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
    letter-spacing: 0.01em;
}

.theater-scenario-badge {
    font-size: 12px;
    padding: 4px 10px;
    background: rgba(148, 163, 184, 0.18);
    color: #475569;
    border-radius: 999px;
    font-weight: 500;
}

.theater-scenario-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

.theater-scenario-content {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
}

/* 小剧场列表多选栏 */
.theater-multi-select-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 0.5px solid rgba(148, 163, 184, 0.35);
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.theater-multi-select-bar.visible {
    display: flex;
}

.theater-multi-select-bar #theater-selected-count {
    font-size: 14px;
    color: #666;
}

.theater-multi-select-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theater-multi-select-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    width: auto;
    border-radius: 8px;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.theater-multi-select-actions .btn-primary {
    background: linear-gradient(135deg, #ff80ab 0%, #ffb3d1 100%);
    color: #ffffff;
}

.theater-multi-select-actions .btn-primary:hover {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff9fbf 100%);
    box-shadow: 0 3px 10px rgba(255, 128, 171, 0.25);
    transform: translateY(-1px);
}

.theater-multi-select-actions .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 128, 171, 0.2);
}

.theater-multi-select-actions .btn-secondary {
    background: rgba(255, 240, 245, 0.8);
    color: #d63384;
    border: 1px solid rgba(255, 182, 193, 0.4);
}

.theater-multi-select-actions .btn-secondary:hover {
    background: rgba(255, 240, 245, 1);
    box-shadow: 0 3px 10px rgba(255, 128, 171, 0.15);
    transform: translateY(-1px);
}

.theater-multi-select-actions .btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 128, 171, 0.1);
}

/* 列表项多选态 */
.theater-scenario-card.selectable {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.theater-scenario-card .theater-card-checkbox {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    border-radius: 6px;
    border: 2px solid rgba(255, 128, 171, 0.5);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theater-scenario-card .theater-card-checkbox.checked {
    background: linear-gradient(135deg, #ff80ab 0%, #ffb3d1 100%);
    border-color: #ff80ab;
    color: #fff;
}

.theater-scenario-card .theater-card-checkbox.checked::after {
    content: '✓';
    font-size: 14px;
    font-weight: bold;
}

.theater-scenario-card .theater-card-content-wrap {
    flex: 1;
    min-width: 0;
}

/* HTML 模式列表卡片内的 iframe 缩略预览 */
.theater-scenario-html-preview {
    margin-top: 10px;
    border-radius: 12px;
    overflow: hidden;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    background: #ffffff;
    height: 180px;
    position: relative;
}

.theater-scenario-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
    display: block;
}

.theater-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* 聊天内小剧场分享卡片样式 */
.theater-share-card-bubble {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 192, 203, 0.12), rgba(255, 255, 255, 0.9));
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    max-width: 260px;
}

.theater-share-card-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.theater-share-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #999;
}

.theater-share-tag {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 128, 171, 0.1);
    color: #ff4f8b;
    font-weight: 600;
}

.theater-share-category {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.03);
}

.theater-share-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-top: 2px;
}

.theater-share-preview {
    font-size: 13px;
    color: #666;
    max-height: 38px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.theater-share-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.theater-share-char {
    max-width: 70%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* 创建页样式 */
.theater-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.theater-control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theater-control-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.theater-select,
.theater-input {
    width: 100%;
    padding: 14px 16px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    border-radius: 12px;
    font-size: 15px;
    color: #1d1d1f;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.theater-select:focus,
.theater-input:focus {
    border-color: rgba(255, 128, 171, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 128, 171, 0.1), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.theater-textarea {
    width: 100%;
    min-height: 140px;
    padding: 14px 16px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    border-radius: 12px;
    font-size: 15px;
    color: #1d1d1f;
    outline: none;
    resize: vertical;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.theater-textarea:focus {
    border-color: rgba(255, 128, 171, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 128, 171, 0.1), 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* 世界书多选下拉列表 */
.theater-multiselect-wrapper {
    position: relative;
    width: 100%;
}

.theater-multiselect-display {
    width: 100%;
    padding: 14px 16px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    border-radius: 12px;
    font-size: 15px;
    color: #1d1d1f;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    box-sizing: border-box;
    min-height: 48px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.theater-multiselect-display:active {
    border-color: rgba(255, 128, 171, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 128, 171, 0.1), 0 1px 3px rgba(0, 0, 0, 0.04);
    background-color: rgba(255, 240, 245, 0.5);
}

.theater-multiselect-placeholder {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #999;
}

.theater-multiselect-display.has-selection .theater-multiselect-placeholder {
    color: #333;
}

.theater-multiselect-arrow {
    margin-left: 10px;
    font-size: 12px;
    color: #999;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.theater-multiselect-dropdown.open .theater-multiselect-arrow {
    transform: rotate(180deg);
}

.theater-multiselect-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 192, 203, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.theater-multiselect-dropdown.open {
    display: block;
}

.theater-multiselect-options {
    padding: 8px;
}

/* 世界书分类分组折叠样式 */
.theater-multiselect-group {
    border-radius: 10px;
    margin-bottom: 4px;
    overflow: hidden;
}

.theater-multiselect-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    user-select: none;
}

.theater-multiselect-group-title {
    flex: 1;
}

.theater-multiselect-group-arrow {
    font-size: 10px;
    color: #c4c4c4;
    transition: transform 0.2s ease;
}

.theater-multiselect-group-body {
    padding: 0 0 4px 0;
}

.theater-multiselect-group.collapsed .theater-multiselect-group-body {
    display: none;
}

.theater-multiselect-group.collapsed .theater-multiselect-group-arrow {
    transform: rotate(-90deg);
}

.theater-multiselect-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}

.theater-multiselect-option:hover {
    background-color: rgba(255, 192, 203, 0.1);
}

.theater-multiselect-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(255, 192, 203, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #ff80ab;
    background-color: #fff;
}

.theater-multiselect-option.selected .theater-multiselect-checkbox {
    background-color: #ff80ab;
    color: #fff;
}

.theater-multiselect-label {
    font-size: 14px;
    color: #333;
    flex: 1;
}

/* 详情页样式 */
.theater-detail-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.theater-detail-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.theater-detail-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.theater-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #999;
}

.theater-detail-badge {
    padding: 4px 10px;
    background: rgba(255, 192, 203, 0.2);
    border-radius: 999px;
    font-size: 12px;
    color: #ff80ab;
}

.theater-detail-body {
    font-size: 15px;
    color: #1d1d1f;
    line-height: 1.75;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 20px;
    background: #ffffff;
    border-radius: 16px;
    margin: 16px 0;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.theater-detail-body strong,
.theater-detail-body b {
    font-weight: 600;
    color: #000000;
}

.theater-detail-body em,
.theater-detail-body i {
    font-style: italic;
    color: #3a3a3c;
}

.theater-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}

.theater-action-row-first {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

.theater-action-row-second {
    display: flex;
    width: 100%;
}

.theater-action-row-third {
    display: flex;
    width: 100%;
}

.theater-action-row-font-size {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    width: 100%;
}

.theater-font-size-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

.theater-font-size-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(148, 163, 184, 0.3);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.theater-font-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff80ab 0%, #ffb3d1 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(255, 128, 171, 0.3);
    transition: all 0.2s ease;
}

.theater-font-size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(255, 128, 171, 0.4);
}

.theater-font-size-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff80ab 0%, #ffb3d1 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(255, 128, 171, 0.3);
    transition: all 0.2s ease;
}

.theater-font-size-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(255, 128, 171, 0.4);
}

.theater-font-size-value {
    font-size: 13px;
    font-weight: 600;
    color: #ff80ab;
    min-width: 45px;
    text-align: center;
}

.theater-save-font-size-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.6) 0%, rgba(255, 192, 203, 0.5) 100%);
    color: #c2185b;
    border: 1px solid rgba(255, 128, 171, 0.4);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(255, 128, 171, 0.2);
    flex-shrink: 0;
}

.theater-save-font-size-btn:hover {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.75) 0%, rgba(255, 192, 203, 0.65) 100%);
    box-shadow: 0 3px 10px rgba(255, 128, 171, 0.3);
    transform: translateY(-1px);
}

.theater-save-font-size-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 128, 171, 0.2);
}

.theater-action-row-font-preset {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    width: 100%;
}

.theater-font-preset-select {
    flex: 1;
    padding: 8px 12px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    border-radius: 8px;
    font-size: 13px;
    color: #1d1d1f;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.theater-font-preset-select:focus {
    border-color: rgba(255, 128, 171, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 128, 171, 0.1), 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* 详情页操作按钮统一样式 - iOS风格，与正文明显区分 */
.theater-detail-actions .theater-action-btn {
    padding: 10px 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    text-align: center;
}

/* 第二行的分享按钮占满整行 */
.theater-action-row-second .theater-action-btn {
    width: 100%;
    flex: none;
}

/* 第三行的导出按钮占满整行 */
.theater-action-row-third .theater-action-btn {
    width: 100%;
    flex: none;
}

.theater-detail-actions .theater-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.theater-detail-actions .theater-action-btn:active::before {
    opacity: 1;
}

/* 隐藏的保存按钮不占空间 */
.theater-detail-actions .theater-action-btn[style*="display: none"] {
    flex: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* 编辑、分享：浅粉色风格按钮 */
.theater-share-btn {
    background: rgba(255, 240, 245, 0.8);
    color: #d63384;
    border: 1px solid rgba(255, 182, 193, 0.4);
    box-shadow: 0 2px 8px rgba(255, 128, 171, 0.15);
}

.theater-share-btn:hover {
    background: rgba(255, 240, 245, 1);
    box-shadow: 0 4px 12px rgba(255, 128, 171, 0.2);
    transform: translateY(-1px);
}

.theater-share-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 128, 171, 0.15);
}

/* 删除：危险操作 - 浅粉色风格 */
.theater-delete-btn {
    background: rgba(255, 235, 238, 0.95);
    color: #c62828;
    border: 1px solid rgba(244, 67, 54, 0.3);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.15);
}

.theater-delete-btn:hover {
    background: rgba(255, 205, 210, 0.9);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
    transform: translateY(-1px);
}

.theater-delete-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(244, 67, 54, 0.15);
}

.theater-edit-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    border-radius: 12px;
    font-size: 15px;
    color: #1d1d1f;
    outline: none;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.theater-edit-textarea:focus {
    border-color: rgba(255, 128, 171, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 128, 171, 0.1);
}

.theater-edit-title-input {
    padding: 6px 12px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    outline: none;
    min-width: 120px;
    background: #ffffff;
    transition: all 0.2s ease;
}

.theater-edit-title-input:focus {
    border-color: rgba(255, 128, 171, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 128, 171, 0.1);
}

.theater-edit-title-btn {
    margin-left: 10px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 240, 245, 0.8);
    border: 1px solid rgba(255, 182, 193, 0.4);
    border-radius: 8px;
    cursor: pointer;
    color: #d63384;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(255, 128, 171, 0.15);
}

.theater-edit-title-btn:hover {
    background: rgba(255, 240, 245, 1);
    box-shadow: 0 2px 6px rgba(255, 128, 171, 0.2);
    transform: translateY(-1px);
}

.theater-edit-title-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(255, 128, 171, 0.15);
}

/* 分享弹窗样式 */
#theater-share-modal .modal-content {
    max-width: 360px;
}

.theater-share-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.theater-share-search {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 14px;
}

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

.theater-share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.theater-share-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.theater-share-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.theater-share-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.theater-share-name {
    font-size: 14px;
    color: #333;
}

.theater-share-meta {
    font-size: 12px;
    color: #999;
}

.theater-share-section-title {
    padding: 4px 2px;
    font-size: 12px;
    color: #999;
}
/* 提示词预设管理弹窗 */
.theater-preset-manager-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.theater-preset-manager-modal.visible {
    display: flex;
}

.theater-preset-manager-dialog {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
}

.theater-preset-manager-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theater-preset-manager-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.theater-preset-manager-close {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

.theater-preset-manager-body {
    padding: 12px 20px 18px;
    overflow-y: auto;
}

.theater-preset-manager-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 8px;
}

.theater-preset-toolbar-btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 192, 203, 0.5);
    background: rgba(255, 192, 203, 0.12);
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theater-preset-toolbar-btn:hover {
    background: rgba(255, 192, 203, 0.22);
}

.theater-preset-toolbar-btn.danger {
    border-color: rgba(244, 67, 54, 0.45);
    background: rgba(244, 67, 54, 0.04);
    color: #c62828;
}

.theater-preset-toolbar-btn.danger:hover {
    background: rgba(244, 67, 54, 0.12);
}
.theater-preset-manager-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theater-preset-manager-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.theater-preset-manager-item:last-child {
    border-bottom: none;
}

.theater-preset-manager-item-main {
    flex: 1;
    min-width: 0;
}

.theater-preset-manager-checkbox-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
}

.theater-preset-manager-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theater-preset-manager-checkbox-mark {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid rgba(255, 192, 203, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    background: #fff;
    box-sizing: border-box;
}

.theater-preset-manager-checkbox:checked + .theater-preset-manager-checkbox-mark {
    background: linear-gradient(135deg, #ff80ab 0%, #ffb3d1 100%);
    border-color: #ff80ab;
}

.theater-preset-manager-checkbox:checked + .theater-preset-manager-checkbox-mark::after {
    content: '✓';
}

.theater-preset-manager-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.theater-preset-manager-item-preview {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theater-preset-manager-delete-btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid rgba(244, 67, 54, 0.35);
    background: rgba(244, 67, 54, 0.06);
    color: #c62828;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.theater-preset-manager-delete-btn:hover {
    background: rgba(244, 67, 54, 0.14);
}

.theater-preset-manager-empty {
    padding: 16px 4px;
    font-size: 13px;
    color: #999;
    text-align: center;
}

/* 详情页与编辑态按钮样式 - 浅粉色风格 */
.theater-favorite-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 193, 7, 0.2) 100%);
    color: #e65100;
    border: 1px solid rgba(255, 193, 7, 0.4);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.1);
}

.theater-favorite-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.35) 0%, rgba(255, 193, 7, 0.3) 100%);
    border-color: rgba(255, 193, 7, 0.5);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.15);
    transform: translateY(-1px);
}

.theater-favorite-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 152, 0, 0.1);
}

.theater-save-edit-btn {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.6) 0%, rgba(255, 192, 203, 0.5) 100%);
    color: #c2185b;
    border: 1px solid rgba(255, 128, 171, 0.4);
    box-shadow: 0 2px 8px rgba(255, 128, 171, 0.2);
}

.theater-save-edit-btn:hover {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.75) 0%, rgba(255, 192, 203, 0.65) 100%);
    box-shadow: 0 4px 12px rgba(255, 128, 171, 0.3);
    transform: translateY(-1px);
}

.theater-save-edit-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 128, 171, 0.2);
}

.theater-edit-category-btn {
    background: rgba(255, 240, 245, 0.8);
    color: #d63384;
    border: 1px solid rgba(255, 182, 193, 0.4);
    box-shadow: 0 2px 8px rgba(255, 128, 171, 0.15);
}

.theater-edit-category-btn:hover {
    background: rgba(255, 240, 245, 1);
    box-shadow: 0 4px 12px rgba(255, 128, 171, 0.2);
    transform: translateY(-1px);
}

.theater-edit-category-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 128, 171, 0.15);
}

/* 聊天记录 & 日记总结读取开关 */
.theater-context-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.theater-context-toggle-row > label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.theater-toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
    background: rgba(148, 163, 184, 0.3);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.theater-toggle-switch[aria-checked="true"] {
    background: linear-gradient(135deg, #ff80ab 0%, #ffb3d1 100%);
}

.theater-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theater-toggle-switch[aria-checked="true"] .theater-toggle-slider {
    transform: translateX(20px);
}

.theater-context-options {
    margin-top: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 0.5px solid rgba(255, 192, 203, 0.3);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: theaterSlideDown 0.25s ease;
}

@keyframes theaterSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.theater-context-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.theater-context-option-row label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    flex: 1;
}

.theater-number-input {
    width: 80px;
    padding: 8px 12px;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    border-radius: 10px;
    font-size: 14px;
    color: #1d1d1f;
    outline: none;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    -moz-appearance: textfield;
}

.theater-number-input::-webkit-outer-spin-button,
.theater-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.theater-number-input:focus {
    border-color: rgba(255, 128, 171, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 128, 171, 0.1), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.theater-context-hint {
    font-size: 12px;
    color: #999;
    line-height: 1.5;
    padding: 2px 0;
}

/* 提示词工具栏与按钮（对齐 ovo 版本） */
.theater-prompt-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.theater-prompt-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.theater-prompt-select {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid rgba(255, 192, 203, 0.3);
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: all 0.3s ease;
}

.theater-prompt-select:focus {
    border-color: rgba(255, 128, 171, 0.5);
    box-shadow: 0 3px 15px rgba(255, 128, 171, 0.15);
}

.theater-save-prompt-btn {
    padding: 10px 20px;
    background: rgba(255, 240, 245, 0.8);
    color: #d63384;
    border: 1px solid rgba(255, 182, 193, 0.4);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(255, 128, 171, 0.15);
}

.theater-save-prompt-btn:hover {
    background: rgba(255, 240, 245, 1);
    box-shadow: 0 3px 10px rgba(255, 128, 171, 0.2);
    transform: translateY(-1px);
}

.theater-save-prompt-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 128, 171, 0.15);
}

/* 生成按钮样式 - 浅粉色风格，与表单内容明显区分 */
.theater-generate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff80ab 0%, #ffb3d1 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(255, 128, 171, 0.35);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.theater-generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.theater-generate-btn:hover {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff9fbf 100%);
    box-shadow: 0 6px 20px rgba(255, 128, 171, 0.4);
    transform: translateY(-2px);
}

.theater-generate-btn:hover::before {
    opacity: 1;
}

.theater-generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 128, 171, 0.3);
}

.theater-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: #bdbdbd;
    box-shadow: none;
}

/* === 模式切换开关 === */
.theater-mode-switch-bar {
    display: flex;
    justify-content: center;
    padding: 10px 18px 6px;
    background: transparent;
}

.theater-mode-switch {
    position: relative;
    display: flex;
    width: 200px;
    height: 36px;
    background: rgba(148, 163, 184, 0.15);
    border-radius: 999px;
    overflow: hidden;
    border: 0.5px solid rgba(148, 163, 184, 0.25);
}

.theater-mode-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s ease;
    user-select: none;
}

.theater-mode-option.active {
    color: #fff;
}

.theater-mode-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    background: linear-gradient(135deg, #ff80ab 0%, #ffb3d1 100%);
    border-radius: 999px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(255, 128, 171, 0.35);
}

.theater-mode-switch[data-mode="html"] .theater-mode-slider {
    transform: translateX(100%);
}

/* HTML 模式详情页 iframe 容器 */
.theater-html-render-frame {
    width: 100%;
    min-height: 200px;
    border: none;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    /* 高度由 JS 动态设置，过渡更丝滑 */
    transition: height 0.3s ease;
}

.theater-html-detail-body {
    padding: 0;
    margin: 16px 0;
    border-radius: 16px;
    overflow: hidden;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    background: #ffffff;
}

.theater-html-detail-body .theater-html-rendered {
    padding: 20px;
    font-size: 15px;
    color: #1d1d1f;
    line-height: 1.75;
    word-wrap: break-word;
}

/* 独立API设置区域 */
.theater-api-config {
    margin-top: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 0.5px solid rgba(255, 192, 203, 0.3);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: theaterSlideDown 0.25s ease;
}

.theater-api-preset-row,
.theater-api-field-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theater-api-preset-row label,
.theater-api-field-row label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}
