.tr-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.tr-header {
    text-align: center;
    margin-bottom: 30px;
}

.tr-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
}

.tr-desc {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.tr-panel {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.tr-panel-header {
    margin-bottom: 24px;
}

.tr-panel-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 6px;
}

.tr-panel-header p {
    color: #888;
    font-size: 13px;
    margin: 0;
}

.tr-search-config {
    padding: 20px 24px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 24px;
}

.tr-config-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
}

.tr-config-item {
    flex: 1;
    min-width: 0;
}

.tr-config-label {
    display: block;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    margin-bottom: 6px;
    white-space: nowrap;
}

.tr-config-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
}

.tr-config-input:focus {
    border-color: #ff044;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.tr-config-input::placeholder {
    color: #bbb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.tr-config-arrow {
    font-size: 24px;
    color: #ff0044;
    font-weight: bold;
    padding-bottom: 8px;
    flex-shrink: 0;
}

.tr-config-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.tr-option-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.tr-option-label:hover {
    color: #ff0044;
}

.tr-option-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ff0044;
    cursor: pointer;
}

.tr-option-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.tr-input-section {
    margin-bottom: 20px;
}

.tr-section-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.tr-char-count {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

.tr-textarea {
    width: 100%;
    min-height: 220px;
    padding: 16px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #fafbfc;
    resize: vertical;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
}

.tr-textarea:focus {
    border-color: #ff0044;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    background: #fff;
}

.tr-textarea::placeholder {
    color: #bbb;
}

.tr-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tr-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tr-btn-icon {
    font-size: 16px;
}

.tr-btn-primary {
    background: #ff0044;
    color: #fff;
}

.tr-btn-primary:hover {
    background: #3a56d4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.tr-btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.tr-btn-success {
    background: #10b981;
    color: #fff;
}

.tr-btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.tr-btn-success:active {
    transform: translateY(0);
    box-shadow: none;
}

.tr-btn-secondary {
    background: #f1f3f5;
    color: #555;
}

.tr-btn-secondary:hover {
    background: #e2e6ea;
}

.tr-result-section {
    border-top: 2px solid #f0f0f0;
    padding-top: 24px;
    margin-top: 8px;
}

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

.tr-result-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tr-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.tr-stat-match {
    background: #fef2f2;
    color: #dc2626;
}

.tr-stat-replace {
    background: #f0fdf4;
    color: #16a34a;
}

.tr-result-output {
    width: 100%;
    min-height: 180px;
    max-height: 500px;
    padding: 16px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #fafbfc;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
    box-sizing: border-box;
    user-select: text;
}

.tr-highlight {
    background: #dcfce7;
    color: #16a34a;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

.tr-result-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.tr-tips {
    margin-top: 30px;
    padding: 20px 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.tr-tips h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px;
}

.tr-tips ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
    font-size: 13px;
    line-height: 2;
}

.tr-tips li {
    margin-bottom: 2px;
}

.tr-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    z-index: 99999;
    animation: tr-slide-in 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tr-toast-success {
    background: #10b981;
}

.tr-toast-error {
    background: #ef4444;
}

.tr-toast-info {
    background: #ff0044;
}

.tr-toast-warning {
    background: #f59e0b;
}

@keyframes tr-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .tr-container {
        padding: 16px 12px 40px;
    }

    .tr-title {
        font-size: 22px;
    }

    .tr-panel {
        padding: 16px;
        border-radius: 12px;
    }

    .tr-search-config {
        padding: 16px;
    }

    .tr-config-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .tr-config-arrow {
        text-align: center;
        padding-bottom: 0;
    }

    .tr-config-options {
        gap: 12px;
    }

    .tr-textarea {
        min-height: 160px;
        font-size: 13px;
        padding: 12px;
    }

    .tr-result-output {
        min-height: 140px;
        font-size: 13px;
        padding: 12px;
    }

    .tr-actions {
        gap: 8px;
    }

    .tr-btn {
        padding: 9px 16px;
        font-size: 13px;
    }

    .tr-result-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .tr-title {
        font-size: 20px;
    }

    .tr-desc {
        font-size: 12px;
    }

    .tr-config-options {
        flex-direction: column;
        gap: 8px;
    }

    .tr-btn {
        flex: 1;
        justify-content: center;
    }

    .tr-result-actions {
        flex-direction: column;
    }

    .tr-result-actions .tr-btn {
        width: 100%;
        justify-content: center;
    }
}
