:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --border-color: #dee2e6;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--dark-text);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.input-section, .output-section {
    background: var(--light-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    font-size: 1.3rem;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-text);
}

textarea, input[type="text"], input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s ease;
}

textarea {
    height: 180px;
    font-family: 'Courier New', monospace;
    resize: vertical;
}

textarea:focus, input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.format-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0 30px;
}

.format-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.format-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.format-option label {
    font-weight: 500;
    cursor: pointer;
    flex: 1;
}

.format-example {
    font-size: 0.9rem;
    color: #6c757d;
    font-family: 'Courier New', monospace;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.secondary-btn {
    background: var(--light-bg);
    color: var(--dark-text);
    border: 2px solid var(--border-color);
}

.secondary-btn:hover {
    background: white;
    border-color: var(--primary-color);
}

.file-btn {
    background: linear-gradient(135deg, var(--success-color), #4895ef);
    color: white;
}

.copy-btn {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
}

.clear-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.result-container {
    background: white;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    min-height: 200px;
    overflow: auto;
}

.result-header {
    background: var(--primary-color);
    color: white;
    padding: 12px 15px;
    font-weight: 600;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.result-content {
    padding: 20px;
    min-height: 150px;
}

.result-content pre {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}

.error {
    background-color: #fff5f5;
    border-left: 4px solid var(--danger-color);
    color: #d32f2f;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.success {
    background-color: #f0f8ff;
    border-left: 4px solid var(--success-color);
    color: #0d6efd;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.stats {
    display: flex;
    justify-content: space-between;
    background: #e9ecef;
    padding: 12px 15px;
    border-radius: 0 0 6px 6px;
    font-size: 0.9rem;
    color: #495057;
}

footer {
    text-align: center;
    padding: 20px;
    background: var(--light-bg);
    color: #6c757d;
    font-size: 0.9rem;
}

.format-tag {
    display: inline-block;
    background: #e7f5ff;
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 5px;
}

.info-box {
    background: #e7f5ff;
    border-left: 4px solid var(--primary-color);
    padding: 12px;
    border-radius: 4px;
    margin: 15px 0;
    font-size: 0.9rem;
}

.info-box strong {
    color: var(--primary-color);
}

.show-more-btn {
    display: inline-block;
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 8px 16px;
    background: #e9ecef;
    border: none;
    border-radius: 6px;
    color: #495057;
    cursor: pointer;
    font-size: 0.9rem;
}

.show-more-btn:hover {
    background: #dee2e6;
}

.hidden {
    display: none;
}

/* 气泡提示样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    background: #4CAF50;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease-out;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: #f44336;
}

.notification.warning {
    background: #ff9800;
}