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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 15px 20px;
}

.container {
    max-width: 80%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

h3 {
    text-align: center;
    margin: -10px 0 10px;
    font-size: 28px;
    color: #333;
    font-weight: 600;
    letter-spacing: 1px;
}

textarea {
    width: 100%;
    height: 180px;
    border: 2px solid #e0e0e0;
    border-radius: 13px;
    padding: 10px;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafafa;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: #fff;
}

textarea::placeholder {
    color: #999;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 7px 0;
}

button {
    padding: 10px 15px;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

button:hover::before {
    left: 100%;
}

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

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

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

.btn_process:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

.btn_clear {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn_clear:hover {
    background: linear-gradient(135deg, #e083eb 0%, #e5475c 100%);
}

.btn_clear2 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.btn_clear2:hover {
    background: linear-gradient(135deg, #3f9ced 0%, #00e2ee 100%);
}

.btn_clear3 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.btn_clear3:hover {
    background: linear-gradient(135deg, #ea608a 0%, #eed130 100%);
}

.btn_clear_add_backslash {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.btn_clear_add_backslash:hover {
    background: linear-gradient(135deg, #917cc1 0%, #ebb2db 100%);
}

.btn_truncate {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.btn_truncate:hover {
    background: linear-gradient(135deg, #ff8a8e 0%, #febfef 100%);
}

.btn_truncate.active {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.btn_manage {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn_manage:hover {
    background: linear-gradient(135deg, #0f8a80 0%, #32d870 100%);
}

.btn_refresh {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn_refresh:hover {
    background: linear-gradient(135deg, #e083eb 0%, #e5475c 100%);
}

.btn_refresh.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.refresh-control {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn_time {
    padding: 8px 16px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn_time:hover {
    background: linear-gradient(135deg, #3f9ced 0%, #00e2ee 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

#refreshTimeDisplay {
    min-width: 60px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    padding: 0 10px;
}

.btn_add {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    padding: 8px 16px;
    font-size: 13px;
}

.btn_add:hover {
    background: linear-gradient(135deg, #3f9ced 0%, #00e2ee 100%);
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-group input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.phrase-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.phrase-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

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

.phrase-item:hover {
    background-color: #f8f9fa;
}

.phrase-text {
    flex: 1;
    font-size: 14px;
    color: #333;
    word-break: break-all;
}

.phrase-delete {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 6px 12px;
    font-size: 12px;
    margin-left: 10px;
}

.phrase-delete:hover {
    background: linear-gradient(135deg, #e083eb 0%, #e5475c 100%);
}

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

#outputText {
    min-height: 500px;
    background: #f8f9fa;
}

.output-label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.toast {
    visibility: hidden;
    min-width: 300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    border-radius: 12px;
    padding: 18px 24px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(20px);
    font-size: 15px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
}

.toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .container {
        padding: 25px 20px;
    }

    h3 {
        font-size: 22px;
    }

    .button-group {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    textarea {
        height: 150px;
    }
}