* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #1e1e1e;
    color: #d4d4d4;
}

.container {
    display: flex;
    height: 100vh;
}

/* 左侧输入区域 */
.input-panel {
    width: 400px;
    padding: 20px;
    background: #252526;
    border-right: 1px solid #3e3e42;
    overflow-y: auto;
}

.input-panel h2 {
    margin-bottom: 20px;
    color: #569cd6;
    font-size: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #9cdcfe;
    font-size: 14px;
}

.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #d4d4d4;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 13px;
    resize: vertical;
}

.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #569cd6;
}

.button-group {
    display: flex;
    gap: 10px;
}

button {
    flex: 1;
    padding: 12px;
    background: #0e639c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

button:hover:not(:disabled) {
    background: #1177bb;
}

button:disabled {
    background: #3e3e42;
    cursor: not-allowed;
    opacity: 0.5;
}

#stopBtn {
    background: #d73a49;
}

#stopBtn:hover:not(:disabled) {
    background: #e85462;
}

/* 右侧展示区域 */
.output-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
}

.tabs {
    display: flex;
    background: #252526;
    border-bottom: 1px solid #3e3e42;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    color: #d4d4d4;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #2a2d2e;
}

.tab-btn.active {
    color: #569cd6;
    border-bottom-color: #569cd6;
    background: #1e1e1e;
}

.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* HTML 区域 */
#htmlArea {
    padding: 0;
}

#htmlIframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #1e1e1e;
}

/* HTML 源码区域 */
#sourceArea {
    padding: 0;
    overflow-y: auto;
    background: #1e1e1e;
}

#sourceContainer {
    margin: 0;
    padding: 20px;
    background: #1e1e1e;
    overflow-x: auto;
}

#sourceCode {
    display: block;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #d4d4d4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 字幕区域 */
#textArea {
    padding: 20px;
    overflow-y: auto;
    background: #1e1e1e;
}

#subtitleContainer {
    max-width: 900px;
    margin: 0 auto;
}

/* Markdown Body 样式覆盖（暗色主题适配） */
#subtitleContainer.markdown-body {
    background: transparent !important;
    color: #d4d4d4 !important;
    padding: 0;
    box-sizing: border-box;
}

#subtitleContainer.markdown-body h1,
#subtitleContainer.markdown-body h2,
#subtitleContainer.markdown-body h3,
#subtitleContainer.markdown-body h4,
#subtitleContainer.markdown-body h5,
#subtitleContainer.markdown-body h6 {
    color: #569cd6 !important;
    border-bottom-color: #3e3e42 !important;
}

#subtitleContainer.markdown-body a {
    color: #4ec9b0 !important;
}

#subtitleContainer.markdown-body code {
    background: #2d2d30 !important;
    color: #ce9178 !important;
    border-radius: 3px;
}

#subtitleContainer.markdown-body pre {
    background: #1e1e1e !important;
    border: 1px solid #3e3e42 !important;
}

#subtitleContainer.markdown-body pre code {
    background: transparent !important;
    color: #d4d4d4 !important;
}

#subtitleContainer.markdown-body blockquote {
    color: #b5cea8 !important;
    border-left-color: #569cd6 !important;
    background: #252526 !important;
}

#subtitleContainer.markdown-body table tr {
    background: #252526 !important;
    border-top-color: #3e3e42 !important;
}

#subtitleContainer.markdown-body table tr:nth-child(2n) {
    background: #2d2d30 !important;
}

#subtitleContainer.markdown-body table th,
#subtitleContainer.markdown-body table td {
    border-color: #3e3e42 !important;
}

#subtitleContainer.markdown-body hr {
    background-color: #3e3e42 !important;
}

#subtitleContainer.markdown-body strong {
    color: #dcdcaa !important;
}

#subtitleContainer.markdown-body em {
    color: #9cdcfe !important;
}

/* 字幕块样式 */
.subtitle-block {
    padding: 20px;
    margin-bottom: 15px;
    background: #252526;
    border-left: 4px solid #569cd6;
    border-radius: 6px;
    animation: slideIn 0.3s ease-out;
}

.subtitle-line {
    padding: 12px 16px;
    margin-bottom: 10px;
    background: #252526;
    border-left: 3px solid #569cd6;
    border-radius: 4px;
    line-height: 1.6;
    animation: slideIn 0.3s ease-out;
}

.interaction-display {
    padding: 12px 16px;
    margin-bottom: 10px;
    background: #264f78;
    border-left: 3px solid #4ec9b0;
    border-radius: 4px;
    line-height: 1.6;
    animation: slideIn 0.3s ease-out;
    color: #4ec9b0;
}

/* 动画 */
@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #3e3e42;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e52;
}
