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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.6;
    padding: 40px 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.subtitle {
    color: #86868b;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 16px;
}

input, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

button {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    background: #0071e3;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: #0077ed;
}

button:disabled {
    background: #86868b;
    cursor: not-allowed;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    color: #515154;
}

.checkbox input {
    width: auto;
}

.result {
    margin-top: 28px;
    padding: 44px 48px;
    background: #fff;
    border: 1px solid #ececf0;
    border-radius: 16px;
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
        "Hiragino Sans GB", "Source Han Sans SC", -apple-system, sans-serif;
    font-size: 17px;
    line-height: 2;
    letter-spacing: 0.015em;
    color: #3a3a3f;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: none;
}

.result.visible {
    display: block;
}

.result > *:first-child {
    margin-top: 0;
}

/* ---------- 文章正式排版 ---------- */
.result h1,
.result h2,
.result h3,
.result h4 {
    /* 标题用宋体/衬线体，与正文黑体形成对比 */
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC",
        "STSong", "SimSun", serif;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: 0.02em;
}

.result h1 {
    font-size: 1.85rem;
    line-height: 1.45;
    text-align: center;
    margin: 0 0 40px;
    padding: 0 0 22px;
    border-bottom: 1px solid #ececf0;
    position: relative;
}

.result h1::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -2px;
    transform: translateX(-50%);
    width: 64px;
    height: 3px;
    border-radius: 3px;
    background: #0071e3;
}

.result h2 {
    font-size: 1.4rem;
    line-height: 1.5;
    margin: 48px 0 18px;
    padding-left: 15px;
    border-left: 4px solid #0071e3;
}

.result h3 {
    font-size: 1.15rem;
    margin: 30px 0 12px;
}

.result p {
    margin: 18px 0;
    text-align: left;
}

.result strong {
    color: #1d1d1f;
    font-weight: 600;
}

.result ul,
.result ol {
    margin: 16px 0;
    padding-left: 1.5em;
}

.result li {
    margin: 8px 0;
}

.result li::marker {
    color: #0071e3;
}

.result blockquote {
    margin: 22px 0;
    padding: 14px 20px;
    background: #f7f7fa;
    border-left: 4px solid #c9c9d2;
    border-radius: 0 8px 8px 0;
    color: #515154;
}

.result img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 26px auto;
    border-radius: 12px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
}

.result hr {
    border: none;
    border-top: 1px solid #ececf0;
    margin: 32px 0;
}

.result code {
    background: #f5f5f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "SF Mono", Menlo, Consolas, monospace;
}

.result pre {
    background: #1d1d1f;
    color: #f5f5f7;
    padding: 18px 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 22px 0;
    line-height: 1.6;
}

.result pre code {
    background: none;
    padding: 0;
}

.result table {
    width: 100%;
    border-collapse: collapse;
    margin: 22px 0;
    font-size: 0.92em;
}

.result th,
.result td {
    border: 1px solid #e5e5ea;
    padding: 10px 14px;
    text-align: left;
}

.result th {
    background: #f5f5f7;
    font-weight: 600;
}

.result a {
    color: #0071e3;
    text-decoration: none;
}

.result a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .result {
        padding: 28px 20px;
        font-size: 16px;
    }

    .result h1 {
        font-size: 1.5rem;
    }
}

.error {
    margin-top: 16px;
    color: #ff3b30;
    font-size: 0.9rem;
    display: none;
}

.error.visible {
    display: block;
}

.loading {
    margin-top: 16px;
    color: #86868b;
    font-size: 0.9rem;
    display: none;
}

.loading.visible {
    display: block;
}
