/* ========== 活动开场白工具容器 ========== */
.eor-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.eor-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.eor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.toolbar-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #059669;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.toolbar-btn:active {
    transform: translateY(0);
}

/* ========== 三栏主内容 ========== */
.eor-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f8fafc;
}

/* ========== 左侧历史面板 ========== */
.eor-history-panel {
    width: 210px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-badge {
    background: #10b981;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    display: none;
}

.history-badge.visible {
    display: inline-block;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 13px;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    background: #fff;
}

.history-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.8;
    padding: 30px 12px;
}

.history-item {
    position: relative;
    padding: 10px 12px;
    margin: 4px 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    animation: fadeIn 0.2s ease;
}

.history-item:hover {
    background: #f0fdf4;
    border-color: #6ee7b7;
    transform: translateX(2px);
}

.history-item.active {
    background: #ecfdf5;
    border-color: #10b981;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.15);
}

.history-item-type {
    font-size: 10px;
    color: #059669;
    background: #ecfdf5;
    padding: 1px 6px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 4px;
    font-weight: 500;
}

.history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    padding-right: 0;
    transition: padding-right 0.15s;
}

.history-item:hover .history-item-title {
    padding-right: 22px;
}

.history-item-time {
    font-size: 11px;
    color: #94a3b8;
}

.history-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: all 0.2s;
    cursor: pointer;
    line-height: 1;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #ef4444;
    color: white;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ========== 中间输入面板 ========== */
.eor-input-panel {
    width: 340px;
    display: flex;
    flex-direction: column;
    background: white;
    border-right: 1px solid #e2e8f0;
    overflow: hidden;
    flex-shrink: 0;
}

.input-panel-header {
    padding: 12px 16px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.panel-header-hint {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    margin-top: 3px;
}

.input-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 表单组 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.form-required {
    color: #ef4444;
    margin-left: 2px;
}

/* 按钮组 */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-option {
    padding: 5px 10px;
    font-size: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    color: #475569;
    transition: all 0.15s;
    user-select: none;
    white-space: nowrap;
}

.btn-option:hover {
    background: #e8f5f0;
    border-color: #6ee7b7;
    color: #059669;
}

.btn-option.active {
    background: #ecfdf5;
    border-color: #10b981;
    color: #059669;
    font-weight: 600;
}

/* 输入框 */
.form-input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #1e293b;
    outline: none;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
    background: #fafafa;
}

.form-input:hover {
    border-color: #a7f3d0;
    background: #fff;
}

.form-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: #fff;
}

.form-input.is-error {
    border-color: #ef4444;
    background: #fff5f5;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.is-error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-input::placeholder {
    color: #94a3b8;
    font-size: 12px;
}

/* 字符计数器 */
.eor-char-counter {
    font-size: 11px;
    color: #cbd5e1;
    text-align: right;
    line-height: 1;
    transition: color 0.2s;
}

.eor-char-counter.near-limit {
    color: #f59e0b;
    font-weight: 600;
}

/* 文本域 */
.form-textarea {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #1e293b;
    outline: none;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    background: #fafafa;
    line-height: 1.6;
}

.form-textarea:hover {
    border-color: #a7f3d0;
    background: #fff;
}

.form-textarea:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: #fff;
}

.form-textarea::placeholder {
    color: #94a3b8;
    font-size: 12px;
}

/* 生成按钮 */
.generate-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
    flex-shrink: 0;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.generate-btn .btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.generate-btn.loading .btn-spinner {
    display: inline-block;
}

.generate-btn .btn-loading-text {
    display: none;
}

.generate-btn.loading .btn-text {
    display: none;
}

.generate-btn.loading .btn-loading-text {
    display: inline;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 右侧结果面板 ========== */
.eor-result-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
    min-width: 300px;
}

.result-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.result-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.result-action-btn {
    padding: 5px 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #059669;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.result-action-btn:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

/* 结果内容区 */
.eor-result-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 空状态 */
.result-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.result-empty.show {
    display: flex;
    flex: 1;
}

.result-empty-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.result-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
}

.result-empty-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.8;
}

