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

body {
    background: linear-gradient(145deg, #eef2f7 0%, #dce5ec 100%);
    font-family: 'Segoe UI', 'Roboto', 'Noto Sans', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    padding: 2rem 1.5rem;
    min-height: 100vh;
}

.converter-card {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    background: rgba(255,255,255,0.96);
    border-radius: 2rem;
    box-shadow: 0 25px 45px -12px rgba(0,0,0,0.3);
    overflow: hidden;
}

.tool-header {
    background: linear-gradient(135deg, #1e2f4b, #14212e);
    padding: 1.5rem 2rem;
    color: white;
}

.tool-header h1 {
    font-weight: 600;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tool-header p {
    margin-top: 0.5rem;
    opacity: 0.85;
    font-size: 0.95rem;
}

.two-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 1.8rem;
    padding: 2rem;
    background: #fefefe;
}

.editor-panel {
    flex: 1.2;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-panel {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-weight: 600;
    color: #1e2f3e;
    border-left: 5px solid #2c7da0;
    padding-left: 0.8rem;
}

.badge {
    background: #eef2f5;
    padding: 0.2rem 0.7rem;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: normal;
    color: #2c7da0;
}

textarea {
    width: 100%;
    height: 480px;
    padding: 1.2rem;
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #fbfcfd;
    border: 1px solid #cddfe7;
    border-radius: 1.2rem;
    resize: vertical;
    outline: none;
    transition: 0.2s;
    color: #1f2a3e;
}

textarea:focus {
    border-color: #2c7da0;
    box-shadow: 0 0 0 3px rgba(44,125,160,0.2);
}

.preview-container {
    background: #ffffff;
    border-radius: 1.2rem;
    border: 1px solid #e2edf2;
    overflow: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    height: 480px;
}

.preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.toolbar-group {
    background: #f8fafd;
    border-radius: 1.2rem;
    padding: 1rem;
    border: 1px solid #e3edf2;
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 1rem;
}

.toolbar-row:last-child {
    margin-bottom: 0;
}

.divider {
    height: 1px;
    background: #e0eef5;
    margin: 0.7rem 0;
}

.format-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 0.5rem 0;
}

button, .file-label {
    background: #ffffff;
    border: 1px solid #cbdde6;
    padding: 0.55rem 1.2rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    color: #1f3b4c;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    box-shadow: 0 1px 1px rgba(0,0,0,0.02);
}

button.primary {
    background: #2c7da0;
    border-color: #2c7da0;
    color: white;
    box-shadow: 0 2px 6px rgba(44,125,160,0.2);
}

button.primary:hover {
    background: #1f6382;
    transform: translateY(-1px);
}

button:hover, .file-label:hover {
    background: #f0f6fa;
    border-color: #9bb7c4;
    transform: translateY(-1px);
}

.file-label {
    cursor: pointer;
    background: #f4f9fe;
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.info-note {
    font-size: 0.7rem;
    color: #5e7e8f;
    margin-top: 8px;
    padding-left: 0.3rem;
    line-height: 1.4;
}

footer {
    font-size: 0.75rem;
    text-align: center;
    padding: 1rem;
    background: #f2f6f9;
    color: #6c8d9c;
    border-top: 1px solid #e3eef3;
}

@media (max-width: 780px) {
    body { padding: 1rem; }
    .two-columns { padding: 1.2rem; gap: 1.2rem; }
    textarea, .preview-container { height: 360px; }
}

.toast-msg {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2a3e;
    color: white;
    padding: 0.6rem 1.4rem;
    border-radius: 60px;
    font-size: 0.85rem;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    text-align: center;
    max-width: 90vw;
    white-space: normal;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #2c7da0;
    z-index: 2000;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}