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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #cab37d;
    min-height: 100vh;
    padding: 20px;
}

.container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 40px);
    max-width: 1800px;
    margin: 0 auto;
}

.section {
    flex: 1;
    background: #b8a271;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #383838;
    margin: 0;
}

.count-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.btn-paste {
    background: #2196f3;
    color: white;
}

.btn-paste:hover {
    background: #1976d2;
}

.left-section .text-editor {
    flex: 2;
    display: flex;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.left-section .text-editor:focus-within {
    border-color: #667eea;
}

.left-section .line-numbers {
    width: 40px;
    padding: 12px 4px;
    background: #b8a271;
    border-right: 1px solid #e0e0e0;
    text-align: right;
    font-size: 12px;
    line-height: 1.6;
    font-family: monospace;
    color: #333;
    user-select: none;
    overflow-y: auto;
}

.left-section .line-numbers .line-number {
    display: block;
}

.left-section .text-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
}

.left-section .text-highlight {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: none;
    color: transparent;
    z-index: 1;
    scrollbar-width: none;
}

.left-section .text-highlight::-webkit-scrollbar {
    display: none;
}

.left-section textarea {
    flex: 1;
    width: 100%;
    height: 100%;
    padding: 12px;
    border: none;
    resize: none;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    outline: none;
    background: transparent;
    position: relative;
    z-index: 2;
    color: #383838;
    overflow-y: auto;
}

.replace-report {
    flex: 1;
    background: #b8a372;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    overflow-y: auto;
}

.replace-report h3 {
    font-size: 13px;
    font-weight: 600;
    color: #383838;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.report-content {
    font-size: 12px;
    line-height: 1.6;
}

.empty-report {
    color: #383838;
    text-align: center;
    padding: 20px;
}

.report-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.report-item:last-child {
    border-bottom: none;
}

.report-original {
    color: #383838;
    font-weight: 500;
    font-size: 18px;
}

.report-lines {
    color: #383838;
    font-size: 11px;
    margin-left: 8px;
}

.report-lines:hover {
    color: #333;
}

.report-count {
    background: #c9c9c9;
    color: #383838;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.text-highlight .word-highlight {
    background-color: #ffcdd2 !important;
    border-radius: 2px;
    color: transparent;
}

.left-section textarea::selection {
    background-color: transparent;
}

.left-section textarea::-moz-selection {
    background-color: transparent;
}

.report-item {
    cursor: pointer;
    transition: background 0.2s;
}

.report-item:hover {
    background: #cab37d;
}

.report-summary {
    font-weight: 500;
    color: #383838;
    font-size: 12px;
    margin-left: 8px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #383838;
}

.speed-display {
    background-color: #4380b1;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
    user-select: none;
}

.speed-display:hover {
    background-color: #3570a0;
}

.result-header h3 {
    margin: 0;
}

.btn-mini {
    padding: 4px 10px;
    font-size: 11px;
}

.btn-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.btn-half {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    text-align: center;
}

.btn-third {
    flex: 1;
    padding: 10px 8px;
    font-size: 12px;
    text-align: center;
}

.left-section textarea:focus {
    outline: none;
    border-color: #667eea;
}

.text-info {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 12px;
    color: #383838;
}

.middle-section {
    align-items: center;
    background-color: #b7a371;
}

.button-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #f57c00;
}

.btn-info {
    background: #2196f3;
    color: white;
}

.btn-info:hover {
    background: #1976d2;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #388e3c;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.result-area {
    width: 100%;
    margin-top: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.result-area h3 {
    font-size: 14px;
    font-weight: 600;
    color: #383838;
    margin-bottom: 10px;
}

.result-area textarea {
    flex: 1;
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    resize: none;
    font-size: 22px;
    line-height: 1.8;
    font-family: inherit;
    background: #b8a271;
    color: #383838;
    transition: box-shadow 0.3s;
}

.result-area textarea:focus {
    box-shadow: 0 0 0 3px rgba(67, 128, 177, 0.3);
    outline: none;
}

.right-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: calc(100% / 3);
    background-color: #b8a372;
}

.search-input {
    width: 150px;
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    transition: border-color 0.3s;
    background: #fff;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-input::placeholder {
    color: #999;
}

.words-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

.words-list::-webkit-scrollbar {
    width: 6px;
}

.words-list::-webkit-scrollbar-track {
    background: #b8a372;
    border-radius: 3px;
}

.words-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.words-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.empty-hint {
    text-align: center;
    color: #383838;
    padding: 40px;
    font-size: 14px;
}

.word-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #b8a271;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.word-item:hover {
    background: #cab37d;
}

.word-item .word-input {
    flex: 2;
    min-width: 60px;
    max-width: 200px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    border: 1px solid #cab37d;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
    background: #b3a380;
    color: #383838;
}

.word-item .word-input:focus {
    border-color: #b8a271;
    box-shadow: 0 0 0 2px rgba(184, 162, 113, 0.3);
}

.word-item .word-time {
    flex: 1;
    min-width: 90px;
    max-width: 120px;
    font-size: 15px;
    color: #e8e3e3;
    padding-left: 10px;
    text-align: right;
    white-space: nowrap;
}

.add-word-form {
    display: flex;
    gap: 8px;
}

.add-word-form input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.3s;
    background: #b8a271;
}

.add-word-form input:focus {
    outline: none;
    border-color: #667eea;
}

.add-word-form input::placeholder {
    color: #1a1a1a;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background: #4caf50;
}

.notification.error {
    background: #f44336;
}

.notification.info {
    background: #2196f3;
}

.modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #b8a271;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    animation: slideDown 0.2s ease;
}

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

.modal.show {
    display: block;
}

.modal-content {
    padding: 12px;
}

.modal-header {
    font-size: 14px;
    font-weight: 600;
    color: #383838;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.modal-body {
    font-size: 13px;
    color: #383838;
    margin-bottom: 12px;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-footer .btn {
    padding: 6px 14px;
    font-size: 12px;
}

textarea#resultText {
    background-color: #b8a271;
}

input#deleteWord {
    background-color: #b8a271;
}

button#confirmAddBtn {
    background-color: #b8a372;
    border-width: 1px;
    border-style: solid;
    border-color: #000000;
}

#deleteWord::placeholder {
    color: #1a1a1a;
}

input#searchInput {
    background-color: #b8a271;
    border-width: 1px;
    border-style: solid;
    border-color: #000000;
}

#searchInput::placeholder {
    color: #1a1a1a;
}

button#speakBtn {
    background-color: #4380b1;
}

button#exportSrtBtn {
    background-color: #4380b1;
}

button#pasteBtn {
    background-color: #4380b1;
}

button#executeBtn {
    background-color: #3c963f;
}

button#exportTxtBtn {
    background-color: #c2a042;
    color: #f9f9fd;
}

.srt-section-container {
    max-width: 1800px;
    margin: 20px auto;
    padding: 0 20px;
}