/* 骨架屏 */
.skeleton-wrap {
    display: none;
    padding: 24px;
    flex-direction: column;
    gap: 10px;
}

.skeleton-wrap.show {
    display: flex;
}

.skeleton-item {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 4px;
}

/* 加载提示文字 */
.loading-tips {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    min-height: 22px;
    padding: 0 8px;
}

.skeleton-title-bar {
    height: 22px;
    width: 55%;
    border-radius: 6px;
}

.skeleton-section-bar {
    height: 16px;
    width: 30%;
}

.skeleton-content-bar {
    height: 14px;
    width: 100%;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 结果展示 */
.result-wrap {
    display: none;
    padding: 20px 24px 32px;
    flex-direction: column;
    gap: 16px;
}

.result-wrap.show {
    display: flex;
    animation: resultFadeIn 0.28s ease;
}

@keyframes resultFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-title-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 14px;
    border-bottom: 2px solid #ecfdf5;
}

.result-event-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.event-type-badge {
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 2px 10px;
    border-radius: 12px;
}

.event-scale-badge {
    font-size: 11px;
    color: #6366f1;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    padding: 2px 10px;
    border-radius: 12px;
}

.event-style-badge {
    font-size: 11px;
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fde68a;
    padding: 2px 10px;
    border-radius: 12px;
}

.result-main-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
}

/* 分区 */
.result-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-label {
    font-size: 13px;
    font-weight: 700;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 8px;
    border-left: 3px solid #10b981;
}

/* 正文 */
.result-script-content {
    font-size: 14px;
    line-height: 2;
    color: #334155;
    white-space: pre-wrap;
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 字数统计 */
.result-wordcount {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
    font-size: 11px;
    color: #94a3b8;
}

.wordcount-badge {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
}

/* 关键词 */
.result-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    font-size: 12px;
    font-weight: 500;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 4px 12px;
    border-radius: 14px;
}

/* 表演建议 */
.result-tips {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    font-size: 13px;
    color: #78350f;
    line-height: 1.6;
}

.tip-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* 错误状态 */
.result-error {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.result-error.show {
    display: flex;
    flex: 1;
}

.result-error-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.result-error-msg {
    font-size: 13px;
    color: #ef4444;
    margin-bottom: 16px;
    line-height: 1.6;
}

.error-retry-btn {
    padding: 8px 20px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.error-retry-btn:hover {
    background: #fecaca;
}

/* ========== 示例抽屉 ========== */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(2px);
}

.drawer-overlay.show {
    opacity: 1;
    visibility: visible;
}

.example-drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: 460px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 10001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.example-drawer.show {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    flex-shrink: 0;
}

.drawer-title {
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.drawer-close-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 14px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-close-btn:hover {
    background: rgba(255,255,255,0.35);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.example-card {
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.example-card:hover {
    background: #f0fdf4;
    border-color: #6ee7b7;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.example-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

.example-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.example-tag {
    font-size: 11px;
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 2px 8px;
    border-radius: 10px;
}

.example-card-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}

/* ========== Toast 通知 ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s;
    pointer-events: auto;
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.toast-success { background: #10b981; }
.toast.toast-error   { background: #ef4444; }
.toast.toast-info    { background: #6366f1; }
.toast.toast-warning { background: #f59e0b; }

/* ========== 滚动条美化 ========== */
.eor-result-body::-webkit-scrollbar,
.input-panel-body::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
    width: 4px;
}
.eor-result-body::-webkit-scrollbar-track,
.input-panel-body::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
    background: #d1fae5;
}
.eor-result-body::-webkit-scrollbar-thumb,
.input-panel-body::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
    background: #6ee7b7;
    border-radius: 3px;
}
.eor-result-body::-webkit-scrollbar-thumb:hover,
.input-panel-body::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
    background: #34d399;
}

/* ========== 空状态快捷键提示 ========== */
.kbd-hint {
    display: inline-block;
    padding: 1px 5px;
    font-size: 11px;
    font-family: inherit;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-bottom-width: 2px;
    border-radius: 3px;
    color: #64748b;
    vertical-align: middle;
}
