@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Serif+SC:wght@400;700&display=swap');

:root {
    --primary-color: #FF9999;
    --secondary-color: #FFCCCC;
    --text-color: #4A4A4A;
    --background-color: #FFF0F5;
    --card-background: #FFFFFF;
}

body {
    font-family: 'Noto Serif SC', serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-content {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    margin: 0 auto;
}

h1, h2 {
    font-family: 'Ma Shan Zheng', cursive;
    text-align: center;
    color: var(--primary-color);
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-top: 0;
    color: var(--text-color);
    opacity: 0.8;
}

.card {
    background-color: var(--card-background);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 2px solid var(--secondary-color);
    width: 100%;
    box-sizing: border-box;
}

textarea {
    width: 100%;
    height: 150px;
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    padding: 1rem;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    background-color: #FFF9F9;
    box-sizing: border-box;
    display: block;
    margin: 0 auto;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 1rem auto 0;
    font-family: 'Ma Shan Zheng', cursive;
}

button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.result-card {
    background-color: #FFF9F9;
    border: 2px dashed var(--primary-color);
}

.hidden {
    display: none !important;
}

#analysisResult {
    white-space: normal;
    word-wrap: break-word;
    font-size: 1rem;
    line-height: 1.8;
}

#analysisResult h1,
#analysisResult h2,
#analysisResult h3,
#analysisResult h4,
#analysisResult h5,
#analysisResult h6 {
    font-family: 'Noto Serif SC', serif;
    color: var(--primary-color);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

#analysisResult p {
    margin-bottom: 1em;
}

#analysisResult ul,
#analysisResult ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

#analysisResult blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1em;
    margin-left: 0;
    color: #666;
}

#analysisResult code {
    background-color: #f0f0f0;
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

#analysisResult pre {
    background-color: #f0f0f0;
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

.info-message {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 15px 0;
    width: 100%;
    margin-top: auto;
}

footer p {
    margin: 0 0 10px 0;
}

footer nav {
    margin-top: 10px;
}

footer a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
    transition: opacity 0.3s ease;
}

footer a:hover {
    opacity: 0.8;
}

#exportPdfBtn {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: none;
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 1rem auto 0;
    font-family: 'Ma Shan Zheng', cursive;
}

#exportPdfBtn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#showExampleBtn {
    background-color: var(--secondary-color);
    color: var(--text-color);
    margin-right: 10px;
}

#showExampleBtn:hover {
    background-color: var(--primary-color);
    color: white;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.button-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    textarea {
        height: 100px;
    }

    button {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }
}