/* CSS 变量定义 */
:root {
    --primary-color: #4a90e2;
    --primary-hover: #3a7bc8;
    --secondary-color: #6c757d;
    --success-color: #5cb85c;
    --success-hover: #4cae4c;
    --danger-color: #d9534f;
    --danger-hover: #c9302c;
    --warning-color: #f0ad4e;
    --info-color: #5bc0de;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --border-radius: 6px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    --box-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dark-color);
    background-color: #f5f5f5;
}

/* 认证加载遮罩 */
.auth-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-loading-content p {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
}

/* 应用容器 */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1920px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: var(--background-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-display-name {
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    margin-right: 0.5rem;
}

.btn-back {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

.btn-logout {
    padding: 0.6rem 1.2rem;
    background: rgba(244, 67, 54, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(244, 67, 54, 1);
    transform: translateY(-2px);
}

.btn-success {
    padding: 0.6rem 1.2rem;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-success:hover {
    background: rgba(76, 175, 80, 1);
    transform: translateY(-2px);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.header-actions .btn {
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
}

.header-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 主内容区域 */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 面板通用样式 */
.panel-header {
    padding: 1rem;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-color);
}

/* 左侧面板 */
.left-panel {
    width: 300px;
    background-color: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

/* 标签页容器 */
.tab-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 标签页按钮 */
.tab-buttons {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--light-color);
}

.tab-btn {
    padding: 0.75rem 1rem;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary-color);
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    background-color: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: white;
}

/* 标签页内容 */
.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: none;
}

.tab-content.active {
    display: block;
}

/* 搜索容器 */
.search-container {
    padding: 0.75rem;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: var(--transition);
    background-color: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.search-input:hover:not(:disabled) {
    border-color: var(--primary-color);
}

/* 列表头部（批量操作） */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.batch-actions {
    display: flex;
    gap: 0.5rem;
}

/* 对话列表 */
.dialog-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.dialog-item {
    padding: 0;
    margin-bottom: 0.75rem;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.dialog-item-content {
    padding: 1rem;
    flex: 1;
}

.dialog-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-color);
    opacity: 0;
    transition: var(--transition);
}

.dialog-item:hover {
    background-color: #f8faff;
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: var(--box-shadow-hover);
}

.dialog-item:hover::before {
    opacity: 1;
}

.dialog-item.active {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1) 0%, rgba(74, 144, 226, 0.05) 100%);
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.dialog-item.active::before {
    opacity: 1;
}

.dialog-item-id {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark-color);
}

.dialog-item.active .dialog-item-id {
    color: var(--primary-color);
}

.dialog-item-name {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-top: 0.35rem;
    font-weight: 500;
}

.dialog-item.active .dialog-item-name {
    color: var(--primary-color);
    opacity: 0.9;
}

/* 角色管理样式 */
.actors-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.actors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.actors-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

/* 角色列表样式 */
.actors-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.actor-item {
    padding: 0;
    margin-bottom: 0.75rem;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.actor-item-content {
    padding: 1rem;
    flex: 1;
}

.actor-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--success-color);
    opacity: 0;
    transition: var(--transition);
}

.actor-item:hover {
    background-color: #f8fff8;
    border-color: var(--success-color);
    transform: translateX(4px);
    box-shadow: var(--box-shadow-hover);
}

.actor-item:hover::before {
    opacity: 1;
}

.actor-item.active {
    background: linear-gradient(135deg, rgba(92, 184, 92, 0.1) 0%, rgba(92, 184, 92, 0.05) 100%);
    color: var(--success-color);
    border-color: var(--success-color);
    box-shadow: var(--box-shadow);
}

.actor-item.active::before {
    opacity: 1;
}

.actor-item-id {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark-color);
}

.actor-item.active .actor-item-id {
    color: var(--success-color);
}

.actor-item-name {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-top: 0.35rem;
    font-weight: 500;
}

.actor-item.active .actor-item-name {
    color: var(--success-color);
    opacity: 0.9;
}

/* 变量管理样式 */
.variables-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.variables-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.variables-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.variables-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.variable-item {
    padding: 0;
    margin-bottom: 0.75rem;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.variable-item-content {
    padding: 1rem;
    flex: 1;
}

.variable-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--info-color);
    opacity: 0;
    transition: var(--transition);
}

.variable-item:hover {
    background-color: #f8fdff;
    border-color: var(--info-color);
    transform: translateX(4px);
    box-shadow: var(--box-shadow-hover);
}

.variable-item:hover::before {
    opacity: 1;
}

.variable-item.active {
    background: linear-gradient(135deg, rgba(91, 192, 222, 0.1) 0%, rgba(91, 192, 222, 0.05) 100%);
    color: var(--info-color);
    border-color: var(--info-color);
    box-shadow: var(--box-shadow);
}

.variable-item.active::before {
    opacity: 1;
}

.variable-item-id {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark-color);
}

.variable-item.active .variable-item-id {
    color: var(--info-color);
}

