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

:root {
    --primary-color: #2196f3;
    --primary-hover: #1976d2;
    --bg-color: #f8f9fa;
    --border-color: #e0e0e0;
    --text-color: #333;
    --text-secondary: #666;
    --accent-color: #00f2fe;
    --gradient-start: #2196f3;
    --gradient-end: #00f2fe;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
    color: var(--text-color);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

h1 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-color);
    font-size: 2.2em;
    font-weight: 700;
    background: linear-gradient(120deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    border-radius: 3px;
}

.intro {
    margin-bottom: 30px;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.intro p {
    font-size: 1.1em;
    color: var(--text-color);
    margin-bottom: 12px;
    line-height: 1.8;
}

.tips {
    color: var(--text-secondary);
    font-size: 0.95em;
    margin-top: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(0, 242, 254, 0.1));
    border-radius: 8px;
    display: inline-block;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.editor-container {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.editor-section, .preview-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
}

h2 {
    margin-bottom: 16px;
    color: var(--text-color);
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(to bottom, var(--gradient-start), var(--gradient-end));
    border-radius: 2px;
    margin-right: 8px;
}

h2 small {
    color: var(--text-secondary);
    font-size: 0.75em;
    font-weight: normal;
    padding: 4px 12px;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(0, 242, 254, 0.1));
    border-radius: 20px;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

#markdown-input {
    width: 100%;
    height: 500px;
    padding: 16px;
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 8px;
    resize: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

#markdown-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    background: #fff;
}

#preview {
    width: 100%;
    height: 500px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow-y: auto;
    background-color: #fff;
}

.button-container {
    text-align: center;
    margin-top: 30px;
    display: flex;
    gap: 16px;
    justify-content: center;
}

button {
    padding: 12px 28px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#convert-btn {
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

#convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

#convert-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

#clear-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    border: 1px solid rgba(33, 150, 243, 0.2);
}

#clear-btn:hover {
    background: rgba(33, 150, 243, 0.1);
    transform: translateY(-2px);
}

/* 预览区样式 */
#preview h1, #preview h2, #preview h3 {
    margin: 1.2em 0 0.6em;
    color: var(--text-color);
    font-weight: 600;
}

#preview h1 { font-size: 1.8em; }
#preview h2 { font-size: 1.5em; }
#preview h3 { font-size: 1.3em; }

#preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    border-radius: 6px;
    overflow: hidden;
}

#preview th, #preview td {
    border: 1px solid var(--border-color);
    padding: 12px;
}

#preview th {
    background-color: var(--bg-color);
    font-weight: 500;
}

#preview tr:nth-child(even) {
    background-color: #fafafa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }

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

    h1 {
        font-size: 1.8em;
        margin-bottom: 16px;
    }

    .intro {
        padding: 16px;
        margin-bottom: 20px;
    }

    .intro p {
        font-size: 1em;
        line-height: 1.6;
    }

    .editor-container {
        flex-direction: column;
        gap: 16px;
    }

    .editor-section, .preview-section {
        padding: 16px;
    }
    
    #markdown-input, #preview {
        height: 350px;
        font-size: 14px;
    }

    .button-container {
        flex-direction: column;
        gap: 12px;
        padding: 0 20px;
    }

    button {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
    }
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

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

.footer {
    margin-top: 40px;
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid rgba(33, 150, 243, 0.2);
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(0, 242, 254, 0.1));
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.footer a:hover {
    color: var(--primary-hover);
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(0, 242, 254, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.1);
} 