:root {
    color-scheme: light;
    --ink: #201f31;
    --muted: #666477;
    --paper: #f7f5ef;
    --line: #e3dfd5;
    --accent: #4d40c9;
    --light: #eeebff;
    font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button, label.file-button, a[download] { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button:focus-visible, a:focus-visible, .file-button:focus-within { outline: 3px solid #8e83ff; outline-offset: 3px; }
[hidden] { display: none !important; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px max(24px, calc((100vw - 1220px) / 2)); background: #fffdf8; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; white-space: nowrap; font-size: 19px; letter-spacing: -.03em; }
.brand-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; background: var(--accent); color: white; font-size: 26px; }
.brand strong span { color: var(--accent); }
main { max-width: 1268px; padding: 0 24px; margin: auto; }
.intro { margin: 44px 0 26px; }
.kicker { font: 700 11px ui-monospace, monospace; letter-spacing: .13em; color: var(--accent); }
h1 { font-size: clamp(32px, 5vw, 57px); line-height: 1.12; letter-spacing: -.065em; margin: 10px 0; }
h1 span { color: var(--accent); }
.intro p { color: var(--muted); margin: 10px 0 0; }
.workbench { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(320px, 1.5fr) minmax(210px, 1fr); gap: 16px; align-items: stretch; }
.panel { min-width: 0; background: #fffdf8; border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: 0 5px 18px #2b1b3007; }
.section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; }
.step { background: var(--light); color: var(--accent); border-radius: 7px; padding: 4px 6px; font: 700 12px ui-monospace, monospace; }
h2 { font-size: 17px; margin: 0; }
.text-button { margin-left: auto; border: 0; background: transparent; color: var(--accent); padding: 5px 0 5px 6px; font-size: 12px; }
.template-card { margin: 0; border: 1px solid #b6a9f8; border-radius: 12px; overflow: hidden; }
.template-stage { position: relative; background: #efebf7; padding: 10px; height: 230px; display: flex; justify-content: center; }
.template-stage img { height: 100%; max-width: 100%; object-fit: contain; border-radius: 6px; }
.tag { position: absolute; top: 9px; left: 9px; color: #4534a5; background: #ffffffdc; padding: 3px 6px; border-radius: 5px; font: 700 10px ui-monospace, monospace; }
figcaption { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 10px; }
figcaption strong { font-size: 14px; }
figcaption span { color: var(--muted); font-size: 11px; }
.tip { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0; }
.portraits { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.portraits article { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
h3 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; font-size: 13px; }
h3 span { font-weight: 500; font-size: 11px; color: var(--muted); }
.portrait-stage, .output-stage { background-color: #f9f7fc; background-image: conic-gradient(#eeeaf7 25%, transparent 0 50%, #eeeaf7 0 75%, transparent 0); background-size: 16px 16px; }
.portrait-stage { display: grid; place-items: center; aspect-ratio: 6 / 7; border-radius: 8px; overflow: hidden; font-size: 12px; color: var(--muted); }
.portrait-stage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.file-button { position: relative; display: block; border: 1px solid var(--line); border-radius: 8px; background: white; text-align: center; padding: 7px 4px; margin-top: 8px; font-size: 12px; }
.file-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.cloud-row, .action-row { display: flex; align-items: center; gap: 10px; }
.cloud-row { margin: 11px 0; }
.action-row { border-top: 1px solid var(--line); padding-top: 12px; }
.cloud-row span, .action-row > span { font-size: 11px; color: var(--muted); line-height: 1.5; }
.primary, .secondary { flex: none; border-radius: 8px; padding: 8px 11px; font-size: 12px; font-weight: 700; }
.primary { background: var(--accent); border: 1px solid var(--accent); color: white; }
.primary span { margin-left: 6px; }
.secondary { border: 1px solid #cfc7f7; background: var(--light); color: #4436ab; }
.output-stage { min-height: 230px; border-radius: 12px; display: grid; place-items: center; }
.output-stage img { height: 230px; max-width: 100%; object-fit: contain; border-radius: 8px; }
#empty { text-align: center; color: var(--muted); padding: 12px; font-size: 12px; }
#empty span { display: block; font-size: 30px; color: #7d70d9; }
.downloads { display: flex; gap: 8px; flex-wrap: wrap; }
.downloads a { text-decoration: none; padding: 7px 9px; background: var(--light); color: #4436ab; font-size: 12px; border-radius: 7px; }
.laugh-guide { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 16px; font-size: 13px; }
.laugh-guide p { margin: 0; color: var(--muted); line-height: 1.6; }
.laugh-guide details { flex: 0 0 100%; }
.laugh-guide summary { width: fit-content; cursor: pointer; color: var(--accent); font-size: 12px; }
#copy-prompt-status { color: var(--muted); font-size: 12px; }
#copy-prompt-status:empty { position: absolute; }
#laugh-prompt { width: 100%; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font: inherit; line-height: 1.6; resize: vertical; }
.laugh-guide details[open] > textarea { display: block; }
.laugh-guide details:not([open]) > textarea { display: none; }
footer { display: flex; justify-content: space-between; padding: 22px 0; color: var(--muted); font-size: 11px; }
@media (max-width: 900px) {
    .workbench { grid-template-columns: minmax(160px, 1fr) minmax(300px, 2fr); }
    .output-panel { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    main { padding: 0 14px; }
    .topbar { padding: 12px 14px; }
    .intro { margin-top: 29px; }
    .workbench { grid-template-columns: 1fr; }
    .template-stage { height: 175px; }
    .panel { padding: 14px; }
}