.variable-item-name {
    font-size: 0.9rem;
    color: var(--dark-color);
    margin-top: 0.35rem;
    font-weight: 600;
}

.variable-item.active .variable-item-name {
    color: var(--info-color);
}

.variable-item-value {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 变量编辑样式 */
.variable-editor {
    max-width: 900px;
    margin: 0 auto;
}

.variable-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.variable-field {
    margin-bottom: 1.25rem;
}

.variable-field.full-width {
    grid-column: 1 / -1;
}

.variable-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
}

/* 角色编辑样式 */
.actor-editor {
    max-width: 900px;
    margin: 0 auto;
}

.actor-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.actor-field {
    margin-bottom: 1.25rem;
}

.actor-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
}

/* 编辑面板 */
.editor-panel {
    flex: 1;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-panel .panel-header {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.05) 0%, rgba(74, 144, 226, 0.02) 100%);
    border-bottom: 2px solid rgba(74, 144, 226, 0.1);
    padding: 1.25rem 1.5rem;
    flex-shrink: 0;
}

.editor-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: transparent;
}

.canvas-container {
    position: relative;
    flex: 1;
    background-color: #f8f9fa;
    overflow: hidden;
    display: none;
}

#dialog-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.editor-panel .panel-header {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.05) 0%, rgba(74, 144, 226, 0.02) 100%);
    border-bottom: 2px solid rgba(74, 144, 226, 0.1);
    padding: 1.25rem 1.5rem;
}

.panel-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.panel-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* 视图切换按钮 */
.view-toggle {
    display: flex;
    gap: 0;
    background-color: #f0f0f0;
    border-radius: 6px;
    padding: 3px;
}

.view-toggle .btn {
    padding: 0.5rem 1rem;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    border-radius: 4px;
    position: relative;
}

.view-toggle .btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--primary-color);
}

.view-toggle .btn.active {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-toggle .btn:not(.active) {
    opacity: 0.6;
}

.view-toggle .btn:not(.active):hover {
    opacity: 1;
}

#dialog-canvas:active {
    cursor: grabbing;
}

.canvas-toolbar {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: white;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.canvas-toolbar .btn-small {
    min-width: 32px;
    height: 32px;
    padding: 0 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.zoom-level {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-color);
    min-width: 45px;
    text-align: center;
}

/* 语音列表样式 */
.voice-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: #f8f9fa;
}

.voice-list-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.voice-list-header .btn {
    padding: 0.65rem 1.25rem;
    font-weight: 600;
}

.voice-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.voice-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.voice-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.voice-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.voice-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.voice-item-id {
    font-size: 0.85rem;
    color: var(--secondary-color);
    background: var(--light-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.voice-entry {
    background: var(--light-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid #E0E0E0;
}

.voice-entry:last-child {
    margin-bottom: 0;
}

.voice-entry-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.voice-entry-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-color);
}

.voice-entry-text {
    font-size: 0.85rem;
    color: var(--secondary-color);
    line-height: 1.5;
    word-wrap: break-word;
    white-space: normal;
}

.voice-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.voice-file-input {
    display: none;
}

.voice-upload-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    flex-shrink: 0;
}

.voice-upload-btn:hover {
    background: #357ABD;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

.voice-file-name {
    font-size: 0.85rem;
    color: var(--secondary-color);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--success-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.voice-play-btn:hover {
    background: #388E3C;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.voice-play-btn:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.voice-pause-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--warning-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.voice-pause-btn:hover {
    background: #F57C00;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
}

.voice-remove-btn {
    padding: 0.5rem 0.75rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
    flex-shrink: 0;
}

.voice-remove-btn:hover {
    background: #D32F2F;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.4);
}

.voice-filename-suggestion {
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

.voice-filename-suggestion strong {
    color: #FF5722;
    font-weight: 600;
    margin-right: 0.25rem;
}

.voice-filename-suggestion span {
    color: #FF5722;
    font-weight: 600;
    font-family: monospace;
}

.voice-download-btn {
    padding: 0.5rem 0.75rem;
    background: #009688;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
    flex-shrink: 0;
}

.voice-download-btn:hover {
    background: #00796B;
    box-shadow: 0 2px 8px rgba(0, 150, 136, 0.4);
}

.voice-upload-server-btn {
    padding: 0.5rem 0.75rem;
    background: #FF9800;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
    flex-shrink: 0;
}

.voice-upload-server-btn:hover {
    background: #F57C00;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
}

.editor-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background-color: transparent;
}

.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--secondary-color);
    font-style: italic;
    padding: 3rem;
    text-align: center;
}

.empty-state::before {
    content: '📝';
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

/* 对话编辑器样式 */
.dialog-editor {
    max-width: 900px;
    margin: 0 auto;
}

.editor-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.editor-section h3 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    color: var(--primary-color);
    font-size: 1.15rem;
    font-weight: 700;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(74, 144, 226, 0.1);
}

