:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --bg-color: #f5f7fa;
    --border-radius: 12px;
    --card-shadow: 0 8px 30px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1400px;
    width: 95%;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 30px;
    margin-bottom: 50px;
}

.header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.header h1 {
    font-size: 2.2em;
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-weight: 700;
}

.db-status {
    margin-left: 0;
    color: #888;
    font-size: 0.95em;
    margin-top: 5px;
    padding: 5px 10px;
    background: #f9f9f9;
    border-radius: 20px;
}

textarea {
    width: 100%;
    min-height: 200px;
    height: auto;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 12px;
    box-sizing: border-box;
    font-family: inherit;
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.controls {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
    font-weight: 500;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

button:active {
    transform: translateY(0);
}

.detect-btn {
    background: var(--primary-color);
    color: white;
    font-size: 16px;
    padding: 12px 24px;
}

.detect-btn:hover {
    background: #FF5252;
}

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

.strikethrough-btn:hover {
    background: #45b7aa;
}

.sensitive-list {
    border-top: 1px solid #f5f5f5;
    padding-top: 20px;
}

.word-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f8f8f8;
    gap: 15px;
}

.word-term {
    min-width: 100px;
    width: auto;
    font-weight: 500;
    color: #333;
    flex-shrink: 0;
}

.replacement-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 15px;
    max-width: calc(100% - 120px);
    margin: 0 10px;
    transition: var(--transition);
}

.replacement-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.process-controls {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: flex-end;
}

.process-btn {
    background: #4CAF50;
    color: white;
}

.process-btn:hover {
    background: #45a049;
}

.copy-btn {
    background: #2196F3;
    color: white;
}

.copy-btn:hover {
    background: #1976D2;
}

.feedback-footer {
    text-align: center;
    background-color: #f0f0f0;
    padding: 15px;
    color: #2196F3;
    font-size: 0.9em;
    border-top: 1px solid #ddd;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.small-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    background: #95a5a6;
    color: white;
}

.small-btn:hover {
    background: #7f8c8d;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.comparison-container {
    display: flex;
    gap: 30px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.original-content,
.detected-content {
    flex: 1;
    min-width: 400px;
}

.original-content h3,
.detected-content h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #34495e;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.content-wrapper {
    position: relative;
    width: 100%;
    min-height: 600px;
    box-sizing: border-box;
}

.original-content textarea {
    width: 100%;
    min-height: 600px;
    height: auto;
    margin-bottom: 0;
    background: #fafafa;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
}

.content-display {
    width: 100%;
    min-height: 600px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #fafafa;
    box-sizing: border-box;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
}

.statistics-container {
    margin-top: 30px;
}

.statistics {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.statistics h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #34495e;
    font-weight: 600;
}

.stats-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.stats-info span {
    font-size: 14px;
    color: #495057;
    padding: 4px 8px;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.stats-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.view-btn {
    background: #17a2b8;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
}

.view-btn:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}



.sensitive-word {
    background-color: #FF6B6B;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    font-weight: 500;
    transition: var(--transition);
}

.sensitive-word:hover {
    background-color: #FF5252;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.replacement-popup {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.15), 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    z-index: 1000;
    min-width: 280px;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.replacement-popup::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 16px;
    height: 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
    box-shadow: -2px -2px 5px rgba(0,0,0,0.05);
}

.replacement-popup input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 16px;
    box-sizing: border-box;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #f9f9f9;
}

.replacement-popup input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.15);
    background: white;
    transform: translateY(-1px);
}

.replacement-popup input::placeholder {
    color: #999;
    font-size: 14px;
}

.replacement-popup div {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.replacement-popup button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-width: 80px;
    text-align: center;
}

.replacement-popup button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.replacement-popup button:active {
    transform: translateY(0);
}

.replacement-popup .replace-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.replacement-popup .replace-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.replacement-popup .cancel-btn {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.replacement-popup .cancel-btn:hover {
    background: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.highlighted-content {
    line-height: 1.6;
}

@media (max-width: 1024px) {
    .container {
        max-width: 1000px;
        padding: 20px;
    }
    
    .original-content textarea,
    .content-display {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .comparison-container {
        flex-direction: column;
    }
    
    .original-content,
    .detected-content {
        width: 100%;
        min-width: unset;
    }
    
    .original-content textarea,
    .content-display {
        min-height: 400px;
    }
    
    .controls {
        gap: 8px;
    }
    
    button {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.5em;
    }
    
    .original-content textarea,
    .content-display {
        min-height: 300px;
    }
}