.editor-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
}

/* 表单元素样式 */
.form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.form-input:hover:not(:disabled) {
    border-color: var(--primary-color);
}

.form-input:not([readonly]):focus {
    background-color: #fafbff;
}

.form-input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-col {
    flex: 1;
}

.form-col.full-width {
    flex: 1 1 100%;
}

.form-col.half-width {
    flex: 0 0 48%;
}

.localization-row {
    display: flex;
    gap: 2%;
}

.form-col label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.9rem;
}

/* 对话行样式 */
.dialog-lines {
    margin-bottom: 1rem;
}

.dialog-line {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1.25rem;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dialog-line:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.line-header {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.05) 0%, rgba(74, 144, 226, 0.02) 100%);
    border-bottom: 2px solid var(--border-color);
}

.line-actions {
    display: flex;
    gap: 0.5rem;
}

.entry-id-display {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.entry-id-display label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.entry-id-input {
    width: 60px;
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    flex-shrink: 0;
}

.line-number {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.95rem;
    background: rgba(74, 144, 226, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.line-content {
    padding: 1rem;
}

/* 按钮样式 */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

.btn:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}

.btn:active {
    transform: translateY(0);
}

.btn-small {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: var(--success-hover);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

/* 编辑操作区域 */
.editor-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* 底部样式 */
.footer {
    padding: 1rem;
    background-color: var(--light-color);
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.85rem;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-hover) 0%, var(--primary-color) 100%);
}

/* 通知样式增强 */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    border-left: 4px solid;
    pointer-events: auto;
    max-width: 400px;
}

.notification.success {
    border-left-color: var(--success-color);
    background: #4CAF50;
    color: white;
}

.notification.info {
    border-left-color: var(--info-color);
    background: #2196F3;
    color: white;
}

.notification.danger {
    border-left-color: var(--danger-color);
    background: #f44336;
    color: white;
}

.notification.warning {
    border-left-color: var(--warning-color);
    background: #FF9800;
    color: white;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes zoomOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content {
    padding: 2rem;
    text-align: center;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.modal-message {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.modal-actions .btn {
    min-width: 100px;
}

.modal-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    padding: 0.5rem 0;
}

/* 转换器页面样式 */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.converter-panel {
    flex: 1;
    background-color: white;
    padding: 1rem;
    overflow-y: auto;
}

.preview-panel {
    width: 400px;
    background-color: white;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.converter-content {
    max-width: 800px;
    margin: 0 auto;
}

.converter-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.step {
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.step h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 格式要求信息样式 */
.format-info {
    background-color: rgba(74, 144, 226, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.format-info h4 {
    margin-top: 0;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.format-info ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.format-info li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.sample-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.sample-link:hover {
    text-decoration: underline;
    transform: translateY(-1px);
}

/* 文件上传区域样式 */
.file-upload-area {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background-color: white;
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(74, 144, 226, 0.05);
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(74, 144, 226, 0.05);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.file-icon {
    font-size: 3rem;
}

.file-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--dark-color);
}

.file-hint {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.file-info {
    padding: 1rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* 选项网格样式 */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.option-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-item label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--dark-color);
}

/* 转换按钮样式 */
.convert-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* 转换结果样式 */
.conversion-result {
    padding: 1rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    color: var(--secondary-color);
    min-height: 50px;
}

/* JSON预览样式 */
.preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.json-preview {
    background-color: var(--light-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--dark-color);
    max-height: 100%;
    overflow-y: auto;
}

/* 对话选项链接样式 */
.outgoing-links-container {
    margin-top: 10px;
    padding: 1rem;
    background: rgba(74, 144, 226, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(74, 144, 226, 0.1);
}

.outgoing-links-container label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--dark-color);
}

.outgoing-link-item {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 0.75rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.outgoing-link-item:last-child {
    margin-bottom: 0;
}

.outgoing-link-item .form-input {
    flex: 1;
    min-width: 200px;
}

.outgoing-link-item .btn {
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .left-panel {
        width: 100%;
        height: 250px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .header-actions .btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.85rem;
    }
    
    .preview-panel {
        width: 100%;
        height: 300px;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .convert-actions {
        flex-direction: column;
    }
    
    .editor-panel .panel-header {
        padding: 1rem;
    }
    
    .editor-panel .panel-header h2 {
        font-size: 1.1rem;
    }
    
    .editor-content {
        padding: 1rem;
    }
    
    .dialog-item,
    .actor-item,
    .variable-item {
        padding: 0.85rem;
    }
    
    .editor-section {
        padding: 1rem;
    }
    
    .actor-fields,
    .variable-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions .btn {
        width: 100%;
    }
    
    .tab-buttons {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 1 auto;
        min-width: 100px;
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .left-panel {
        height: 200px;
    }
    
    .notification {
        left: 10px;
        right: 10px;
        min-width: auto;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .left-panel {
        width: 250px;
    }
    
    .header-actions .btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.85rem;
    }
}